|
|
|
|
|
Roadmap of sources |
abiSoftButtonsMain.cppStarts the datatypes library (used for translating file formats) and contains the main() functions, which creates and runs the application. |
DemoApp.cppCreates the application, a ButtonWindow (a very simple subclass of a BWindow), and an abisoftButtonBox.The abisoftButtonBox is interesting -- it's a very simple way of using a structure to create a collection of buttons. The idea is based on a concept popularized by Heller in his Motif programming book. |
ButtonWindow.cppA very simple subclass of a BWindow -- just adds a QuitRequested method. |
abisoftButtonBox.cppdescribed in DemoApp.cpp |
abisoftButton.cppInspired by frustration about the absence of methods to change the color of BButtons and by an article in the Newsletter about BPictureButtons. Some ideas were inspired by Dan Heller's Motif Programmer's Manual, Volume 6 of the series on X Windows Programming from O'Reilly & Associates; the concept of offsetting the button image on button press was inspired by the ButtonFace Library for Motif by Harald Albrecht.The basic idea is that you should be able to create easily an arrow button, a button with a picture (only), a button with multi-line text, and a button with multi-line text and a picture. And sound. Also a toggle button with any of these. (Up and down arrows are left as an exercise for the reader.) (As is anti-aliasing the left and right arrows.) The type of button (arrow, picture only, text) is set when the button is constructed. The image darkens on button press and when a file (with a sound or an image) is pulled over for drag and drop. The background color of the button can be set after the button is constructed, or can be set by roColour drops. (Saving the changed colors using libprefs.so is left as an exercise for the reader.) The font size and style of the button can be set after the button is constructed, or can be set by dropping FFont messages from Marco Nelissen's FontSelector. Again, saving changed fonts is left as an exercise for the reader. For other than arrow buttons, the picture can be set at construction, or by dropping an image file (in a format that is translatable by datatypes) onto the button. Currently, image files that are dropped on the button are not saved. (Another exercise for the reader. Hint: they can be saved in the Image directory, or in resources, or in preferences.) Image files are compressed to fit the button rectangle using code by Thorsten Seitz from his Thumbnail application. The very nice routine for converting a 32 bit bitmap to an 8 bit bitmap was posted on BeDevTalk by Jon Watte. Button sounds are set by dropping a sound file (a file containing a sound saved in .au, .wav or .aiff) onto the button. The file is copied and saved in the Sound subdirectory. You can zero out a saved sound by dropping a non-sound file on the button. (An excellent source of digitized speech is at the Bells Labs Text-to-Speech web page.
|
CopyrightExcept as otherwise noted, the author of this software is ABiSoft. Inc. Copyright (c) 1998 ABiSoft. Inc.Permission to use, copy, modify, and distribute this software for any purpose without fee is hereby granted, provided that this entire notice is included in all copies of any software which is or includes a copy or modification of this software and in all copies of the supporting documentation for such software. THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED WARRANTY. IN PARTICULAR, THE AUTHOR DOES NOT MAKE ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. |
AcknowledgementsABiSoft buttons uses the FFont class by Dianne Hackborn. To compress images we use code from Thumbnail by Thorsten Seitz. The list of colors in myrgbtab.h is from the XPM distribution and is copyright Groupe Bull. |
About ABiSoftABiSoft, Inc. (pronounced as "A B Soft") develops software in Chicago, Illinois, is the home of ANewsWire and Legolas and sponsors fuzzy-text searching of the BeDevTalk archives. |