• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..27-May-2009-

Makefile.amH A D02-Jan-20081.2 KiB4729

Makefile.inH A D27-May-200914.6 KiB508433

MegaB.cH A D14-May-200244.8 KiB1,6741,321

MegaB.hH A D14-May-20022.9 KiB8739

MegaBP.hH A D14-May-20023.2 KiB11666

READMEH A D14-May-20022.4 KiB6447

test1.cH A D14-May-20024.4 KiB14988

test2.cH A D14-May-20022.4 KiB12080

README

1/* $Id: README,v 1.1 2002/05/14 23:01:27 dannybackx Exp $ */
2
3
4	This is the xmMegaButtonWidget.  It basically allows you
5to have a menu with a SCROLLING array of menu buttons like
6on other windowing systems.  It is not an xmList, but rather,
7is subclassed from the xmPushButtonWidgetClass -- despite which,
8the xmMegaButtonWidget can operate in 1 of two modes: As a menu
9of pushbuttons, or a menu of toggle buttons.  When the number
10of items in the xmMegaButtonWidget becomes greater than the
11XmNvisibleItemCount, up and down arrows become visible on the
12top and bottom of the widget respectively. If not, then the
13menu looks just like an ordinary menu, except that it is one
14widget.  The advantage of this approach is that you can have
15thousands of choices and only the overhead of one widget.
16
17
18	It has the following resources:
19
20	XmNitems : A list of XmStrings to be displayed in the menu
21	XmNitemCount : the number of items
22	XmNvisibleItemCount: maximum number of items that can be
23		shown at once
24	XmNsetPosition: If in toggle button mode, the position
25		from 0-XmNitemCount-1 of the set button
26	XmNinitialDelay: initial scroll delay
27	XmNrepeatDelay : subsequent scroll delay
28	XmNbuttonMode: XmMODE_TOGGLE_BUTTON or XmMODE_PUSH_BUTTON
29	XmNfillOnSelect: Fill toggle button when it is selected
30	XmNchunkSize: allows control over internal memory chunk size
31	XmNcallbackData: an array of XmNitemCount of data to
32		be sent with callbacks
33
34	It has the following public functions (pretty self explanatory...)
35
36extern void XmMegaButtonAddItem(Widget _w, XmString _item, int _pos, XtPointer _cbData);
37extern XtPointer XmMegaButtonRemoveItem(Widget _w, int _pos);
38extern int XmMegaButtonGetPos(Widget _w);
39extern void XmMegaButtonSetPos(Widget _w, int _pos);
40
41
42	Other things:
43
44	1) The toggle button spacing/draw code is a class method, so
45	if you wanted some special looking toggle button it should be
46	easy to implement.
47
48	2) Memory is allocated in chunks as it grows, instead of one at a
49	time.  This way you can get some decent performance from the
50	XmMegaButtonAddItem function if you have menus that the size
51	will be unknown.
52
53	3)  Both click & drag, and click and select menus work
54
55	Bad things:
56
57	1) Requires Motif 1.2
58
59	2) I haven't implemented the SetValues or GetValues method. Personally,
60I haven't had need for them so unless people ask, I probably won't get
61around to it.
62
63	3) All the menu items are the same type -- no separators.
64