From 1d451aada0455b19f0de47aa16761ebc0b3123ca Mon Sep 17 00:00:00 2001
From: Michael R Sweet The Border button turns the window manager border on
+or off. On most window managers you will have to close the
+window and reopen it to see the effect.
+
+ The string typed into here is passed to the X window manager
+as the class. This can change the icon or window decorations.
+On most (all?) window managers you will have to close the window
+and reopen it to see the effect.
+
X Class (text field)
+
+
Figure 9-9: The FLUID widget Style attributes.
This button turns the window manager border on or off. On -most window managers you will have to close the window and -reopen it to see the effect. - -
The string typed into here is passed to the X window manager -as the class. This can change the icon or window decorations. -On most (all?) window managers you will have to close the window -and reopen it to see the effect. - -
Selecting "Image..." off the label style pull-down -menu will bring up a file chooser from which you pick the image -file. If an image has already been chosen, you can change the -image used by picking "Image..." again. The name of -the image will appear in the "label" field, but you -can't edit it.
- -The contents of the image file are written to the -.cxx file, so if you wish to distribute the C code, you -only need to copy the .cxx file, not the images. If -many widgets share the same image then only one copy is -written.
+The contents of the image files in the Image +and Inactive text fields are written to the .cxx +file. If many widgets share the same image then only one copy is +written. Since the image data is embedded in the generated +source code, you need only distribute the C++ code and not the +image files themselves.
-However the file name is stored in the .fl -file, so to read the .fl file you need the image files -as well. Filenames are relative to the location the -.fl file is (not necessarily the current directory). I +
However, the filenames are stored in the .fl +file so you will need the image files as well to read the +.fl file. Filenames are relative to the location of the +.fl file and not necessarily the current directory. We recommend you either put the images in the same directory as the .fl file, or use absolute path names.
-FLUID runs using the default visual of your X server. This -may be 8 bits, which will give you dithered images. You may get +
FLUID runs using the default visual of your X server. This +may be 8 bits, which will give you dithered images. You may get better results in your actual program by adding the code "Fl::visual(FL_RGB)" to your code right before the first window is displayed.
All widgets with the same image on them share the same code -and source X pixmap. Thus once you have put an image on a +and source X pixmap. Thus once you have put an image on a widget, it is nearly free to put the same image on many other widgets.
-If you are using a painting program to edit an image: the -only way to convince FLUID to read the image file again is to -remove the image from all widgets that are using it (including -ones in closed windows), which will cause it to free its -internal copy, and then set the image again. You may find it -easier to exit FLUID and run it again.
+If you edit an image at the same time you are using it in FLUID, +the only way to convince FLUID to read the image file again is to +remove the image from all widgets that are using it or re-load the +.fl file.
Don't rely on how FLTK crops images that are outside the -widget, as this may change in future versions! The cropping of +widget, as this may change in future versions! The cropping of inside labels will probably be unchanged.
To more accurately place images, make a new "box" -widget and put the image in that as the label. This is also how -you can put both an image and text label on the same widget. If -your widget is a button, and you want the image inside it, you -must change the button's boxtype to FL_UP_FRAME (or -another frame), otherwise when it is pushed it will erase the -image.
+widget and put the image in that as the label. -FLUID will read X bitmap files. These files have C source -code to define a bitmap. Sometimes they are stored with the -".h" or ".bm" extension rather than the -standard ".xbm". +
FLUID reads X bitmap files which use C source code to define +a bitmap. Sometimes they are stored with the ".h" or +".bm" extension rather than the standard +".xbm" extension. -
FLUID will output code to construct an Fl_Bitmap widget and -use it to label the widget. The '1' bits in the bitmap are -drawn using the label color of the widget. You can change the -color in FLUID. The '0' bits are transparent.
+FLUID writes code to construct an Fl_Bitmap image and use it +to label the widget. The '1' bits in the bitmap are drawn using +the label color of the widget. You can change this color in the +FLUID widget attributes panel. The '0' bits are transparent.
The program "bitmap" on the X distribution does an -ok job of editing bitmaps.
- -FLUID will read X pixmap files as used by the libxpm library. -These files have C source code to define a pixmap. The -filenames usually have a ".xpm" extension. - -
FLUID will output code to construct an Fl_Pixmap widget and -use it to label the widget. The label color of the widget is -ignored, even for 2-color images that could be a bitmap.
- -XPM files can mark a single color as being transparent. -Currently FLTK and FLUID simulate this transparency rather -badly. It will use the color() of the widget as the background, -and all widgets using the same pixmap are assumed to have the -same color. This may be fixed in the future or on non-X -systems.
- -I have not found any good editors for small iconic pictures. -For pixmaps I have used XPaint. -This (and most other) painting programs are designed for large -full color images and are difficult to use to edit an image of -small size and few colors.
- -FLUID will also read GIF image files. These files are often -used on html documents to make icons. This lets you use nice -icons that you steal off the net in your user interface. - -
FLUID converts these into (modified) XPM format and uses an -Fl_Pixmap widget to label the widget. Transparency is handled -the same as for XPM files. Notice that the conversion removes -the compression, so the code may be much bigger than the .gif -file. Only the first image of an animated gif file is used.
- -Behavior and performance with large .gif files is not -guaranteed!
+adequate job of editing bitmaps. + +FLUID reads X pixmap files as used by the libxpm +library. These files use C source code to define a pixmap. The +filenames usually have the ".xpm" extension. + +
FLUID writes code to construct an Fl_Pixmap image and use it +to label the widget. The label color of the widget is ignored, +even for 2-color images that could be a bitmap. XPM files can +mark a single color as being transparent, and FLTK uses this +information to generate a transparency mask for the image.
+ +We have not found any good editors for small iconic pictures. +For pixmaps we have used XPaint +and the KDE icon editor.
+ +FLUID reads Windows BMP image files which are often used in +WIN32 applications for icons. FLUID converts BMP files into +(modified) XPM format and uses a Fl_BMP_Image image to label the +widget. Transparency is handled the same as for XPM files. All +image data is uncompressed when written to the source file, so +the code may be much bigger than the .bmp file.
+ +FLUID reads GIF image files which are often used in HTML +documents to make icons. FLUID converts GIF files into +(modified) XPM format and uses a Fl_GIF_Image image to label the +widget. Transparency is handled the same as for XPM files. All +image data is uncompressed when written to the source file, so +the code may be much bigger than the .gif file. Only +the first image of an animated GIF file is used.
+ +If FLTK is compiled with JPEG support, FLUID can read JPEG +image files which are often used for digital photos. FLUID uses +a Fl_JPEG_Image image to label the widget, and writes +uncompressed RGB or grayscale data to the source file. + +
If FLTK is compiled with PNG support, FLUID can read PNG +image files which are often used in HTML documents. FLUID uses a +Fl_PNG_Image image to label the widget, and writes uncompressed +RGB or grayscale data to the source file. PNG images can provide +a full alpha channel for partial transparency, and FLTK supports +this as best as possible on each platform.