Welcome to ftp.nluug.nl Current directory: /pub/windowing/X/contrib/widgets/motif/MegaB/ |
|
Contents of README:/* $Id: README,v 1.1 1994/12/26 02:17:18 cwikla Exp $ */ This is the xmMegaButtonWidget. It basically allows you to have a menu with a SCROLLING array of menu buttons like on other windowing systems. It is not an xmList, but rather, is subclassed from the xmPushButtonWidgetClass -- despite which, the xmMegaButtonWidget can operate in 1 of two modes: As a menu of pushbuttons, or a menu of toggle buttons. When the number of items in the xmMegaButtonWidget becomes greater than the XmNvisibleItemCount, up and down arrows become visible on the top and bottom of the widget respectively. If not, then the menu looks just like an ordinary menu, except that it is one widget. The advantage of this approach is that you can have thousands of choices and only the overhead of one widget. It has the following resources: XmNitems : A list of XmStrings to be displayed in the menu XmNitemCount : the number of items XmNvisibleItemCount: maximum number of items that can be shown at once XmNsetPosition: If in toggle button mode, the position from 0-XmNitemCount-1 of the set button XmNinitialDelay: initial scroll delay XmNrepeatDelay : subsequent scroll delay XmNbuttonMode: XmMODE_TOGGLE_BUTTON or XmMODE_PUSH_BUTTON XmNfillOnSelect: Fill toggle button when it is selected XmNchunkSize: allows control over internal memory chunk size XmNcallbackData: an array of XmNitemCount of data to be sent with callbacks It has the following public functions (pretty self explanatory...) extern void XmMegaButtonAddItem(Widget _w, XmString _item, int _pos, XtPointer _cbData); extern XtPointer XmMegaButtonRemoveItem(Widget _w, int _pos); extern int XmMegaButtonGetPos(Widget _w); extern void XmMegaButtonSetPos(Widget _w, int _pos); Other things: 1) The toggle button spacing/draw code is a class method, so if you wanted some special looking toggle button it should be easy to implement. 2) Memory is allocated in chunks as it grows, instead of one at a time. This way you can get some decent performance from the XmMegaButtonAddItem function if you have menus that the size will be unknown. 3) Both click & drag, and click and select menus work Bad things: 1) Requires Motif 1.2 2) I haven't implemented the SetValues or GetValues method. Personally, I haven't had need for them so unless people ask, I probably won't get around to it. 3) All the menu items are the same type -- no separators. |
Name Last modified Size
Parent Directory - CHANGES 31-Dec-1994 00:00 695 README 25-Dec-1994 00:00 2.4K megab.tz 15-May-1995 00:00 36K readme.txt 29-Jan-1995 00:00 2.4K
NLUUG - Open Systems. Open Standards
Become a member
and get discounts on conferences and more, see the NLUUG website!