#ifndef _COMMON_OWNER_HPP_ #define _COMMON_OWNER_HPP_ #ifndef _COMMON_WINDOWS_HPP_ #include #endif #ifndef _COMMON_LINKEDBUTTON_HPP_ #include #endif #ifndef _COMMON_LINKEDBITMAP_HPP_ #include #endif #ifndef _COMMON_BLOCK_HPP_ #include #endif #ifndef _COMMON_STRING_HPP_ #include #endif class OwnerDraw { public: enum FocusItem{FOCUS,NOFOCUS}; enum Usage{UseLibrary,UseInstance}; OwnerDraw(Usage sourceResource=UseLibrary); virtual ~OwnerDraw(); operator HINSTANCE(void)const; int associate(int ctlID,String &focusUp,String &noFocusUp,String &focusDown,FocusItem focusItem); int associate(int ctlID,String &focusUp,String &noFocusUp,String &focusDown,String &noFocusDisabled,FocusItem focusItem); int handleOwnerButton(int ctlID,LPARAM lParam); void freeButton(int ctlID); int associate(int ctlID,String &bitmapName); void drawBitmap(int ctlID,HWND hWnd,RECT locationRect); void drawBitmap(int ctlID); void freeBitmap(int ctlID); private: HINSTANCE instanceData(void); int locateLinkedButton(int ctlID); int locateLinkedBitmap(int ctlID); HINSTANCE mhLibrary; HINSTANCE mhInstance; Block mLinkedButtons; Block mLinkedBitmaps; }; inline OwnerDraw::operator HINSTANCE(void)const { return mhLibrary; } inline HINSTANCE OwnerDraw::instanceData(void) { #ifdef __FLAT__ return ::GetModuleHandle(0); #else return ((HINSTANCE)(_DS-1)); #endif } #endif