soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SNcPainter Class Reference

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>

Inheritance diagram for SNcPainter:
TObjRefImpl< SObjectImpl< INcPainter > > SObjectImpl< INcPainter >

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;amp;strAttribName, const SNS::SStringW &amp;amp;amp;amp;strValue, BOOL bLoading=FALSE)
 
- Public Member Functions inherited from TObjRefImpl< SObjectImpl< INcPainter > >
 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.
 
- Public Member Functions inherited from SObjectImpl< INcPainter >
 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 Public Member Functions inherited from SObjectImpl< INcPainter >
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 ISwndContainerGetHostContainer ()
 Gets the host container.
 
virtual IRenderTargetOnGetHostRenderTarget (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

- Protected Attributes inherited from TObjRefImpl< SObjectImpl< INcPainter > >
LONG m_cRef
 Reference count.
 
- Protected Attributes inherited from SObjectImpl< INcPainter >
SStringW m_strName
 
int m_nID
 
FunAttrHandler m_attrHandler
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SNcPainter()

SNcPainter::SNcPainter ( SHostWnd * pHost)

Constructor for SNcPainter.

Parameters
pHostPointer to the host window.

Definition at line 47 of file SNcPainter.cpp.

◆ ~SNcPainter()

SNcPainter::~SNcPainter ( void )

Destructor for SNcPainter.

Definition at line 57 of file SNcPainter.cpp.

Member Function Documentation

◆ GetHost()

IObject * SNcPainter::GetHost ( )
protectedvirtual

Gets the host object.

Returns
Pointer to the host object.

Definition at line 511 of file SNcPainter.cpp.

◆ GetHostContainer()

ISwndContainer * SNcPainter::GetHostContainer ( )
protectedvirtual

Gets the host container.

Returns
Pointer to the host container.

Definition at line 562 of file SNcPainter.cpp.

◆ GetHostRect()

CRect SNcPainter::GetHostRect ( ) const
protectedvirtual

Gets the rectangle of the host.

Returns
Rectangle of the host.

Definition at line 531 of file SNcPainter.cpp.

◆ GetNcSize()

CSize SNcPainter::GetNcSize ( ) const
protected

Gets the size of the non-client area.

Returns
Size of the non-client area.

Definition at line 704 of file SNcPainter.cpp.

◆ GetRoot()

IWindow * SNcPainter::GetRoot ( )

Gets the root window.

Returns
Pointer to the root window.

Definition at line 98 of file SNcPainter.cpp.

◆ GetScale()

int SNcPainter::GetScale ( ) const
protected

Gets the scale factor.

Returns
Scale factor.

Definition at line 103 of file SNcPainter.cpp.

◆ InitFromXml()

BOOL SNcPainter::InitFromXml ( IXmlNode * pXmlNode)

Initializes the non-client painter from an XML node.

Parameters
pXmlNodePointer to the XML node.
Returns
TRUE if initialization is successful, FALSE otherwise.

Definition at line 76 of file SNcPainter.cpp.

◆ InvalidateHostRect()

void SNcPainter::InvalidateHostRect ( LPCRECT pRc,
BOOL bClip )
protectedvirtual

Invalidates a rectangle in the host.

Parameters
pRcPointer to the rectangle to invalidate.
bClipTRUE to clip the rectangle, FALSE otherwise.

Definition at line 542 of file SNcPainter.cpp.

◆ IsDrawNc()

BOOL SNcPainter::IsDrawNc ( ) const
protected

Checks if non-client area should be drawn.

Returns
TRUE if non-client area should be drawn, FALSE otherwise.

Definition at line 444 of file SNcPainter.cpp.

◆ IsHostUpdateLocked()

BOOL SNcPainter::IsHostUpdateLocked ( ) const
protectedvirtual

Checks if host updates are locked.

Returns
TRUE if updates are locked, FALSE otherwise.

Definition at line 521 of file SNcPainter.cpp.

◆ IsHostVisible()

BOOL SNcPainter::IsHostVisible ( ) const
protectedvirtual

Checks if the host is visible.

Returns
TRUE if the host is visible, FALSE otherwise.

Definition at line 526 of file SNcPainter.cpp.

◆ IsItemRedrawDelay()

BOOL SNcPainter::IsItemRedrawDelay ( ) const
protectedvirtual

Checks if item redraw is delayed.

Returns
TRUE if redraw is delayed, FALSE otherwise.

Definition at line 506 of file SNcPainter.cpp.

◆ OnGetHostRenderTarget()

IRenderTarget * SNcPainter::OnGetHostRenderTarget ( LPCRECT rc,
GrtFlag gdcFlags )
protectedvirtual

Called to get the host render target.

Parameters
rcRectangle for the render target.
gdcFlagsFlags for the render target.
Returns
Pointer to the render target.

Definition at line 567 of file SNcPainter.cpp.

◆ OnHostFireEvent()

BOOL SNcPainter::OnHostFireEvent ( IEvtArgs * e)
protectedvirtual

Called when an event is fired on the host.

Parameters
ePointer to the event arguments.
Returns
TRUE if the event is handled, FALSE otherwise.

Definition at line 516 of file SNcPainter.cpp.

◆ OnItemGetRect()

BOOL SNcPainter::OnItemGetRect ( const SOsrPanel * pItem,
CRect & rcItem ) const
protectedvirtual

Called to get the rectangle of an item.

Parameters
pItemPointer to the item.
rcItemRectangle to receive the item's bounds.
Returns
TRUE if the rectangle is successfully retrieved, FALSE otherwise.

Definition at line 500 of file SNcPainter.cpp.

◆ OnItemSetCapture()

void SNcPainter::OnItemSetCapture ( SOsrPanel * pItem,
BOOL bCapture )
protectedvirtual

Called when an item sets capture.

Parameters
pItemPointer to the item.
bCaptureTRUE if the item sets capture, FALSE otherwise.

Definition at line 496 of file SNcPainter.cpp.

◆ OnLayoutDirty()

void SNcPainter::OnLayoutDirty ( )
protectedvirtual

Called when layout is dirty.

Definition at line 555 of file SNcPainter.cpp.

◆ OnLButtonUp()

void SNcPainter::OnLButtonUp ( WPARAM wp,
LPARAM lp )
protected

Handles the WM_LBUTTONUP message.

Parameters
wpWPARAM for the message.
lpLPARAM for the message.

Definition at line 714 of file SNcPainter.cpp.

◆ OnMouseMove()

void SNcPainter::OnMouseMove ( WPARAM wp,
LPARAM lp )
protected

Handles the WM_MOUSEMOVE message.

Parameters
wpWPARAM for the message.
lpLPARAM for the message.

Definition at line 722 of file SNcPainter.cpp.

◆ OnNcActivate()

BOOL SNcPainter::OnNcActivate ( BOOL bActive)
protected

Handles the WM_NCACTIVATE message.

Parameters
bActiveTRUE if the window is activated, FALSE otherwise.
Returns
Result of the message handling.

Definition at line 213 of file SNcPainter.cpp.

◆ OnNcCalcSize()

LRESULT SNcPainter::OnNcCalcSize ( BOOL bCalcValidRects,
LPARAM lParam )
protected

Handles the WM_NCCALCSIZE message.

Parameters
bCalcValidRectsTRUE if valid rectangle calculation is required.
lParamLPARAM for the message.
Returns
Result of the message handling.

Definition at line 108 of file SNcPainter.cpp.

◆ OnNcDestroy()

void SNcPainter::OnNcDestroy ( )
protected

Handles the WM_NCDESTROY message.

Definition at line 485 of file SNcPainter.cpp.

◆ OnNcHitTest()

UINT SNcPainter::OnNcHitTest ( CPoint point)
protected

Handles the WM_NCHITTEST message.

Parameters
pointPoint to test.
Returns
Hit test result.

Definition at line 233 of file SNcPainter.cpp.

◆ OnNcLButtonDown()

void SNcPainter::OnNcLButtonDown ( UINT flag,
CPoint pt )
protected

Handles the WM_NCLBUTTONDOWN message.

Parameters
flagFlags for the message.
ptPoint where the button was pressed.

Definition at line 624 of file SNcPainter.cpp.

◆ OnNcMouseEvent()

LRESULT SNcPainter::OnNcMouseEvent ( UINT msg,
WPARAM wp,
LPARAM lp )
protected

Handles non-client mouse events.

Parameters
msgMessage identifier.
wpWPARAM for the message.
lpLPARAM for the message.
Returns
Result of the message handling.

Definition at line 585 of file SNcPainter.cpp.

◆ OnNcMouseLeave()

LRESULT SNcPainter::OnNcMouseLeave ( UINT msg,
WPARAM wp,
LPARAM lp )
protected

Handles the WM_NCMOUSELEAVE message.

Parameters
msgMessage identifier.
wpWPARAM for the message.
lpLPARAM for the message.
Returns
Result of the message handling.

Definition at line 611 of file SNcPainter.cpp.

◆ OnNcPaint()

void SNcPainter::OnNcPaint ( HRGN hRgn)
protected

Handles the WM_NCPAINT message.

Parameters
hRgnRegion to paint.

Definition at line 365 of file SNcPainter.cpp.

◆ OnReleaseHostRenderTarget()

void SNcPainter::OnReleaseHostRenderTarget ( IRenderTarget * pRT,
LPCRECT rc,
GrtFlag gdcFlags )
protectedvirtual

Called to release the host render target.

Parameters
pRTPointer to the render target.
rcRectangle for the render target.
gdcFlagsFlags for the render target.

Definition at line 573 of file SNcPainter.cpp.

◆ OnRepaint()

LRESULT SNcPainter::OnRepaint ( UINT msg,
WPARAM wp,
LPARAM lp )
protected

Handles repaint messages.

Parameters
msgMessage identifier.
wpWPARAM for the message.
lpLPARAM for the message.
Returns
Result of the message handling.

Definition at line 472 of file SNcPainter.cpp.

◆ OnSetText()

LRESULT SNcPainter::OnSetText ( LPCTSTR pszText)
protected

Handles the WM_SETTEXT message.

Parameters
pszTextNew text for the window.
Returns
Result of the message handling.

Definition at line 449 of file SNcPainter.cpp.

◆ OnSize()

void SNcPainter::OnSize ( UINT nType,
CSize size )
protected

Handles the WM_SIZE message.

Parameters
nTypeType of size change.
sizeNew size of the window.

Definition at line 677 of file SNcPainter.cpp.

◆ OnTimer()

void SNcPainter::OnTimer ( UINT_PTR tid)
protected

Handles the WM_TIMER message.

Parameters
tidTimer ID.

Definition at line 730 of file SNcPainter.cpp.

◆ Reset()

void SNcPainter::Reset ( )
protected

Resets the non-client painter.

Definition at line 62 of file SNcPainter.cpp.

◆ SetAttribute()

virtual HRESULT SNcPainter::SetAttribute ( const SNS::SStringW &amp;amp;amp;amp; strAttribName,
const SNS::SStringW &amp;amp;amp;amp; strValue,
BOOL bLoading = FALSE )
inlinevirtual

Definition at line 179 of file SNcPainter.h.

◆ toNcBuiltinID()

int SNcPainter::toNcBuiltinID ( const SStringW & str)
static

Converts a string to a built-in non-client ID.

Parameters
strString representing the non-client ID.
Returns
The corresponding non-client ID.

Definition at line 654 of file SNcPainter.cpp.

◆ updateSystemButton()

void SNcPainter::updateSystemButton ( SWindow * pRoot,
UINT nResizeMode )
static

Updates system buttons in the non-client area.

Parameters
pRootPointer to the root window.
nResizeModeResize mode for the window.

Definition at line 748 of file SNcPainter.cpp.

◆ UpdateToolTip()

void SNcPainter::UpdateToolTip ( )
protected

Updates the tooltip.

Definition at line 685 of file SNcPainter.cpp.

Friends And Related Symbol Documentation

◆ SHostWnd

friend class SHostWnd
friend

Definition at line 23 of file SNcPainter.h.

◆ SNcPanel

friend class SNcPanel
friend

Definition at line 24 of file SNcPainter.h.


The documentation for this class was generated from the following files: