Menu Item.
Definition at line 691 of file fbcontrols.h.
#include <fbcontrols.h>
Public Member Functions | |
FBMenuItem () | |
Constructor. | |
void | Set (FBMenuItemType pType, const char *pExtension, const char *pLabel, const char *pDescription) |
Initialization function. | |
bool | IsActive () |
Is menu item active? | |
void | Activate (bool pState=true) |
Activate menu item. | |
virtual void | OnItemSelectEvent (HIRegister pSender, HKEvent pEvent) |
Internal callback function for activated menu item. | |
virtual bool | Execute (const char *pFilename=NULL)=0 |
The callback function for when the menu item is selected. | |
Public Attributes | |
FBPropertyComponent | Component |
Read Write Property: Component handle. | |
FBPropertyString | Extension |
Read Write Property: Default extension. | |
FBPropertyString | Label |
Read Write Property: Label of the menu item. | |
FBPropertyString | Description |
Read Write Property: Description of the menu item. | |
FBPropertyMenuItemType | Type |
Read Write Property: Type of menu item. | |
FBPropertyString | Path |
Read Write Property: Default path to open file dialog to. |
FBMenuItem | ( | ) |
Constructor.
void Set | ( | FBMenuItemType | pType, |
const char * | pExtension, | ||
const char * | pLabel, | ||
const char * | pDescription | ||
) |
Initialization function.
pType | Type of menu item to be set. |
pExtension | File extension to use as filter for popup. |
pLabel | Short description of file format (usually one word identifier) |
pDescription | Long description of file format |
bool IsActive | ( | ) |
Is menu item active?
void Activate | ( | bool | pState = true | ) |
Activate menu item.
This will register the callback functions for the menu item, as well as make the item itself appear in the menu. Once activated, you have no more control over the menu item, seeing as it will be registered and cannot be activated twice. This function should be the last one you call when activating the menu item.
pState | Activate if true (default = true). |
virtual void OnItemSelectEvent | ( | HIRegister | pSender, |
HKEvent | pEvent | ||
) | [virtual] |
Internal callback function for activated menu item.
Registers internally the menu item.
pSender | Sending register. |
pEvent | Event being sent. |
virtual bool Execute | ( | const char * | pFilename = NULL | ) | [pure virtual] |
The callback function for when the menu item is selected.
In order to use this class correctly, you must create a class that inherits directly from this class, overloading this virtual function. This function will then be called when the menu item is selected.
pFilename | Filename from popup (default = NULL). |
Read Write Property: Component handle.
Definition at line 729 of file fbcontrols.h.
Read Write Property: Default extension.
Definition at line 730 of file fbcontrols.h.
Read Write Property: Label of the menu item.
Definition at line 731 of file fbcontrols.h.
Read Write Property: Description of the menu item.
Definition at line 732 of file fbcontrols.h.
FBPropertyMenuItemType Type |
Read Write Property: Type of menu item.
Definition at line 733 of file fbcontrols.h.
Read Write Property: Default path to open file dialog to.
Definition at line 735 of file fbcontrols.h.