1 #ifndef GUI_UTILS___MENU_ITEM__HPP
2 #define GUI_UTILS___MENU_ITEM__HPP
47 struct SMenuItemRecRec;
84 const string& image_alias =
"",
const string& tooltip =
"",
93 const string& image_alias =
"",
const string& tooltip =
"",
96 void InitPopup(
const string&
label,
const string& image_alias =
"",
97 const string& tooltip =
"");
98 void InitItem(
const string&
label,
TCmdID cmd,
const string& image_alias =
"",
100 void InitSeparator();
107 EType GetType()
const;
110 bool IsSubmenu()
const;
111 bool IsSeparator()
const;
114 void SetLabel(
const string&
label);
116 const TCmdID& GetCommand()
const;
119 bool HasImage()
const;
120 const string& GetImageAlias()
const;
121 void SetImageAlias(
const string& image_alias);
123 const string& GetTooltip()
const;
124 void SetTooltip(
const string& tooltip);
126 int GetState()
const;
127 void SetState(
int state) ;
129 bool IsEnabled()
const;
130 void Enable(
bool b_en);
132 bool IsCheckType()
const;
133 bool IsChecked()
const;
134 void SetCheck(
bool b_set);
136 bool IsRadioType()
const;
137 bool IsRadioSelected()
const;
138 void SelectRadio(
bool b_set);
165 CMenuItem* AddSubMenu(
const string& Label,
const string& image_alias =
"");
174 void DestroyAllSubNodes();
176 bool IsSubmenuEmpty();
199 const string&
label,
bool skip_named_groups);
200 void x_InsertInUnnamedGroup(
CMenuItem& item);
254 #define DEFINE_MENU(name) \
255 const SMenuItemRec name[] = \
258 #define MENU_ITEM(cmd, label) \
259 { CMenuItem::eItem, label, cmd, "", "", CMenuItem::eDefault},
261 #define MENU_ITEM_T(cmd, label, tooltip) \
262 { CMenuItem::eItem, label, cmd, "", tooltip, CMenuItem::eDefault},
264 #define MENU_ITEM_IM(cmd, label, image) \
265 { CMenuItem::eItem, label, cmd, image, "", CMenuItem::eDefault},
267 #define MENU_ITEM_IM_T(cmd, label, image, tooltip) \
268 { CMenuItem::eItem, label, cmd, image, tooltip, CMenuItem::eDefault},
270 #define MENU_ITEM_RADIO(cmd, label) \
271 { CMenuItem::eItem, label, cmd, "", "", CMenuItem::eRadioItem},
273 #define MENU_ITEM_CHECK(cmd, label) \
274 { CMenuItem::eItem, label, cmd, "", "", CMenuItem::eCheckItem},
276 #define MENU_SEPARATOR() \
277 { CMenuItem::eSeparator, "", eCmdNone, "", "", CMenuItem::eDefault},
279 #define MENU_SEPARATOR_L(label) \
280 { CMenuItem::eSeparator, label, eCmdNone, "", "", CMenuItem::eDefault},
282 #define SUBMENU(label) \
283 { CMenuItem::eSubmenu, label, eCmdNone, "", "", CMenuItem::eDefault},
285 #define SUBMENU_IM(label, image) \
286 { CMenuItem::eSubmenu, label, eCmdNone, image, "", CMenuItem::eDefault},
288 #define END_SUBMENU() \
289 { CMenuItem::eSubmenu, "", eCmdInvalid, "", "", CMenuItem::eDefault},
292 { CMenuItem::eSubmenu, "", eCmdMenuEnd, "", "", CMenuItem::eDefault}, \
GUI command routing and handling framework.
Include a standard set of the NCBI C++ Toolkit most basic headers.
bool IsEnabledItem() const
const CMenuItem * GetParent() const
bool IsEnabledSubmenu() const
const char * m_ImageAlias
TItemNode::TNodeList_CI TChildItem_CI
bool IsSubMenuEnd() const
TItemNode::TNodeList_I TChildItem_I
CTreeNode< CMenuItem * > TItemNode
CMenuItem * CreateMenuItems(const SMenuItemRec *items)
creates CMenuItem hierarchy from an array of SMenuItemRecRec
void x_SetState(int mask, int values)
void x_SetState(int mask, bool b_en)
@ eCmdInvalid
marks menu end in array initializers
@ eCmdNone
not a valid command
string GetLabel(const CSeq_id &id)
bool IsValid(const CSeq_point &pt, CScope *scope)
Checks that point >= 0 and point < length of Bioseq.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
TNodeList::const_iterator TNodeList_CI
#define NCBI_GUIUTILS_EXPORT
static const char label[]
void Merge(wxMenu &menu_1, const wxMenu &menu_2)
merges all items form menu_2 into menu_1, preserving the structure if possible
wxMenuItem * FindSubItem(wxMenu &menu, const wxString &text)
Find a subitem of the given menu by text.