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

提示控件类,继承自IToolTip和SNativeWnd More...

#include <SToolTip.h>

Inheritance diagram for STipCtrl:
IToolTip SNativeWnd IMsgFilter TObjRefImpl< INativeWnd > INativeWnd IObjRef

Public Member Functions

 STipCtrl (void)
 构造函数
 
virtual ~STipCtrl (void)
 析构函数
 
BOOL Create ()
 创建提示控件
 
BOOL PreTranslateMessage (MSG *pMsg) OVERRIDE
 预翻译消息
 
void UpdateTip (const TIPID *id, RECT rc, LPCTSTR pszTip, int nScale) OVERRIDE
 更新提示信息
 
void ClearTip () OVERRIDE
 清除提示信息
 
void RelayEvent (const MSG *pMsg) OVERRIDE
 传递事件
 
void SetToolTip (LPCRECT rc, UINT tipAlign, LPCTSTR pszTip, int nScale) OVERRIDE
 设置提示信息
 
- Public Member Functions inherited from IToolTip
BOOL PreTranslateMessage (MSG *pMsg) PURE
 Pre-translates messages for the tooltip.
 
void UpdateTip (const TIPID *id, RECT rc, LPCTSTR pszTip, int nScale) PURE
 Updates the current tooltip.
 
void SetToolTip (LPCRECT rc, UINT tipAlign, LPCTSTR pszTip, int nScale) PURE
 Displays the tooltip at a specified position.
 
void ClearTip () PURE
 Clears the current tooltip.
 
void RelayEvent (const MSG *pMsg) PURE
 Relays mouse messages to the tooltip.
 
- Public Member Functions inherited from SNativeWnd
int GetID () SCONST
 Retrieves the window ID.
 
void SetID (int nID)
 Sets the window ID.
 
HWND CreateNative (LPCTSTR lpWindowName, DWORD dwStyle, DWORD dwExStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, int nID=0, LPVOID lpParam=0) OVERRIDE
 Creates a native window.
 
HWND GetHwnd () OVERRIDE
 Retrieves the handle to the window.
 
BOOL SubclassWindow (HWND hWnd) OVERRIDE
 Subclasses an existing window.
 
HWND UnsubclassWindow (BOOL bForce=FALSE) OVERRIDE
 Unsubclasses a window.
 
const MSG * GetCurrentMessage () SCONST OVERRIDE
 Retrieves the current message being processed.
 
int GetDlgCtrlID () SCONST OVERRIDE
 Retrieves the dialog control ID.
 
DWORD GetStyle () SCONST OVERRIDE
 Retrieves the window style.
 
DWORD GetExStyle () SCONST OVERRIDE
 Retrieves the extended window style.
 
LONG_PTR GetWindowLongPtr (int nIndex) SCONST OVERRIDE
 Retrieves the long pointer value at the specified index.
 
LONG_PTR SetWindowLongPtr (int nIndex, LONG_PTR dwNewLong) OVERRIDE
 Sets the long pointer value at the specified index.
 
HWND GetParent () OVERRIDE
 Retrieves the handle to the parent window.
 
HWND SetParent (HWND hWndNewParent) OVERRIDE
 Sets the handle to the parent window.
 
BOOL IsWindowEnabled () SCONST OVERRIDE
 Checks if the window is enabled.
 
BOOL ModifyStyle (DWORD dwRemove, DWORD dwAdd, UINT nFlags=0) OVERRIDE
 Modifies the window style.
 
BOOL ModifyStyleEx (DWORD dwRemove, DWORD dwAdd, UINT nFlags=0) OVERRIDE
 Modifies the extended window style.
 
BOOL SetWindowPos (HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags) OVERRIDE
 Sets the window position.
 
BOOL CenterWindow (HWND hWndCenter=0) OVERRIDE
 Centers the window relative to another window.
 
BOOL DestroyWindow () OVERRIDE
 Destroys the window.
 
BOOL IsWindow () SCONST OVERRIDE
 Checks if the handle is a valid window handle.
 
BOOL Invalidate (BOOL bErase=TRUE) OVERRIDE
 Invalidates the entire window.
 
BOOL InvalidateRect (LPCRECT lpRect, BOOL bErase=TRUE) OVERRIDE
 Invalidates a specified rectangle of the window.
 
BOOL GetWindowRect (LPRECT lpRect) SCONST OVERRIDE
 Retrieves the window rectangle.
 
BOOL GetClientRect (LPRECT lpRect) SCONST OVERRIDE
 Retrieves the client rectangle.
 
BOOL ClientToScreen (LPPOINT lpPoint) SCONST OVERRIDE
 Converts client coordinates to screen coordinates.
 
BOOL ClientToScreen2 (LPRECT lpRect) SCONST OVERRIDE
 Converts client rectangle coordinates to screen coordinates.
 
BOOL ScreenToClient (LPPOINT lpPoint) SCONST OVERRIDE
 Converts screen coordinates to client coordinates.
 
BOOL ScreenToClient2 (LPRECT lpRect) SCONST OVERRIDE
 Converts screen rectangle coordinates to client coordinates.
 
int MapWindowPoints (HWND hWndTo, LPPOINT lpPoint, UINT nCount) SCONST OVERRIDE
 Maps points from one window to another.
 
int MapWindowRect (HWND hWndTo, LPRECT lpRect) SCONST OVERRIDE
 Maps a rectangle from one window to another.
 
UINT_PTR SetTimer (UINT_PTR nIDEvent, UINT nElapse, void(CALLBACK *lpfnTimer)(HWND, UINT, UINT_PTR, DWORD)=NULL) OVERRIDE
 Sets a timer for the window.
 
BOOL KillTimer (UINT_PTR nIDEvent) OVERRIDE
 Kills a timer for the window.
 
HDC GetDC () OVERRIDE
 Retrieves a device context for the window.
 
HDC GetWindowDC () OVERRIDE
 Retrieves a device context for the entire window.
 
int ReleaseDC (HDC hDC) OVERRIDE
 Releases a device context.
 
BOOL CreateCaret (HBITMAP hBitmap, int nWidth, int nHeight) OVERRIDE
 Creates a caret for the window.
 
BOOL HideCaret () OVERRIDE
 Hides the caret.
 
BOOL ShowCaret () OVERRIDE
 Shows the caret.
 
HWND GetCapture () OVERRIDE
 Retrieves the handle to the window that has captured the mouse.
 
HWND SetCapture () OVERRIDE
 Sets the window to capture the mouse.
 
BOOL ReleaseCapture () OVERRIDE
 Releases the mouse capture.
 
HWND SetFocus () OVERRIDE
 Sets the input focus to the window.
 
LRESULT SendMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0) OVERRIDE
 Sends a message to the window.
 
BOOL PostMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0) OVERRIDE
 Posts a message to the window.
 
BOOL SendNotifyMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0) OVERRIDE
 Sends a notify message to the window.
 
BOOL SetWindowText (LPCTSTR lpszString) OVERRIDE
 Sets the window text.
 
int GetWindowText (LPTSTR lpszStringBuf, int nMaxCount) SCONST OVERRIDE
 Retrieves the window text.
 
BOOL IsIconic () SCONST OVERRIDE
 Checks if the window is iconic (minimized).
 
BOOL IsZoomed () SCONST OVERRIDE
 Checks if the window is zoomed (maximized).
 
BOOL IsWindowVisible () SCONST OVERRIDE
 Checks if the window is visible.
 
BOOL MoveWindow (int x, int y, int nWidth, int nHeight, BOOL bRepaint=TRUE) OVERRIDE
 Moves the window to the specified position and resizes it.
 
BOOL MoveWindow2 (LPCRECT lpRect, BOOL bRepaint=TRUE) OVERRIDE
 Moves the window to the specified position and resizes it using a rectangle.
 
BOOL ShowWindow (int nCmdShow) OVERRIDE
 Sets the show state of the window.
 
int SetWindowRgn (HRGN hRgn, BOOL bRedraw=TRUE) OVERRIDE
 Sets the window region.
 
BOOL SetLayeredWindowAttributes (COLORREF crKey, BYTE bAlpha, DWORD dwFlags) OVERRIDE
 Sets the layered window attributes.
 
BOOL UpdateLayeredWindow (HDC hdcDst, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc, COLORREF crKey, BLENDFUNCTION *pblend, DWORD dwFlags) OVERRIDE
 Updates the layered window.
 
void SetMsgHandler (FunMsgHandler fun, void *ctx) OVERRIDE
 Sets the message handler for the window.
 
MsgHandlerInfoGetMsgHandler () OVERRIDE
 Retrieves the message handler for the window.
 
LRESULT DefWindowProc ()
 Calls the default window procedure.
 
LRESULT ForwardNotifications (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 Forwards notifications to the appropriate handler.
 
LRESULT ReflectNotifications (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 Reflects notifications to the appropriate handler.
 
virtual BOOL ProcessWindowMessage (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult, DWORD dwMsgMapID=0)
 Processes a window message.
 
- Public Member Functions inherited from TObjRefImpl< INativeWnd >
 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 IObjRef
long AddRef () PURE
 Increases the reference count.
 
long Release () PURE
 Decreases the reference count.
 
void OnFinalRelease () PURE
 Called when the reference count reaches zero and the object is about to be released.
 

Protected Member Functions

virtual void OnFinalMessage (HWND hWnd)
 处理最终消息
 
void UpdateFont (int nScale)
 更新字体
 
void OnTimer (UINT_PTR idEvent)
 处理定时器消息
 
void OnPaint (HDC dc)
 处理绘制消息
 
void ShowTip (BOOL bShow)
 显示或隐藏提示
 
- Protected Member Functions inherited from SNativeWnd
LRESULT DefWindowProc (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Calls the default window procedure with specific parameters.
 

Protected Attributes

int m_nDelay
 
int m_nShowSpan
 
SStringT m_strTip
 
int m_nScale
 
CRect m_rcTarget
 
HFONT m_font
 
TIPID m_id
 
UINT m_tipAlign
 
- Protected Attributes inherited from SNativeWnd
const MSG * m_pCurrentMsg
 Pointer to the current message.
 
BOOL m_bDestoryed
 Flag indicating if the window is destroyed.
 
MsgHandlerInfo m_msgHandlerInfo
 Message handler information.
 
tagThunk * m_pThunk
 Thunk structure.
 
WNDPROC m_pfnSuperWindowProc
 Pointer to the superclass window procedure.
 
- Protected Attributes inherited from TObjRefImpl< INativeWnd >
LONG m_cRef
 Reference count.
 

Additional Inherited Members

- Static Public Member Functions inherited from SNativeWnd
static ATOM RegisterSimpleWnd (HINSTANCE hInst, LPCTSTR pszSimpleWndName, BOOL bImeWnd)
 Registers a simple window class.
 
static void InitWndClass (HINSTANCE hInst, LPCTSTR pszSimpleWndName, BOOL bImeWnd)
 Initializes the window class.
 
static BOOL DefaultReflectionHandler (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult)
 Default reflection handler for notifications.
 
- Public Attributes inherited from SNativeWnd
HWND m_hWnd
 Handle to the window.
 
- Static Protected Member Functions inherited from SNativeWnd
static LRESULT CALLBACK WindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 Window procedure callback function.
 
static LRESULT CALLBACK StartWindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 Start window procedure callback function (executed once).
 

Detailed Description

提示控件类,继承自IToolTip和SNativeWnd

Definition at line 14 of file SToolTip.h.

Constructor & Destructor Documentation

◆ STipCtrl()

STipCtrl::STipCtrl ( void )

构造函数

Definition at line 14 of file SToolTip.cpp.

◆ ~STipCtrl()

STipCtrl::~STipCtrl ( void )
virtual

析构函数

Definition at line 25 of file SToolTip.cpp.

Member Function Documentation

◆ ClearTip()

void STipCtrl::ClearTip ( )

清除提示信息

Definition at line 166 of file SToolTip.cpp.

◆ Create()

BOOL STipCtrl::Create ( )

创建提示控件

Returns
如果成功创建返回TRUE,否则返回FALSE

Definition at line 31 of file SToolTip.cpp.

◆ OnFinalMessage()

void STipCtrl::OnFinalMessage ( HWND hWnd)
protectedvirtual

处理最终消息

Parameters
hWnd窗口句柄

Reimplemented from SNativeWnd.

Definition at line 296 of file SToolTip.cpp.

◆ OnPaint()

void STipCtrl::OnPaint ( HDC dc)
protected

处理绘制消息

Parameters
dc设备上下文句柄

Definition at line 265 of file SToolTip.cpp.

◆ OnTimer()

void STipCtrl::OnTimer ( UINT_PTR idEvent)
protected

处理定时器消息

Parameters
idEvent定时器ID

Definition at line 249 of file SToolTip.cpp.

◆ PreTranslateMessage()

BOOL STipCtrl::PreTranslateMessage ( MSG * pMsg)

预翻译消息

Parameters
pMsg消息结构指针
Returns
如果消息被处理返回TRUE,否则返回FALSE

Implements IMsgFilter.

Definition at line 287 of file SToolTip.cpp.

◆ RelayEvent()

void STipCtrl::RelayEvent ( const MSG * pMsg)

传递事件

Parameters
pMsg消息结构指针

Definition at line 46 of file SToolTip.cpp.

◆ SetToolTip()

void STipCtrl::SetToolTip ( LPCRECT rc,
UINT tipAlign,
LPCTSTR pszTip,
int nScale )

设置提示信息

Parameters
rc目标矩形区域
tipAlign提示对齐方式
pszTip提示文本
nScale缩放比例

Definition at line 121 of file SToolTip.cpp.

◆ ShowTip()

void STipCtrl::ShowTip ( BOOL bShow)
protected

显示或隐藏提示

Parameters
bShow是否显示提示

Definition at line 174 of file SToolTip.cpp.

◆ UpdateFont()

void STipCtrl::UpdateFont ( int nScale)
protected

更新字体

Parameters
nScale缩放比例

Definition at line 106 of file SToolTip.cpp.

◆ UpdateTip()

void STipCtrl::UpdateTip ( const TIPID * id,
RECT rc,
LPCTSTR pszTip,
int nScale )

更新提示信息

Parameters
id提示ID指针
rc目标矩形区域
pszTip提示文本
nScale缩放比例

Definition at line 147 of file SToolTip.cpp.

Member Data Documentation

◆ m_font

HFONT STipCtrl::m_font
protected

Definition at line 114 of file SToolTip.h.

◆ m_id

TIPID STipCtrl::m_id
protected

Definition at line 116 of file SToolTip.h.

◆ m_nDelay

int STipCtrl::m_nDelay
protected

Definition at line 109 of file SToolTip.h.

◆ m_nScale

int STipCtrl::m_nScale
protected

Definition at line 112 of file SToolTip.h.

◆ m_nShowSpan

int STipCtrl::m_nShowSpan
protected

Definition at line 110 of file SToolTip.h.

◆ m_rcTarget

CRect STipCtrl::m_rcTarget
protected

Definition at line 113 of file SToolTip.h.

◆ m_strTip

SStringT STipCtrl::m_strTip
protected

Definition at line 111 of file SToolTip.h.

◆ m_tipAlign

UINT STipCtrl::m_tipAlign
protected

Definition at line 118 of file SToolTip.h.


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