OSDN Git Service

menu.hpp: 101022_menu\5_sys_bitmap対応
authorMyun2 <myun2@nwhite.info>
Sat, 16 Apr 2011 06:47:08 +0000 (15:47 +0900)
committerMyun2 <myun2@nwhite.info>
Sat, 16 Apr 2011 06:47:08 +0000 (15:47 +0900)
roast_ex/include/roast/windows/menu.hpp

index 6f65e41..889f997 100644 (file)
@@ -46,6 +46,23 @@ namespace roast
                        BOOL fByPosition;
                        MENUITEMINFO minfo;
                public:
+                       struct sys_bitmap{
+                               enum enums_
+                               {
+                                       owner_event_process = (int)HBMMENU_CALLBACK,
+                                       //HBMMENU_SYSTEM
+                                       mbar_size_restore = (int)HBMMENU_MBAR_RESTORE,
+                                       mbar_minimize = (int)HBMMENU_MBAR_MINIMIZE,
+                                       mbar_close = (int)HBMMENU_MBAR_CLOSE,
+                                       mbar_minimize2 = (int)HBMMENU_MBAR_MINIMIZE_D,
+                                       mbar_close2 = (int)HBMMENU_MBAR_CLOSE_D,
+                                       popup_size_restore = (int)HBMMENU_POPUP_RESTORE,
+                                       popup_minimize = (int)HBMMENU_POPUP_MINIMIZE,
+                                       popup_maximize = (int)HBMMENU_POPUP_MAXIMIZE,
+                                       popup_close = (int)HBMMENU_POPUP_CLOSE
+                               };
+                       };
+               public:
                        menuitem(HMENU hMenu, UINT uItem_in, BOOL fByPosition_in)
                                : m_hMenu(hMenu), uItem(uItem_in), fByPosition(fByPosition_in), m_hBulkMenuBackup(NULL) {
                                        ZeroMemory(&minfo, sizeof(minfo)); minfo.cbSize = sizeof(minfo); }
@@ -65,7 +82,9 @@ namespace roast
                        void set_id(UINT id){ minfo.wID = id; _update(); }
                        void set_userdata(ULONG_PTR dwAnyData){ minfo.dwItemData = dwAnyData; _update(); }
                        void set_submenu(HMENU hSubMenu){ minfo.hSubMenu = hSubMenu; _update(); }
+
                        void set_bitmap(HBITMAP hBitmap){ minfo.hbmpItem = hBitmap; _update(); }
+                       void set_bitmap(sys_bitmap::enums_ eSysBitmap){ minfo.hbmpItem = (HBITMAP)eSysBitmap; _update(); }
                        void set_checked_bitmap(HBITMAP hBitmap){ minfo.hbmpChecked = hBitmap; _update(); }
                        void set_unchecked_bitmap(HBITMAP hBitmap){ minfo.hbmpUnchecked = hBitmap; _update(); }
 
@@ -135,7 +154,7 @@ namespace roast
                        ::HMENU m_hMenu;
                        bool m_bAttachedMenu;
                public:
-                       class menu_type_popup_{} menu_type_popup;
+                       class popup_type_{} popup_type;
                public:
                        menu(){
                                m_bAttachedMenu = false;
@@ -143,7 +162,7 @@ namespace roast
                                if ( m_hMenu == NULL )
                                        windows_menu_exception("::CreateMenu() Returned Error.");
                        }
-                       menu(const menu_type_popup_&){
+                       menu(const popup_type_&){
                                m_bAttachedMenu = false;
                                m_hMenu = ::CreatePopupMenu();
                                if ( m_hMenu == NULL )