Non-client area painter class. This class handles the painting and event processing for the non-client area of a window. More...
#include <SNcPainter.h>
Public Member Functions | |
SNcPainter (SHostWnd *pHost) | |
Constructor for SNcPainter. | |
~SNcPainter (void) | |
Destructor for SNcPainter. | |
BOOL | InitFromXml (IXmlNode *pXmlNode) OVERRIDE |
Initializes the non-client painter from an XML node. | |
IWindow * | GetRoot () OVERRIDE |
Gets the root window. | |
virtual HRESULT | SetAttribute (const SNS::SStringW &amp;amp;amp;strAttribName, const SNS::SStringW &amp;amp;amp;strValue, BOOL bLoading=FALSE) |
![]() | |
TObjRefImpl () | |
Constructor that initializes the reference count to 1. | |
virtual | ~TObjRefImpl () |
Virtual destructor. | |
long | AddRef () override |
Increments the reference count. | |
long | Release () override |
Decrements the reference count and deletes the object if the count reaches zero. | |
void | OnFinalRelease () override |
Deletes the object. | |
![]() | |
SObjectImpl () | |
Constructor. | |
BOOL | InitFromXml (IXmlNode *pXmlNode) OVERRIDE |
Initializes the object from an XML node. | |
LPCWSTR | GetName () SCONST OVERRIDE |
Retrieves the object's name. | |
LPCSTR | GetNameA () SCONST OVERRIDE |
Retrieves the object's name in ANSI format. | |
void | SetName (LPCWSTR pszName) OVERRIDE |
Sets the object's name. | |
int | GetID () SCONST OVERRIDE |
Retrieves the object's ID. | |
void | SetID (int nID) OVERRIDE |
Sets the object's ID. | |
HRESULT | AfterAttribute (LPCWSTR strAttribName, LPCWSTR strValue, BOOL bLoading, HRESULT hr) OVERRIDE |
Handles attribute processing after setting an attribute. | |
HRESULT | SetAttributeA (LPCSTR pszAttr, LPCSTR pszValue, BOOL bLoading) OVERRIDE |
Sets an attribute using ANSI strings. | |
HRESULT | SetAttribute (LPCWSTR pszAttr, LPCWSTR pszValue, BOOL bLoading) OVERRIDE |
Sets an attribute using wide strings. | |
virtual HRESULT | SetAttribute (const SStringW &strAttr, const SStringW &strValue, BOOL bLoading) |
Sets an attribute using wide strings. | |
HRESULT | ISetAttribute (const IStringW *strAttr, const IStringW *strValue, BOOL bLoading) OVERRIDE |
Sets an attribute using IStringW objects. | |
LPCWSTR | GetObjectClass () SCONST OVERRIDE |
Retrieves the object's class name. | |
int | GetObjectType () SCONST OVERRIDE |
Retrieves the object's type. | |
BOOL | IsClass (LPCWSTR lpszName) SCONST OVERRIDE |
Checks if the object is of a specific class. | |
BOOL | GetAttribute (LPCWSTR strAttr, IStringW *pValue) SCONST OVERRIDE |
Retrieves an attribute value. | |
void | OnInitFinished (IXmlNode *xmlNode) OVERRIDE |
Handles initialization completion. | |
void | SetAttrHandler (FunAttrHandler attrHandler) OVERRIDE |
Sets the attribute handler. | |
virtual HRESULT | DefAttributeProc (const SStringW &strAttr, const SStringW &strValue, BOOL bLoading) |
Default attribute processing. | |
Static Public Member Functions | |
static int | toNcBuiltinID (const SStringW &str) |
Converts a string to a built-in non-client ID. | |
static void | updateSystemButton (SWindow *pRoot, UINT nResizeMode) |
Updates system buttons in the non-client area. | |
![]() | |
static int | GetClassType () |
Retrieves the class type. | |
static LPCWSTR | GetClassName () |
Retrieves the class name. | |
static LPCWSTR | GetClassAlias () |
Retrieves the class alias. | |
static void | MarkAttributeHandled (SXmlAttr xmlAttr, bool bHandled) |
Marks an attribute as handled. | |
static bool | IsAttributeHandled (SXmlAttr xmlAttr) |
Checks if an attribute is handled. | |
Protected Member Functions | |
virtual void | OnItemSetCapture (SOsrPanel *pItem, BOOL bCapture) |
Called when an item sets capture. | |
virtual BOOL | OnItemGetRect (const SOsrPanel *pItem, CRect &rcItem) const |
Called to get the rectangle of an item. | |
virtual BOOL | IsItemRedrawDelay () const |
Checks if item redraw is delayed. | |
virtual IObject * | GetHost () |
Gets the host object. | |
virtual BOOL | OnHostFireEvent (IEvtArgs *e) |
Called when an event is fired on the host. | |
virtual BOOL | IsHostUpdateLocked () const |
Checks if host updates are locked. | |
virtual BOOL | IsHostVisible () const |
Checks if the host is visible. | |
virtual CRect | GetHostRect () const |
Gets the rectangle of the host. | |
virtual void | InvalidateHostRect (LPCRECT pRc, BOOL bClip) |
Invalidates a rectangle in the host. | |
virtual ISwndContainer * | GetHostContainer () |
Gets the host container. | |
virtual IRenderTarget * | OnGetHostRenderTarget (LPCRECT rc, GrtFlag gdcFlags) |
Called to get the host render target. | |
virtual void | OnReleaseHostRenderTarget (IRenderTarget *pRT, LPCRECT rc, GrtFlag gdcFlags) |
Called to release the host render target. | |
virtual void | OnLayoutDirty () |
Called when layout is dirty. | |
int | GetScale () const |
Gets the scale factor. | |
CSize | GetNcSize () const |
Gets the size of the non-client area. | |
LRESULT | OnNcCalcSize (BOOL bCalcValidRects, LPARAM lParam) |
Handles the WM_NCCALCSIZE message. | |
BOOL | OnNcActivate (BOOL bActive) |
Handles the WM_NCACTIVATE message. | |
UINT | OnNcHitTest (CPoint point) |
Handles the WM_NCHITTEST message. | |
void | OnNcPaint (HRGN hRgn) |
Handles the WM_NCPAINT message. | |
LRESULT | OnSetText (LPCTSTR pszText) |
Handles the WM_SETTEXT message. | |
LRESULT | OnRepaint (UINT msg, WPARAM wp, LPARAM lp) |
Handles repaint messages. | |
void | OnNcDestroy () |
Handles the WM_NCDESTROY message. | |
void | OnNcLButtonDown (UINT flag, CPoint pt) |
Handles the WM_NCLBUTTONDOWN message. | |
void | OnLButtonUp (WPARAM wp, LPARAM lp) |
Handles the WM_LBUTTONUP message. | |
void | OnMouseMove (WPARAM wp, LPARAM lp) |
Handles the WM_MOUSEMOVE message. | |
LRESULT | OnNcMouseEvent (UINT msg, WPARAM wp, LPARAM lp) |
Handles non-client mouse events. | |
LRESULT | OnNcMouseLeave (UINT msg, WPARAM wp, LPARAM lp) |
Handles the WM_NCMOUSELEAVE message. | |
void | OnSize (UINT nType, CSize size) |
Handles the WM_SIZE message. | |
void | OnTimer (UINT_PTR tid) |
Handles the WM_TIMER message. | |
if (m_bSysNcPainter) return FALSE | |
void | Reset () |
Resets the non-client painter. | |
BOOL | IsDrawNc () const |
Checks if non-client area should be drawn. | |
void | PaintCaption () |
Paints the caption. | |
void | UpdateToolTip () |
Updates the tooltip. | |
Friends | |
class | SHostWnd |
class | SNcPanel |
Additional Inherited Members | |
![]() | |
LONG | m_cRef |
Reference count. | |
![]() | |
SStringW | m_strName |
int | m_nID |
FunAttrHandler | m_attrHandler |
Non-client area painter class. This class handles the painting and event processing for the non-client area of a window.
Definition at line 18 of file SNcPainter.h.
SNcPainter::SNcPainter | ( | SHostWnd * | pHost | ) |
Constructor for SNcPainter.
pHost | Pointer to the host window. |
Definition at line 47 of file SNcPainter.cpp.
SNcPainter::~SNcPainter | ( | void | ) |
Destructor for SNcPainter.
Definition at line 57 of file SNcPainter.cpp.
|
protectedvirtual |
Gets the host object.
Definition at line 511 of file SNcPainter.cpp.
|
protectedvirtual |
Gets the host container.
Definition at line 562 of file SNcPainter.cpp.
|
protectedvirtual |
Gets the rectangle of the host.
Definition at line 531 of file SNcPainter.cpp.
|
protected |
Gets the size of the non-client area.
Definition at line 704 of file SNcPainter.cpp.
IWindow * SNcPainter::GetRoot | ( | ) |
Gets the root window.
Definition at line 98 of file SNcPainter.cpp.
|
protected |
BOOL SNcPainter::InitFromXml | ( | IXmlNode * | pXmlNode | ) |
Initializes the non-client painter from an XML node.
pXmlNode | Pointer to the XML node. |
Definition at line 76 of file SNcPainter.cpp.
|
protectedvirtual |
Invalidates a rectangle in the host.
pRc | Pointer to the rectangle to invalidate. |
bClip | TRUE to clip the rectangle, FALSE otherwise. |
Definition at line 542 of file SNcPainter.cpp.
|
protected |
Checks if non-client area should be drawn.
Definition at line 444 of file SNcPainter.cpp.
|
protectedvirtual |
Checks if host updates are locked.
Definition at line 521 of file SNcPainter.cpp.
|
protectedvirtual |
Checks if the host is visible.
Definition at line 526 of file SNcPainter.cpp.
|
protectedvirtual |
Checks if item redraw is delayed.
Definition at line 506 of file SNcPainter.cpp.
|
protectedvirtual |
Called to get the host render target.
rc | Rectangle for the render target. |
gdcFlags | Flags for the render target. |
Definition at line 567 of file SNcPainter.cpp.
|
protectedvirtual |
Called when an event is fired on the host.
e | Pointer to the event arguments. |
Definition at line 516 of file SNcPainter.cpp.
|
protectedvirtual |
Called to get the rectangle of an item.
pItem | Pointer to the item. |
rcItem | Rectangle to receive the item's bounds. |
Definition at line 500 of file SNcPainter.cpp.
|
protectedvirtual |
Called when an item sets capture.
pItem | Pointer to the item. |
bCapture | TRUE if the item sets capture, FALSE otherwise. |
Definition at line 496 of file SNcPainter.cpp.
|
protectedvirtual |
Called when layout is dirty.
Definition at line 555 of file SNcPainter.cpp.
|
protected |
Handles the WM_LBUTTONUP message.
wp | WPARAM for the message. |
lp | LPARAM for the message. |
Definition at line 714 of file SNcPainter.cpp.
|
protected |
Handles the WM_MOUSEMOVE message.
wp | WPARAM for the message. |
lp | LPARAM for the message. |
Definition at line 722 of file SNcPainter.cpp.
|
protected |
Handles the WM_NCACTIVATE message.
bActive | TRUE if the window is activated, FALSE otherwise. |
Definition at line 213 of file SNcPainter.cpp.
|
protected |
Handles the WM_NCCALCSIZE message.
bCalcValidRects | TRUE if valid rectangle calculation is required. |
lParam | LPARAM for the message. |
Definition at line 108 of file SNcPainter.cpp.
|
protected |
Handles the WM_NCDESTROY message.
Definition at line 485 of file SNcPainter.cpp.
|
protected |
Handles the WM_NCHITTEST message.
point | Point to test. |
Definition at line 233 of file SNcPainter.cpp.
|
protected |
Handles the WM_NCLBUTTONDOWN message.
flag | Flags for the message. |
pt | Point where the button was pressed. |
Definition at line 624 of file SNcPainter.cpp.
|
protected |
Handles non-client mouse events.
msg | Message identifier. |
wp | WPARAM for the message. |
lp | LPARAM for the message. |
Definition at line 585 of file SNcPainter.cpp.
|
protected |
Handles the WM_NCMOUSELEAVE message.
msg | Message identifier. |
wp | WPARAM for the message. |
lp | LPARAM for the message. |
Definition at line 611 of file SNcPainter.cpp.
|
protected |
Handles the WM_NCPAINT message.
hRgn | Region to paint. |
Definition at line 365 of file SNcPainter.cpp.
|
protectedvirtual |
Called to release the host render target.
pRT | Pointer to the render target. |
rc | Rectangle for the render target. |
gdcFlags | Flags for the render target. |
Definition at line 573 of file SNcPainter.cpp.
|
protected |
Handles repaint messages.
msg | Message identifier. |
wp | WPARAM for the message. |
lp | LPARAM for the message. |
Definition at line 472 of file SNcPainter.cpp.
|
protected |
Handles the WM_SETTEXT message.
pszText | New text for the window. |
Definition at line 449 of file SNcPainter.cpp.
|
protected |
Handles the WM_SIZE message.
nType | Type of size change. |
size | New size of the window. |
Definition at line 677 of file SNcPainter.cpp.
|
protected |
Handles the WM_TIMER message.
tid | Timer ID. |
Definition at line 730 of file SNcPainter.cpp.
|
protected |
Resets the non-client painter.
Definition at line 62 of file SNcPainter.cpp.
|
inlinevirtual |
Definition at line 179 of file SNcPainter.h.
|
static |
Converts a string to a built-in non-client ID.
str | String representing the non-client ID. |
Definition at line 654 of file SNcPainter.cpp.
|
static |
Updates system buttons in the non-client area.
pRoot | Pointer to the root window. |
nResizeMode | Resize mode for the window. |
Definition at line 748 of file SNcPainter.cpp.
|
protected |
Updates the tooltip.
Definition at line 685 of file SNcPainter.cpp.
|
friend |
Definition at line 23 of file SNcPainter.h.
|
friend |
Definition at line 24 of file SNcPainter.h.