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

Caret management class. More...

#include <SCaret.h>

Inheritance diagram for SCaret:
TObjRefImpl< SObjectImpl< ICaret > > ITimelineHandler SObjectImpl< ICaret >

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;amp;strAttribName, const SNS::SStringW &amp;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< IBitmapSm_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
 
ISwndContainerm_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.
 

Detailed Description

Caret management class.

This class manages the caret, including its initialization, positioning, visibility, drawing, and animation.

Definition at line 18 of file SCaret.h.

Constructor & Destructor Documentation

◆ SCaret()

SNSBEGIN SCaret::SCaret ( ISwndContainer * pContainer)

Constructor.

Parameters
pContainerPointer to the container window

Initializes the caret with a container window.

Definition at line 9 of file SCaret.cpp.

◆ ~SCaret()

SCaret::~SCaret ( )

Destructor.

Cleans up the caret object.

Definition at line 24 of file SCaret.cpp.

Member Function Documentation

◆ Draw()

void SCaret::Draw ( IRenderTarget * pRT)

Draws the caret.

Parameters
pRTPointer to the rendering target

Draws the caret on the specified rendering target.

Definition at line 66 of file SCaret.cpp.

◆ GetRect()

RECT SCaret::GetRect ( )

Gets the rectangle of the caret.

Returns
Rectangle of the caret

Returns the bounding rectangle of the caret.

Definition at line 158 of file SCaret.cpp.

◆ Init()

BOOL SCaret::Init ( HBITMAP hBmp,
int nWid,
int nHei )

Initializes the caret.

Parameters
hBmpHandle to the bitmap for the caret
nWidWidth of the caret
nHeiHeight of the caret
Returns
TRUE if successful, otherwise FALSE

Initializes the caret with a bitmap and specified dimensions.

Definition at line 29 of file SCaret.cpp.

◆ Invalidate()

void SCaret::Invalidate ( )
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.

◆ IsVisible()

BOOL SCaret::IsVisible ( )

Checks if the caret is visible.

Returns
TRUE if the caret is visible, otherwise FALSE

Returns the visibility status of the caret.

Definition at line 153 of file SCaret.cpp.

◆ OnNextFrame()

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.

◆ SetAttribute()

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

Definition at line 107 of file SCaret.h.

◆ SetPosition()

void SCaret::SetPosition ( int x,
int y )

Sets the position of the caret.

Parameters
xX-coordinate of the caret
yY-coordinate of the caret

Sets the position of the caret to the specified coordinates.

Definition at line 120 of file SCaret.cpp.

◆ SetVisible()

BOOL SCaret::SetVisible ( BOOL bVisible,
SWND owner )

Sets the visibility of the caret.

Parameters
bVisibleTRUE to make the caret visible, FALSE to hide it
ownerHandle to the owner window
Returns
TRUE if successful, otherwise FALSE

Sets the visibility of the caret and associates it with the owner window.

Definition at line 134 of file SCaret.cpp.

Member Data Documentation

◆ m_AniInterpolator

SAutoRefPtr<IInterpolator> SCaret::m_AniInterpolator
protected

Interpolator for caret animation.

Definition at line 136 of file SCaret.h.

◆ m_bAniCaret

BOOL SCaret::m_bAniCaret
protected

TRUE if the caret has animation enabled.

Definition at line 132 of file SCaret.h.

◆ m_bDrawCaret

bool SCaret::m_bDrawCaret
protected

TRUE if the caret is currently drawing.

Definition at line 128 of file SCaret.h.

◆ m_bmpCaret

SAutoRefPtr<IBitmapS> SCaret::m_bmpCaret
protected

Bitmap representing the caret.

Definition at line 127 of file SCaret.h.

◆ m_bVisible

BOOL SCaret::m_bVisible
protected

TRUE if the caret is currently visible.

Definition at line 125 of file SCaret.h.

◆ m_byAlpha

BYTE SCaret::m_byAlpha
protected

Alpha value for caret transparency.

Definition at line 130 of file SCaret.h.

◆ m_crCaret

COLORREF SCaret::m_crCaret
protected

Color of the caret.

Definition at line 133 of file SCaret.h.

◆ m_hOwner

SWND SCaret::m_hOwner
protected

Handle to the owner window.

Definition at line 138 of file SCaret.h.

◆ m_iFrame

int SCaret::m_iFrame
protected

Current frame index for animation.

Definition at line 129 of file SCaret.h.

◆ m_nAniFrames

int SCaret::m_nAniFrames
protected

Number of frames for fade animation.

Definition at line 134 of file SCaret.h.

◆ m_nShowFrames

int SCaret::m_nShowFrames
protected

Number of frames for show/hide animation.

Definition at line 135 of file SCaret.h.

◆ m_pContainer

ISwndContainer* SCaret::m_pContainer
protected

Pointer to the container window.

Definition at line 137 of file SCaret.h.

◆ m_ptCaret

CPoint SCaret::m_ptCaret
protected

Position of the caret.

Definition at line 126 of file SCaret.h.


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