Caret management class. More...
#include <SCaret.h>
Public Member Functions | |
| SCaret (ISwndContainer *pContainer) | |
| Constructor. | |
| ~SCaret () | |
| Destructor. | |
| BOOL | Init (HBITMAP hBmp, int nWid, int nHei) OVERRIDE |
| Initializes the caret. | |
| void | SetPosition (int x, int y) OVERRIDE |
| Sets the position of the caret. | |
| BOOL | SetVisible (BOOL bVisible, SWND owner) OVERRIDE |
| Sets the visibility of the caret. | |
| BOOL | IsVisible () SCONST OVERRIDE |
| Checks if the caret is visible. | |
| void | Draw (IRenderTarget *pRT) OVERRIDE |
| Draws the caret. | |
| RECT | GetRect () SCONST OVERRIDE |
| Gets the rectangle of the caret. | |
| void | OnNextFrame () OVERRIDE |
| Handles the next frame in the timeline. | |
| virtual HRESULT | SetAttribute (const SNS::SStringW &amp;amp;amp;strAttribName, const SNS::SStringW &amp;amp;amp;strValue, BOOL bLoading=FALSE) |
Public Member Functions inherited from TObjRefImpl< SObjectImpl< ICaret > > | |
| 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< ICaret > | |
| 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. | |
Public Member Functions inherited from ITimelineHandler | |
| void | OnNextFrame () PURE |
| 下一个动画帧处理接口 | |
Protected Member Functions | |
| void | Invalidate () |
| Invalidates the caret area. | |
Protected Attributes | |
| BOOL | m_bVisible |
| CPoint | m_ptCaret |
| SAutoRefPtr< IBitmapS > | m_bmpCaret |
| bool | m_bDrawCaret |
| int | m_iFrame |
| BYTE | m_byAlpha |
| BOOL | m_bAniCaret |
| COLORREF | m_crCaret |
| int | m_nAniFrames |
| int | m_nShowFrames |
| SAutoRefPtr< IInterpolator > | m_AniInterpolator |
| ISwndContainer * | m_pContainer |
| SWND | m_hOwner |
Protected Attributes inherited from TObjRefImpl< SObjectImpl< ICaret > > | |
| LONG | m_cRef |
| Reference count. | |
Protected Attributes inherited from SObjectImpl< ICaret > | |
| SStringW | m_strName |
| int | m_nID |
| FunAttrHandler | m_attrHandler |
Additional Inherited Members | |
Static Public Member Functions inherited from SObjectImpl< ICaret > | |
| 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. | |
Caret management class.
This class manages the caret, including its initialization, positioning, visibility, drawing, and animation.
| SNSBEGIN SCaret::SCaret | ( | ISwndContainer * | pContainer | ) |
Constructor.
| pContainer | Pointer to the container window |
Initializes the caret with a container window.
Definition at line 9 of file SCaret.cpp.
| SCaret::~SCaret | ( | ) |
| void SCaret::Draw | ( | IRenderTarget * | pRT | ) |
Draws the caret.
| pRT | Pointer to the rendering target |
Draws the caret on the specified rendering target.
Definition at line 66 of file SCaret.cpp.
| RECT SCaret::GetRect | ( | ) |
Gets the rectangle of the caret.
Returns the bounding rectangle of the caret.
Definition at line 158 of file SCaret.cpp.
| BOOL SCaret::Init | ( | HBITMAP | hBmp, |
| int | nWid, | ||
| int | nHei ) |
Initializes the caret.
| hBmp | Handle to the bitmap for the caret |
| nWid | Width of the caret |
| nHei | Height of the caret |
Initializes the caret with a bitmap and specified dimensions.
Definition at line 29 of file SCaret.cpp.
|
protected |
Invalidates the caret area.
Invalidates the area where the caret is drawn to trigger a redraw.
Definition at line 166 of file SCaret.cpp.
| BOOL SCaret::IsVisible | ( | ) |
Checks if the caret is visible.
Returns the visibility status of the caret.
Definition at line 153 of file SCaret.cpp.
| void SCaret::OnNextFrame | ( | ) |
Handles the next frame in the timeline.
Updates the caret's state for the next frame, handling animation if enabled.
Definition at line 78 of file SCaret.cpp.
|
inlinevirtual |
| void SCaret::SetPosition | ( | int | x, |
| int | y ) |
Sets the position of the caret.
| x | X-coordinate of the caret |
| y | Y-coordinate of the caret |
Sets the position of the caret to the specified coordinates.
Definition at line 120 of file SCaret.cpp.
| BOOL SCaret::SetVisible | ( | BOOL | bVisible, |
| SWND | owner ) |
Sets the visibility of the caret.
| bVisible | TRUE to make the caret visible, FALSE to hide it |
| owner | Handle to the owner window |
Sets the visibility of the caret and associates it with the owner window.
Definition at line 134 of file SCaret.cpp.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |