From 1d451aada0455b19f0de47aa16761ebc0b3123ca Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sun, 24 Mar 2002 21:51:32 +0000 Subject: Finish changes to FLUID chapter... git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2010 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- documentation/cubeview.gif | Bin 8289 -> 10937 bytes documentation/fluid.html | 190 ++++++++++++++++++++++----------------------- 2 files changed, 94 insertions(+), 96 deletions(-) (limited to 'documentation') diff --git a/documentation/cubeview.gif b/documentation/cubeview.gif index 7dd3863f9..024cc55d2 100644 Binary files a/documentation/cubeview.gif and b/documentation/cubeview.gif differ diff --git a/documentation/fluid.html b/documentation/fluid.html index aa7a15d71..99dfd880e 100644 --- a/documentation/fluid.html +++ b/documentation/fluid.html @@ -864,6 +864,17 @@ you want the window to hide and then reappear at a new position, you should have your program set the hotspot itself just before show(). +

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. + +

X Class (text field)

+ +

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. +

The FLUID widget Style attributes.
Figure 9-9: The FLUID widget Style attributes.

@@ -1103,126 +1114,113 @@ different.

it) is almost identical to the panel for any other Fl_Widget. There are three extra items:

-

Border

- -

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. - -

xclass

+

Images

-

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. - -

Image Labels

- -

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.

-

Notes for all image types

+

Notes for All Image Types

-

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.

-

XBM (X bitmap files)

+

XBM (X Bitmap) Files

-

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.

- -

XPM (X pixmap files)

- -

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.

- -

GIF files

- -

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.

+ +

XPM (X Pixmap) Files

+ +

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.

+ +

BMP Files

+ +

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.

+ +

GIF Files

+ +

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.

+ +

JPEG Files

+ +

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. + +

PNG (Portable Network Graphics) Files

+ +

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.

Internationalization with FLUID

-- cgit v1.2.3