Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Related Pages | Examples

fgl::FGMenuWindow Class Reference

#include <fastgl.h>

Inheritance diagram for fgl::FGMenuWindow:

Inheritance graph
[legend]
Collaboration diagram for fgl::FGMenuWindow:

Collaboration graph
[legend]
List of all members.

Detailed Description

Used for Pop-up menus.
See also:
class FGWindow
Examples:

buttons.cpp.


Public Member Functions

 FGMenuWindow (int x, int y, int w, int h, GuiHwnd proc=0, void *user_data=UNDEFINED_USER_DATA)
 FGMenuWindow (int w, int h, GuiHwnd proc=0, void *user_data=UNDEFINED_USER_DATA)
virtual void draw (void)
FGBaseMenuItemAddMenu (char *nm, int key=0, ControlCall f=0, void *user_data=UNDEFINED_USER_DATA)
FGLabelAddLabel (char *nm, int key=0, ControlCall f=0, unsigned i=UNDEFINED_COLOR, unsigned p=UNDEFINED_COLOR, void *user_data=UNDEFINED_USER_DATA)
FGTextAddText (const char *s, unsigned ink=UNDEFINED_COLOR, unsigned paper=UNDEFINED_COLOR, void *user_data=UNDEFINED_USER_DATA)
FGCheckBoxAddCheckBox (char *nm, int key=0, int *variable=0, ControlCall f=0, void *user_data=UNDEFINED_USER_DATA)
FGCheckBoxAddCheckBox (char *nm, int key=0, bool *variable=0, ControlCall f=0, void *user_data=UNDEFINED_USER_DATA)
FGRadioButtonAddRadioButton (char *nm, int key=0, int *variable=0, ControlCall f=0, void *user_data=UNDEFINED_USER_DATA)
FGRadioButtonAddRadioButton (char *nm, int key=0, bool *variable=0, ControlCall f=0, void *user_data=UNDEFINED_USER_DATA)
FGCheckBoxAddCheckBoxMask (int, char *nm, int key=0, int *variable=0, ControlCall f=0, void *user_data=UNDEFINED_USER_DATA)
FGRadioButtonAddRadioButtonMask (int, char *nm, int key=0, int *variable=0, ControlCall f=0, void *user_data=UNDEFINED_USER_DATA)
FGEditBoxAddEditBox (int ws1, int ws2, char *nm, int key, int *p, ControlCall f, int min, int max, void *user_data=UNDEFINED_USER_DATA)
FGEditBoxAddEditBox (int ws1, int ws2, char *nm, int key, int *p, ControlCall f=0, void *user_data=UNDEFINED_USER_DATA)
FGEditBoxAddEditBox (int ws1, int ws2, char *nm, int key, char *p, ControlCall f=0, void *user_data=UNDEFINED_USER_DATA)
FGEditBoxAddEditBox (int sz, int ws1, int ws2, char *nm, int key, char *p, ControlCall f=0, void *user_data=UNDEFINED_USER_DATA)
FGEditBoxAddEditBox (int ws1, int ws2, char *nm, int key, double *p, ControlCall f, double min, double max, void *user_data=UNDEFINED_USER_DATA)
FGEditBoxAddEditBox (int ws1, int ws2, char *nm, int key, double *p, ControlCall f=0, void *user_data=UNDEFINED_USER_DATA)
void Separator (void)


Constructor & Destructor Documentation

fgl::FGMenuWindow::FGMenuWindow int  x,
int  y,
int  w,
int  h,
GuiHwnd  proc = 0,
void *  user_data = UNDEFINED_USER_DATA
[inline]
 

Creates pulldown menu.

Parameters:
x x coordinate
y y coordinate
w a width of menu
h a height of menu
proc an optional window callback procedure
user_data an optional user data pointer (for better binding between GUI and user's objects).

fgl::FGMenuWindow::FGMenuWindow int  w,
int  h,
GuiHwnd  proc = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Creates pulldown menu at current mouse position.

Parameters:
w a width of menu
h a height of menu
proc an optional window callback procedure
user_data an optional user data pointer (for better binding between GUI and user's objects).


Member Function Documentation

FGCheckBox * fgl::FGMenuWindow::AddCheckBox char *  nm,
int  key = 0,
bool *  variable = 0,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds a FGCheckBox to the FGMenuWindow.

Parameters:
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
variable a pointer to bool variable. The value of this variable controls the state of button (true/false)
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGCheckBox FGButtonGroup

FGCheckBox * fgl::FGMenuWindow::AddCheckBox char *  nm,
int  key = 0,
int *  variable = 0,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds a FGCheckBox to the FGMenuWindow.

Parameters:
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
variable a pointer to int variable. The value of this variable controls the state of button (true/false)
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGCheckBox FGButtonGroup

FGCheckBox * fgl::FGMenuWindow::AddCheckBoxMask int  m,
char *  nm,
int  key = 0,
int *  variable = 0,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds a masked version FGCheckBox to the FGMenuWindow. This is like a normal check box but it is controlled by one of a 32 bit in a triggered variable (of type uint32). This is useful when you want change only one bit of variable.

Parameters:
m bit mask value, by example 1 for a bit 0 or (1<<20) for twenth bit.
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
variable a pointer to int variable. The value of this variable controls the state of button (true/false)
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGCheckBox FGButtonGroup

FGEditBox * fgl::FGMenuWindow::AddEditBox int  ws1,
int  ws2,
char *  nm,
int  key,
double *  p,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds an FGEditBox for an one-line-edit box for an double number without the test to in-a-range-number.

Parameters:
ws1 width of the button caption, the text is right alligned
ws2 width of the button input part
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
p a pointer to the edited double variable
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGEditBox

FGEditBox * fgl::FGMenuWindow::AddEditBox int  ws1,
int  ws2,
char *  nm,
int  key,
double *  p,
ControlCall  f,
double  min,
double  max,
void *  user_data = UNDEFINED_USER_DATA
 

Adds an FGEditBox for an one-line-edit box for an double number with the test to in-a-range-number.

Parameters:
ws1 width of the button caption, the text is right alligned
ws2 width of the button input part
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
p a pointer to the edited double variable
f a callback function of type ControllCall
min minimal correct value for a range testing
max maximal correct value for a range testing
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGEditBox

FGEditBox * fgl::FGMenuWindow::AddEditBox int  sz,
int  ws1,
int  ws2,
char *  nm,
int  key,
char *  p,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds an FGEditBox for an one-line-edit box for an string. The max length of string is get from the ws2 parameter/8, i.e. you don't type bigger string string that that value.

Parameters:
sz is the maximal size of input string in range from 1 to 127 characters.
ws1 width of the button caption, the text is right alligned
ws2 width of the button input part
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
p a pointer to the edited int variable
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGEditBox

FGEditBox * fgl::FGMenuWindow::AddEditBox int  ws1,
int  ws2,
char *  nm,
int  key,
char *  p,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds an FGEditBox for an one-line-edit box for an string. The max length of string is get from the ws2 parameter/8, i.e. you don't type bigger string string that that value.

Parameters:
ws1 width of the button caption, the text is right alligned
ws2 width of the button input part
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
p a pointer to the edited int variable
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGEditBox

FGEditBox * fgl::FGMenuWindow::AddEditBox int  ws1,
int  ws2,
char *  nm,
int  key,
int *  p,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds an FGEditBox for an one-line-edit box for an integer number without the test to in-a-range-number.

Parameters:
ws1 width of the button caption, the text is right alligned
ws2 width of the button input part
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
p a pointer to the edited int variable
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGEditBox

FGEditBox * fgl::FGMenuWindow::AddEditBox int  ws1,
int  ws2,
char *  nm,
int  key,
int *  p,
ControlCall  f,
int  min,
int  max,
void *  user_data = UNDEFINED_USER_DATA
 

Adds an FGEditBox for an one-line-edit box for an integer number with the test to in-a-range-number.

Parameters:
ws1 width of the button caption, the text is right alligned
ws2 width of the button input part
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
p a pointer to the edited int variable
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
min minimal correct value from -2147483648 to 2147483647 for a range testing
max maximal correct value from -2147483648 to 2147483647 for a range testing
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGEditBox

FGLabel * fgl::FGMenuWindow::AddLabel char *  nm,
int  key = 0,
ControlCall  f = 0,
unsigned  i = UNDEFINED_COLOR,
unsigned  p = UNDEFINED_COLOR,
void *  user_data = UNDEFINED_USER_DATA
 

Adds a Label for an one-line-edit box for an string. The max length of string is get from the ws2 parameter/8, i.e. you don't type bigger string string that that value.

Parameters:
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
f a callback function of type ControllCall
i explicit foreground color, default is color of parents
p explicit background color, default is color of parents
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl Label

FGBaseMenuItem * fgl::FGMenuWindow::AddMenu char *  nm,
int  key = 0,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds an single menu item to the FGMenuWindow. This used for pop-up menus. The position and size is calculated automatically.

Parameters:
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGBaseMenuItem
Examples:
buttons.cpp.

FGRadioButton * fgl::FGMenuWindow::AddRadioButton char *  nm,
int  key = 0,
bool *  variable = 0,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds a FGRadioButton to the FGMenuWindow.

Parameters:
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
variable a pointer to int variable. The value of this variable controls the state of button (true/false)
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGCheckBox FGButtonGroup

FGRadioButton * fgl::FGMenuWindow::AddRadioButton char *  nm,
int  key = 0,
int *  variable = 0,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds a FGRadioButton to the FGMenuWindow.

Parameters:
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
variable a pointer to int variable. The value of this variable controls the state of button (true/false)
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGCheckBox FGButtonGroup

FGRadioButton * fgl::FGMenuWindow::AddRadioButtonMask int  m,
char *  nm,
int  key = 0,
int *  variable = 0,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds a masked version FGRadioButton to the FGMenuWindow. This is like a normal check box but it is controlled by one of a 32 bit in a triggered variable (of type uint32). This is useful when you want change only one bit of variable.

Parameters:
m bit mask value, by example 1 for a bit 0 or (1<<20) for twenth bit.
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
variable a pointer to int variable. The value of this variable controls the state of button (true/false)
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGRadioButton FGButtonGroup

FGText * fgl::FGMenuWindow::AddText const char *  s,
unsigned  ink = UNDEFINED_COLOR,
unsigned  paper = UNDEFINED_COLOR,
void *  user_data = UNDEFINED_USER_DATA
 

Adds dynamic text string to the FGMenuWindow.

Parameters:
s name of the panel
ink explicit foreground color1, default is CWHITED
paper explicit background color, default is color of parents
user_data an optional user data pointer (for better binding between GUI and user's objects).

void fgl::FGMenuWindow::Separator void   ) 
 

Adds a separator to the menu.


Generated on Wed Feb 9 11:31:49 2005 for OpenGUI by  doxygen 1.4.0