1#include "include/souistd.h"
7 ,
m_pUpSkin(GETBUILTINSKIN(SKIN_SYS_SPIN_UP))
91 SStringT strValue = SStringT().Format(_T(
"%d"),
m_nValue);
92 EventSpinValue2String evt(
this);
95 evt.strValue = &strValue;
119 if (rcClient.PtInRect(point))
121 if (point.y > (rcClient.top + rcClient.Height() / 2))
134 __baseCls::OnColorize(cr);
146 CRect rcUp = rcClient, rcDown = rcClient;
147 rcUp.bottom = rcDown.top = rcClient.top + rcClient.Height() / 2;
151 m_pUpSkin->DrawByIndex(pRT, rcUp, iState);
152 m_pDownSkin->DrawByIndex(pRT, rcDown, iState != 2 ? iState : 1);
156 m_pUpSkin->DrawByIndex(pRT, rcUp, iState != 2 ? iState : 1);
161 iState = iState != 2 ? iState : 0;
162 m_pUpSkin->DrawByIndex(pRT, rcUp, iState);
178 EventRENotify *pEvt2 = sobj_cast<EventRENotify>(pEvt);
179 if (pEvt2->iNotify != EN_CHANGE)
185 if (nValue <= m_nMax && nValue >=
m_nMin)
189 SStringT strValue = SStringT().Format(_T(
"%d"),
m_nValue);
190 EventSpinValue2String evt(
this);
193 evt.strValue = &strValue;
202 __baseCls::OnScaleChanged(scale);
209 int nRet = __baseCls::OnCreate(NULL);
@ EVT_RE_NOTIFY
丰富编辑控件通知事件
BOOL subscribeEvent(DWORD dwEventID, const IEvtSlot &subscriber)
订阅事件
BOOL addEvent(DWORD dwEventID, LPCWSTR pszEventHandlerName)
添加一个新事件到事件集
int toPixelSize(int scale) const
将大小转换为像素值
static int GetDefIndex(DWORD dwState, bool checkAsPushdown=false)
Gets the default index for a given state.
A class representing an ASCII string.
BOOL SetTimer(char id, UINT uElapse) OVERRIDE
Sets a timer for the window.
BOOL FireEvent(IEvtArgs *evt) OVERRIDE
Fires an event.
SWindow * GetParent() const
Retrieves the parent window.
DWORD GetState() SCONST OVERRIDE
Retrieves the current state of the window.
int GetWindowText(TCHAR *pBuf, int nBufLen, BOOL bRawText) OVERRIDE
Retrieves the window text.
void OnPaint(IRenderTarget *pRT)
Handles the painting of the window.
int GetScale() SCONST OVERRIDE
Retrieves the scale factor of the window.
SWindow * FindChildByName(LPCWSTR strName, int nDeep=-1)
Finds a child window by its name.
virtual CRect GetClientRect() const
Retrieves the client rectangle of the window.
void OnLButtonUp(UINT nFlags, CPoint pt)
Handles the left mouse button up event.
void OnLButtonDown(UINT nFlags, CPoint pt)
Handles the left mouse button down event.
ILayoutParam * GetLayoutParam() SCONST OVERRIDE
Retrieves the layout parameter object associated with the window.
SEventSet * GetEventSet()
Retrieves the event set associated with the window.
BOOL KillTimer(char id) OVERRIDE
Kills a timer for the window.
void Invalidate() OVERRIDE
Invalidates the entire window.
void SetWindowText(LPCTSTR lpszText) OVERRIDE
Sets the window text.
void GetScaleSkin(SAutoRefPtr< ISkinObj > &pSkin, int nScale)
Retrieves a scaled skin object based on the current scale factor.
Interface for rendering target objects.