|
JX Application Framework
|
#include <JXTextMenuData.h>
Classes | |
| class | ImageChanged |
Public Member Functions | |
| JXTextMenuData (JXTextMenu *menu) | |
| ~JXTextMenuData () override | |
| void | InsertItem (const JIndex index, const JString &str, const JXMenu::ItemType type=JXMenu::kPlainType, const JString &shortcuts=JString::empty, const JString &nmShortcut=JString::empty, const JString &id=JString::empty) |
| void | PrependItem (const JString &str, const JXMenu::ItemType type=JXMenu::kPlainType, const JString &shortcuts=JString::empty, const JString &nmShortcut=JString::empty, const JString &id=JString::empty) |
| void | AppendItem (const JString &str, const JXMenu::ItemType type=JXMenu::kPlainType, const JString &shortcuts=JString::empty, const JString &nmShortcut=JString::empty, const JString &id=JString::empty) |
| void | DeleteItem (const JIndex index) override |
| void | DeleteAll () override |
| const JString & | GetText (const JIndex index) const |
| void | SetText (const JIndex index, const JString &str) |
| void | SetMenuItems (const JUtf8Byte *menuStr) |
| void | InsertMenuItems (const JIndex index, const JUtf8Byte *menuStr) |
| void | PrependMenuItems (const JUtf8Byte *menuStr) |
| void | AppendMenuItems (const JUtf8Byte *menuStr) |
| JFont | GetFont (const JIndex index) const |
| void | SetFontName (const JIndex index, const JString &name) |
| void | SetFontSize (const JIndex index, const JSize size) |
| void | SetFontStyle (const JIndex index, const JFontStyle &style) |
| void | SetFont (const JIndex index, const JFont &font) |
| const JFont & | GetDefaultFont () const |
| void | SetDefaultFontName (const JString &name, const bool updateExisting) |
| void | SetDefaultFontSize (const JSize size, const bool updateExisting) |
| void | SetDefaultFontStyle (const JFontStyle &style, const bool updateExisting) |
| void | SetDefaultFont (const JFont &font, const bool updateExisting) |
| bool | GetImage (const JIndex index, const JXImage **image) const |
| void | SetImage (const JIndex index, JXImage *image, const bool menuOwnsImage) |
| void | ClearImage (const JIndex index) |
| bool | GetNMShortcut (const JIndex index, const JString **str) const |
| void | SetNMShortcut (const JIndex index, const JString &str) |
| bool | HasSeparator (const JIndex index) const |
| void | ShowSeparatorAfter (const JIndex index, const bool show=true) |
| bool | HeightCompressed () const |
| void | CompressHeight (const bool compress=true) |
| void | ConfigureTable (JXTextMenuTable *table) |
| const JString & | GetText (const JIndex index, JIndex *ulIndex, JFont *font) const |
| bool | GetNMShortcut (const JIndex index, const JString **str, JFont *font) const |
Public Member Functions inherited from JXMenuData | |
| JXMenuData () | |
| ~JXMenuData () override | |
| bool | HasCheckboxes () const |
| bool | HasSubmenus () const |
| bool | IsEnabled (const JIndex index) const |
| JXMenu::ItemType | GetType (const JIndex index) const |
| bool | IsChecked (const JIndex index) const |
| bool | HasSubmenu (const JIndex index) const |
| bool | GetSubmenu (const JIndex index, JXMenu **menu) const |
| bool | ShortcutToIndex (const JUtf8Character &c, JIndex *index) const |
Public Member Functions inherited from JContainer | |
| JContainer () | |
| JContainer (const JContainer &source) | |
| JContainer & | operator= (const JContainer &source) |
Public Member Functions inherited from JCollection | |
| JCollection () | |
| JCollection (const JCollection &source) | |
| ~JCollection () override | |
| JCollection & | operator= (const JCollection &source) |
| JSize | GetItemCount () const |
| bool | IsEmpty () const |
| bool | IndexValid (const JIndex index) const |
| JIndex | GetIndexFromEnd (const JIndex index) const |
| JString | ToString () const override |
Public Member Functions inherited from JBroadcaster | |
| JBroadcaster () | |
| virtual | ~JBroadcaster () |
| JBroadcaster & | operator= (const JBroadcaster &source) |
| bool | HasSenders () const |
| JSize | GetSenderCount () const |
| bool | HasRecipients () const |
| JSize | GetRecipientCount () const |
| template<class T > | |
| void | ListenTo (const JBroadcaster *sender, const std::function< void(const T &)> &f) |
Static Public Attributes | |
| static const JUtf8Byte * | kImageChanged = "ImageChanged::JXTextMenuData" |
Protected Member Functions | |
| void | ItemShortcutsChanged (const JIndex index, const JString *shortcuts) override |
Protected Member Functions inherited from JXMenuData | |
| void | InsertItem (const JIndex index, const JXMenu::ItemType type=JXMenu::kPlainType, const JString &shortcuts=JString::empty, const JString &id=JString::empty) |
| void | PrependItem (const JXMenu::ItemType type=JXMenu::kPlainType, const JString &shortcuts=JString::empty, const JString &id=JString::empty) |
| void | AppendItem (const JXMenu::ItemType type=JXMenu::kPlainType, const JString &shortcuts=JString::empty, const JString &id=JString::empty) |
| bool | GetItemShortcuts (const JIndex index, const JString **shortcuts) const |
| void | SetItemShortcuts (const JIndex index, const JString &shortcuts) |
| bool | GetItemID (const JIndex index, const JString **id) const |
| void | SetItemID (const JIndex index, const JString &id) |
| void | EnableItem (const JIndex index) |
| void | EnableAll () |
| void | DisableItem (const JIndex index) |
| void | DisableAll () |
| void | SetItemEnabled (const JIndex index, const bool enabled) |
| virtual void | PrepareToOpenMenu (const JXMenu::UpdateAction updateAction) |
Protected Member Functions inherited from JContainer | |
| void | InstallCollection (JCollection *list) |
| const JCollection * | GetList () const |
| void | Receive (JBroadcaster *sender, const Message &message) override |
Protected Member Functions inherited from JCollection | |
| void | ItemAdded () |
| void | ItemRemoved () |
| void | SetItemCount (const JSize newItemCount) |
Protected Member Functions inherited from JBroadcaster | |
| JBroadcaster (const JBroadcaster &source) | |
| void | ListenTo (const JBroadcaster *sender) |
| void | StopListening (const JBroadcaster *sender) |
| void | ClearWhenGoingAway (const JBroadcaster *sender, void *pointerToMember) |
| void | StopListening (const JBroadcaster *sender, const std::type_info &messageType) |
| template<class T > | |
| void | Send (JBroadcaster *recipient, const T &message) |
| template<class T > | |
| void | Broadcast (const T &message) |
| void | SendWithFeedback (JBroadcaster *recipient, Message *message) |
| void | BroadcastWithFeedback (Message *message) |
| virtual void | ReceiveWithFeedback (JBroadcaster *sender, Message *message) |
| virtual void | ReceiveGoingAway (JBroadcaster *sender) |
Stores a string and an image (optional) for each menu item.
| JXTextMenuData::JXTextMenuData | ( | JXTextMenu * | menu | ) |
|
override |
|
inline |
|
inline |
| void JXTextMenuData::ClearImage | ( | const JIndex | index | ) |
|
inline |
| void JXTextMenuData::ConfigureTable | ( | JXTextMenuTable * | table | ) |
Called by JXTextMenuTable constructor.
|
overridevirtual |
Reimplemented from JXMenuData.
|
overridevirtual |
Reimplemented from JXMenuData.
|
inline |
| const JString & JXTextMenuData::GetText | ( | const JIndex | index, |
| JIndex * | ulIndex, | ||
| JFont * | font | ||
| ) | const |
|
inline |
This takes effect next time the menu is displayed.
| void JXTextMenuData::InsertItem | ( | const JIndex | index, |
| const JString & | str, | ||
| const JXMenu::ItemType | type = JXMenu::kPlainType, |
||
| const JString & | shortcuts = JString::empty, |
||
| const JString & | nmShortcut = JString::empty, |
||
| const JString & | id = JString::empty |
||
| ) |
%% is not supported. The shortcuts can be listed after h (e.g. "Quit %h Qq"), but they cannot include %.
The vertical bar '|' separates menu items.
See ParseMenuItemStr() for more details.
If id is not nullptr, the string database is searched for "<item ID>" and this is parsed for the item's text and shortcuts.
|
overrideprotectedvirtual |
Derived classes can override this to update underlining, etc.
Note that shortcuts can be nullptr.
Reimplemented from JXMenuData.
|
inline |
|
inline |
| void JXTextMenuData::SetDefaultFontStyle | ( | const JFontStyle & | style, |
| const bool | updateExisting | ||
| ) |
| void JXTextMenuData::SetFontStyle | ( | const JIndex | index, |
| const JFontStyle & | style | ||
| ) |
| void JXTextMenuData::SetMenuItems | ( | const JUtf8Byte * | menuStr | ) |
See InsertMenuItems() for documentation.
|
static |