A SERVICE OF

logo

virtual void PaintGadgets(TDC& dc, BOOL erase, TRect& rect);
PaintGadgets iterates through the gadgets in the window and asks each one
to draw itself. Override PaintGadgets to implement a custom look for your
window such as separator lines, a raised look, and so on.,
Use the GetDesiredSize and GetInnerRect functions to find the overall desired
Size and inner
size (that is, the size needed to accommodate the borders, margins, and the
rectangle
widest or highest gadget) and the size and location of the window’ inners
rectangle.
virtual void GetDesiredSize(TSize& size);
If shrink wrapping was requested for the window GetDesiredSize calculates,
the size the window needs to be to accommodate the borders, margins, and
the widest or highest gadget. If shrink wrapping was not requested,
GetDesiredSize uses the current width and height. The results are then
placed into size.
virtual void GetInnerRect(TRect& rect);
GetInnerRect calculates the area inside the borders and margins of the
window. The results are then placed into rect.
Y u can override GetDesiredSize and GetInnerRect to leave extra room for ao
custom look for your window. If you override either one of these functions,
you probably also need to override the other.
Y u can use three different units of measurement in a gadget window:o
Layout units
Pixels, which are based on a single screen pixel
Layout units, which are logical units defined by dividing the window
font “em” into 8 vertical and 8 horizontal segments.
Border units are based on the thickness of a window frame. This is
usually equivalent to one pixel, but it could be greater at higher screen
resolutions.
It is usually better to use layout units; because they are based on the font
size, you don’t have to worry about scaling your measures when you
change window size or system metrics.
If you need to convert layout units to pixels, use the LayoutUnitsT Pixelso
function:
int LayoutUnitsToPixels(int units);
where units is the layout unit measure you want to convert to pixels.
LayoutUnitsT Pixels returns the pixel equivalent of units.o
272
OWL P ogrammer’ Guider s