NCBI C++ ToolKit
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CMapItem Class Reference

Search Toolkit Book for CMapItem

CMapItem This is a base class for IwxMapItem implementations. More...

#include <gui/widgets/wx/map_item.hpp>

+ Inheritance diagram for CMapItem:
+ Collaboration diagram for CMapItem:

Public Member Functions

 CMapItem ()
 CMapItem. More...
 
 CMapItem (const string &label, wxBitmap &icon, const string &descr, bool separator=false)
 
virtual ~CMapItem ()
 
const stringGetLabel () const
 
const stringGetDescr () const
 
void SetIcon (wxBitmap &image)
 
virtual void SetCommand (TCmdID cmd, wxEvtHandler *target)
 enables sending commands on default action; set target to NULL to disable More...
 
IwxMapItem implementation
virtual void SetRect (const wxRect &rc)
 
virtual void GetRect (wxRect &rc) const
 
virtual void Layout (wxDC &dc, SwxMapItemProperties &props)
 
virtual int PreferredHeight (wxDC &dc, SwxMapItemProperties &props, int width)
 
virtual bool IsGroupSeparator () const
 
virtual void Draw (wxDC &dc, int state, SwxMapItemProperties &props)
 Draws item in the given rectangle, state is a combination of EItemState flags. More...
 
virtual void OnDefaultAction ()
 a callback to perform a default action associated with the item More...
 
virtual bool OnHotTrack (const wxPoint &ms_pos)
 
virtual void OnMouseDown (const wxPoint &ms_pos)
 
virtual void OnLeftDoubleClick (const wxPoint &ms_pos)
 
- Public Member Functions inherited from CObject
 CObject (void)
 Constructor. More...
 
 CObject (const CObject &src)
 Copy constructor. More...
 
virtual ~CObject (void)
 Destructor. More...
 
CObjectoperator= (const CObject &src) THROWS_NONE
 Assignment operator. More...
 
bool CanBeDeleted (void) const THROWS_NONE
 Check if object can be deleted. More...
 
bool IsAllocatedInPool (void) const THROWS_NONE
 Check if object is allocated in memory pool (not system heap) More...
 
bool Referenced (void) const THROWS_NONE
 Check if object is referenced. More...
 
bool ReferencedOnlyOnce (void) const THROWS_NONE
 Check if object is referenced only once. More...
 
void AddReference (void) const
 Add reference to object. More...
 
void RemoveReference (void) const
 Remove reference to object. More...
 
void ReleaseReference (void) const
 Remove reference without deleting object. More...
 
virtual void DoNotDeleteThisObject (void)
 Mark this object as not allocated in heap – do not delete this object. More...
 
virtual void DoDeleteThisObject (void)
 Mark this object as allocated in heap – object can be deleted. More...
 
void * operator new (size_t size)
 Define new operator for memory allocation. More...
 
void * operator new[] (size_t size)
 Define new[] operator for 'array' memory allocation. More...
 
void operator delete (void *ptr)
 Define delete operator for memory deallocation. More...
 
void operator delete[] (void *ptr)
 Define delete[] operator for memory deallocation. More...
 
void * operator new (size_t size, void *place)
 Define new operator. More...
 
void operator delete (void *ptr, void *place)
 Define delete operator. More...
 
void * operator new (size_t size, CObjectMemoryPool *place)
 Define new operator using memory pool. More...
 
void operator delete (void *ptr, CObjectMemoryPool *place)
 Define delete operator. More...
 
virtual void DebugDump (CDebugDumpContext ddc, unsigned int depth) const
 Define method for dumping debug information. More...
 
- Public Member Functions inherited from CDebugDumpable
 CDebugDumpable (void)
 
virtual ~CDebugDumpable (void)
 
void DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const
 
void DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const
 
void DumpToConsole (void) const
 
- Public Member Functions inherited from IwxMapItem
virtual ~IwxMapItem ()
 

Protected Member Functions

void x_Init ()
 
virtual int x_GetItemShift () const
 
virtual int x_GetTextAreaWidth (SwxMapItemProperties &props, int width) const
 
virtual void x_UpdatePreferredHeights (wxDC &dc, SwxMapItemProperties &props, int width)
 
virtual int x_PreferredSeparatorHeight (wxDC &dc) const
 
virtual int x_PreferredLabelHeight (wxDC &dc, SwxMapItemProperties &props, int text_w) const
 
virtual int x_CalculateRealTextWidth (wxDC &dc, SwxMapItemProperties &props)
 
virtual void x_DrawFocusRect (wxDC &dc, const wxRect &rc, int state, SwxMapItemProperties &props)
 
virtual void x_DrawBackground (wxDC &dc, const wxRect &rc, int state, SwxMapItemProperties &props)
 
virtual void x_DrawSeparator (wxDC &dc, const wxRect &rc, SwxMapItemProperties &props)
 
virtual void x_DrawText (wxDC &dc, const string &text, const wxRect &rc, bool selected, bool focused, bool highlighted, SwxMapItemProperties &props)
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 

Protected Attributes

string m_Label
 
wxBitmap m_Icon
 
string m_Descr
 
bool m_Separator
 
TCmdID m_Cmd
 
wxEvtHandler * m_CmdTarget
 
bool m_PrefsDirty
 
int m_LabelPrefH
 
wxRect m_Rect
 
wxPoint m_IconPos
 
wxRect m_LabelRect
 

Additional Inherited Members

- Public Types inherited from CObject
enum  EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern }
 Control filling of newly allocated memory. More...
 
typedef CObjectCounterLocker TLockerType
 Default locker type for CRef. More...
 
typedef atomic< Uint8TCounter
 Counter type is CAtomiCounter. More...
 
typedef Uint8 TCount
 Alias for value type of counter. More...
 
- Static Public Member Functions inherited from CObject
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (void)
 Define method to throw null pointer exception. More...
 
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (const type_info &type)
 
static EAllocFillMode GetAllocFillMode (void)
 
static void SetAllocFillMode (EAllocFillMode mode)
 
static void SetAllocFillMode (const string &value)
 Set mode from configuration parameter value. More...
 
- Static Public Member Functions inherited from CDebugDumpable
static void EnableDebugDump (bool on)
 
- Static Public Attributes inherited from CObject
static const TCount eCounterBitsCanBeDeleted = 1 << 0
 Define possible object states. More...
 
static const TCount eCounterBitsInPlainHeap = 1 << 1
 Heap signature was found. More...
 
static const TCount eCounterBitsPlaceMask
 Mask for 'in heap' state flags. More...
 
static const int eCounterStep = 1 << 2
 Skip over the "in heap" bits. More...
 
static const TCount eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2)
 Minimal value for valid objects (reference counter is zero) Must be a single bit value. More...
 
static const TCount eCounterStateMask
 Valid object, and object in heap. More...
 

Detailed Description

CMapItem This is a base class for IwxMapItem implementations.

Provides basic services.

Definition at line 50 of file map_item.hpp.

Constructor & Destructor Documentation

◆ CMapItem() [1/2]

CMapItem::CMapItem ( )

CMapItem.

Definition at line 53 of file map_item.cpp.

References x_Init().

◆ CMapItem() [2/2]

CMapItem::CMapItem ( const string label,
wxBitmap &  icon,
const string descr,
bool  separator = false 
)

Definition at line 62 of file map_item.cpp.

References x_Init().

◆ ~CMapItem()

CMapItem::~CMapItem ( )
virtual

Definition at line 74 of file map_item.cpp.

Member Function Documentation

◆ Draw()

void CMapItem::Draw ( wxDC &  dc,
int  state,
SwxMapItemProperties props 
)
virtual

◆ GetDescr()

const string& CMapItem::GetDescr ( void  ) const
inline

Definition at line 61 of file map_item.hpp.

References m_Descr.

◆ GetLabel()

const string& CMapItem::GetLabel ( void  ) const
inline

◆ GetRect()

void CMapItem::GetRect ( wxRect &  rc) const
virtual

Implements IwxMapItem.

Definition at line 291 of file map_item.cpp.

References m_Rect.

◆ IsGroupSeparator()

bool CMapItem::IsGroupSeparator ( ) const
virtual

Implements IwxMapItem.

Definition at line 279 of file map_item.cpp.

References m_Separator.

Referenced by CGroupMapWidget::GetCurrentItem(), and CGroupMapWidget::GetItemLabel().

◆ Layout()

void CMapItem::Layout ( wxDC &  dc,
SwxMapItemProperties props 
)
virtual

◆ OnDefaultAction()

void CMapItem::OnDefaultAction ( )
virtual

a callback to perform a default action associated with the item

Implements IwxMapItem.

Reimplemented in CGroupMapWidget::CGroupItem.

Definition at line 450 of file map_item.cpp.

◆ OnHotTrack()

virtual bool CMapItem::OnHotTrack ( const wxPoint &  ms_pos)
inlinevirtual

Implements IwxMapItem.

Reimplemented in CGroupMapWidget::CGroupItem.

Definition at line 78 of file map_item.hpp.

◆ OnLeftDoubleClick()

virtual void CMapItem::OnLeftDoubleClick ( const wxPoint &  ms_pos)
inlinevirtual

Implements IwxMapItem.

Reimplemented in CGroupMapWidget::CGroupItem.

Definition at line 80 of file map_item.hpp.

◆ OnMouseDown()

virtual void CMapItem::OnMouseDown ( const wxPoint &  ms_pos)
inlinevirtual

Implements IwxMapItem.

Reimplemented in CGroupMapWidget::CGroupItem.

Definition at line 79 of file map_item.hpp.

◆ PreferredHeight()

int CMapItem::PreferredHeight ( wxDC &  dc,
SwxMapItemProperties props,
int  width 
)
virtual

◆ SetCommand()

void CMapItem::SetCommand ( TCmdID  cmd,
wxEvtHandler *  target 
)
virtual

enables sending commands on default action; set target to NULL to disable

Definition at line 92 of file map_item.cpp.

References cmd, m_Cmd, and m_CmdTarget.

◆ SetIcon()

void CMapItem::SetIcon ( wxBitmap &  image)

Definition at line 85 of file map_item.cpp.

References m_Icon, and m_PrefsDirty.

Referenced by CGroupMapWidget::x_OnToggleGroup().

◆ SetRect()

void CMapItem::SetRect ( const wxRect &  rc)
virtual

Implements IwxMapItem.

Definition at line 285 of file map_item.cpp.

References m_Rect.

◆ x_CalculateRealTextWidth()

int CMapItem::x_CalculateRealTextWidth ( wxDC &  dc,
SwxMapItemProperties props 
)
protectedvirtual

◆ x_DrawBackground()

void CMapItem::x_DrawBackground ( wxDC &  dc,
const wxRect &  rc,
int  state,
SwxMapItemProperties props 
)
protectedvirtual

Reimplemented in CGroupMapWidget::CGroupItem.

Definition at line 354 of file map_item.cpp.

References SwxMapItemProperties::m_BackColor.

Referenced by Draw().

◆ x_DrawFocusRect()

void CMapItem::x_DrawFocusRect ( wxDC &  dc,
const wxRect &  rc,
int  state,
SwxMapItemProperties props 
)
protectedvirtual

Definition at line 342 of file map_item.cpp.

References CSelectionControl::fItemFocused, m_Rect, and SwxMapItemProperties::m_TextColor.

Referenced by Draw().

◆ x_DrawSeparator()

void CMapItem::x_DrawSeparator ( wxDC &  dc,
const wxRect &  rc,
SwxMapItemProperties props 
)
protectedvirtual

◆ x_DrawText()

void CMapItem::x_DrawText ( wxDC &  dc,
const string text,
const wxRect &  rc,
bool  selected,
bool  focused,
bool  highlighted,
SwxMapItemProperties props 
)
protectedvirtual

◆ x_GetItemShift()

int CMapItem::x_GetItemShift ( ) const
protectedvirtual

Reimplemented in CGroupMapWidget::CGroupItem.

Definition at line 161 of file map_item.cpp.

Referenced by Layout().

◆ x_GetTextAreaWidth()

int CMapItem::x_GetTextAreaWidth ( SwxMapItemProperties props,
int  width 
) const
protectedvirtual

◆ x_Init()

void CMapItem::x_Init ( void  )
protected

Definition at line 79 of file map_item.cpp.

References m_LabelPrefH, and m_PrefsDirty.

Referenced by CMapItem().

◆ x_PreferredLabelHeight()

int CMapItem::x_PreferredLabelHeight ( wxDC &  dc,
SwxMapItemProperties props,
int  text_w 
) const
protectedvirtual

◆ x_PreferredSeparatorHeight()

int CMapItem::x_PreferredSeparatorHeight ( wxDC &  dc) const
protectedvirtual

Reimplemented in CGroupMapWidget::CGroupItem.

Definition at line 211 of file map_item.cpp.

References kSeparatorH.

Referenced by Layout(), and PreferredHeight().

◆ x_UpdatePreferredHeights()

void CMapItem::x_UpdatePreferredHeights ( wxDC &  dc,
SwxMapItemProperties props,
int  width 
)
protectedvirtual

Definition at line 179 of file map_item.cpp.

References m_LabelPrefH, m_PrefsDirty, x_GetTextAreaWidth(), and x_PreferredLabelHeight().

Referenced by Layout(), and PreferredHeight().

Member Data Documentation

◆ m_Cmd

TCmdID CMapItem::m_Cmd
protected

Definition at line 105 of file map_item.hpp.

Referenced by SetCommand().

◆ m_CmdTarget

wxEvtHandler* CMapItem::m_CmdTarget
protected

Definition at line 106 of file map_item.hpp.

Referenced by SetCommand().

◆ m_Descr

string CMapItem::m_Descr
protected

Definition at line 102 of file map_item.hpp.

Referenced by GetDescr().

◆ m_Icon

wxBitmap CMapItem::m_Icon
protected

Definition at line 101 of file map_item.hpp.

Referenced by Draw(), Layout(), PreferredHeight(), SetIcon(), and x_GetTextAreaWidth().

◆ m_IconPos

wxPoint CMapItem::m_IconPos
protected

Definition at line 113 of file map_item.hpp.

Referenced by Draw(), and Layout().

◆ m_Label

string CMapItem::m_Label
protected

◆ m_LabelPrefH

int CMapItem::m_LabelPrefH
protected

Definition at line 110 of file map_item.hpp.

Referenced by Layout(), PreferredHeight(), x_Init(), and x_UpdatePreferredHeights().

◆ m_LabelRect

wxRect CMapItem::m_LabelRect
protected

Definition at line 114 of file map_item.hpp.

Referenced by Draw(), Layout(), and x_CalculateRealTextWidth().

◆ m_PrefsDirty

bool CMapItem::m_PrefsDirty
protected

Definition at line 109 of file map_item.hpp.

Referenced by Layout(), PreferredHeight(), SetIcon(), x_Init(), and x_UpdatePreferredHeights().

◆ m_Rect

wxRect CMapItem::m_Rect
protected

Definition at line 112 of file map_item.hpp.

Referenced by Draw(), GetRect(), Layout(), SetRect(), and x_DrawFocusRect().

◆ m_Separator

bool CMapItem::m_Separator
protected

Definition at line 103 of file map_item.hpp.

Referenced by Draw(), IsGroupSeparator(), Layout(), and PreferredHeight().


The documentation for this class was generated from the following files:
Modified on Wed Jun 12 11:15:38 2024 by modify_doxy.py rev. 669887