57 lines
1.1 KiB
C++
57 lines
1.1 KiB
C++
#ifndef _LINKEDBITMAP_HPP_
|
|
#define _LINKEDBITMAP_HPP_
|
|
#include <mdiwin/drawbmp.hpp>
|
|
#include <mdiwin/string.hpp>
|
|
|
|
class LinkedBitmap : public DrawBitmap
|
|
{
|
|
public:
|
|
LinkedBitmap(void);
|
|
LinkedBitmap(int ctlID,String &bitmapName,HINSTANCE hLibrary);
|
|
LinkedBitmap(const LinkedBitmap &someLinkedBitmap);
|
|
~LinkedBitmap();
|
|
WORD drawBitmap(HDC hDC,RECT locationRect);
|
|
WORD drawBitmap(void);
|
|
int referenceCount(void)const;
|
|
void referenceCount(int newCount);
|
|
WORD operator==(const LinkedBitmap &someLinkedBitmap)const;
|
|
WORD operator==(int ctlID)const;
|
|
private:
|
|
void loadBitmap(void);
|
|
int mCtlID;
|
|
HBITMAP mhBitmap;
|
|
String mBitmapName;
|
|
int mReferenceCount;
|
|
HINSTANCE mhLibrary;
|
|
};
|
|
|
|
inline
|
|
int LinkedBitmap::referenceCount(void)const
|
|
{
|
|
return mReferenceCount;
|
|
}
|
|
|
|
inline
|
|
void LinkedBitmap::referenceCount(int newCount)
|
|
{
|
|
mReferenceCount=newCount;
|
|
}
|
|
|
|
inline
|
|
WORD LinkedBitmap::operator==(const LinkedBitmap &someLinkedBitmap)const
|
|
{
|
|
return (mCtlID==someLinkedBitmap.mCtlID);
|
|
}
|
|
|
|
inline
|
|
WORD LinkedBitmap::operator==(int ctlID)const
|
|
{
|
|
return mCtlID==ctlID;
|
|
}
|
|
|
|
inline
|
|
void LinkedBitmap::loadBitmap(void)
|
|
{
|
|
mhBitmap=::LoadBitmap(mhLibrary,mBitmapName);
|
|
}
|
|
#endif |