1#ifndef __SNCPAINTER__H__
2#define __SNCPAINTER__H__
4#include <sobject/Sobject.hpp>
5#include <interface/SNcPainter-i.h>
6#include <core/SItemPanel.h>
20 ,
public IItemContainer
23 friend class SHostWnd;
24 friend class SNcPanel;
33 IDC_SYS_RESTORE = -105,
75 STDMETHOD_(IWindow *,
GetRoot)(THIS) OVERRIDE;
91 virtual BOOL
OnItemGetRect(
const SOsrPanel *pItem, CRect &rcItem)
const;
180 ATTR_LAYOUTSIZE(L
"titleHeight", m_titleHeight, FALSE)
181 ATTR_LAYOUTSIZE(L
"borderWidth", m_borderWidth, FALSE)
182 ATTR_SKIN(L
"skinBorder", m_skinBorder, FALSE)
183 ATTR_BOOL(L
"system", m_bSysNcPainter, FALSE)
193 LRESULT
OnNcCalcSize(BOOL bCalcValidRects, LPARAM lParam);
229 LRESULT
OnRepaint(UINT msg, WPARAM wp, LPARAM lp);
280 void OnSize(UINT nType, CSize size);
300 MESSAGE_RANGE_HANDLER_EX(WM_NCMOUSEMOVE, WM_NCMBUTTONDBLCLK,
OnNcMouseEvent)
301 MESSAGE_HANDLER_EX(WM_SETTINGCHANGE,
OnRepaint)
302 MESSAGE_HANDLER_EX(WM_SYSCOLORCHANGE,
OnRepaint)
339 BOOL m_bSysNcPainter;
370 DEF_SOBJECT(SOsrPanel, L
"ncpanel")
378 SNcPanel(IHostProxy *pFrameHost, IItemContainer *pItemContainer);
409 ATTR_SKIN(L
"skinActive", m_skinActive, FALSE)
410 ATTR_SKIN(L
"skinInactive", m_skinInactive, FALSE)
411 ATTR_COLOR(L
"colorActiveTitle", m_crActiveTitle, TRUE)
412 ATTR_COLOR(L
"colorInactiveTitle", m_crInactiveTitle, TRUE)
421 COLORREF m_crActiveTitle;
423 COLORREF m_crInactiveTitle;
Smart pointer class for managing COM-style reference-counted objects.
The main host window class responsible for managing the layout, events, and rendering of SOUI windows...
virtual BOOL IsHostUpdateLocked() const
Checks if host updates are locked.
LRESULT OnSetText(LPCTSTR pszText)
Handles the WM_SETTEXT message.
void OnSize(UINT nType, CSize size)
Handles the WM_SIZE message.
void OnLButtonUp(WPARAM wp, LPARAM lp)
Handles the WM_LBUTTONUP message.
virtual BOOL OnHostFireEvent(IEvtArgs *e)
Called when an event is fired on the host.
virtual ISwndContainer * GetHostContainer()
Gets the host container.
virtual void OnLayoutDirty()
Called when layout is dirty.
virtual CRect GetHostRect() const
Gets the rectangle of the host.
void OnNcLButtonDown(UINT flag, CPoint pt)
Handles the WM_NCLBUTTONDOWN message.
BOOL IsDrawNc() const
Checks if non-client area should be drawn.
void PaintCaption()
Paints the caption.
CSize GetNcSize() const
Gets the size of the non-client area.
static void updateSystemButton(SWindow *pRoot, UINT nResizeMode)
Updates system buttons in the non-client area.
LRESULT OnNcMouseLeave(UINT msg, WPARAM wp, LPARAM lp)
Handles the WM_NCMOUSELEAVE message.
virtual BOOL IsItemRedrawDelay() const
Checks if item redraw is delayed.
static int toNcBuiltinID(const SStringW &str)
Converts a string to a built-in non-client ID.
void Reset()
Resets the non-client painter.
void OnTimer(UINT_PTR tid)
Handles the WM_TIMER message.
virtual void OnReleaseHostRenderTarget(IRenderTarget *pRT, LPCRECT rc, GrtFlag gdcFlags)
Called to release the host render target.
LRESULT OnRepaint(UINT msg, WPARAM wp, LPARAM lp)
Handles repaint messages.
virtual IRenderTarget * OnGetHostRenderTarget(LPCRECT rc, GrtFlag gdcFlags)
Called to get the host render target.
void OnMouseMove(WPARAM wp, LPARAM lp)
Handles the WM_MOUSEMOVE message.
void OnNcDestroy()
Handles the WM_NCDESTROY message.
virtual void OnItemSetCapture(SOsrPanel *pItem, BOOL bCapture)
Called when an item sets capture.
LRESULT OnNcCalcSize(BOOL bCalcValidRects, LPARAM lParam)
Handles the WM_NCCALCSIZE message.
BOOL OnNcActivate(BOOL bActive)
Handles the WM_NCACTIVATE message.
virtual BOOL OnItemGetRect(const SOsrPanel *pItem, CRect &rcItem) const
Called to get the rectangle of an item.
int GetScale() const
Gets the scale factor.
SNcPainter(SHostWnd *pHost)
Constructor for SNcPainter.
virtual void InvalidateHostRect(LPCRECT pRc, BOOL bClip)
Invalidates a rectangle in the host.
IWindow * GetRoot() OVERRIDE
Gets the root window.
UINT OnNcHitTest(CPoint point)
Handles the WM_NCHITTEST message.
virtual IObject * GetHost()
Gets the host object.
void OnNcPaint(HRGN hRgn)
Handles the WM_NCPAINT message.
~SNcPainter(void)
Destructor for SNcPainter.
virtual BOOL IsHostVisible() const
Checks if the host is visible.
void UpdateToolTip()
Updates the tooltip.
BOOL InitFromXml(IXmlNode *pXmlNode) OVERRIDE
Initializes the non-client painter from an XML node.
LRESULT OnNcMouseEvent(UINT msg, WPARAM wp, LPARAM lp)
Handles non-client mouse events.
Non-client panel class. This class represents a panel in the non-client area.
BOOL OnEraseBkgnd(IRenderTarget *pRT)
Erases the background of the panel.
BOOL IsActive() const
Checks if the panel is active.
SNcPanel(IHostProxy *pFrameHost, IItemContainer *pItemContainer)
Constructor for SNcPanel.
void SetActive(BOOL bActive)
Sets the active state of the panel.
A class representing an ASCII string.
Base class for SOUI DUI windows.
Interface for rendering target objects.
Interface for Skin Objects.
SOUI Window Container Interface.