Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cXMenu.h
Go to the documentation of this file.
1 //
4 //
5 #ifndef _INC_cXMenu_H
6 #define _INC_cXMenu_H
7 #pragma once
8 
9 #include "../Window/cXWindow.h"
10 #include "../Window/cXIcon.h"
11 
12 enum PLAYCMD_TYPE;
13 
14 namespace GrayGUI
15 {
16 class cXMenu : public cXWindowText
17 {
20 public:
21  cXWindowPtr m_pCommand; // where do i send OnCommand commands ? (maybe not my direct parent)
22 
23 public:
24  cXMenu( cXWindow* pParent, DLGID_t id, cXWindow* pCommand );
25  virtual ~cXMenu();
26 
27  virtual HRESULT DisposeThis();
28  virtual bool OnCommand( DLGID_t id, cXWindow* pCtrl, WORD wNotify );
29  virtual bool OnMouseDown( MBUTTON_TYPE uButton,int x,int y );
30  virtual bool OnMouseMove( MBUTTON_TYPE uButton,int x,int y );
31  virtual bool OnKeyFocus( bool bActive )
32  {
33  // just keep focus. no pass to parent.
34  UNREFERENCED_PARAMETER(bActive);
35  return true;
36  }
37 
38 public:
39  void AddMenuItem( DWORD dwMenuFlags, DLGID_t id, const GChar_t* pCaption, SPRITEID_t iIconIndex = SPRITEID_None );
40  void AddMenuItemID( DWORD dwMenuFlags, RESOURCEID_t idText, SPRITEID_t iIconIndex = SPRITEID_None );
41  void AddMenuCommand( PLAYCMD_TYPE eCommand );
42  void RemoveMenuItem( DLGID_t id );
43  void ShowMenu( int x, int y, bool bBottom = false );
44  void UpdateMenuSize();
45  void SetBlinking(DLGID_t id,bool bBlink);
46 };
47 
48 typedef cRefPtr<cXMenu> cXMenuPtr;
49 };
50 
51 #endif
#define UNREFERENCED_PARAMETER(P)
< _WIN32 type thing. get rid of stupid warning.
Definition: SysTypes.h:299
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
Definition: cXMenu.h:17
void RemoveMenuItem(DLGID_t id)
Definition: cXMenu.cpp:41
void AddMenuItemID(DWORD dwMenuFlags, RESOURCEID_t idText, SPRITEID_t iIconIndex=SPRITEID_None)
Definition: cXMenu.cpp:98
cXWindowPtr m_pCommand
Definition: cXMenu.h:21
virtual bool OnCommand(DLGID_t id, cXWindow *pCtrl, WORD wNotify)
Definition: cXMenu.cpp:194
virtual HRESULT DisposeThis()
utility
Definition: cXMenu.cpp:35
void UpdateMenuSize()
Definition: cXMenu.cpp:139
virtual bool OnMouseMove(MBUTTON_TYPE uButton, int x, int y)
Definition: cXMenu.cpp:206
virtual ~cXMenu()
Definition: cXMenu.cpp:31
void ShowMenu(int x, int y, bool bBottom=false)
Definition: cXMenu.cpp:175
void AddMenuCommand(PLAYCMD_TYPE eCommand)
Definition: cXMenu.cpp:104
virtual bool OnKeyFocus(bool bActive)
Definition: cXMenu.h:31
void SetBlinking(DLGID_t id, bool bBlink)
Definition: cXMenu.cpp:129
virtual bool OnMouseDown(MBUTTON_TYPE uButton, int x, int y)
Definition: cXMenu.cpp:211
void AddMenuItem(DWORD dwMenuFlags, DLGID_t id, const GChar_t *pCaption, SPRITEID_t iIconIndex=SPRITEID_None)
Definition: cXMenu.cpp:54
cXMenu(cXWindow *pParent, DLGID_t id, cXWindow *pCommand)
Definition: cXMenu.cpp:20
Definition: cXWindow.h:484
Definition: cXWindow.h:94
Definition: GrayGUI.cpp:11
cRefPtr< cXMenu > cXMenuPtr
Definition: cXDesktopMgr.h:20
UINT DLGID_t
old window format this was a WORD, EX format this is UINT32.
Definition: cResDialog.h:68
MBUTTON_TYPE
Definition: cInputBase.h:40
WORD RESOURCEID_t
A resource in .RC attached to a file/module. like MAKEINTRESOURCE(). https://docs....
Definition: cResourceBase.h:19
char GChar_t
My version of TCHAR, _TCHAR.
Definition: StrConst.h:26