FB II Compiler
Use popup menu like a control
Weee, no more DEF SHOWPOP, DEF SHADOWBOX etc...
The following code will use the proper system pop-up CDEF , and Jam it into the FB button list. Then you will get a Button event when the pop-up is selected. Use SCROLL BUTTON to set the popu-menu, and x% = BUTTON(id) to get the value of the menu. The Settings% paramater will take things like _useWndFont etc. You will also need a menu resource as specified by MenuResID%.
It will also do all the left & Right justification, Fixed Width,No title pop-ups etc,etc just have a flick thru IM to find out how, it would take me too long to go thru all the options...
LOCAL FN PopupMenuButton(theName$,IDtoUse%,MenuResID%,theRect&,Settings%)
myWindow& = WINDOW(_wndPointer)
LONG IF myWindow& > 0
_PopupMenuProc = 1009
Settings% = _PopupMenuProc + Settings%
theWidth% = FN STRINGWIDTH(theName$)
IF theWidth% > 0 THEN theWidth% = theWidth% + 13
hControl& = FN NEWCONTROL(myWindow&,theRect&.top%,theName$,_True,0,MenuResID%,theWidth%,Settings%,IDtoUse% * 65536)
... or something like that...
FN PopupMenuButton("Font Size:",1,4000,@myRect,0)