40 CurrentImage(startImage),
46 ImageIndex = imageResIdOrIndex.
GetInt();
49 ResId = imageResIdOrIndex;
102 TRACEX(OwlGadget, 1,
"TBitmapGadget::SetBounds() called @" <<
this);
108 TSize bitmapSize = ImageArray->CelSize();
110 BitmapOrigin.x = innerRect.left + (innerRect.
Width()-bitmapSize.cx)/2;
111 BitmapOrigin.y = innerRect.top + (innerRect.
Height()-bitmapSize.cy)/2;
130 TRACEX(OwlGadget, 1,
"TBitmapGadget::GetDesiredSize() called @" <<
this);
136 size += (ImageArray ? ImageArray->CelSize() :
GetGadgetWindow()->GetCelArray().CelSize());
148 uint oldImageNum = CurrentImage;
150 if (imageNum != CurrentImage) {
151 CurrentImage = imageNum;
173 imageArray.
BitBlt(ImageIndex+CurrentImage, dc, destRect.left, destRect.top);
180# if defined(BI_COMP_BORLANDC)
195 void Enable(
bool enable);
196 void SetText(LPCTSTR){}
197 void SetCheck(
int state);
200 TDynamicBitmapGadget* Gadget;
202# if defined(BI_COMP_BORLANDC)
207void TDynamicBitmapGadgetEnabler::Enable(
bool enable)
210 if(Gadget->GetEnabled() != enable)
211 Gadget->SetEnabled(enable);
214void TDynamicBitmapGadgetEnabler::SetCheck(
int state)
216 Gadget->SelectImage(state,
false);
225 int startImage,
bool sharedCels)
227 TBitmapGadget(imageResIdOrIndex,id,borderStyle,numImages,startImage,
Definition of class TBitmapGadget Definition of class TDynamicBitmapGadget.
Definition of a bitmap Cel array class.
#define PRECONDITION(condition)
#define TRACEX(group, level, message)
void SetBounds(const TRect &boundRect)
Set the bounding rect for this button gadget.
void SysColorChange()
When the system colors have been changed, SysColorChange is called by the gadget window's EvSysColorC...
TBitmapGadget(TResId imageResIdOrIndex, int id, TBorderStyle borderStyle, int numImages, int startImage=0, bool sharedCels=false)
Construct a bitmap gadget.
void Paint(TDC &dc)
Paint this bitmap gadget. Uses normal borders, plus draws the image centered.
~TBitmapGadget()
Destruct a bitmap gadget and free its resources.
int SelectImage(int imageNum, bool immediate)
Choose the relative image to display.
virtual TCelArray * CreateCelArray(TResId resId, int numImages) const
void GetDesiredSize(TSize &size)
Find out how big this bitmap gadget wants to be.
TCelArray is a horizontal array of cels (a unit of animation) created by slicing a portion of or an e...
TCelArray(TBitmap *bmp, int numCels, TSize celSize=TSize(), TPoint offset=TPoint(), int numRows=1, TAutoDelete=AutoDelete)
Constructs a TCelArray from a bitmap by slicing the bitmap into a horizontal array of cels of a speci...
bool BitBlt(int index, TDC &dc, int x, int y, uint32 rop=SRCCOPY)
Draws the cel at index onto the DC at position x and y.
Base class for an extensible interface for auto enabling/disabling of commands (menu items,...
uint GetId() const
Retrieves the id of the command.
virtual void Enable(bool enable=true)
Enables or disables the command sender.
TDC is the root class for GDI DC wrappers.
Pseudo-GDI object Device Independent Bitmap (DIB) class.
void MapUIColors(uint mapColors, const TColor *bkColor=nullptr)
Maps the UI colors to the value specified in the parameter, mapColors, which is one of the values of ...
Class will send EvEnable message to window, so you can set bitmap, using SetCheck() method of TComman...
TDynamicBitmapGadget(TResId imageResIdOrIndex, int id, TBorderStyle borderStyle, int numImages, int startImage=0, bool sharedCels=false)
TDynamicBitmapGadget Constructor.
virtual void CommandEnable()
void Invalidate(bool erase=true)
Used to invalidate the active (usually nonborder) portion of the gadget, Invalidate calls InvalidateR...
void GetInnerRect(TRect &rect)
Computes the area of the gadget's rectangle excluding the borders and margins.
TGadget(int id=0, TBorderStyle borderStyle=None)
Construct a gadget with a given id and border style.
TGadgetWindow * GetGadgetWindow()
Return a pointer to the owning or parent window for the gadget.
virtual void SetBounds(const TRect &rect)
Called by the gadget window to inform the gadget of a change in its bounding rectangle.
TBorderStyle
Gadget border styles.
void Update()
Paint now if possible.
virtual void GetDesiredSize(TSize &size)
Request by the gadget window to query the gadget's desired size.
virtual void PaintBorder(TDC &dc)
Self sent by method Paint().
virtual TCelArray & GetCelArray(int minX=0, int minY=0)
Gets the Shared CelArray for this gadget window.
TRect is a mathematical class derived from tagRect.
int Height() const
Returns the height of this rectangle (bottom - top).
int Width() const
Returns the width of this rectangle (right - left).
WORD GetInt() const
Returns the encapsulated numerical identifier, provided this resource identifier encodes a numerical ...
The tagSIZE struct is defined as.
TResult HandleMessage(TMsgId, TParam1=0, TParam2=0)
Dispatches the given message using the response table.
HWND THandle
TWindow encapsulates an HWND.
#define WM_COMMAND_ENABLE
Definition of TGadgetList, TGadgetWindow & TGadgetWindowFont A list holding gadgets,...
Object Windows Library (OWLNext Core).
LPARAM TParam2
Second parameter type.
DIAG_DECLARE_GROUP(OwlThread)