Menu Item.
Definition at line 681 of file fbcontrols.h.
#include <fbcontrols.h>
Public Member Functions |
|
FBMenuItem () | |
Constructor. |
|
void | Set (FBMenuItemType pType, char *pExtension, char *pLabel, 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 (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. |
FBMenuItem | ( | ) |
Constructor.
void Set | ( | FBMenuItemType | pType, |
char * | pExtension, | ||
char * | pLabel, | ||
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 | Activateif 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 | ( | 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 719 of file fbcontrols.h.
Read Write Property: Default extension.
Definition at line 720 of file fbcontrols.h.
Read Write Property: Label of the menu item.
Definition at line 721 of file fbcontrols.h.
Read Write Property: Description of the menu item.
Definition at line 722 of file fbcontrols.h.
FBPropertyMenuItemType Type |
Read Write Property: Type of menu item.
Definition at line 723 of file fbcontrols.h.