63 lines
1.5 KiB
C++
63 lines
1.5 KiB
C++
#ifndef _COMMON_OWNER_HPP_
|
||
#define _COMMON_OWNER_HPP_
|
||
#ifndef _COMMON_WINDOWS_HPP_
|
||
#include <common/windows.hpp>
|
||
#endif
|
||
#ifndef _COMMON_LINKEDBUTTON_HPP_
|
||
#include <common/btnlnk.hpp>
|
||
#endif
|
||
#ifndef _COMMON_LINKEDBITMAP_HPP_
|
||
#include <common/bmplnk.hpp>
|
||
#endif
|
||
#ifndef _COMMON_BLOCK_HPP_
|
||
#include <common/block.hpp>
|
||
#endif
|
||
#ifndef _COMMON_STRING_HPP_
|
||
#include <common/string.hpp>
|
||
#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<LinkedButton> mLinkedButtons;
|
||
Block<LinkedBitmap> 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
|
||
|
||
|