summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2005-11-02 19:06:55 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2005-11-02 19:06:55 +0000
commit5cdf984737d7a7f55006e3ca04f28451dfe2099c (patch)
tree3648ce952446e70bba55c56c9d0f71e5e82eaa5e
parentb128af1d4a73d1ec305cd0e95a8d9309797f56e6 (diff)
Remove DOS line endings from text files.
Make sure that all files have the proper MIME type and eol-style properties set. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4628 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--documentation/examples.html740
-rw-r--r--fluid/pixmaps/flComment.xpm54
-rw-r--r--fluid/print_panel.cxx1182
-rw-r--r--fluid/print_panel.h142
-rw-r--r--fluid/template_panel.cxx520
-rw-r--r--fluid/template_panel.fl488
-rw-r--r--fluid/template_panel.h112
7 files changed, 1619 insertions, 1619 deletions
diff --git a/documentation/examples.html b/documentation/examples.html
index 73818f543..f3f3e55d0 100644
--- a/documentation/examples.html
+++ b/documentation/examples.html
@@ -1,370 +1,370 @@
-<HTML>
-<BODY>
-
-<H1 ALIGN="RIGHT"><A NAME="tests">I - Tests and Demo Source Code</A></H1>
-
-<P ALIGN="RIGHT">March 19, 2005</P>
-
-<P>The FLTK distribution contains over 60 sample applications written
-in or ported to FLTK. If the FLTK archive you received does not
-contain a 'test' directory, you can download the complete FLTK
-distribution from
-<a href="http://fltk.org/software.php">http://fltk.org/software.php</a>.</P>
-
-<P>Most of the example programs were created while testing a group of widgets.
-They are not meant to be great achievements in clean C++ programming, but merely
-a test platform to verify the functionality of the FLTK library.</P>
-
-<table width=100% border=0>
-<tr><td colspan=4><font size=+1><b>Example Applications</b></font></td>
-<tr>
-<td><a href="#adjuster"><tt>adjuster</tt></a></td>
-<td><a href="#arc"><tt>arc</tt></a></td>
-<td><a href="#ask"><tt>ask</tt></a></td>
-<td><a href="#bitmap"><tt>bitmap</tt></a></td>
-<td><a href="#boxtype"><tt>boxtype</tt></a></td>
-<td><a href="#browser"><tt>browser</tt></a></td>
-</tr>
-<tr>
-<td><a href="#button"><tt>button</tt></a></td>
-<td><a href="#buttons"><tt>buttons</tt></a></td>
-<td><a href="#checkers"><tt>checkers</tt></a></td>
-<td><a href="#clock"><tt>clock</tt></a></td>
-<td><a href="#colbrowser"><tt>colbrowser</tt></a></td>
-<td><a href="#color_chooser"><tt>color_chooser</tt></a></td>
-</tr>
-<tr>
-<td><a href="#cube"><tt>cube</tt></a></td>
-<td><a href="#CubeView"><tt>CubeView</tt></a></td>
-<td><a href="#cursor"><tt>cursor</tt></a></td>
-<td><a href="#curve"><tt>curve</tt></a></td>
-<td><a href="#demo"><tt>demo</tt></a></td>
-<td><a href="#doublebuffer"><tt>doublebuffer</tt></a></td>
-</tr>
-<tr>
-<td><a href="#editor"><tt>editor</tt></a></td>
-<td><a href="#fast_slow"><tt>fast_slow</tt></a></td>
-<td><a href="#file_chooser"><tt>file_chooser</tt></a></td>
-<td><a href="#fluid"><tt>fluid</tt></a></td>
-<td><a href="#fonts"><tt>fonts</tt></a></td>
-<td><a href="#forms"><tt>forms</tt></a></td>
-</tr>
-<tr>
-<td><a href="#fractals"><tt>fractals</tt></a></td>
-<td><a href="#fullscreen"><tt>fullscreen</tt></a></td>
-<td><a href="#gl_overlay"><tt>gl_overlay</tt></a></td>
-<td><a href="#glpuzzle"><tt>glpuzzle</tt></a></td>
-<td><a href="#hello"><tt>hello</tt></a></td>
-<td><a href="#help"><tt>help</tt></a></td>
-</tr>
-<tr>
-<td><a href="#iconize"><tt>iconize</tt></a></td>
-<td><a href="#image"><tt>image</tt></a></td>
-<td><a href="#inactive"><tt>inactive</tt></a></td>
-<td><a href="#input"><tt>input</tt></a></td>
-<td><a href="#input_choice"><tt>input_choice</tt></a></td>
-<td><a href="#keyboard"><tt>keyboard</tt></a></td>
-</tr>
-<tr>
-<td><a href="#label"><tt>label</tt></a></td>
-<td><a href="#line_style"><tt>line_style</tt></a></td>
-<td><a href="#list_visuals"><tt>list_visuals</tt></a></td>
-<td><a href="#mandelbrot"><tt>mandelbrot</tt></a></td>
-<td><a href="#menubar"><tt>menubar</tt></a></td>
-<td><a href="#message"><tt>message</tt></a></td>
-</tr>
-<tr>
-<td><a href="#minimum"><tt>minimum</tt></a></td>
-<td><a href="#navigation"><tt>navigation</tt></a></td>
-<td><a href="#output"><tt>output</tt></a></td>
-<td><a href="#overlay"><tt>overlay</tt></a></td>
-<td><a href="#pack"><tt>pack</tt></a></td>
-<td><a href="#pixmap_browser"><tt>pixmap_browser</tt></a></td>
-</tr>
-<tr>
-<td><a href="#pixmap"><tt>pixmap</tt></a></td>
-<td><a href="#preferences"><tt>preferences</tt></a></td>
-<td><a href="#radio"><tt>radio</tt></a></td>
-<td><a href="#resizebox"><tt>resizebox</tt></a></td>
-<td><a href="#resize"><tt>resize</tt></a></td>
-<td><a href="#scroll"><tt>scroll</tt></a></td>
-</tr>
-<tr>
-<td><a href="#shape"><tt>shape</tt></a></td>
-<td><a href="#subwindow"><tt>subwindow</tt></a></td>
-<td><a href="#symbols"><tt>symbols</tt></a></td>
-<td><a href="#tabs"><tt>tabs</tt></a></td>
-<td><a href="#threads"><tt>threads</tt></a></td>
-<td><a href="#tile"><tt>tile</tt></a></td>
-</tr>
-<tr>
-<td><a href="#tiled_image"><tt>tiled_image</tt></a></td>
-<td><a href="#valuators"><tt>valuators</tt></a></td>
-</tr>
-</table>
-
-<h3><a name="adjuster">adjuster</h3>
-<tt>adjuster</tt> shows a nifty little widget for quickly
-setting values in a great range.
-<h3><a name="arc">arc</h3>
-The <tt>arc</tt> demo explains how to derive your own widget to
-generate some custom drawings. The sample drawings use the matrix
-based arc drawing for some fun effects.
-<h3><a name="ask">ask</h3>
-<tt>ask</tt> shows some of FLTK's standard dialog boxes, but you
-may end up in a loop, but you may end up in a loop, but... .
-<h3><a name="bitmap">bitmap</h3>
-This simple test shows the use of a single color bitmap as a
-label for a box widget. Bitmaps are stored in the X11 '.bmp'
-file format and can be part of the source code.
-<h3><a name="boxtype">boxtype</h3>
-<tt>boxtype</tt> gives an overview of readily available boxes and
-frames in FLTK. More types can be added by the user. When using
-themes, FLTK shuffles boxtypes around to give an app a new look.
-<h3><a name="browser">browser</h3>
-<tt>browser</tt> shows the capabilities of the <tt>Fl_Browser</tt> widget.
-Important features tested are loading of files, line formatting, and
-correct positioning of the browser data window.
-<h3><a name="button">button</h3>
-The <tt>button</tt> test is a very simple demo of buttons and callbacks.
-<h3><a name="buttons">buttons</h3>
-<tt>buttons</tt> shows a sample of FLTK button types.
-<h3><a name="checkers">checkers</h3>
-Written by Steve Poulsen in early 1979, <tt>checkers</tt> shows
-how to polish a VT100 text terminal based program into a neat
-program with a graphical UI. Check out the code that drags the
-pieces, and how the pieces are drawn by layering. Then tell me
-how to beat this program.
-<h3><a name="clock">clock</h3>
-The <tt>clock</tt> demo shows two analog clocks. The innards of
-teh <tt>Fl_Clock</tt> widget are pretty interesting as they explain
-the use of timeouts and matrix based drawing.
-<h3><a name="colbrowser">colbrowser</h3>
-<tt>colbrowser</tt> runs only on X11 systems. It reads
-<i>/usr/lib/X11/rgb.txt</i> to show the color representation
-of every text entry in the file. This is beautiful, but
-only mederatly useful unless your UI is written in <i>Motif</i>.
-<h3><a name="color_chooser">color_chooser</h3>
-The <tt>color_chooser</tt> gives a short demo of FLTK's palette based
-color chooser and of the RGB based color wheel.
-<h3><a name="cube">cube</h3>
-The <tt>cube</tt> demo shows the speed of OpenGL. It also tests
-the ability to render two OpenGL buffers into a single window,
-and shows OpenGL text.
-<h3><a name="CubeView">CubeView</h3>
-<tt>CubeView</tt> shows how to create a UI containing OpenGL with fluid.
-<h3><a name="cursor">cursor</h3>
-The <tt>cursor</tt> demo show all mouse cursor shapes that come standard
-with FLTK. The <i>fgcolor</i> and <i>bgcolor</i> sliders work only
-on few systems like Irix.
-<h3><a name="curve">curve</h3>
-<tt>curve</tt> draws a nice Bezier curve into a custom widget. The
-<i>points</i> option for splines is not supported on all platforms.
-<h3><a name="demo">demo</h3>
-This tool allows quick access to all programs in the <tt>test</tt> directory.
-<tt>demo</tt> is viaully based on the IrixGL demo program and cna be
-extended by editing <tt>test/demo.menu</tt>.
-<h3><a name="doublebuffer">doublebuffer</h3>
-The <tt>doublebuffer</tt> demo show the difference between a single
-buffered window, which may flicker during a slow redraw, and a
-double buffered window, which never flickers, but uses twice the
-amount of RAM. Some modern OS's double buffer all windows automatically
-to allow transparency and shadows on the desktop. FLTK is smart enough
-to not tripple buffer a window in that case.
-<h3><a name="editor">editor</h3>
-FLTK has two very different text input widgets. <tt>Fl_Input</tt>
-and derived classes are rather leight weight, however
-<tt>Fl_Text_Editor</tt> is a complete port of nedit (with permission).
-The <tt>editor</tt> test is almost a full application, showing custom
-syntax highlighting and dialog creation.
-<h3><a name="fast_slow">fast_slow</h3>
-<tt>fast_slow</tt> shows how an application can use then <tt>when()</tt>
-setting to receive different kinds of callbacks.
-<h3><a name="file_chooser">file_chooser</h3>
-The standard FLTK <tt>file_chooser</tt> is the result of many
-iterations, trying to find a middle ground between a complex
-browser and a fast light implementation.
-<h3><a name="fonts">fonts</h3>
-<tt>fonts</tt> show all available text fonts on the host system.
-If your machine still has some pixmap based fonts, the supported
-sizes will be shown in bold face. Only the first 256 fonts will
-be listed.
-<h3><a name="forms">forms</h3>
-<tt>forms</tt> is an XForms program with very few changes.
-Search for "fltk" to find all changes necessary to port to fltk.
-This demo show the different boxtypes. Note that some
-boxtypes are not appropriate for some objects.
-<h3><a name="fractals">fractals</h3>
-<tt>fractals</tt> shows how to mix OpenGL, Glut and FLTK code.
-FLTK supports a rather large subset of Glut, so that many Glut
-application compile just fine.
-<h3><a name="fullscreen">fullscreen</h3>
-This demo shows how to do many of the window manipulations that
-are popular on SGI programs, even though X does not really like
-them. You can toggle the border on/off, change the visual to
-switch between single/double buffer, and make the window take
-over the screen. More information in the source code.
-<h3><a name="gl_overlay">gl_overlay</h3>
-<tt>gl_overlay</tt> shows OpenGL overlay plane rendering. If no
-hardware overly plane is available, FLTK will simulate it
-automatically.
-<h3><a name="glpuzzle">glpuzzle</h3>
-The <tt>glpuzzle</tt> test dhows how most Glut source code compiles
-easily under FLTK.
-<h3><a name="hello">hello</h3>
-<tt>hello</tt>: Hello, World. Need I say maore? Well, maybe. This
-tiny demo shows how little is needed to get a functioning application
-running with FLTK. Quite impressive, I'd say.
-<h3><a name="help">help</h3>
-<tt>help</tt> displays the built-in FLTK help browser. The
-<tt>Fl_Help_Dialog</tt> understands a subset of html and renders
-various image formats. It is a great help to provide help
-pages to the user without depending on the operating system's
-html browser.
-<h3><a name="iconize">iconize</h3>
-<tt>iconize</tt> demonstrates the efeect of the window functions
-<tt>hide()</tt>, <tt>iconize()</tt>, and <tt>show()</tt>.
-<h3><a name="image">image</h3>
-The <tt>image</tt> demo shows how an image can be created on the fly.
-This generated image contains an alpha (transparency) channel which
-lets previous renderings 'shine through', either via true
-transparency or by using screen door transparency (pixelation).
-<h3><a name="inactive">inactive</h3>
-<tt>inactive</tt> tests the correct rendering of inactive widgets.
-To see the inactive version of images, you can check the pixmap
-or image test.
-<h3><a name="input">input</h3>
-This tool shows and tests differnet types of text input fields based on
-<tt>Fl_Input_</tt>. The <tt>input</tt> program also tests various
-settings of <tt>Fl_Input::when()</tt>.
-<h3><a name="input_choice">input_choice</h3>
-<tt>input_choice</tt> tests the latest addition to FLTK1, a text input
-field with an attached pulldown menu. Windows users will recognize
-similarities to the 'ComboBox'. <tt>input_choice</tt> starts up in
-'plastic' scheme, but the traditional scheme is also supported.
-<h3><a name="keyboard">keyboard</h3>
-FLTK unifies keyboard events for all platforms. The <tt>keyboard</tt>
-test can be used to check the return values of <tt>Fl::event_key()</tt>
-and <tt>Fl::event_text()</tt>. It is also great to see the modifier
-buttons and the scroll wheel at work. Quit this application by closing
-the window. The ESC key will not work.
-<h3><a name="label">label</h3>
-Every FLTK widget can have a label attached to it. The <tt>label</tt>
-demo shows alignment, clipping and wrapping of text labels. Labels
-can contain symbols at the start and end of the text, like <i>@FLTK</i>
-or <i>@circle uh-huh @square</i>.
-<h3><a name="line_style">line_style</h3>
-Advanced line drawing can be tested with <tt>line_style</tt>.
-Not all platforms support all line styles.
-<h3><a name="list_visuals">list_visuals</h3>
-This little app finds all available pixel formats for the current X11
-screen. But since you are now an FLTK user, you don't have to worry
-about any of this.
-<h3><a name="mandelbrot">mandelbrot</h3>
-<tt>mandelbrot</tt> shows two advanced topics in one test. It creates
-grayscale images on the fly, updating them via the <i>idle</i> callback
-system. This is one of the few occasions where the <i>idle</i> callback
-is very useful by giving all available processor time to the application
-without blocking the UI or other apps.
-<h3><a name="menubar">menubar</h3>
-The <tt>menubar</tt> tests many aspects of FLTK's popup menu system.
-Among the features are radio buttons, menus taller than the screen,
-arbitrary sub menu depth, and global shortcuts.
-<h3><a name="message">message</h3>
-<tt>message</tt> pops up a few of FLTK's standars message boxes.
-<h3><a name="minimum">minimum</h3>
-The <tt>minimum</tt> test program verifies that the update regions
-are set correctly. In a real life application, the trail would
-be avoided by choosing a smaller label or by setting label clipping.
-correctly.
-<h3><a name="navigation">navigation</h3>
-<tt>navigation</tt> demonstrates how the text cursor moves from
-text field to text field by using the arrow keys, tab and shift-tab..
-<h3><a name="output">output</h3>
-<tt>output</tt> shows the difference between the single line and
-multi line mode of the <tt>Fl_Output</tt> widget. Fonts can be
-selected from the FLTK standard list of fonts.
-<h3><a name="overlay">overlay</h3>
-The <tt>overlay</tt> test app show how easy an FLTK window can
-be layered to display cursor and manipulator style elemnts. This
-example derives a new class from <tt>Fl_Overly_WIndow</tt> and
-provides a new function to draw custom overlays.
-<h3><a name="pack">pack</h3>
-The <tt>pack</tt> test program demonstrates the resizing
-and repositioning of children of the <tt>Fl_Pack</tt> group.
-Putting an <tt>Fl_Pack</tt> into an <tt>Fl_Scroll</tt> is
-a useful way to create a kind of browser.
-<h3><a name="pixmap_browser">pixmap_browser</h3>
-<tt>pixmap_browser</tt> tests the shared image interface. When using
-the same image multiple times <tt>Fl_Shared_Image</tt> will keep it
-only once in memory.
-<h3><a name="pixmap">pixmap</h3>
-This simple test shows the use of a LUT based pixmap as a
-label for a box widget. Pixmaps are stored in the X11 '.xpm'
-file format and can be part of the source code. Pixmaps support
-one transparent color.
-<h3><a name="preferences">preferences</h3>
-I do have my <tt>preferences</tt> in the morning, but sometimes I
-just can't remember a thing. This is where the <tt>Fl_Preferences</tt>
-come in handy. The remember any kind of data between program launches.
-<h3><a name="radio">radio</h3>
-The <tt>radio</tt> tool was created entirely with <i>fluid</i>. It
-shows some of the available btton types and tests radio
-button behavior.
-<h3><a name="resizebox">resizebox</h3>
-<tt>resizebox</tt> shows some possible ways of FLTK's automatic
-resize bahavior..
-<h3><a name="resize">resize</h3>
-The <tt>resize</tt> demo tests size and position functions with
-the given window manager.
-<h3><a name="scroll">scroll</h3>
-<tt>scroll</tt> shows how to scroll an area of widgets, one of
-them beeing a slow custom drawing. <tt>Fl_Scroll</tt> uses
-clipping and smart window area copying to improve redraw speed.
-The buttons at the bottom of the window test decoration rendering
-and updates.
-<h3><a name="shape">shape</h3>
-<tt>shape</tt> is a very minimal demo that shows how to create
-your own OpenGL rendering widget. Now that you know that, go ahead
-and write that flight simulator you always dreamt of.
-<h3><a name="subwindow">subwindow</h3>
-The <tt>subwindow</tt> demo tests messaging and drawing between
-the main window and 'true' sub windows. A sub window is differnt
-to a group by resetting the FLTK coordinate stystem to 0, 0 in the
-top left corner. On Win32 and X11, subwindows have their own
-operating system specific handle.
-<h3><a name="symbols">symbols</h3>
-<tt>symbols</tt> are a speciality of FLTK. These little vector
-drawings can be integrated into labels. They scale and rotate,
-and with a little patience, you can define your own. The rotation
-number refers to 45 degree rotations if you were looking at a
-numeric keypad (2 is down, 6 is right, etc.).
-<h3><a name="tabs">tabs</h3>
-The <tt>tabs</tt> tool was created with <i>fluid</i>. It tests
-correct hiding and redisplaying of tabs, navigation across tabs,
-resize behavior, and no unneeded redrawing of invisible widgets.
-<h3><a name="threads">threads</h3>
-FLTK can be used in a multithreading environment. There are some
-limitations, mostly due to the underlying operating system.
-<tt>threads</tt> show how to use <tt>Fl::lock()</tt>,
-<tt>Fl::unlock()</tt>, and <tt>Fl::awake()</tt> in secondary threads
-to keep FLTK happy. Although locking works on all platforms,
-this demo is not available on every machine.
-<h3><a name="tile">tile</h3>
-The <tt>tile</tt> tool shows a nice way of using <tt>Fl_Tile</tt>.
-To test correct resizing of subwindows, the widget for region
-1 is created from an <tt>Fl_Window</tt> class.
-<h3><a name="tiled_image">tiled_image</h3>
-The <tt>tiled_image</tt> demo uses an image as the background
-for a window by repeating it over the full size of the widget.
-Thw window is resizable and shows how the image gets repeated.
-<h3><a name="valuators">valuators</h3>
-<tt>valuators</tt> shows all of FLTK's nifty widgets to change
-numeric values.
-<h3><a name="fluid">fluid</h3>
-<tt>fuid</tt> is not only a big test program, but also a very
-useful visual UI designer. Many parts of <tt>fluid</tt> were
-created using <tt>fluid</tt>.
-
-</BODY>
-</HTML>
+<HTML>
+<BODY>
+
+<H1 ALIGN="RIGHT"><A NAME="tests">I - Tests and Demo Source Code</A></H1>
+
+<P ALIGN="RIGHT">March 19, 2005</P>
+
+<P>The FLTK distribution contains over 60 sample applications written
+in or ported to FLTK. If the FLTK archive you received does not
+contain a 'test' directory, you can download the complete FLTK
+distribution from
+<a href="http://fltk.org/software.php">http://fltk.org/software.php</a>.</P>
+
+<P>Most of the example programs were created while testing a group of widgets.
+They are not meant to be great achievements in clean C++ programming, but merely
+a test platform to verify the functionality of the FLTK library.</P>
+
+<table width=100% border=0>
+<tr><td colspan=4><font size=+1><b>Example Applications</b></font></td>
+<tr>
+<td><a href="#adjuster"><tt>adjuster</tt></a></td>
+<td><a href="#arc"><tt>arc</tt></a></td>
+<td><a href="#ask"><tt>ask</tt></a></td>
+<td><a href="#bitmap"><tt>bitmap</tt></a></td>
+<td><a href="#boxtype"><tt>boxtype</tt></a></td>
+<td><a href="#browser"><tt>browser</tt></a></td>
+</tr>
+<tr>
+<td><a href="#button"><tt>button</tt></a></td>
+<td><a href="#buttons"><tt>buttons</tt></a></td>
+<td><a href="#checkers"><tt>checkers</tt></a></td>
+<td><a href="#clock"><tt>clock</tt></a></td>
+<td><a href="#colbrowser"><tt>colbrowser</tt></a></td>
+<td><a href="#color_chooser"><tt>color_chooser</tt></a></td>
+</tr>
+<tr>
+<td><a href="#cube"><tt>cube</tt></a></td>
+<td><a href="#CubeView"><tt>CubeView</tt></a></td>
+<td><a href="#cursor"><tt>cursor</tt></a></td>
+<td><a href="#curve"><tt>curve</tt></a></td>
+<td><a href="#demo"><tt>demo</tt></a></td>
+<td><a href="#doublebuffer"><tt>doublebuffer</tt></a></td>
+</tr>
+<tr>
+<td><a href="#editor"><tt>editor</tt></a></td>
+<td><a href="#fast_slow"><tt>fast_slow</tt></a></td>
+<td><a href="#file_chooser"><tt>file_chooser</tt></a></td>
+<td><a href="#fluid"><tt>fluid</tt></a></td>
+<td><a href="#fonts"><tt>fonts</tt></a></td>
+<td><a href="#forms"><tt>forms</tt></a></td>
+</tr>
+<tr>
+<td><a href="#fractals"><tt>fractals</tt></a></td>
+<td><a href="#fullscreen"><tt>fullscreen</tt></a></td>
+<td><a href="#gl_overlay"><tt>gl_overlay</tt></a></td>
+<td><a href="#glpuzzle"><tt>glpuzzle</tt></a></td>
+<td><a href="#hello"><tt>hello</tt></a></td>
+<td><a href="#help"><tt>help</tt></a></td>
+</tr>
+<tr>
+<td><a href="#iconize"><tt>iconize</tt></a></td>
+<td><a href="#image"><tt>image</tt></a></td>
+<td><a href="#inactive"><tt>inactive</tt></a></td>
+<td><a href="#input"><tt>input</tt></a></td>
+<td><a href="#input_choice"><tt>input_choice</tt></a></td>
+<td><a href="#keyboard"><tt>keyboard</tt></a></td>
+</tr>
+<tr>
+<td><a href="#label"><tt>label</tt></a></td>
+<td><a href="#line_style"><tt>line_style</tt></a></td>
+<td><a href="#list_visuals"><tt>list_visuals</tt></a></td>
+<td><a href="#mandelbrot"><tt>mandelbrot</tt></a></td>
+<td><a href="#menubar"><tt>menubar</tt></a></td>
+<td><a href="#message"><tt>message</tt></a></td>
+</tr>
+<tr>
+<td><a href="#minimum"><tt>minimum</tt></a></td>
+<td><a href="#navigation"><tt>navigation</tt></a></td>
+<td><a href="#output"><tt>output</tt></a></td>
+<td><a href="#overlay"><tt>overlay</tt></a></td>
+<td><a href="#pack"><tt>pack</tt></a></td>
+<td><a href="#pixmap_browser"><tt>pixmap_browser</tt></a></td>
+</tr>
+<tr>
+<td><a href="#pixmap"><tt>pixmap</tt></a></td>
+<td><a href="#preferences"><tt>preferences</tt></a></td>
+<td><a href="#radio"><tt>radio</tt></a></td>
+<td><a href="#resizebox"><tt>resizebox</tt></a></td>
+<td><a href="#resize"><tt>resize</tt></a></td>
+<td><a href="#scroll"><tt>scroll</tt></a></td>
+</tr>
+<tr>
+<td><a href="#shape"><tt>shape</tt></a></td>
+<td><a href="#subwindow"><tt>subwindow</tt></a></td>
+<td><a href="#symbols"><tt>symbols</tt></a></td>
+<td><a href="#tabs"><tt>tabs</tt></a></td>
+<td><a href="#threads"><tt>threads</tt></a></td>
+<td><a href="#tile"><tt>tile</tt></a></td>
+</tr>
+<tr>
+<td><a href="#tiled_image"><tt>tiled_image</tt></a></td>
+<td><a href="#valuators"><tt>valuators</tt></a></td>
+</tr>
+</table>
+
+<h3><a name="adjuster">adjuster</h3>
+<tt>adjuster</tt> shows a nifty little widget for quickly
+setting values in a great range.
+<h3><a name="arc">arc</h3>
+The <tt>arc</tt> demo explains how to derive your own widget to
+generate some custom drawings. The sample drawings use the matrix
+based arc drawing for some fun effects.
+<h3><a name="ask">ask</h3>
+<tt>ask</tt> shows some of FLTK's standard dialog boxes, but you
+may end up in a loop, but you may end up in a loop, but... .
+<h3><a name="bitmap">bitmap</h3>
+This simple test shows the use of a single color bitmap as a
+label for a box widget. Bitmaps are stored in the X11 '.bmp'
+file format and can be part of the source code.
+<h3><a name="boxtype">boxtype</h3>
+<tt>boxtype</tt> gives an overview of readily available boxes and
+frames in FLTK. More types can be added by the user. When using
+themes, FLTK shuffles boxtypes around to give an app a new look.
+<h3><a name="browser">browser</h3>
+<tt>browser</tt> shows the capabilities of the <tt>Fl_Browser</tt> widget.
+Important features tested are loading of files, line formatting, and
+correct positioning of the browser data window.
+<h3><a name="button">button</h3>
+The <tt>button</tt> test is a very simple demo of buttons and callbacks.
+<h3><a name="buttons">buttons</h3>
+<tt>buttons</tt> shows a sample of FLTK button types.
+<h3><a name="checkers">checkers</h3>
+Written by Steve Poulsen in early 1979, <tt>checkers</tt> shows
+how to polish a VT100 text terminal based program into a neat
+program with a graphical UI. Check out the code that drags the
+pieces, and how the pieces are drawn by layering. Then tell me
+how to beat this program.
+<h3><a name="clock">clock</h3>
+The <tt>clock</tt> demo shows two analog clocks. The innards of
+teh <tt>Fl_Clock</tt> widget are pretty interesting as they explain
+the use of timeouts and matrix based drawing.
+<h3><a name="colbrowser">colbrowser</h3>
+<tt>colbrowser</tt> runs only on X11 systems. It reads
+<i>/usr/lib/X11/rgb.txt</i> to show the color representation
+of every text entry in the file. This is beautiful, but
+only mederatly useful unless your UI is written in <i>Motif</i>.
+<h3><a name="color_chooser">color_chooser</h3>
+The <tt>color_chooser</tt> gives a short demo of FLTK's palette based
+color chooser and of the RGB based color wheel.
+<h3><a name="cube">cube</h3>
+The <tt>cube</tt> demo shows the speed of OpenGL. It also tests
+the ability to render two OpenGL buffers into a single window,
+and shows OpenGL text.
+<h3><a name="CubeView">CubeView</h3>
+<tt>CubeView</tt> shows how to create a UI containing OpenGL with fluid.
+<h3><a name="cursor">cursor</h3>
+The <tt>cursor</tt> demo show all mouse cursor shapes that come standard
+with FLTK. The <i>fgcolor</i> and <i>bgcolor</i> sliders work only
+on few systems like Irix.
+<h3><a name="curve">curve</h3>
+<tt>curve</tt> draws a nice Bezier curve into a custom widget. The
+<i>points</i> option for splines is not supported on all platforms.
+<h3><a name="demo">demo</h3>
+This tool allows quick access to all programs in the <tt>test</tt> directory.
+<tt>demo</tt> is viaully based on the IrixGL demo program and cna be
+extended by editing <tt>test/demo.menu</tt>.
+<h3><a name="doublebuffer">doublebuffer</h3>
+The <tt>doublebuffer</tt> demo show the difference between a single
+buffered window, which may flicker during a slow redraw, and a
+double buffered window, which never flickers, but uses twice the
+amount of RAM. Some modern OS's double buffer all windows automatically
+to allow transparency and shadows on the desktop. FLTK is smart enough
+to not tripple buffer a window in that case.
+<h3><a name="editor">editor</h3>
+FLTK has two very different text input widgets. <tt>Fl_Input</tt>
+and derived classes are rather leight weight, however
+<tt>Fl_Text_Editor</tt> is a complete port of nedit (with permission).
+The <tt>editor</tt> test is almost a full application, showing custom
+syntax highlighting and dialog creation.
+<h3><a name="fast_slow">fast_slow</h3>
+<tt>fast_slow</tt> shows how an application can use then <tt>when()</tt>
+setting to receive different kinds of callbacks.
+<h3><a name="file_chooser">file_chooser</h3>
+The standard FLTK <tt>file_chooser</tt> is the result of many
+iterations, trying to find a middle ground between a complex
+browser and a fast light implementation.
+<h3><a name="fonts">fonts</h3>
+<tt>fonts</tt> show all available text fonts on the host system.
+If your machine still has some pixmap based fonts, the supported
+sizes will be shown in bold face. Only the first 256 fonts will
+be listed.
+<h3><a name="forms">forms</h3>
+<tt>forms</tt> is an XForms program with very few changes.
+Search for "fltk" to find all changes necessary to port to fltk.
+This demo show the different boxtypes. Note that some
+boxtypes are not appropriate for some objects.
+<h3><a name="fractals">fractals</h3>
+<tt>fractals</tt> shows how to mix OpenGL, Glut and FLTK code.
+FLTK supports a rather large subset of Glut, so that many Glut
+application compile just fine.
+<h3><a name="fullscreen">fullscreen</h3>
+This demo shows how to do many of the window manipulations that
+are popular on SGI programs, even though X does not really like
+them. You can toggle the border on/off, change the visual to
+switch between single/double buffer, and make the window take
+over the screen. More information in the source code.
+<h3><a name="gl_overlay">gl_overlay</h3>
+<tt>gl_overlay</tt> shows OpenGL overlay plane rendering. If no
+hardware overly plane is available, FLTK will simulate it
+automatically.
+<h3><a name="glpuzzle">glpuzzle</h3>
+The <tt>glpuzzle</tt> test dhows how most Glut source code compiles
+easily under FLTK.
+<h3><a name="hello">hello</h3>
+<tt>hello</tt>: Hello, World. Need I say maore? Well, maybe. This
+tiny demo shows how little is needed to get a functioning application
+running with FLTK. Quite impressive, I'd say.
+<h3><a name="help">help</h3>
+<tt>help</tt> displays the built-in FLTK help browser. The
+<tt>Fl_Help_Dialog</tt> understands a subset of html and renders
+various image formats. It is a great help to provide help
+pages to the user without depending on the operating system's
+html browser.
+<h3><a name="iconize">iconize</h3>
+<tt>iconize</tt> demonstrates the efeect of the window functions
+<tt>hide()</tt>, <tt>iconize()</tt>, and <tt>show()</tt>.
+<h3><a name="image">image</h3>
+The <tt>image</tt> demo shows how an image can be created on the fly.
+This generated image contains an alpha (transparency) channel which
+lets previous renderings 'shine through', either via true
+transparency or by using screen door transparency (pixelation).
+<h3><a name="inactive">inactive</h3>
+<tt>inactive</tt> tests the correct rendering of inactive widgets.
+To see the inactive version of images, you can check the pixmap
+or image test.
+<h3><a name="input">input</h3>
+This tool shows and tests differnet types of text input fields based on
+<tt>Fl_Input_</tt>. The <tt>input</tt> program also tests various
+settings of <tt>Fl_Input::when()</tt>.
+<h3><a name="input_choice">input_choice</h3>
+<tt>input_choice</tt> tests the latest addition to FLTK1, a text input
+field with an attached pulldown menu. Windows users will recognize
+similarities to the 'ComboBox'. <tt>input_choice</tt> starts up in
+'plastic' scheme, but the traditional scheme is also supported.
+<h3><a name="keyboard">keyboard</h3>
+FLTK unifies keyboard events for all platforms. The <tt>keyboard</tt>
+test can be used to check the return values of <tt>Fl::event_key()</tt>
+and <tt>Fl::event_text()</tt>. It is also great to see the modifier
+buttons and the scroll wheel at work. Quit this application by closing
+the window. The ESC key will not work.
+<h3><a name="label">label</h3>
+Every FLTK widget can have a label attached to it. The <tt>label</tt>
+demo shows alignment, clipping and wrapping of text labels. Labels
+can contain symbols at the start and end of the text, like <i>@FLTK</i>
+or <i>@circle uh-huh @square</i>.
+<h3><a name="line_style">line_style</h3>
+Advanced line drawing can be tested with <tt>line_style</tt>.
+Not all platforms support all line styles.
+<h3><a name="list_visuals">list_visuals</h3>
+This little app finds all available pixel formats for the current X11
+screen. But since you are now an FLTK user, you don't have to worry
+about any of this.
+<h3><a name="mandelbrot">mandelbrot</h3>
+<tt>mandelbrot</tt> shows two advanced topics in one test. It creates
+grayscale images on the fly, updating them via the <i>idle</i> callback
+system. This is one of the few occasions where the <i>idle</i> callback
+is very useful by giving all available processor time to the application
+without blocking the UI or other apps.
+<h3><a name="menubar">menubar</h3>
+The <tt>menubar</tt> tests many aspects of FLTK's popup menu system.
+Among the features are radio buttons, menus taller than the screen,
+arbitrary sub menu depth, and global shortcuts.
+<h3><a name="message">message</h3>
+<tt>message</tt> pops up a few of FLTK's standars message boxes.
+<h3><a name="minimum">minimum</h3>
+The <tt>minimum</tt> test program verifies that the update regions
+are set correctly. In a real life application, the trail would
+be avoided by choosing a smaller label or by setting label clipping.
+correctly.
+<h3><a name="navigation">navigation</h3>
+<tt>navigation</tt> demonstrates how the text cursor moves from
+text field to text field by using the arrow keys, tab and shift-tab..
+<h3><a name="output">output</h3>
+<tt>output</tt> shows the difference between the single line and
+multi line mode of the <tt>Fl_Output</tt> widget. Fonts can be
+selected from the FLTK standard list of fonts.
+<h3><a name="overlay">overlay</h3>
+The <tt>overlay</tt> test app show how easy an FLTK window can
+be layered to display cursor and manipulator style elemnts. This
+example derives a new class from <tt>Fl_Overly_WIndow</tt> and
+provides a new function to draw custom overlays.
+<h3><a name="pack">pack</h3>
+The <tt>pack</tt> test program demonstrates the resizing
+and repositioning of children of the <tt>Fl_Pack</tt> group.
+Putting an <tt>Fl_Pack</tt> into an <tt>Fl_Scroll</tt> is
+a useful way to create a kind of browser.
+<h3><a name="pixmap_browser">pixmap_browser</h3>
+<tt>pixmap_browser</tt> tests the shared image interface. When using
+the same image multiple times <tt>Fl_Shared_Image</tt> will keep it
+only once in memory.
+<h3><a name="pixmap">pixmap</h3>
+This simple test shows the use of a LUT based pixmap as a
+label for a box widget. Pixmaps are stored in the X11 '.xpm'
+file format and can be part of the source code. Pixmaps support
+one transparent color.
+<h3><a name="preferences">preferences</h3>
+I do have my <tt>preferences</tt> in the morning, but sometimes I
+just can't remember a thing. This is where the <tt>Fl_Preferences</tt>
+come in handy. The remember any kind of data between program launches.
+<h3><a name="radio">radio</h3>
+The <tt>radio</tt> tool was created entirely with <i>fluid</i>. It
+shows some of the available btton types and tests radio
+button behavior.
+<h3><a name="resizebox">resizebox</h3>
+<tt>resizebox</tt> shows some possible ways of FLTK's automatic
+resize bahavior..
+<h3><a name="resize">resize</h3>
+The <tt>resize</tt> demo tests size and position functions with
+the given window manager.
+<h3><a name="scroll">scroll</h3>
+<tt>scroll</tt> shows how to scroll an area of widgets, one of
+them beeing a slow custom drawing. <tt>Fl_Scroll</tt> uses
+clipping and smart window area copying to improve redraw speed.
+The buttons at the bottom of the window test decoration rendering
+and updates.
+<h3><a name="shape">shape</h3>
+<tt>shape</tt> is a very minimal demo that shows how to create
+your own OpenGL rendering widget. Now that you know that, go ahead
+and write that flight simulator you always dreamt of.
+<h3><a name="subwindow">subwindow</h3>
+The <tt>subwindow</tt> demo tests messaging and drawing between
+the main window and 'true' sub windows. A sub window is differnt
+to a group by resetting the FLTK coordinate stystem to 0, 0 in the
+top left corner. On Win32 and X11, subwindows have their own
+operating system specific handle.
+<h3><a name="symbols">symbols</h3>
+<tt>symbols</tt> are a speciality of FLTK. These little vector
+drawings can be integrated into labels. They scale and rotate,
+and with a little patience, you can define your own. The rotation
+number refers to 45 degree rotations if you were looking at a
+numeric keypad (2 is down, 6 is right, etc.).
+<h3><a name="tabs">tabs</h3>
+The <tt>tabs</tt> tool was created with <i>fluid</i>. It tests
+correct hiding and redisplaying of tabs, navigation across tabs,
+resize behavior, and no unneeded redrawing of invisible widgets.
+<h3><a name="threads">threads</h3>
+FLTK can be used in a multithreading environment. There are some
+limitations, mostly due to the underlying operating system.
+<tt>threads</tt> show how to use <tt>Fl::lock()</tt>,
+<tt>Fl::unlock()</tt>, and <tt>Fl::awake()</tt> in secondary threads
+to keep FLTK happy. Although locking works on all platforms,
+this demo is not available on every machine.
+<h3><a name="tile">tile</h3>
+The <tt>tile</tt> tool shows a nice way of using <tt>Fl_Tile</tt>.
+To test correct resizing of subwindows, the widget for region
+1 is created from an <tt>Fl_Window</tt> class.
+<h3><a name="tiled_image">tiled_image</h3>
+The <tt>tiled_image</tt> demo uses an image as the background
+for a window by repeating it over the full size of the widget.
+Thw window is resizable and shows how the image gets repeated.
+<h3><a name="valuators">valuators</h3>
+<tt>valuators</tt> shows all of FLTK's nifty widgets to change
+numeric values.
+<h3><a name="fluid">fluid</h3>
+<tt>fuid</tt> is not only a big test program, but also a very
+useful visual UI designer. Many parts of <tt>fluid</tt> were
+created using <tt>fluid</tt>.
+
+</BODY>
+</HTML>
diff --git a/fluid/pixmaps/flComment.xpm b/fluid/pixmaps/flComment.xpm
index ece76c562..191b13910 100644
--- a/fluid/pixmaps/flComment.xpm
+++ b/fluid/pixmaps/flComment.xpm
@@ -1,27 +1,27 @@
-/* XPM */
-static const char *flComment_xpm[] = {
-/* width height ncolors chars_per_pixel */
-"16 16 4 1",
-/* colors */
-". c none",
-"a c #000000",
-"b c #c0e0c0",
-"c c #000000",
-/* pixels */
-"................",
-"................",
-".aaaaaaaaaaaaaa.",
-".abbbbbbbbbbbbc.",
-".abbbbbccbbccbc.",
-".abbbbccbbccbbc.",
-".abbbbccbbccbbc.",
-".abbbccbbccbbbc.",
-".abbbccbbccbbbc.",
-".abbccbbccbbbbc.",
-".abbccbbccbbbbc.",
-".abccbbccbbbbbc.",
-".abbbbbbbbbbbbc.",
-".accccccccccccc.",
-"................",
-"................",
-};
+/* XPM */
+static const char *flComment_xpm[] = {
+/* width height ncolors chars_per_pixel */
+"16 16 4 1",
+/* colors */
+". c none",
+"a c #000000",
+"b c #c0e0c0",
+"c c #000000",
+/* pixels */
+"................",
+"................",
+".aaaaaaaaaaaaaa.",
+".abbbbbbbbbbbbc.",
+".abbbbbccbbccbc.",
+".abbbbccbbccbbc.",
+".abbbbccbbccbbc.",
+".abbbccbbccbbbc.",
+".abbbccbbccbbbc.",
+".abbccbbccbbbbc.",
+".abbccbbccbbbbc.",
+".abccbbccbbbbbc.",
+".abbbbbbbbbbbbc.",
+".accccccccccccc.",
+"................",
+"................",
+};
diff --git a/fluid/print_panel.cxx b/fluid/print_panel.cxx
index 6baf5afb7..881bb0147 100644
--- a/fluid/print_panel.cxx
+++ b/fluid/print_panel.cxx
@@ -1,591 +1,591 @@
-//
-// "$Id$"
-//
-// FLUID print panel for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2005 by Bill Spitzak and others.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Library General Public
-// License as published by the Free Software Foundation; either
-// version 2 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Library General Public License for more details.
-//
-// You should have received a copy of the GNU Library General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-// USA.
-//
-// Please report all bugs and problems on the following page:
-//
-// http://www.fltk.org/str.php
-//
-
-// generated by Fast Light User Interface Designer (fluid) version 1.0107
-
-#include "print_panel.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include "../src/flstring.h"
-#include <FL/Fl_Preferences.H>
-extern Fl_Preferences fluid_prefs;
-
-Fl_Double_Window *print_panel=(Fl_Double_Window *)0;
-
-Fl_Group *print_panel_controls=(Fl_Group *)0;
-
-Fl_Choice *print_choice=(Fl_Choice *)0;
-
-static void cb_print_choice(Fl_Choice*, void*) {
- print_update_status();
-}
-
-Fl_Button *print_properties=(Fl_Button *)0;
-
-static void cb_print_properties(Fl_Button*, void*) {
- print_properties_panel->show();
-}
-
-Fl_Box *print_status=(Fl_Box *)0;
-
-Fl_Round_Button *print_all=(Fl_Round_Button *)0;
-
-static void cb_print_all(Fl_Round_Button*, void*) {
- print_from->deactivate();
-print_to->deactivate();
-}
-
-Fl_Round_Button *print_pages=(Fl_Round_Button *)0;
-
-static void cb_print_pages(Fl_Round_Button*, void*) {
- print_from->activate();
-print_to->activate();
-}
-
-Fl_Round_Button *print_selection=(Fl_Round_Button *)0;
-
-static void cb_print_selection(Fl_Round_Button*, void*) {
- print_from->deactivate();
-print_to->deactivate();
-}
-
-Fl_Input *print_from=(Fl_Input *)0;
-
-Fl_Input *print_to=(Fl_Input *)0;
-
-Fl_Spinner *print_copies=(Fl_Spinner *)0;
-
-static void cb_print_copies(Fl_Spinner*, void*) {
- if (print_copies->value() == 1) {
- print_collate_button->deactivate();
- print_collate_group[0]->deactivate();
- print_collate_group[1]->deactivate();
-} else {
- print_collate_button->activate();
- print_collate_group[0]->activate();
- print_collate_group[1]->activate();
-};
-}
-
-Fl_Check_Button *print_collate_button=(Fl_Check_Button *)0;
-
-static void cb_print_collate_button(Fl_Check_Button*, void*) {
- int i = print_collate_button->value() != 0;
-print_collate_group[i]->show();
-print_collate_group[1 - i]->hide();
-}
-
-Fl_Group *print_collate_group[2]={(Fl_Group *)0};
-
-static void cb_Cancel(Fl_Button*, void*) {
- print_panel->hide();
-}
-
-Fl_Progress *print_progress=(Fl_Progress *)0;
-
-Fl_Double_Window *print_properties_panel=(Fl_Double_Window *)0;
-
-static void cb_print_properties_panel(Fl_Double_Window*, void*) {
- print_properties_panel->hide();
-print_update_status();
-}
-
-Fl_Choice *print_page_size=(Fl_Choice *)0;
-
-Fl_Menu_Item menu_print_page_size[] = {
- {"Letter", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
- {"A4", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
- {0,0,0,0,0,0,0,0,0}
-};
-
-#include <FL/Fl_Pixmap.H>
-static const char *idata_print_color[] = {
-"24 24 17 1",
-" \tc None",
-".\tc #FFFF00",
-"+\tc #C8FF00",
-"@\tc #00FF00",
-"#\tc #FFC800",
-"$\tc #FF0000",
-"%\tc #00FFFF",
-"&\tc #000000",
-"*\tc #FF00FF",
-"=\tc #00FFC8",
-"-\tc #FF00C8",
-";\tc #00C800",
-">\tc #C80000",
-",\tc #0000C8",
-"\'\tc #0000FF",
-")\tc #00C8FF",
-"!\tc #C800FF",
-" ...... ",
-" .......... ",
-" ............ ",
-" .............. ",
-" .............. ",
-" ................ ",
-" ................ ",
-" ................ ",
-" +@@@@@@+#$$$$$$# ",
-" %@@@@@@@&&$$$$$$$* ",
-" %%@@@@@@&&&&$$$$$$** ",
-" %%%=@@@@&&&&&&$$$$-*** ",
-" %%%%@@@;&&&&&&>$$$**** ",
-"%%%%%%@@&&&&&&&&$$******",
-"%%%%%%%@&&&&&&&&$*******",
-"%%%%%%%%,&&&&&&,********",
-"%%%%%%%%\'\'\'\'\'\'\'\'********",
-"%%%%%%%%\'\'\'\'\'\'\'\'********",
-"%%%%%%%%\'\'\'\'\'\'\'\'********",
-" %%%%%%%)\'\'\'\'\'\'!******* ",
-" %%%%%%%%\'\'\'\'\'\'******** ",
-" %%%%%%%%\'\'\'\'******** ",
-" %%%%%%%%\'\'******** ",
-" %%%%%% ****** "
-};
-static Fl_Pixmap image_print_color(idata_print_color);
-
-static const char *idata_print_gray[] = {
-"24 24 17 1",
-" \tc None",
-".\tc #E3E3E3",
-"+\tc #D2D2D2",
-"@\tc #969696",
-"#\tc #C2C2C2",
-"$\tc #4C4C4C",
-"%\tc #B2B2B2",
-"&\tc #000000",
-"*\tc #696969",
-"=\tc #ACACAC",
-"-\tc #626262",
-";\tc #767676",
-">\tc #3C3C3C",
-",\tc #161616",
-"\'\tc #1C1C1C",
-")\tc #929292",
-"!\tc #585858",
-" ...... ",
-" .......... ",
-" ............ ",
-" .............. ",
-" .............. ",
-" ................ ",
-" ................ ",
-" ................ ",
-" +@@@@@@+#$$$$$$# ",
-" %@@@@@@@&&$$$$$$$* ",
-" %%@@@@@@&&&&$$$$$$** ",
-" %%%=@@@@&&&&&&$$$$-*** ",
-" %%%%@@@;&&&&&&>$$$**** ",
-"%%%%%%@@&&&&&&&&$$******",
-"%%%%%%%@&&&&&&&&$*******",
-"%%%%%%%%,&&&&&&,********",
-"%%%%%%%%\'\'\'\'\'\'\'\'********",
-"%%%%%%%%\'\'\'\'\'\'\'\'********",
-"%%%%%%%%\'\'\'\'\'\'\'\'********",
-" %%%%%%%)\'\'\'\'\'\'!******* ",
-" %%%%%%%%\'\'\'\'\'\'******** ",
-" %%%%%%%%\'\'\'\'******** ",
-" %%%%%%%%\'\'******** ",
-" %%%%%% ****** "
-};
-static Fl_Pixmap image_print_gray(idata_print_gray);
-
-Fl_Button *print_output_mode[4]={(Fl_Button *)0};
-
-static void cb_Save(Fl_Return_Button*, void*) {
- print_properties_panel->hide();
-
-char name[1024];
-int val;
-const char *printer = (const char *)print_choice->menu()[print_choice->value()].user_data();
-
-snprintf(name, sizeof(name), "%s/page_size", printer);
-fluid_prefs.set(name, print_page_size->value());
-
-snprintf(name, sizeof(name), "%s/output_mode", printer);
-for (val = 0; val < 4; val ++) {
- if (print_output_mode[val]->value()) break;
-}
-fluid_prefs.set(name, val);
-}
-
-static void cb_Cancel1(Fl_Button*, void*) {
- print_properties_panel->hide();
-print_update_status();
-}
-
-static void cb_Use(Fl_Button*, void*) {
- print_properties_panel->hide();
-}
-
-Fl_Double_Window* make_print_panel() {
- Fl_Double_Window* w;
- { Fl_Double_Window* o = print_panel = new Fl_Double_Window(465, 235, "Print");
- w = o;
- { Fl_Group* o = print_panel_controls = new Fl_Group(10, 10, 447, 216);
- { Fl_Choice* o = print_choice = new Fl_Choice(113, 10, 181, 25, "Printer:");
- o->down_box(FL_BORDER_BOX);
- o->labelfont(1);
- o->callback((Fl_Callback*)cb_print_choice);
- o->when(FL_WHEN_CHANGED);
- }
- { Fl_Button* o = print_properties = new Fl_Button(294, 10, 105, 25, "Properties...");
- o->callback((Fl_Callback*)cb_print_properties);
- }
- { Fl_Box* o = print_status = new Fl_Box(111, 41, 288, 17, "printer/job status");
- o->align(68|FL_ALIGN_INSIDE);
- }
- { Fl_Group* o = new Fl_Group(10, 86, 227, 105, "Print Range");
- o->box(FL_THIN_DOWN_BOX);
- o->labelfont(1);
- o->align(FL_ALIGN_TOP_LEFT);
- { Fl_Round_Button* o = print_all = new Fl_Round_Button(20, 96, 38, 25, "All");
- o->type(102);
- o->down_box(FL_ROUND_DOWN_BOX);
- o->value(1);
- o->callback((Fl_Callback*)cb_print_all);
- }
- { Fl_Round_Button* o = print_pages = new Fl_Round_Button(20, 126, 64, 25, "Pages");
- o->type(102);
- o->down_box(FL_ROUND_DOWN_BOX);
- o->callback((Fl_Callback*)cb_print_pages);
- }
- { Fl_Round_Button* o = print_selection = new Fl_Round_Button(20, 156, 82, 25, "Selection");
- o->type(102);
- o->down_box(FL_ROUND_DOWN_BOX);
- o->callback((Fl_Callback*)cb_print_selection);
- }
- { Fl_Input* o = print_from = new Fl_Input(136, 126, 28, 25, "From:");
- o->type(2);
- o->textfont(4);
- o->deactivate();
- }
- { Fl_Input* o = print_to = new Fl_Input(199, 126, 28, 25, "To:");
- o->type(2);
- o->textfont(4);
- o->deactivate();
- }
- o->end();
- }
- { Fl_Group* o = new Fl_Group(247, 86, 210, 105, "Copies");
- o->box(FL_THIN_DOWN_BOX);
- o->labelfont(1);
- o->align(FL_ALIGN_TOP_LEFT);
- { Fl_Spinner* o = print_copies = new Fl_Spinner(321, 96, 45, 25, "# Copies:");
- o->callback((Fl_Callback*)cb_print_copies);
- o->when(FL_WHEN_CHANGED);
- }
- { Fl_Check_Button* o = print_collate_button = new Fl_Check_Button(376, 96, 64, 25, "Collate");
- o->down_box(FL_DOWN_BOX);
- o->callback((Fl_Callback*)cb_print_collate_button);
- o->when(FL_WHEN_CHANGED);
- o->deactivate();
- }
- { Fl_Group* o = print_collate_group[0] = new Fl_Group(257, 131, 191, 50);
- o->deactivate();
- { Fl_Box* o = new Fl_Box(287, 141, 30, 40, "1");
- o->box(FL_BORDER_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->labelsize(11);
- o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
- o->deactivate();
- }
- { Fl_Box* o = new Fl_Box(272, 136, 30, 40, "1");
- o->box(FL_BORDER_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->labelsize(11);
- o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
- o->deactivate();
- }
- { Fl_Box* o = new Fl_Box(257, 131, 30, 40, "1");
- o->box(FL_BORDER_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->labelsize(11);
- o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
- o->deactivate();
- }
- { Fl_Box* o = new Fl_Box(352, 141, 30, 40, "2");
- o->box(FL_BORDER_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->labelsize(11);
- o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
- o->deactivate();
- }
- { Fl_Box* o = new Fl_Box(337, 136, 30, 40, "2");
- o->box(FL_BORDER_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->labelsize(11);
- o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
- o->deactivate();
- }
- { Fl_Box* o = new Fl_Box(322, 131, 30, 40, "2");
- o->box(FL_BORDER_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->labelsize(11);
- o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
- o->deactivate();
- }
- { Fl_Box* o = new Fl_Box(417, 141, 30, 40, "3");
- o->box(FL_BORDER_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->labelsize(11);
- o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
- o->deactivate();
- }
- { Fl_Box* o = new Fl_Box(402, 136, 30, 40, "3");
- o->box(FL_BORDER_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->labelsize(11);
- o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
- o->deactivate();
- }
- { Fl_Box* o = new Fl_Box(387, 131, 30, 40, "3");
- o->box(FL_BORDER_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->labelsize(11);
- o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
- o->deactivate();
- }
- o->end();
- }
- { Fl_Group* o = print_collate_group[1] = new Fl_Group(257, 131, 191, 50);
- o->hide();
- o->deactivate();
- { Fl_Box* o = new Fl_Box(287, 141, 30, 40, "3");
- o->box(FL_BORDER_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->labelsize(11);
- o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
- }
- { Fl_Box* o = new Fl_Box(272, 136, 30, 40, "2");
- o->box(FL_BORDER_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->labelsize(11);
- o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
- }
- { Fl_Box* o = new Fl_Box(257, 131, 30, 40, "1");
- o->box(FL_BORDER_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->labelsize(11);
- o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
- }
- { Fl_Box* o = new Fl_Box(352, 141, 30, 40, "3");
- o->box(FL_BORDER_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->labelsize(11);
- o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
- }
- { Fl_Box* o = new Fl_Box(337, 136, 30, 40, "2");
- o->box(FL_BORDER_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->labelsize(11);
- o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
- }
- { Fl_Box* o = new Fl_Box(322, 131, 30, 40, "1");
- o->box(FL_BORDER_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->labelsize(11);
- o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
- }
- { Fl_Box* o = new Fl_Box(417, 141, 30, 40, "3");
- o->box(FL_BORDER_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->labelsize(11);
- o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
- }
- { Fl_Box* o = new Fl_Box(402, 136, 30, 40, "2");
- o->box(FL_BORDER_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->labelsize(11);
- o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
- }
- { Fl_Box* o = new Fl_Box(387, 131, 30, 40, "1");
- o->box(FL_BORDER_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->labelsize(11);
- o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
- }
- o->end();
- }
- o->end();
- }
- { Fl_Return_Button* o = new Fl_Return_Button(309, 201, 70, 25, "Print");
- o->callback((Fl_Callback*)print_cb);
- }
- { Fl_Button* o = new Fl_Button(389, 201, 68, 25, "Cancel");
- o->callback((Fl_Callback*)cb_Cancel);
- }
- o->end();
- }
- { Fl_Progress* o = print_progress = new Fl_Progress(10, 203, 289, 21);
- o->selection_color((Fl_Color)4);
- o->hide();
- }
- o->set_modal();
- o->end();
- }
- { Fl_Double_Window* o = print_properties_panel = new Fl_Double_Window(290, 130, "Printer Properties");
- w = o;
- o->callback((Fl_Callback*)cb_print_properties_panel);
- { Fl_Choice* o = print_page_size = new Fl_Choice(110, 10, 80, 25, "Page Size:");
- o->down_box(FL_BORDER_BOX);
- o->labelfont(1);
- o->menu(menu_print_page_size);
- }
- { Fl_Group* o = new Fl_Group(110, 45, 170, 40, "Output Mode:");
- o->labelfont(1);
- o->align(FL_ALIGN_LEFT);
- { Fl_Button* o = print_output_mode[0] = new Fl_Button(110, 45, 30, 40);
- o->type(102);
- o->box(FL_BORDER_BOX);
- o->down_box(FL_BORDER_BOX);
- o->value(1);
- o->color(FL_BACKGROUND2_COLOR);
- o->selection_color(FL_FOREGROUND_COLOR);
- o->image(image_print_color);
- }
- { Fl_Button* o = print_output_mode[1] = new Fl_Button(150, 50, 40, 30);
- o->type(102);
- o->box(FL_BORDER_BOX);
- o->down_box(FL_BORDER_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->selection_color(FL_FOREGROUND_COLOR);
- o->image(image_print_color);
- }
- { Fl_Button* o = print_output_mode[2] = new Fl_Button(200, 45, 30, 40);
- o->type(102);
- o->box(FL_BORDER_BOX);
- o->down_box(FL_BORDER_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->selection_color(FL_FOREGROUND_COLOR);
- o->image(image_print_gray);
- }
- { Fl_Button* o = print_output_mode[3] = new Fl_Button(240, 50, 40, 30);
- o->type(102);
- o->box(FL_BORDER_BOX);
- o->down_box(FL_BORDER_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->selection_color(FL_FOREGROUND_COLOR);
- o->image(image_print_gray);
- }
- o->end();
- }
- { Fl_Return_Button* o = new Fl_Return_Button(123, 95, 79, 25, "Save");
- o->callback((Fl_Callback*)cb_Save);
- }
- { Fl_Button* o = new Fl_Button(212, 95, 68, 25, "Cancel");
- o->callback((Fl_Callback*)cb_Cancel1);
- }
- { Fl_Button* o = new Fl_Button(60, 95, 53, 25, "Use");
- o->callback((Fl_Callback*)cb_Use);
- }
- o->set_modal();
- o->end();
- }
- return w;
-}
-void print_cb(Fl_Return_Button *, void *);
-
-void print_load() {
- FILE *lpstat;
-char line[1024], name[1024], *nptr, qname[2048], *qptr, defname[1024];
-int i;
-
-if (print_choice->size() > 1) {
- for (i = 1; print_choice->text(i); i ++) {
- free(print_choice->menu()[i].user_data());
- }
-}
-
-print_choice->clear();
-print_choice->add("Print To File", 0, 0, 0, FL_MENU_DIVIDER);
-print_choice->value(0);
-
-defname[0] = '\0';
-
-if ((lpstat = popen("lpstat -p -d", "r")) != NULL) {
- while (fgets(line, sizeof(line), lpstat)) {
- if (!strncmp(line, "printer ", 8) &&
- sscanf(line + 8, "%s", name) == 1) {
- for (nptr = name, qptr = qname; *nptr; *qptr++ = *nptr++) {
- if (*nptr == '/') *qptr++ = '\\';
- }
- *qptr = '\0';
-
- print_choice->add(qname, 0, 0, (void *)strdup(name), 0);
- } else if (!strncmp(line, "system default destination: ", 28)) {
- if (sscanf(line + 28, "%s", defname) != 1) defname[0] = '\0';
- }
- }
- pclose(lpstat);
-}
-
-if (defname[0]) {
- for (i = 1; print_choice->text(i); i ++) {
- if (!strcmp((char *)print_choice->menu()[i].user_data(), defname)) {
- print_choice->value(i);
- break;
- }
- }
-} else if (print_choice->size() > 2) print_choice->value(1);
-
-
-print_update_status();
-}
-
-void print_update_status() {
- FILE *lpstat;
-char command[1024];
-static char status[1024];
-const char *printer = (const char *)print_choice->menu()[print_choice->value()].user_data();
-
-if (print_choice->value()) {
- snprintf(command, sizeof(command), "lpstat -p '%s'", printer);
- if ((lpstat = popen(command, "r")) != NULL) {
- fgets(status, sizeof(status), lpstat);
- pclose(lpstat);
- } else strcpy(status, "printer status unavailable");
-} else status[0] = '\0';
-
-print_status->label(status);
-
-char name[1024];
-int val;
-
-snprintf(name, sizeof(name), "%s/page_size", printer);
-fluid_prefs.get(name, val, 0);
-print_page_size->value(val);
-
-snprintf(name, sizeof(name), "%s/output_mode", printer);
-fluid_prefs.get(name, val, 0);
-print_output_mode[val]->setonly();
-}
-
-//
-// End of "$Id$".
-//
+//
+// "$Id$"
+//
+// FLUID print panel for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+// http://www.fltk.org/str.php
+//
+
+// generated by Fast Light User Interface Designer (fluid) version 1.0107
+
+#include "print_panel.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "../src/flstring.h"
+#include <FL/Fl_Preferences.H>
+extern Fl_Preferences fluid_prefs;
+
+Fl_Double_Window *print_panel=(Fl_Double_Window *)0;
+
+Fl_Group *print_panel_controls=(Fl_Group *)0;
+
+Fl_Choice *print_choice=(Fl_Choice *)0;
+
+static void cb_print_choice(Fl_Choice*, void*) {
+ print_update_status();
+}
+
+Fl_Button *print_properties=(Fl_Button *)0;
+
+static void cb_print_properties(Fl_Button*, void*) {
+ print_properties_panel->show();
+}
+
+Fl_Box *print_status=(Fl_Box *)0;
+
+Fl_Round_Button *print_all=(Fl_Round_Button *)0;
+
+static void cb_print_all(Fl_Round_Button*, void*) {
+ print_from->deactivate();
+print_to->deactivate();
+}
+
+Fl_Round_Button *print_pages=(Fl_Round_Button *)0;
+
+static void cb_print_pages(Fl_Round_Button*, void*) {
+ print_from->activate();
+print_to->activate();
+}
+
+Fl_Round_Button *print_selection=(Fl_Round_Button *)0;
+
+static void cb_print_selection(Fl_Round_Button*, void*) {
+ print_from->deactivate();
+print_to->deactivate();
+}
+
+Fl_Input *print_from=(Fl_Input *)0;
+
+Fl_Input *print_to=(Fl_Input *)0;
+
+Fl_Spinner *print_copies=(Fl_Spinner *)0;
+
+static void cb_print_copies(Fl_Spinner*, void*) {
+ if (print_copies->value() == 1) {
+ print_collate_button->deactivate();
+ print_collate_group[0]->deactivate();
+ print_collate_group[1]->deactivate();
+} else {
+ print_collate_button->activate();
+ print_collate_group[0]->activate();
+ print_collate_group[1]->activate();
+};
+}
+
+Fl_Check_Button *print_collate_button=(Fl_Check_Button *)0;
+
+static void cb_print_collate_button(Fl_Check_Button*, void*) {
+ int i = print_collate_button->value() != 0;
+print_collate_group[i]->show();
+print_collate_group[1 - i]->hide();
+}
+
+Fl_Group *print_collate_group[2]={(Fl_Group *)0};
+
+static void cb_Cancel(Fl_Button*, void*) {
+ print_panel->hide();
+}
+
+Fl_Progress *print_progress=(Fl_Progress *)0;
+
+Fl_Double_Window *print_properties_panel=(Fl_Double_Window *)0;
+
+static void cb_print_properties_panel(Fl_Double_Window*, void*) {
+ print_properties_panel->hide();
+print_update_status();
+}
+
+Fl_Choice *print_page_size=(Fl_Choice *)0;
+
+Fl_Menu_Item menu_print_page_size[] = {
+ {"Letter", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {"A4", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {0,0,0,0,0,0,0,0,0}
+};
+
+#include <FL/Fl_Pixmap.H>
+static const char *idata_print_color[] = {
+"24 24 17 1",
+" \tc None",
+".\tc #FFFF00",
+"+\tc #C8FF00",
+"@\tc #00FF00",
+"#\tc #FFC800",
+"$\tc #FF0000",
+"%\tc #00FFFF",
+"&\tc #000000",
+"*\tc #FF00FF",
+"=\tc #00FFC8",
+"-\tc #FF00C8",
+";\tc #00C800",
+">\tc #C80000",
+",\tc #0000C8",
+"\'\tc #0000FF",
+")\tc #00C8FF",
+"!\tc #C800FF",
+" ...... ",
+" .......... ",
+" ............ ",
+" .............. ",
+" .............. ",
+" ................ ",
+" ................ ",
+" ................ ",
+" +@@@@@@+#$$$$$$# ",
+" %@@@@@@@&&$$$$$$$* ",
+" %%@@@@@@&&&&$$$$$$** ",
+" %%%=@@@@&&&&&&$$$$-*** ",
+" %%%%@@@;&&&&&&>$$$**** ",
+"%%%%%%@@&&&&&&&&$$******",
+"%%%%%%%@&&&&&&&&$*******",
+"%%%%%%%%,&&&&&&,********",
+"%%%%%%%%\'\'\'\'\'\'\'\'********",
+"%%%%%%%%\'\'\'\'\'\'\'\'********",
+"%%%%%%%%\'\'\'\'\'\'\'\'********",
+" %%%%%%%)\'\'\'\'\'\'!******* ",
+" %%%%%%%%\'\'\'\'\'\'******** ",
+" %%%%%%%%\'\'\'\'******** ",
+" %%%%%%%%\'\'******** ",
+" %%%%%% ****** "
+};
+static Fl_Pixmap image_print_color(idata_print_color);
+
+static const char *idata_print_gray[] = {
+"24 24 17 1",
+" \tc None",
+".\tc #E3E3E3",
+"+\tc #D2D2D2",
+"@\tc #969696",
+"#\tc #C2C2C2",
+"$\tc #4C4C4C",
+"%\tc #B2B2B2",
+"&\tc #000000",
+"*\tc #696969",
+"=\tc #ACACAC",
+"-\tc #626262",
+";\tc #767676",
+">\tc #3C3C3C",
+",\tc #161616",
+"\'\tc #1C1C1C",
+")\tc #929292",
+"!\tc #585858",
+" ...... ",
+" .......... ",
+" ............ ",
+" .............. ",
+" .............. ",
+" ................ ",
+" ................ ",
+" ................ ",
+" +@@@@@@+#$$$$$$# ",
+" %@@@@@@@&&$$$$$$$* ",
+" %%@@@@@@&&&&$$$$$$** ",
+" %%%=@@@@&&&&&&$$$$-*** ",
+" %%%%@@@;&&&&&&>$$$**** ",
+"%%%%%%@@&&&&&&&&$$******",
+"%%%%%%%@&&&&&&&&$*******",
+"%%%%%%%%,&&&&&&,********",
+"%%%%%%%%\'\'\'\'\'\'\'\'********",
+"%%%%%%%%\'\'\'\'\'\'\'\'********",
+"%%%%%%%%\'\'\'\'\'\'\'\'********",
+" %%%%%%%)\'\'\'\'\'\'!******* ",
+" %%%%%%%%\'\'\'\'\'\'******** ",
+" %%%%%%%%\'\'\'\'******** ",
+" %%%%%%%%\'\'******** ",
+" %%%%%% ****** "
+};
+static Fl_Pixmap image_print_gray(idata_print_gray);
+
+Fl_Button *print_output_mode[4]={(Fl_Button *)0};
+
+static void cb_Save(Fl_Return_Button*, void*) {
+ print_properties_panel->hide();
+
+char name[1024];
+int val;
+const char *printer = (const char *)print_choice->menu()[print_choice->value()].user_data();
+
+snprintf(name, sizeof(name), "%s/page_size", printer);
+fluid_prefs.set(name, print_page_size->value());
+
+snprintf(name, sizeof(name), "%s/output_mode", printer);
+for (val = 0; val < 4; val ++) {
+ if (print_output_mode[val]->value()) break;
+}
+fluid_prefs.set(name, val);
+}
+
+static void cb_Cancel1(Fl_Button*, void*) {
+ print_properties_panel->hide();
+print_update_status();
+}
+
+static void cb_Use(Fl_Button*, void*) {
+ print_properties_panel->hide();
+}
+
+Fl_Double_Window* make_print_panel() {
+ Fl_Double_Window* w;
+ { Fl_Double_Window* o = print_panel = new Fl_Double_Window(465, 235, "Print");
+ w = o;
+ { Fl_Group* o = print_panel_controls = new Fl_Group(10, 10, 447, 216);
+ { Fl_Choice* o = print_choice = new Fl_Choice(113, 10, 181, 25, "Printer:");
+ o->down_box(FL_BORDER_BOX);
+ o->labelfont(1);
+ o->callback((Fl_Callback*)cb_print_choice);
+ o->when(FL_WHEN_CHANGED);
+ }
+ { Fl_Button* o = print_properties = new Fl_Button(294, 10, 105, 25, "Properties...");
+ o->callback((Fl_Callback*)cb_print_properties);
+ }
+ { Fl_Box* o = print_status = new Fl_Box(111, 41, 288, 17, "printer/job status");
+ o->align(68|FL_ALIGN_INSIDE);
+ }
+ { Fl_Group* o = new Fl_Group(10, 86, 227, 105, "Print Range");
+ o->box(FL_THIN_DOWN_BOX);
+ o->labelfont(1);
+ o->align(FL_ALIGN_TOP_LEFT);
+ { Fl_Round_Button* o = print_all = new Fl_Round_Button(20, 96, 38, 25, "All");
+ o->type(102);
+ o->down_box(FL_ROUND_DOWN_BOX);
+ o->value(1);
+ o->callback((Fl_Callback*)cb_print_all);
+ }
+ { Fl_Round_Button* o = print_pages = new Fl_Round_Button(20, 126, 64, 25, "Pages");
+ o->type(102);
+ o->down_box(FL_ROUND_DOWN_BOX);
+ o->callback((Fl_Callback*)cb_print_pages);
+ }
+ { Fl_Round_Button* o = print_selection = new Fl_Round_Button(20, 156, 82, 25, "Selection");
+ o->type(102);
+ o->down_box(FL_ROUND_DOWN_BOX);
+ o->callback((Fl_Callback*)cb_print_selection);
+ }
+ { Fl_Input* o = print_from = new Fl_Input(136, 126, 28, 25, "From:");
+ o->type(2);
+ o->textfont(4);
+ o->deactivate();
+ }
+ { Fl_Input* o = print_to = new Fl_Input(199, 126, 28, 25, "To:");
+ o->type(2);
+ o->textfont(4);
+ o->deactivate();
+ }
+ o->end();
+ }
+ { Fl_Group* o = new Fl_Group(247, 86, 210, 105, "Copies");
+ o->box(FL_THIN_DOWN_BOX);
+ o->labelfont(1);
+ o->align(FL_ALIGN_TOP_LEFT);
+ { Fl_Spinner* o = print_copies = new Fl_Spinner(321, 96, 45, 25, "# Copies:");
+ o->callback((Fl_Callback*)cb_print_copies);
+ o->when(FL_WHEN_CHANGED);
+ }
+ { Fl_Check_Button* o = print_collate_button = new Fl_Check_Button(376, 96, 64, 25, "Collate");
+ o->down_box(FL_DOWN_BOX);
+ o->callback((Fl_Callback*)cb_print_collate_button);
+ o->when(FL_WHEN_CHANGED);
+ o->deactivate();
+ }
+ { Fl_Group* o = print_collate_group[0] = new Fl_Group(257, 131, 191, 50);
+ o->deactivate();
+ { Fl_Box* o = new Fl_Box(287, 141, 30, 40, "1");
+ o->box(FL_BORDER_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->labelsize(11);
+ o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
+ o->deactivate();
+ }
+ { Fl_Box* o = new Fl_Box(272, 136, 30, 40, "1");
+ o->box(FL_BORDER_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->labelsize(11);
+ o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
+ o->deactivate();
+ }
+ { Fl_Box* o = new Fl_Box(257, 131, 30, 40, "1");
+ o->box(FL_BORDER_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->labelsize(11);
+ o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
+ o->deactivate();
+ }
+ { Fl_Box* o = new Fl_Box(352, 141, 30, 40, "2");
+ o->box(FL_BORDER_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->labelsize(11);
+ o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
+ o->deactivate();
+ }
+ { Fl_Box* o = new Fl_Box(337, 136, 30, 40, "2");
+ o->box(FL_BORDER_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->labelsize(11);
+ o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
+ o->deactivate();
+ }
+ { Fl_Box* o = new Fl_Box(322, 131, 30, 40, "2");
+ o->box(FL_BORDER_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->labelsize(11);
+ o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
+ o->deactivate();
+ }
+ { Fl_Box* o = new Fl_Box(417, 141, 30, 40, "3");
+ o->box(FL_BORDER_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->labelsize(11);
+ o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
+ o->deactivate();
+ }
+ { Fl_Box* o = new Fl_Box(402, 136, 30, 40, "3");
+ o->box(FL_BORDER_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->labelsize(11);
+ o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
+ o->deactivate();
+ }
+ { Fl_Box* o = new Fl_Box(387, 131, 30, 40, "3");
+ o->box(FL_BORDER_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->labelsize(11);
+ o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
+ o->deactivate();
+ }
+ o->end();
+ }
+ { Fl_Group* o = print_collate_group[1] = new Fl_Group(257, 131, 191, 50);
+ o->hide();
+ o->deactivate();
+ { Fl_Box* o = new Fl_Box(287, 141, 30, 40, "3");
+ o->box(FL_BORDER_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->labelsize(11);
+ o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
+ }
+ { Fl_Box* o = new Fl_Box(272, 136, 30, 40, "2");
+ o->box(FL_BORDER_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->labelsize(11);
+ o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
+ }
+ { Fl_Box* o = new Fl_Box(257, 131, 30, 40, "1");
+ o->box(FL_BORDER_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->labelsize(11);
+ o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
+ }
+ { Fl_Box* o = new Fl_Box(352, 141, 30, 40, "3");
+ o->box(FL_BORDER_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->labelsize(11);
+ o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
+ }
+ { Fl_Box* o = new Fl_Box(337, 136, 30, 40, "2");
+ o->box(FL_BORDER_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->labelsize(11);
+ o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
+ }
+ { Fl_Box* o = new Fl_Box(322, 131, 30, 40, "1");
+ o->box(FL_BORDER_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->labelsize(11);
+ o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
+ }
+ { Fl_Box* o = new Fl_Box(417, 141, 30, 40, "3");
+ o->box(FL_BORDER_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->labelsize(11);
+ o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
+ }
+ { Fl_Box* o = new Fl_Box(402, 136, 30, 40, "2");
+ o->box(FL_BORDER_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->labelsize(11);
+ o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
+ }
+ { Fl_Box* o = new Fl_Box(387, 131, 30, 40, "1");
+ o->box(FL_BORDER_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->labelsize(11);
+ o->align(FL_ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE);
+ }
+ o->end();
+ }
+ o->end();
+ }
+ { Fl_Return_Button* o = new Fl_Return_Button(309, 201, 70, 25, "Print");
+ o->callback((Fl_Callback*)print_cb);
+ }
+ { Fl_Button* o = new Fl_Button(389, 201, 68, 25, "Cancel");
+ o->callback((Fl_Callback*)cb_Cancel);
+ }
+ o->end();
+ }
+ { Fl_Progress* o = print_progress = new Fl_Progress(10, 203, 289, 21);
+ o->selection_color((Fl_Color)4);
+ o->hide();
+ }
+ o->set_modal();
+ o->end();
+ }
+ { Fl_Double_Window* o = print_properties_panel = new Fl_Double_Window(290, 130, "Printer Properties");
+ w = o;
+ o->callback((Fl_Callback*)cb_print_properties_panel);
+ { Fl_Choice* o = print_page_size = new Fl_Choice(110, 10, 80, 25, "Page Size:");
+ o->down_box(FL_BORDER_BOX);
+ o->labelfont(1);
+ o->menu(menu_print_page_size);
+ }
+ { Fl_Group* o = new Fl_Group(110, 45, 170, 40, "Output Mode:");
+ o->labelfont(1);
+ o->align(FL_ALIGN_LEFT);
+ { Fl_Button* o = print_output_mode[0] = new Fl_Button(110, 45, 30, 40);
+ o->type(102);
+ o->box(FL_BORDER_BOX);
+ o->down_box(FL_BORDER_BOX);
+ o->value(1);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->selection_color(FL_FOREGROUND_COLOR);
+ o->image(image_print_color);
+ }
+ { Fl_Button* o = print_output_mode[1] = new Fl_Button(150, 50, 40, 30);
+ o->type(102);
+ o->box(FL_BORDER_BOX);
+ o->down_box(FL_BORDER_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->selection_color(FL_FOREGROUND_COLOR);
+ o->image(image_print_color);
+ }
+ { Fl_Button* o = print_output_mode[2] = new Fl_Button(200, 45, 30, 40);
+ o->type(102);
+ o->box(FL_BORDER_BOX);
+ o->down_box(FL_BORDER_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->selection_color(FL_FOREGROUND_COLOR);
+ o->image(image_print_gray);
+ }
+ { Fl_Button* o = print_output_mode[3] = new Fl_Button(240, 50, 40, 30);
+ o->type(102);
+ o->box(FL_BORDER_BOX);
+ o->down_box(FL_BORDER_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->selection_color(FL_FOREGROUND_COLOR);
+ o->image(image_print_gray);
+ }
+ o->end();
+ }
+ { Fl_Return_Button* o = new Fl_Return_Button(123, 95, 79, 25, "Save");
+ o->callback((Fl_Callback*)cb_Save);
+ }
+ { Fl_Button* o = new Fl_Button(212, 95, 68, 25, "Cancel");
+ o->callback((Fl_Callback*)cb_Cancel1);
+ }
+ { Fl_Button* o = new Fl_Button(60, 95, 53, 25, "Use");
+ o->callback((Fl_Callback*)cb_Use);
+ }
+ o->set_modal();
+ o->end();
+ }
+ return w;
+}
+void print_cb(Fl_Return_Button *, void *);
+
+void print_load() {
+ FILE *lpstat;
+char line[1024], name[1024], *nptr, qname[2048], *qptr, defname[1024];
+int i;
+
+if (print_choice->size() > 1) {
+ for (i = 1; print_choice->text(i); i ++) {
+ free(print_choice->menu()[i].user_data());
+ }
+}
+
+print_choice->clear();
+print_choice->add("Print To File", 0, 0, 0, FL_MENU_DIVIDER);
+print_choice->value(0);
+
+defname[0] = '\0';
+
+if ((lpstat = popen("lpstat -p -d", "r")) != NULL) {
+ while (fgets(line, sizeof(line), lpstat)) {
+ if (!strncmp(line, "printer ", 8) &&
+ sscanf(line + 8, "%s", name) == 1) {
+ for (nptr = name, qptr = qname; *nptr; *qptr++ = *nptr++) {
+ if (*nptr == '/') *qptr++ = '\\';
+ }
+ *qptr = '\0';
+
+ print_choice->add(qname, 0, 0, (void *)strdup(name), 0);
+ } else if (!strncmp(line, "system default destination: ", 28)) {
+ if (sscanf(line + 28, "%s", defname) != 1) defname[0] = '\0';
+ }
+ }
+ pclose(lpstat);
+}
+
+if (defname[0]) {
+ for (i = 1; print_choice->text(i); i ++) {
+ if (!strcmp((char *)print_choice->menu()[i].user_data(), defname)) {
+ print_choice->value(i);
+ break;
+ }
+ }
+} else if (print_choice->size() > 2) print_choice->value(1);
+
+
+print_update_status();
+}
+
+void print_update_status() {
+ FILE *lpstat;
+char command[1024];
+static char status[1024];
+const char *printer = (const char *)print_choice->menu()[print_choice->value()].user_data();
+
+if (print_choice->value()) {
+ snprintf(command, sizeof(command), "lpstat -p '%s'", printer);
+ if ((lpstat = popen(command, "r")) != NULL) {
+ fgets(status, sizeof(status), lpstat);
+ pclose(lpstat);
+ } else strcpy(status, "printer status unavailable");
+} else status[0] = '\0';
+
+print_status->label(status);
+
+char name[1024];
+int val;
+
+snprintf(name, sizeof(name), "%s/page_size", printer);
+fluid_prefs.get(name, val, 0);
+print_page_size->value(val);
+
+snprintf(name, sizeof(name), "%s/output_mode", printer);
+fluid_prefs.get(name, val, 0);
+print_output_mode[val]->setonly();
+}
+
+//
+// End of "$Id$".
+//
diff --git a/fluid/print_panel.h b/fluid/print_panel.h
index 4a0ce779b..123936f52 100644
--- a/fluid/print_panel.h
+++ b/fluid/print_panel.h
@@ -1,71 +1,71 @@
-//
-// "$Id$"
-//
-// FLUID print panel for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2005 by Bill Spitzak and others.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Library General Public
-// License as published by the Free Software Foundation; either
-// version 2 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Library General Public License for more details.
-//
-// You should have received a copy of the GNU Library General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-// USA.
-//
-// Please report all bugs and problems on the following page:
-//
-// http://www.fltk.org/str.php
-//
-
-// generated by Fast Light User Interface Designer (fluid) version 1.0107
-
-#ifndef print_panel_h
-#define print_panel_h
-#include <FL/Fl.H>
-#include <FL/Fl_Double_Window.H>
-extern Fl_Double_Window *print_panel;
-#include <FL/Fl_Group.H>
-extern Fl_Group *print_panel_controls;
-#include <FL/Fl_Choice.H>
-extern Fl_Choice *print_choice;
-#include <FL/Fl_Button.H>
-extern Fl_Button *print_properties;
-#include <FL/Fl_Box.H>
-extern Fl_Box *print_status;
-#include <FL/Fl_Round_Button.H>
-extern Fl_Round_Button *print_all;
-extern Fl_Round_Button *print_pages;
-extern Fl_Round_Button *print_selection;
-#include <FL/Fl_Input.H>
-extern Fl_Input *print_from;
-extern Fl_Input *print_to;
-#include <FL/Fl_Spinner.H>
-extern Fl_Spinner *print_copies;
-#include <FL/Fl_Check_Button.H>
-extern Fl_Check_Button *print_collate_button;
-extern Fl_Group *print_collate_group[2];
-#include <FL/Fl_Return_Button.H>
-extern void print_cb(Fl_Return_Button*, void*);
-#include <FL/Fl_Progress.H>
-extern Fl_Progress *print_progress;
-extern Fl_Double_Window *print_properties_panel;
-extern Fl_Choice *print_page_size;
-extern Fl_Button *print_output_mode[4];
-Fl_Double_Window* make_print_panel();
-extern Fl_Menu_Item menu_print_page_size[];
-extern void print_cb(Fl_Return_Button *, void *);
-void print_load();
-void print_update_status();
-#endif
-
-//
-// End of "$Id$".
-//
+//
+// "$Id$"
+//
+// FLUID print panel for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+// http://www.fltk.org/str.php
+//
+
+// generated by Fast Light User Interface Designer (fluid) version 1.0107
+
+#ifndef print_panel_h
+#define print_panel_h
+#include <FL/Fl.H>
+#include <FL/Fl_Double_Window.H>
+extern Fl_Double_Window *print_panel;
+#include <FL/Fl_Group.H>
+extern Fl_Group *print_panel_controls;
+#include <FL/Fl_Choice.H>
+extern Fl_Choice *print_choice;
+#include <FL/Fl_Button.H>
+extern Fl_Button *print_properties;
+#include <FL/Fl_Box.H>
+extern Fl_Box *print_status;
+#include <FL/Fl_Round_Button.H>
+extern Fl_Round_Button *print_all;
+extern Fl_Round_Button *print_pages;
+extern Fl_Round_Button *print_selection;
+#include <FL/Fl_Input.H>
+extern Fl_Input *print_from;
+extern Fl_Input *print_to;
+#include <FL/Fl_Spinner.H>
+extern Fl_Spinner *print_copies;
+#include <FL/Fl_Check_Button.H>
+extern Fl_Check_Button *print_collate_button;
+extern Fl_Group *print_collate_group[2];
+#include <FL/Fl_Return_Button.H>
+extern void print_cb(Fl_Return_Button*, void*);
+#include <FL/Fl_Progress.H>
+extern Fl_Progress *print_progress;
+extern Fl_Double_Window *print_properties_panel;
+extern Fl_Choice *print_page_size;
+extern Fl_Button *print_output_mode[4];
+Fl_Double_Window* make_print_panel();
+extern Fl_Menu_Item menu_print_page_size[];
+extern void print_cb(Fl_Return_Button *, void *);
+void print_load();
+void print_update_status();
+#endif
+
+//
+// End of "$Id$".
+//
diff --git a/fluid/template_panel.cxx b/fluid/template_panel.cxx
index a24e13086..01b1a35dd 100644
--- a/fluid/template_panel.cxx
+++ b/fluid/template_panel.cxx
@@ -1,260 +1,260 @@
-//
-// "$Id$"
-//
-// FLUID template support for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2005 by Bill Spitzak and others.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Library General Public
-// License as published by the Free Software Foundation; either
-// version 2 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Library General Public License for more details.
-//
-// You should have received a copy of the GNU Library General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-// USA.
-//
-// Please report all bugs and problems on the following page:
-//
-// http://www.fltk.org/str.php
-//
-
-// generated by Fast Light User Interface Designer (fluid) version 1.0107
-
-#include "template_panel.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include "../src/flstring.h"
-#include <errno.h>
-#include <FL/filename.H>
-#include <FL/fl_ask.H>
-#include <FL/Fl_Shared_Image.H>
-#include <FL/Fl_Preferences.H>
-#if defined(WIN32) && !defined(__CYGWIN__)
-#include <io.h>
-#else
-#include <unistd.h>
-#endif // WIN32 && !__CYGWIN__
-extern Fl_Preferences fluid_prefs;
-
-Fl_Double_Window *template_panel=(Fl_Double_Window *)0;
-
-static void cb_template_panel(Fl_Double_Window*, void*) {
- Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image();
-if (img) img->release();
-template_preview->image(0);
-
-template_browser->deselect();
-template_name->value("");
-template_instance->value("");
-template_panel->hide();
-}
-
-Fl_Browser *template_browser=(Fl_Browser *)0;
-
-static void cb_template_browser(Fl_Browser*, void*) {
- if (Fl::event_clicks()) {
- template_panel->hide();
- return;
-}
-Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image();
-if (img) img->release();
-template_preview->image(0);
-template_preview->redraw();
-
-int item = template_browser->value();
-
-if (item <= 1) template_instance->deactivate();
-else template_instance->activate();
-
-if (item < 1) {
- template_submit->deactivate();
- template_delete->deactivate();
- return;
-}
-
-template_submit->activate();
-
-const char *flfile = (const char *)template_browser->data(item);
-if (!flfile) {
- template_delete->deactivate();
- return;
-}
-
-template_name->value(template_browser->text(item));
-
-template_delete->activate();
-
-char pngfile[1024], *ext;
-
-strlcpy(pngfile, flfile, sizeof(pngfile));
-if ((ext = strrchr(pngfile, '.')) == NULL) return;
-strcpy(ext, ".png");
-
-img = Fl_Shared_Image::get(pngfile);
-
-if (img) {
- template_preview->image(img);
- template_preview->redraw();
-};
-}
-
-Fl_Box *template_preview=(Fl_Box *)0;
-
-Fl_Input *template_name=(Fl_Input *)0;
-
-static void cb_template_name(Fl_Input*, void*) {
- if (strlen(template_name->value())) {
- template_submit->activate();
- if (Fl::event_key() == FL_Enter) template_panel->hide();
-} else template_submit->deactivate();
-}
-
-Fl_Input *template_instance=(Fl_Input *)0;
-
-Fl_Button *template_delete=(Fl_Button *)0;
-
-static void cb_Cancel(Fl_Button*, void*) {
- Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image();
-if (img) img->release();
-template_preview->image(0);
-
-template_browser->deselect();
-template_name->value("");
-template_instance->value("");
-template_panel->hide();
-}
-
-Fl_Return_Button *template_submit=(Fl_Return_Button *)0;
-
-static void cb_template_submit(Fl_Return_Button*, void*) {
- Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image();
-if (img) img->release();
-template_preview->image(0);
-
-template_panel->hide();
-}
-
-Fl_Double_Window* make_template_panel() {
- Fl_Double_Window* w;
- { Fl_Double_Window* o = template_panel = new Fl_Double_Window(460, 355, "New/Save Template");
- w = o;
- o->callback((Fl_Callback*)cb_template_panel);
- { Fl_Browser* o = template_browser = new Fl_Browser(10, 28, 180, 250, "Available Templates:");
- o->type(2);
- o->labelfont(1);
- o->callback((Fl_Callback*)cb_template_browser);
- o->align(FL_ALIGN_TOP_LEFT);
- o->when(3);
- }
- { Fl_Box* o = template_preview = new Fl_Box(200, 28, 250, 250);
- o->box(FL_THIN_DOWN_BOX);
- o->align(69|FL_ALIGN_INSIDE);
- Fl_Group::current()->resizable(o);
- }
- { Fl_Input* o = template_name = new Fl_Input(124, 288, 326, 25, "Template Name:");
- o->labelfont(1);
- o->textfont(4);
- o->callback((Fl_Callback*)cb_template_name);
- o->when(3);
- }
- { Fl_Input* o = template_instance = new Fl_Input(124, 288, 326, 25, "Instance Name:");
- o->labelfont(1);
- o->textfont(4);
- o->hide();
- }
- { Fl_Group* o = new Fl_Group(10, 323, 440, 25);
- { Fl_Button* o = template_delete = new Fl_Button(10, 323, 133, 25, "Delete Template");
- o->callback((Fl_Callback*)template_delete_cb);
- }
- { Fl_Box* o = new Fl_Box(153, 323, 126, 25);
- Fl_Group::current()->resizable(o);
- }
- { Fl_Button* o = new Fl_Button(289, 323, 72, 25, "Cancel");
- o->callback((Fl_Callback*)cb_Cancel);
- }
- { Fl_Return_Button* o = template_submit = new Fl_Return_Button(371, 323, 79, 25, "Save");
- o->callback((Fl_Callback*)cb_template_submit);
- }
- o->end();
- }
- o->set_modal();
- o->end();
- }
- return w;
-}
-
-void template_clear() {
- int i;
-void *filename;
-
-for (i = 1; i <= template_browser->size(); i ++) {
- if ((filename = template_browser->data(i)) != NULL) free(filename);
-}
-
-template_browser->deselect();
-template_browser->clear();
-}
-
-void template_delete_cb(Fl_Button *, void *) {
- int item = template_browser->value();
-if (item < 1) return;
-
-const char *name = template_browser->text(item);
-const char *flfile = (const char *)template_browser->data(item);
-if (!flfile) return;
-
-if (!fl_choice("Are you sure you want to delete the template \"%s\"?",
- "Cancel", "Delete", 0, name)) return;
-
-if (unlink(flfile)) {
- fl_alert("Unable to delete template \"%s\":\n%s", name, strerror(errno));
- return;
-}
-
-template_browser->remove(item);
-template_browser->do_callback();
-}
-
-void template_load() {
- int i;
-char name[1024], filename[1024], path[1024], *ptr;
-struct dirent **files;
-int num_files;
-
-fluid_prefs.getUserdataPath(path, sizeof(path));
-strlcat(path, "templates", sizeof(path));
-
-num_files = fl_filename_list(path, &files);
-
-for (i = 0; i < num_files; i ++) {
- if (fl_filename_match(files[i]->d_name, "*.fl")) {
- // Format the name as the filename with "_" replaced with " "
- // and without the trailing ".fl"...
- strlcpy(name, files[i]->d_name, sizeof(name));
- *strstr(name, ".fl") = '\0';
-
- for (ptr = name; *ptr; ptr ++) {
- if (*ptr == '_') *ptr = ' ';
- }
-
- // Add the template to the browser...
- snprintf(filename, sizeof(filename), "%s/%s", path, files[i]->d_name);
- template_browser->add(name, strdup(filename));
- }
-
- free(files[i]);
-}
-
-if (num_files > 0) free(files);
-}
-
-//
-// End of "$Id$".
-//
+//
+// "$Id$"
+//
+// FLUID template support for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+// http://www.fltk.org/str.php
+//
+
+// generated by Fast Light User Interface Designer (fluid) version 1.0107
+
+#include "template_panel.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "../src/flstring.h"
+#include <errno.h>
+#include <FL/filename.H>
+#include <FL/fl_ask.H>
+#include <FL/Fl_Shared_Image.H>
+#include <FL/Fl_Preferences.H>
+#if defined(WIN32) && !defined(__CYGWIN__)
+#include <io.h>
+#else
+#include <unistd.h>
+#endif // WIN32 && !__CYGWIN__
+extern Fl_Preferences fluid_prefs;
+
+Fl_Double_Window *template_panel=(Fl_Double_Window *)0;
+
+static void cb_template_panel(Fl_Double_Window*, void*) {
+ Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image();
+if (img) img->release();
+template_preview->image(0);
+
+template_browser->deselect();
+template_name->value("");
+template_instance->value("");
+template_panel->hide();
+}
+
+Fl_Browser *template_browser=(Fl_Browser *)0;
+
+static void cb_template_browser(Fl_Browser*, void*) {
+ if (Fl::event_clicks()) {
+ template_panel->hide();
+ return;
+}
+Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image();
+if (img) img->release();
+template_preview->image(0);
+template_preview->redraw();
+
+int item = template_browser->value();
+
+if (item <= 1) template_instance->deactivate();
+else template_instance->activate();
+
+if (item < 1) {
+ template_submit->deactivate();
+ template_delete->deactivate();
+ return;
+}
+
+template_submit->activate();
+
+const char *flfile = (const char *)template_browser->data(item);
+if (!flfile) {
+ template_delete->deactivate();
+ return;
+}
+
+template_name->value(template_browser->text(item));
+
+template_delete->activate();
+
+char pngfile[1024], *ext;
+
+strlcpy(pngfile, flfile, sizeof(pngfile));
+if ((ext = strrchr(pngfile, '.')) == NULL) return;
+strcpy(ext, ".png");
+
+img = Fl_Shared_Image::get(pngfile);
+
+if (img) {
+ template_preview->image(img);
+ template_preview->redraw();
+};
+}
+
+Fl_Box *template_preview=(Fl_Box *)0;
+
+Fl_Input *template_name=(Fl_Input *)0;
+
+static void cb_template_name(Fl_Input*, void*) {
+ if (strlen(template_name->value())) {
+ template_submit->activate();
+ if (Fl::event_key() == FL_Enter) template_panel->hide();
+} else template_submit->deactivate();
+}
+
+Fl_Input *template_instance=(Fl_Input *)0;
+
+Fl_Button *template_delete=(Fl_Button *)0;
+
+static void cb_Cancel(Fl_Button*, void*) {
+ Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image();
+if (img) img->release();
+template_preview->image(0);
+
+template_browser->deselect();
+template_name->value("");
+template_instance->value("");
+template_panel->hide();
+}
+
+Fl_Return_Button *template_submit=(Fl_Return_Button *)0;
+
+static void cb_template_submit(Fl_Return_Button*, void*) {
+ Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image();
+if (img) img->release();
+template_preview->image(0);
+
+template_panel->hide();
+}
+
+Fl_Double_Window* make_template_panel() {
+ Fl_Double_Window* w;
+ { Fl_Double_Window* o = template_panel = new Fl_Double_Window(460, 355, "New/Save Template");
+ w = o;
+ o->callback((Fl_Callback*)cb_template_panel);
+ { Fl_Browser* o = template_browser = new Fl_Browser(10, 28, 180, 250, "Available Templates:");
+ o->type(2);
+ o->labelfont(1);
+ o->callback((Fl_Callback*)cb_template_browser);
+ o->align(FL_ALIGN_TOP_LEFT);
+ o->when(3);
+ }
+ { Fl_Box* o = template_preview = new Fl_Box(200, 28, 250, 250);
+ o->box(FL_THIN_DOWN_BOX);
+ o->align(69|FL_ALIGN_INSIDE);
+ Fl_Group::current()->resizable(o);
+ }
+ { Fl_Input* o = template_name = new Fl_Input(124, 288, 326, 25, "Template Name:");
+ o->labelfont(1);
+ o->textfont(4);
+ o->callback((Fl_Callback*)cb_template_name);
+ o->when(3);
+ }
+ { Fl_Input* o = template_instance = new Fl_Input(124, 288, 326, 25, "Instance Name:");
+ o->labelfont(1);
+ o->textfont(4);
+ o->hide();
+ }
+ { Fl_Group* o = new Fl_Group(10, 323, 440, 25);
+ { Fl_Button* o = template_delete = new Fl_Button(10, 323, 133, 25, "Delete Template");
+ o->callback((Fl_Callback*)template_delete_cb);
+ }
+ { Fl_Box* o = new Fl_Box(153, 323, 126, 25);
+ Fl_Group::current()->resizable(o);
+ }
+ { Fl_Button* o = new Fl_Button(289, 323, 72, 25, "Cancel");
+ o->callback((Fl_Callback*)cb_Cancel);
+ }
+ { Fl_Return_Button* o = template_submit = new Fl_Return_Button(371, 323, 79, 25, "Save");
+ o->callback((Fl_Callback*)cb_template_submit);
+ }
+ o->end();
+ }
+ o->set_modal();
+ o->end();
+ }
+ return w;
+}
+
+void template_clear() {
+ int i;
+void *filename;
+
+for (i = 1; i <= template_browser->size(); i ++) {
+ if ((filename = template_browser->data(i)) != NULL) free(filename);
+}
+
+template_browser->deselect();
+template_browser->clear();
+}
+
+void template_delete_cb(Fl_Button *, void *) {
+ int item = template_browser->value();
+if (item < 1) return;
+
+const char *name = template_browser->text(item);
+const char *flfile = (const char *)template_browser->data(item);
+if (!flfile) return;
+
+if (!fl_choice("Are you sure you want to delete the template \"%s\"?",
+ "Cancel", "Delete", 0, name)) return;
+
+if (unlink(flfile)) {
+ fl_alert("Unable to delete template \"%s\":\n%s", name, strerror(errno));
+ return;
+}
+
+template_browser->remove(item);
+template_browser->do_callback();
+}
+
+void template_load() {
+ int i;
+char name[1024], filename[1024], path[1024], *ptr;
+struct dirent **files;
+int num_files;
+
+fluid_prefs.getUserdataPath(path, sizeof(path));
+strlcat(path, "templates", sizeof(path));
+
+num_files = fl_filename_list(path, &files);
+
+for (i = 0; i < num_files; i ++) {
+ if (fl_filename_match(files[i]->d_name, "*.fl")) {
+ // Format the name as the filename with "_" replaced with " "
+ // and without the trailing ".fl"...
+ strlcpy(name, files[i]->d_name, sizeof(name));
+ *strstr(name, ".fl") = '\0';
+
+ for (ptr = name; *ptr; ptr ++) {
+ if (*ptr == '_') *ptr = ' ';
+ }
+
+ // Add the template to the browser...
+ snprintf(filename, sizeof(filename), "%s/%s", path, files[i]->d_name);
+ template_browser->add(name, strdup(filename));
+ }
+
+ free(files[i]);
+}
+
+if (num_files > 0) free(files);
+}
+
+//
+// End of "$Id$".
+//
diff --git a/fluid/template_panel.fl b/fluid/template_panel.fl
index ae2e2b7ea..8192ead44 100644
--- a/fluid/template_panel.fl
+++ b/fluid/template_panel.fl
@@ -1,244 +1,244 @@
-# data file for the Fltk User Interface Designer (fluid)
-version 1.0107
-header_name {.h}
-code_name {.cxx}
-comment {//
-// "$Id$"
-//
-// FLUID template support for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2005 by Bill Spitzak and others.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Library General Public
-// License as published by the Free Software Foundation; either
-// version 2 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Library General Public License for more details.
-//
-// You should have received a copy of the GNU Library General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-// USA.
-//
-// Please report all bugs and problems on the following page:
-//
-// http://www.fltk.org/str.php
-//
-} {in_source in_header
-}
-
-decl {\#include <stdio.h>} {}
-
-decl {\#include <stdlib.h>} {}
-
-decl {\#include "../src/flstring.h"} {}
-
-decl {\#include <errno.h>} {}
-
-decl {\#include <FL/filename.H>} {}
-
-decl {\#include <FL/fl_ask.H>} {}
-
-decl {\#include <FL/Fl_Shared_Image.H>} {}
-
-decl {\#include <FL/Fl_Preferences.H>} {}
-
-declblock {\#if defined(WIN32) && !defined(__CYGWIN__)} {selected after {\#endif // WIN32 && !__CYGWIN__}
-} {
- decl {\#include <io.h>} {}
- decl {\#else} {}
- decl {\#include <unistd.h>} {}
-}
-
-decl {extern Fl_Preferences fluid_prefs;} {}
-
-Function {make_template_panel()} {open
-} {
- Fl_Window template_panel {
- label {New/Save Template}
- callback {Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image();
-if (img) img->release();
-template_preview->image(0);
-
-template_browser->deselect();
-template_name->value("");
-template_instance->value("");
-template_panel->hide();} open
- xywh {340 237 460 355} type Double resizable modal visible
- } {
- Fl_Browser template_browser {
- label {Available Templates:}
- callback {if (Fl::event_clicks()) {
- template_panel->hide();
- return;
-}
-Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image();
-if (img) img->release();
-template_preview->image(0);
-template_preview->redraw();
-
-int item = template_browser->value();
-
-if (item <= 1) template_instance->deactivate();
-else template_instance->activate();
-
-if (item < 1) {
- template_submit->deactivate();
- template_delete->deactivate();
- return;
-}
-
-template_submit->activate();
-
-const char *flfile = (const char *)template_browser->data(item);
-if (!flfile) {
- template_delete->deactivate();
- return;
-}
-
-template_name->value(template_browser->text(item));
-
-template_delete->activate();
-
-char pngfile[1024], *ext;
-
-strlcpy(pngfile, flfile, sizeof(pngfile));
-if ((ext = strrchr(pngfile, '.')) == NULL) return;
-strcpy(ext, ".png");
-
-img = Fl_Shared_Image::get(pngfile);
-
-if (img) {
- template_preview->image(img);
- template_preview->redraw();
-}}
- xywh {10 28 180 250} type Hold labelfont 1 align 5 when 3
- }
- Fl_Box template_preview {
- xywh {200 28 250 250} box THIN_DOWN_BOX align 85 resizable
- }
- Fl_Input template_name {
- label {Template Name:}
- callback {if (strlen(template_name->value())) {
- template_submit->activate();
- if (Fl::event_key() == FL_Enter) template_panel->hide();
-} else template_submit->deactivate();}
- xywh {124 288 326 25} labelfont 1 when 3 textfont 4
- }
- Fl_Input template_instance {
- label {Instance Name:}
- xywh {124 288 326 25} labelfont 1 textfont 4 hide
- }
- Fl_Group {} {
- xywh {10 323 440 25}
- } {
- Fl_Button template_delete {
- label {Delete Template}
- callback template_delete_cb
- xywh {10 323 133 25}
- }
- Fl_Box {} {
- xywh {153 323 126 25} resizable
- }
- Fl_Button {} {
- label Cancel
- callback {Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image();
-if (img) img->release();
-template_preview->image(0);
-
-template_browser->deselect();
-template_name->value("");
-template_instance->value("");
-template_panel->hide();}
- xywh {289 323 72 25}
- }
- Fl_Return_Button template_submit {
- label Save
- callback {Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image();
-if (img) img->release();
-template_preview->image(0);
-
-template_panel->hide();}
- xywh {371 323 79 25}
- }
- }
- }
-}
-
-Function {template_clear()} {return_type void
-} {
- code {int i;
-void *filename;
-
-for (i = 1; i <= template_browser->size(); i ++) {
- if ((filename = template_browser->data(i)) != NULL) free(filename);
-}
-
-template_browser->deselect();
-template_browser->clear();} {}
-}
-
-Function {template_delete_cb(Fl_Button *, void *)} {return_type void
-} {
- code {int item = template_browser->value();
-if (item < 1) return;
-
-const char *name = template_browser->text(item);
-const char *flfile = (const char *)template_browser->data(item);
-if (!flfile) return;
-
-if (!fl_choice("Are you sure you want to delete the template \\"%s\\"?",
- "Cancel", "Delete", 0, name)) return;
-
-if (unlink(flfile)) {
- fl_alert("Unable to delete template \\"%s\\":\\n%s", name, strerror(errno));
- return;
-}
-
-template_browser->remove(item);
-template_browser->do_callback();} {}
-}
-
-Function {template_load()} {open return_type void
-} {
- code {int i;
-char name[1024], filename[1024], path[1024], *ptr;
-struct dirent **files;
-int num_files;
-
-fluid_prefs.getUserdataPath(path, sizeof(path));
-strlcat(path, "templates", sizeof(path));
-
-num_files = fl_filename_list(path, &files);
-
-for (i = 0; i < num_files; i ++) {
- if (fl_filename_match(files[i]->d_name, "*.fl")) {
- // Format the name as the filename with "_" replaced with " "
- // and without the trailing ".fl"...
- strlcpy(name, files[i]->d_name, sizeof(name));
- *strstr(name, ".fl") = '\\0';
-
- for (ptr = name; *ptr; ptr ++) {
- if (*ptr == '_') *ptr = ' ';
- }
-
- // Add the template to the browser...
- snprintf(filename, sizeof(filename), "%s/%s", path, files[i]->d_name);
- template_browser->add(name, strdup(filename));
- }
-
- free(files[i]);
-}
-
-if (num_files > 0) free(files);} {}
-}
-
-comment {
-//
-// End of "$Id$".
-//} {in_source in_header
-}
+# data file for the Fltk User Interface Designer (fluid)
+version 1.0107
+header_name {.h}
+code_name {.cxx}
+comment {//
+// "$Id$"
+//
+// FLUID template support for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+// http://www.fltk.org/str.php
+//
+} {in_source in_header
+}
+
+decl {\#include <stdio.h>} {}
+
+decl {\#include <stdlib.h>} {}
+
+decl {\#include "../src/flstring.h"} {}
+
+decl {\#include <errno.h>} {}
+
+decl {\#include <FL/filename.H>} {}
+
+decl {\#include <FL/fl_ask.H>} {}
+
+decl {\#include <FL/Fl_Shared_Image.H>} {}
+
+decl {\#include <FL/Fl_Preferences.H>} {}
+
+declblock {\#if defined(WIN32) && !defined(__CYGWIN__)} {selected after {\#endif // WIN32 && !__CYGWIN__}
+} {
+ decl {\#include <io.h>} {}
+ decl {\#else} {}
+ decl {\#include <unistd.h>} {}
+}
+
+decl {extern Fl_Preferences fluid_prefs;} {}
+
+Function {make_template_panel()} {open
+} {
+ Fl_Window template_panel {
+ label {New/Save Template}
+ callback {Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image();
+if (img) img->release();
+template_preview->image(0);
+
+template_browser->deselect();
+template_name->value("");
+template_instance->value("");
+template_panel->hide();} open
+ xywh {340 237 460 355} type Double resizable modal visible
+ } {
+ Fl_Browser template_browser {
+ label {Available Templates:}
+ callback {if (Fl::event_clicks()) {
+ template_panel->hide();
+ return;
+}
+Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image();
+if (img) img->release();
+template_preview->image(0);
+template_preview->redraw();
+
+int item = template_browser->value();
+
+if (item <= 1) template_instance->deactivate();
+else template_instance->activate();
+
+if (item < 1) {
+ template_submit->deactivate();
+ template_delete->deactivate();
+ return;
+}
+
+template_submit->activate();
+
+const char *flfile = (const char *)template_browser->data(item);
+if (!flfile) {
+ template_delete->deactivate();
+ return;
+}
+
+template_name->value(template_browser->text(item));
+
+template_delete->activate();
+
+char pngfile[1024], *ext;
+
+strlcpy(pngfile, flfile, sizeof(pngfile));
+if ((ext = strrchr(pngfile, '.')) == NULL) return;
+strcpy(ext, ".png");
+
+img = Fl_Shared_Image::get(pngfile);
+
+if (img) {
+ template_preview->image(img);
+ template_preview->redraw();
+}}
+ xywh {10 28 180 250} type Hold labelfont 1 align 5 when 3
+ }
+ Fl_Box template_preview {
+ xywh {200 28 250 250} box THIN_DOWN_BOX align 85 resizable
+ }
+ Fl_Input template_name {
+ label {Template Name:}
+ callback {if (strlen(template_name->value())) {
+ template_submit->activate();
+ if (Fl::event_key() == FL_Enter) template_panel->hide();
+} else template_submit->deactivate();}
+ xywh {124 288 326 25} labelfont 1 when 3 textfont 4
+ }
+ Fl_Input template_instance {
+ label {Instance Name:}
+ xywh {124 288 326 25} labelfont 1 textfont 4 hide
+ }
+ Fl_Group {} {
+ xywh {10 323 440 25}
+ } {
+ Fl_Button template_delete {
+ label {Delete Template}
+ callback template_delete_cb
+ xywh {10 323 133 25}
+ }
+ Fl_Box {} {
+ xywh {153 323 126 25} resizable
+ }
+ Fl_Button {} {
+ label Cancel
+ callback {Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image();
+if (img) img->release();
+template_preview->image(0);
+
+template_browser->deselect();
+template_name->value("");
+template_instance->value("");
+template_panel->hide();}
+ xywh {289 323 72 25}
+ }
+ Fl_Return_Button template_submit {
+ label Save
+ callback {Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image();
+if (img) img->release();
+template_preview->image(0);
+
+template_panel->hide();}
+ xywh {371 323 79 25}
+ }
+ }
+ }
+}
+
+Function {template_clear()} {return_type void
+} {
+ code {int i;
+void *filename;
+
+for (i = 1; i <= template_browser->size(); i ++) {
+ if ((filename = template_browser->data(i)) != NULL) free(filename);
+}
+
+template_browser->deselect();
+template_browser->clear();} {}
+}
+
+Function {template_delete_cb(Fl_Button *, void *)} {return_type void
+} {
+ code {int item = template_browser->value();
+if (item < 1) return;
+
+const char *name = template_browser->text(item);
+const char *flfile = (const char *)template_browser->data(item);
+if (!flfile) return;
+
+if (!fl_choice("Are you sure you want to delete the template \\"%s\\"?",
+ "Cancel", "Delete", 0, name)) return;
+
+if (unlink(flfile)) {
+ fl_alert("Unable to delete template \\"%s\\":\\n%s", name, strerror(errno));
+ return;
+}
+
+template_browser->remove(item);
+template_browser->do_callback();} {}
+}
+
+Function {template_load()} {open return_type void
+} {
+ code {int i;
+char name[1024], filename[1024], path[1024], *ptr;
+struct dirent **files;
+int num_files;
+
+fluid_prefs.getUserdataPath(path, sizeof(path));
+strlcat(path, "templates", sizeof(path));
+
+num_files = fl_filename_list(path, &files);
+
+for (i = 0; i < num_files; i ++) {
+ if (fl_filename_match(files[i]->d_name, "*.fl")) {
+ // Format the name as the filename with "_" replaced with " "
+ // and without the trailing ".fl"...
+ strlcpy(name, files[i]->d_name, sizeof(name));
+ *strstr(name, ".fl") = '\\0';
+
+ for (ptr = name; *ptr; ptr ++) {
+ if (*ptr == '_') *ptr = ' ';
+ }
+
+ // Add the template to the browser...
+ snprintf(filename, sizeof(filename), "%s/%s", path, files[i]->d_name);
+ template_browser->add(name, strdup(filename));
+ }
+
+ free(files[i]);
+}
+
+if (num_files > 0) free(files);} {}
+}
+
+comment {
+//
+// End of "$Id$".
+//} {in_source in_header
+}
diff --git a/fluid/template_panel.h b/fluid/template_panel.h
index 26fef3655..df5898a88 100644
--- a/fluid/template_panel.h
+++ b/fluid/template_panel.h
@@ -1,56 +1,56 @@
-//
-// "$Id$"
-//
-// FLUID template support for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2005 by Bill Spitzak and others.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Library General Public
-// License as published by the Free Software Foundation; either
-// version 2 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Library General Public License for more details.
-//
-// You should have received a copy of the GNU Library General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-// USA.
-//
-// Please report all bugs and problems on the following page:
-//
-// http://www.fltk.org/str.php
-//
-
-// generated by Fast Light User Interface Designer (fluid) version 1.0107
-
-#ifndef template_panel_h
-#define template_panel_h
-#include <FL/Fl.H>
-#include <FL/Fl_Double_Window.H>
-extern Fl_Double_Window *template_panel;
-#include <FL/Fl_Browser.H>
-extern Fl_Browser *template_browser;
-#include <FL/Fl_Box.H>
-extern Fl_Box *template_preview;
-#include <FL/Fl_Input.H>
-extern Fl_Input *template_name;
-extern Fl_Input *template_instance;
-#include <FL/Fl_Group.H>
-#include <FL/Fl_Button.H>
-extern void template_delete_cb(Fl_Button*, void*);
-extern Fl_Button *template_delete;
-#include <FL/Fl_Return_Button.H>
-extern Fl_Return_Button *template_submit;
-Fl_Double_Window* make_template_panel();
-void template_clear();
-void template_delete_cb(Fl_Button *, void *);
-void template_load();
-#endif
-
-//
-// End of "$Id$".
-//
+//
+// "$Id$"
+//
+// FLUID template support for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+// http://www.fltk.org/str.php
+//
+
+// generated by Fast Light User Interface Designer (fluid) version 1.0107
+
+#ifndef template_panel_h
+#define template_panel_h
+#include <FL/Fl.H>
+#include <FL/Fl_Double_Window.H>
+extern Fl_Double_Window *template_panel;
+#include <FL/Fl_Browser.H>
+extern Fl_Browser *template_browser;
+#include <FL/Fl_Box.H>
+extern Fl_Box *template_preview;
+#include <FL/Fl_Input.H>
+extern Fl_Input *template_name;
+extern Fl_Input *template_instance;
+#include <FL/Fl_Group.H>
+#include <FL/Fl_Button.H>
+extern void template_delete_cb(Fl_Button*, void*);
+extern Fl_Button *template_delete;
+#include <FL/Fl_Return_Button.H>
+extern Fl_Return_Button *template_submit;
+Fl_Double_Window* make_template_panel();
+void template_clear();
+void template_delete_cb(Fl_Button *, void *);
+void template_load();
+#endif
+
+//
+// End of "$Id$".
+//