xoblite™ / Blackbox for Windows bb5 | RC6 preview | 0.25.2.14
http://xoblite.net/
HotkeysMenu Class Reference

#include <HotkeysMenu.h>

Public Member Functions

 HotkeysMenu (char *pszTitle)
 
virtual ~HotkeysMenu ()
 
bool Active (bool bActivate)
 
void Attached (Menu *pMenu)
 
void UpdateFolder ()
 
- Public Member Functions inherited from FolderItem
 FolderItem (Menu *pSubMenu, char *pszTitleANSI, wchar_t *pszTitleUnicode)
 
virtual ~FolderItem ()
 
void Invoke ()
 
void Timer (int nTimer)
 
void ShowSubMenu ()
 
- Public Member Functions inherited from MenuItem
 MenuItem (int type, char *pszTitleANSI, wchar_t *pszTitleUnicode, char *pszCommand, char *pszArgument, bool isSelected)
 
virtual ~MenuItem ()
 
virtual LRESULT NcHitTest (int x, int y)
 
int IsOver (int x, int y)
 
virtual void Mouse (UINT nMsg, POINT pt)
 
virtual void Invoke (int button)
 
virtual bool IsActive ()
 
virtual char * GetSortString ()
 
virtual void GetItemRect (RECT *r)
 
virtual void GetTitleRect (RECT *r)
 
virtual UINT GetDrawTextFormat ()
 
virtual void SetTitleANSI (char *pszTitleANSI)
 
virtual void SetTitleUnicode (wchar_t *pszTitleUnicode)
 
void AddToSelectionGroup (int group)
 
void ItemSetTimer ()
 
void ItemKillTimer ()
 
virtual void SetWidth (int nWidth)
 
virtual int GetWidth ()
 
virtual void SetHeight (int nHeight)
 
virtual int GetHeight ()
 
virtual void SetPosition (int nLeft, int nTop)
 
virtual void SetSortPriority (int nSortPriority)
 
virtual int GetSortPriority ()
 
virtual LRESULT Command (WPARAM wParam, LPARAM lParam)
 
virtual bool OnUser (int nMessage, WPARAM wParam, LPARAM lParam, LRESULT &lResult)
 
virtual void Moving ()
 
virtual HWND GetWindow ()
 
void ToggleSelected ()
 

Additional Inherited Members

- Static Public Member Functions inherited from MenuItem
static bool Compare (MenuItem *pM1, MenuItem *pM2)
 
- Public Attributes inherited from FolderItem
UINT m_nTimerId
 
- Public Attributes inherited from MenuItem
char * m_pszTitleANSI
 
wchar_t * m_pszTitleUnicode
 
int itemType
 
char * m_pszCommand
 
char * m_pszArgument
 
char * m_pszOriginalTitleANSI
 
wchar_t * m_pszOriginalTitleUnicode
 
bool m_isSelected
 
int m_selectionGroup
 
int m_currentValue
 
int m_minValue
 
int m_maxValue
 
POINT m_mousePos
 
int m_nSortPriority
 
Menum_pParent
 
Menum_pSubMenu
 
int m_nLeft
 
int m_nTop
 
int m_nWidth
 
int m_nHeight
 
bool m_bActive
 
UINT m_nTimerId
 
int m_nLastMouseButton
 

Constructor & Destructor Documentation

◆ HotkeysMenu()

HotkeysMenu::HotkeysMenu ( char * pszTitle)
46 : FolderItem(NULL, pszTitle, NULL)
47{
48}
FolderItem(Menu *pSubMenu, char *pszTitleANSI, wchar_t *pszTitleUnicode)
Definition FolderItem.cpp:43

◆ ~HotkeysMenu()

HotkeysMenu::~HotkeysMenu ( )
virtual
51{
52 m_pParent->RemoveChild(m_pSubMenu);
53 if (m_pSubMenu) delete m_pSubMenu;
54 m_pSubMenu = NULL;
55}
Menu * m_pSubMenu
Definition MenuItem.h:181
Menu * m_pParent
Definition MenuItem.h:180

Member Function Documentation

◆ Active()

bool HotkeysMenu::Active ( bool bActivate)
virtual

Reimplemented from FolderItem.

60{
61 if (bActivate && !m_bActive) UpdateFolder();
62 return FolderItem::Active(bActivate);
63}
bool Active(bool bActivate)
Definition FolderItem.cpp:76
void UpdateFolder()
Definition HotkeysMenu.cpp:75
bool m_bActive
Definition MenuItem.h:188

◆ Attached()

void HotkeysMenu::Attached ( Menu * pMenu)
virtual

Reimplemented from FolderItem.

66{
68 m_pSubMenu = new Menu(pMenuCommon->hInst);
69 m_pParent->AddChild(m_pSubMenu);
70 m_pSubMenu->SetParent(m_pParent);
71}
MenuCommon * pMenuCommon
Definition Blackbox.cpp:41
Menu * pMenu
Definition Blackbox.cpp:40
HINSTANCE hInst
Definition MenuCommon.h:94

◆ UpdateFolder()

void HotkeysMenu::UpdateFolder ( )
76{
77 m_pSubMenu->DeleteMenuItems();
79
80 pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_COMMAND, "@xoblite Edit", pSettings->hotkeysFile, "Edit hotkeys.rc", false);
81 pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_SEPARATOR, NULL, NULL, NULL, false);
82
83 //====================
84
85 if (pHotkeys)
86 {
87 char hotkeyMenuItemString[MAX_LINE_LENGTH], number[10], hotkeyAsNumber[10];
88
89 for (int i=0; i<(int)pHotkeys->hotkeyList.size(); i++)
90 {
91 hotkeyMenuItemString[0] = '\0';
92 if (pHotkeys->hotkeyList[i]->mods & MOD_CONTROL) strcat(hotkeyMenuItemString, "C");
93 if (pHotkeys->hotkeyList[i]->mods & MOD_ALT) strcat(hotkeyMenuItemString, "A");
94 if (pHotkeys->hotkeyList[i]->mods & MOD_SHIFT) strcat(hotkeyMenuItemString, "S");
95 if (pHotkeys->hotkeyList[i]->mods & MOD_WIN) strcat(hotkeyMenuItemString, "W");
96 strcat(hotkeyMenuItemString, " ");
97 strcat(hotkeyMenuItemString, pHotkeys->hotkeyList[i]->keyAsString);
98 strcat(hotkeyMenuItemString, " -> ");
99 strcat(hotkeyMenuItemString, pHotkeys->hotkeyList[i]->cmd);
100 strcat(hotkeyMenuItemString, " ");
101 strcat(hotkeyMenuItemString, pHotkeys->hotkeyList[i]->args);
102
103 strcpy(hotkeyAsNumber, "#");
104 strcat(hotkeyAsNumber, _itoa(i+1, number, 10)); // Nb. Using more human friendly 1-N numbering for the Hotkey bro@ms!
105
106 pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_COMMAND, "@xoblite Hotkey", hotkeyAsNumber, hotkeyMenuItemString, false);
107 }
108 }
109
110 //====================
111
113
114 m_pSubMenu->Invalidate();
115 m_pSubMenu->Validate();
116}
Settings * pSettings
Definition Blackbox.cpp:46
#define MAX_LINE_LENGTH
Definition BBApi.h:64
Hotkeys * pHotkeys
Definition Blackbox.cpp:39
#define MENUITEM_COMMAND
Definition MenuItem.h:42
#define MENUITEM_SEPARATOR
Definition MenuItem.h:47
hotkeyVector hotkeyList
Definition Hotkeys.h:64
void AddFooterItem(Menu *pMenu, LPSTR pszTitle)
Definition MenuCommon.cpp:813
MenuItem * CreateMenuItem(Menu *pMenu, int itemType, char *pszCommand, char *pszArgument, char *pszTitle, bool isSelected)
Definition MenuCommon.cpp:1065
void AddHeaderItem(Menu *pMenu, LPSTR pszTitle)
Definition MenuCommon.cpp:791
char * m_pszTitleANSI
Definition MenuItem.h:93
char hotkeysFile[MAX_LINE_LENGTH]
Definition Settings.h:303