23#if defined(BI_MULTI_THREAD_RTL)
44class TPickerCellArray:
public TIPtrArray<TPickerCell*>{
54class TDefTextCell:
public TTextCell {
57 virtual ~TDefTextCell();
59 virtual void PaintCell(TDC& dc, TRect&
rect);
70class TLocalTipCell:
public TTextCell {
74 virtual void PaintCell(TDC& dc, TRect&
rect);
170 if(
rect.Width() < size.cx)
172 if(
rect.Height() < size.cy)
270 if(
rect.Width() < size.cx)
272 if(
rect.Height() < size.cy)
283 rect.Inflate(-1, -1);
313TDefTextCell::~TDefTextCell()
320TDefTextCell::PaintCell(TDC& dc, TRect&
rect)
323 rect.Inflate(-1, -1);
333 rect.left +=
rc.Width()-5;
345 TTextCell(id,
text, None)
352TLocalTipCell::PaintCell(TDC& dc, TRect&)
418 Cells =
new TPickerCellArray;
535 cell->Bounds.SetEmpty();
559 cell->Bounds.SetEmpty();
577 cell->Bounds.SetEmpty();
644 return cell->GetCell();
656 return cell->GetCell();
874 (*Cells)[
i]->QueryBounds(
rec);
887 (*Cells)[
i]->Paint(dc);
909 rect.Inflate(-1, -1);
934 (*Cells)[
Focused]->LeaveMouse();
938 (*Cells)[
loc]->EnterMouse();
1237 (*Cells)[
Focused]->LeaveMouse();
1279 TModule*
module = TModule::FindResModule(resId/16+1, RT_STRING);
1281 tipText =
module->LoadString(resId);
1285 tstring::size_type
i =
tipText.find_first_of(
_T(
'\n'));
1286 if (
i != tstring::npos)
1292 while (parent && !frame)
1315 while (parent && !frame){
1425 TSize size(Attr.W, Attr.H);
1472 picker.GetWindowAttr().Id = 0;
1494 Window->ClientToScreen(
p2);
1575#if defined(BI_MULTI_THREAD_RTL)
1580TCustomColors::TCustomColors()
1582 Colors[0] =
RGB(0x01, 0x01, 0x01);
1583 Colors[1] =
RGB(0x10, 0x10, 0x10);
1584 Colors[2] =
RGB(0x20, 0x20, 0x20);
1585 Colors[3] =
RGB(0x30, 0x30, 0x30);
1587 Colors[4] =
RGB(0x40, 0x40, 0x40);
1588 Colors[5] =
RGB(0x50, 0x50, 0x50);
1589 Colors[6] =
RGB(0x60, 0x60, 0x60);
1590 Colors[7] =
RGB(0x70, 0x70, 0x70);
1592 Colors[8] =
RGB(0x80, 0x80, 0x80);
1593 Colors[9] =
RGB(0x90, 0x90, 0x90);
1594 Colors[10] =
RGB(0xA0, 0xA0, 0xA0);
1595 Colors[11] =
RGB(0xB0, 0xB0, 0xB0);
1597 Colors[12] =
RGB(0xC0, 0xC0, 0xC0);
1598 Colors[13] =
RGB(0xD0, 0xD0, 0xD0);
1599 Colors[14] =
RGB(0xE0, 0xE0, 0xE0);
1600 Colors[15] =
RGB(0xF0, 0xF0, 0xF0);
1606static TCustomColors& GetCustomColors()
1608#if defined(BI_MULTI_THREAD_RTL)
1625#if defined(BI_MULTI_THREAD_RTL)
1645 CustomColors(GetCustomColors().Colors),
1647 PaletteRealized(
false)
1656 CustomColors(GetCustomColors().Colors),
1658 PaletteRealized(
false)
1701 CustomColors = GetCustomColors().Colors;
1721 WorkPalette =
new TPalette(*Palette);
1726 if(PaletteRealized){
1739 if(PaletteRealized){
1754 WorkPalette =
nullptr;
1791 choose.CustColors = CustomColors;
1793 CustomColor =
choose.Color;
1835 TSize size = CelArray ? CelArray->CelSize() : Window->GetCelArray().CelSize();
Definition of a bitmap Cel array class.
Definition of Choose Color Common Dialog class.
uint Clear(uint t)
Clear the bits that are enabled in the specified parameter.
bool IsSet(uint t) const
Return true of the ON bits of the parameter are currently enabled.
uint Set(uint t)
Activate the bits that are enabled in the specified parameter.
virtual void PaintCell(TDC &dc, TRect &rect)
virtual void QueryBounds(TRect &rect)
void SetCelArray(TCelArray *array, TAutoDelete=NoAutoDelete)
TBitmapCell(int id=0, TCelArray *array=0, int index=0, TBorderStyle borderStyle=Flat)
TBitmap is the GDI bitmap class derived from TGdiObject.
virtual void GetSelection()
virtual void BuildCelArray()
TBitmapPickerGadget(TPopupPicker &picker, TResId glyphResIdOrIndex, TStyle style=sBitmapText, TPopupType poptype=DownArrowAction, TType type=Command, bool enabled=false, TState state=Up, bool sharedGlyph=false, uint numChars=4)
The GDI Brush class is derived from TGdiObject.
TStyle
TStyle contains values that defines how gadget will be displayed:
virtual void Created()
Calls TButtonGadget::Created and if Text == 0 and (Style & sText) retrieves text from menu or resourc...
TCelArray is a horizontal array of cels (a unit of animation) created by slicing a portion of or an e...
TSize CelSize() const
Return the size of the celarray.
bool StretchBlt(int index, TDC &dc, const TRect &dstRect, uint32 rop=SRCCOPY)
Draws the image of the cel onto the DC.
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.
Defines information necessary to initialize the dialog box with the user's color selection.
Wrapper for the Choose-Color common dialog.
virtual void PaintCell(TDC &dc, TRect &rect)
Class wrapper for management of color values.
static const TColor None
not-a-color
static const TColor SysWindowFrame
The symbolic system color value for the frame around each window.
uint8 Blue() const
Return the color's blue component.
static const TColor Sys3dShadow
The symbolic system color value for the shadow regions of 3-dimensional display elements (for edges f...
static const TColor Sys3dFace
The symbolic system color value for the face color of 3-dimensional display elements.
uint8 Red() const
Return the color's red component.
static const TColor White
Static TColor object with fixed Value set by RGB(255, 255, 255).
static TColor CreateFromPaletteIndex(int index)
Construct a color that is an index into a palette.
uint8 Green() const
Return the color's green component.
static const TColor Black
Static TColor object with fixed Value set by RGB(0, 0, 0).
virtual void GetFillRect(TRect &rect, const TRect &faceRect)
TColorPickerGadget(TColorPicker &picker, TResId glyphResIdOrIndex, TStyle style=sBitmapText, TPopupType poptype=DownArrowAction, TType type=Command, bool enabled=false, TState state=Up, bool sharedGlyph=false, uint numChars=4)
virtual void PaintFace(TDC &dc, const TRect &rect)
virtual void GetSelection()
TColor ColorSel
currect selected color
auto CallCustomBox() -> bool override
void NotifyParent(uint code) override
void EvPaletteChanged(HWND hWndPalChg)
void SetCustomColors(TColor *colors)
TColorPicker(TWindow *parent, int id, int x, int y, int w=0, int h=0, TModule *module=0)
void SetupWindow() override
void Paint(TDC &, bool erase, TRect &) override
TControl unifies its derived control classes, such as TScrollBar, TControlGadget, and TButton.
TDC is the root class for GDI DC wrappers.
virtual bool SetViewportOrg(const TPoint &origin, TPoint *oldOrg=nullptr)
Sets this DC's viewport origin to the given origin value, and saves the previous origin in oldOrg.
bool FrameRect(int x1, int y1, int x2, int y2, const TBrush &brush)
Draws a border on this DC around the given rectangle, rect, using the given brush,...
virtual int DrawTextEx(TCHAR *str, int count, TRect *=nullptr, uint format=0, LPDRAWTEXTPARAMS=nullptr)
Formats and draws in the given rectangle, r, up to count characters of the null-terminated string usi...
bool GetViewportOrg(TPoint &point) const
The first version sets in the point argument the x- and y-extents (in device-units) of this DC's view...
void SelectObject(const TBrush &brush)
Selects the given GDI brush object into this DC.
void RestorePalette()
Restores the original GDI palette object to this DC.
bool FillRect(int x1, int y1, int x2, int y2, const TBrush &brush)
Fills the given rectangle on this DC using the specified brush.
bool TextRect(int x1, int y1, int x2, int y2)
Fills the given rectangle, clipping any text to the rectangle.
virtual TColor SetBkColor(const TColor &color)
Sets the current background color of this DC to the given color value or the nearest available.
void RestoreBrush()
Restores the original GDI brush object to this DC.
virtual void RestoreFont()
Restores the original GDI font object to this DC.
int RealizePalette()
Maps to the system palette the logical palette entries selected into this DC.
int SetBkMode(int mode)
Sets the background mode to the given mode argument, which can be either OPAQUE or TRANSPARENT.
void OWLFastWindowFrame(TBrush &brush, TRect &r, int xWidth, int yWidth, uint32 rop=PATCOPY)
Draws a frame of the specified size and thickness with the given brush.
TDecoratedFrame automatically positions its client window (you must supply a client window) so that i...
virtual tstring GetHintText(uint id, THintText hintType) const
Retrieves the text specified by the resource id.
TFont derived from TGdiObject provides constructors for creating font objects from explicit informati...
TEXTMETRIC GetTextMetrics(TDC &dc) const
Retrieves information about this font when selected in the specified dc.
TRect & GetBounds()
Returns the boundary rectangle for the gadget.
bool GetEnabled() const
Determines whether keyboard and mouse input have been enabled for the specified gadget.
virtual void Inserted()
Called after a gadget is inserted into a window.
int GetId() const
Gets the ID for the gadget.
void SetSelection(int sel=0)
virtual void PaintDivider(TDC &dc, const TRect &rect)
paint divider
void AddCell(TPickerCell *cells, bool select=false)
int Contains(const TPoint &point)
void EnableTooltip(bool enable=true) override
void EvMouseMove(uint modKeys, const TPoint &point)
void GetCellRect(TRect &rect)
void EvKillFocus(THandle hWndGetFocus)
void EnableButton(LPCTSTR text=0, int resId=0, TPickerCell *cl=0)
void EnableDefault(LPCTSTR text=0, int resId=0, TPickerCell *cl=0)
void SetTooltip(TTooltip *tooltip)
void EvActivateApp(bool active, DWORD threadId)
void EvKeyUp(uint key, uint repeatCount, uint flags)
void EvLButtonUp(uint modKeys, const TPoint &point)
void RefocusCell(int loc)
TPickerCell * GetDefaultCell()
void SetupWindow() override
void SetFont(const TFont &font)
TGridPicker(TWindow *parent, int id, int x, int y, int w=0, int h=0, TModule *module=0)
virtual tstring LoadTipText(int resId)
load tiptext from resource
int Add(TPickerCell *cell)
auto GetWindowClassName() -> TWindowClassName override
void EvKeyDown(uint key, uint repeatCount, uint flags)
void EvLButtonDown(uint modKeys, const TPoint &point)
void EvSetFocus(THandle hWndLostFocus)
void ModifyPopStyle(uint off, uint on)
virtual void NotifyParent(uint code)
notify parent on event -> BN_CLICKED and BN_HILITE
TPickerCell * GetCell(int loc)
void SetMargins(const TMargins &margins)
void GetWindowClass(WNDCLASS &) override
virtual bool IsFlatStyle()
auto PreProcessMsg(MSG &) -> bool override
void Paint(TDC &, bool erase, TRect &) override
virtual bool CallCustomBox()
call user defined custom box if pressed custom button
void EvLButtonDblClk(uint modKeys, const TPoint &point)
virtual void SetStatusBarMessage(int id)
send WM_MENUSELECT and WM_ENTERIDLE to frame window
TPickerCell * GetSelectedCell()
void SetColumns(int colmn=4)
TPickerCell * GetCustomCell()
TPickerCell * Remove(int loc)
TPickerCell * RemoveCell(int loc)
virtual void ExitPicker(bool status=false)
do noting here
A device context (DC) class derived from TCreatedDC, TMemoryDC provides access to a memory DC.
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
bool PumpWaitingMessages()
The inner message loop.
TPalette is the GDI Palette class derived from TGdiObject.
uint GetPaletteEntries(uint16 start, uint16 count, PALETTEENTRY *entries) const
Retrieves a range of entries in this logical palette and places them in the entries array.
uint16 GetNumEntries() const
Returns the number of entries in this palette, or 0 if the call fails.
void SetBorderStyle(TBorderStyle bs)
virtual void EnterMouse()
virtual void LeaveMouse()
virtual void Paint(TDC &dc, TRect *r=0, bool drawbrd=true)
virtual void PaintBorder(TDC &dc, TRect &rect)
virtual void Select(bool sel=true)
TBorderStyle
Cell border styles. These match TIUBorder's TStyles exactly.
@ None
No border painted at all.
@ Plain
Plain plain window frame.
@ WndRecessed
Input field & other window recessed.
virtual void PaintCell(TDC &dc, TRect &rect)=0
TPickerCell(int id=0, TBorderStyle borderStyle=Flat)
virtual void QueryBounds(TRect &rect)
TPickerGadget(TPopupPicker &picker, TResId glyphResIdOrIndex, TStyle style=sBitmapText, TPopupType poptype=DownArrowAction, TType type=Command, bool enabled=false, TState state=Up, bool sharedGlyph=false, uint numChars=4)
TPickerCell * Selected
currect selected cell
virtual void GetSelection()
virtual void PopupAction()
TPoint is a support class, derived from tagPOINT.
TRect is a mathematical class derived from tagRect.
int Height() const
Returns the height of this rectangle (bottom - top).
TSize Size() const
Returns the size of rectangle.
The tagSIZE struct is defined as.
virtual void PaintCell(TDC &dc, TRect &rect)
Assists in drawing borders of many styles.
TFlag
Constructor flags to limit or modify border.
@ Adjust
Adjust passed rect to client (Not Applicable)
@ Soft
Soft edge look for buttons.
@ RaisedInner
Raised inner edge only.
void Paint(TDC &dc) const
Paints this UIBorder object onto a given device context.
TStyle
Enumeration describing hilevel border styles.
@ WndRecessed
Input field & other window recessed.
@ Recessed
Status field style recessed.
@ Embossed
Grouping raised emboss bead.
@ ButtonUp
Button in up position.
static THatch8x8Brush & GetDitherBrush()
Internal static helper function that can be used alone.
static const TUIMetric CxScreen
static const TUIMetric CyBorder
static const TUIMetric CyScreen
static const TUIMetric CxBorder
Type-safe encapsulation of a Windows class name, a union between ATOM and LPCTSTR.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
HWND SetFocus()
Sets the keyboard focus to current window and activates the window that receives the focus by sending...
HWND SetCapture()
Sets the mouse capture to the current window.
tstring LoadString(uint id) const
static HWND GetCapture()
Returns the handle of the window that has captured the mouse.
void EvKeyDown(uint key, uint repeatCount, uint flags)
The default message handler for WM_KEYDOWN.
virtual void SetParent(TWindow *newParent)
Sets the parent for the specified window by setting Parent to the specified new Parent window object.
TApplication * GetApplication() const
Gets a pointer to the TApplication object associated with this.
void SetBkgndColor(TColor color, bool shouldUpdate=true)
Sets the background color for the window.
virtual void GetWindowClass(WNDCLASS &wndClass)
Redefined by derived classes, GetWindowClass fills the supplied MS-Windows registration class structu...
bool SetWindowPos(HWND hWndInsertAfter, const TRect &rect, uint flags)
Changes the size of the window pointed to by rect.
virtual int Execute()
Creates the underlying HWND and makes it modal with the help of TApplication's BeginModal support.
virtual bool PreProcessMsg(MSG &msg)
Called from TApplication::ProcessAppMsg() to give the window an opportunity to perform preprocessing ...
virtual void Destroy(int retVal=0)
Destroys an MS-Windows element associated with the TWindow.
virtual bool Create()
Creates the window interface element to be associated with this ObjectWindows interface element.
int GetId() const
Returns Attr.Id, the ID used to find the window in a specified parent's child list.
TWindow * GetParent() const
Retrieves the OWL object of the parent window. If none exists, returns 0.
TRect GetWindowRect() const
Gets the screen coordinates of the window's rectangle.
virtual void InvalidateRect(const TRect &rect, bool erase=true)
Invalidates a specified client area.
TWindow * GetParentO() const
Return the OWL's parent for this window.
static void ReleaseCapture()
Releases the mouse capture from this window.
TWindowAttr & GetWindowAttr()
Returns the TWindowAttr structure, which contains the window's creation attributes.
void MapWindowPoints(HWND hWndTo, TPoint *pts, int count) const
Maps a set of points in one window to a relative set of points in another window.
bool EvQueryNewPalette()
The default message handler for WM_QUERYNEWPALETTE.
bool IsWindow() const
Returns true if an HWND is being used.
void EvKillFocus(HWND hWndGetFocus)
Handle WM_KILLFOCUS so that we can have a parent window hold onto our Handle and possibly restore foc...
bool IsChild(HWND hWnd) const
Returns true if the window is a child window or a descendant window of this window.
TResult HandleMessage(TMsgId, TParam1=0, TParam2=0)
Dispatches the given message using the response table.
void EvLButtonDown(uint modKeys, const TPoint &point)
Response method for an incoming WM_LBUTTONDOWN message.
bool ModifyStyle(uint32 offBits, uint32 onBits, uint swpFlags=0)
Modifies the style bits of the window.
uint32 GetStyle() const
Gets the style bits of the underlying window or the 'Style' member of the attribute structure associa...
TRect GetClientRect() const
Gets the coordinates of the window's client area (the area in a window you can use for drawing).
int GetDlgCtrlID() const
Returns the ID of the control.
void EvSetFocus(HWND hWndLostFocus)
The default message handler for WM_SETFOCUS.
void SendNotification(int id, int notifyCode, HWND hCtl, TMsgId=WM_COMMAND)
Repacks a command message (msg) so that a child window (hCtl) can send a message to its parent regard...
bool IsWindowVisible() const
Returns true if the window is visible.
virtual bool ShowWindow(int cmdShow)
Displays this TWindow in a given state.
TResult SendMessage(TMsgId, TParam1=0, TParam2=0) const
Sends a message (msg) to a specified window or windows.
virtual void SetupWindow()
Performs setup following creation of an associated MS-Windows window.
bool ModifyExStyle(uint32 offBits, uint32 onBits, uint swpFlags=0)
Modifies the style bits of the window.
void EvPaletteChanged(HWND hWndPalChg)
The default message handler for WM_PALETTECHANGED.
HWND THandle
TWindow encapsulates an HWND.
virtual void Invalidate(bool erase=true)
Invalidates (mark for painting) the entire client area of a window.
HWND GetHandle() const
Returns the handle of the window.
Definition of class TDecoratedFrame, a TFrameWindow that can manage decorations around the client win...
#define DEFINE_RESPONSE_TABLE1(cls, base)
Macro to define a response table for a class with one base.
Definition of TGadgetList, TGadgetWindow & TGadgetWindowFont A list holding gadgets,...
TAutoDelete
Flag for Handle ctors to control Handle deletion in dtor.
@ htTooltip
Shorter text displayed in a tooltip.
Object Windows Library (OWLNext Core)
#define TYPESAFE_DOWNCAST(object, toClass)
Definition of classes TPickerCell, TColorCell, TBitmapCell, TTextCell, TGridPicker,...
Used by the TGadgetWindow and TGadget classes, TMargins contains the measurements of the margins for ...
void GetPixels(int &left, int &right, int &top, int &bottom, int fontHeight) const
int Id
Contains the identifier of the child window.
Definition of container classes used and made available by OWL.
Definition of the UI Helper Classes: TUIHandle, TUIBorder, TUIFace, TUIPart.
Definition of TUIMetric, a UI metrics provider class.