NCBI C++ ToolKit
|
Search Toolkit Book for CMapItem
CMapItem This is a base class for IwxMapItem implementations. More...
#include <gui/widgets/wx/map_item.hpp>
Public Member Functions | |
CMapItem () | |
CMapItem. More... | |
CMapItem (const string &label, wxBitmap &icon, const string &descr, bool separator=false) | |
virtual | ~CMapItem () |
const string & | GetLabel () const |
const string & | GetDescr () 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... | |
CObject & | operator= (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< Uint8 > | TCounter |
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... | |
CMapItem This is a base class for IwxMapItem implementations.
Provides basic services.
Definition at line 50 of file map_item.hpp.
CMapItem::CMapItem | ( | ) |
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().
|
virtual |
Definition at line 74 of file map_item.cpp.
|
virtual |
Draws item in the given rectangle, state is a combination of EItemState flags.
Implements IwxMapItem.
Reimplemented in CGroupMapWidget::CGroupItem.
Definition at line 297 of file map_item.cpp.
References CSelectionControl::fItemSelected, CSelectionControl::fWidgetFocused, kSeparatorH, SwxMapItemProperties::m_Border, SwxMapItemProperties::m_Font, m_Icon, m_IconPos, m_Label, m_LabelRect, m_Rect, SwxMapItemProperties::m_SelBackColor, m_Separator, x_DrawBackground(), x_DrawFocusRect(), x_DrawSeparator(), and x_DrawText().
Definition at line 61 of file map_item.hpp.
References m_Descr.
Definition at line 60 of file map_item.hpp.
References m_Label.
Referenced by CGroupMapWidget::GetGroupLabels(), CGroupMapWidget::GetItemLabel(), CGroupMapWidget::x_GetGroupIndex(), CGroupMapWidget::x_OnMakeDefaultItem(), CGroupMapWidget::x_OnSelectItem(), and CGroupMapWidget::x_OnToggleGroup().
|
virtual |
|
virtual |
Implements IwxMapItem.
Definition at line 279 of file map_item.cpp.
References m_Separator.
Referenced by CGroupMapWidget::GetCurrentItem(), and CGroupMapWidget::GetItemLabel().
|
virtual |
Implements IwxMapItem.
Reimplemented in CGroupMapWidget::CGroupItem.
Definition at line 108 of file map_item.cpp.
References _TRACE, kDefIconHeight, kDefIconWidth, SwxMapItemProperties::m_Border, SwxMapItemProperties::m_CenterLabelAndIcon, SwxMapItemProperties::m_HorzMargin, m_Icon, m_IconPos, m_Label, m_LabelPrefH, m_LabelRect, m_PrefsDirty, m_Rect, m_Separator, SwxMapItemProperties::m_VertMargin, max(), min(), x_GetItemShift(), x_PreferredSeparatorHeight(), and x_UpdatePreferredHeights().
Referenced by CGroupMapWidget::CGroupItem::Layout().
|
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.
Implements IwxMapItem.
Reimplemented in CGroupMapWidget::CGroupItem.
Definition at line 78 of file map_item.hpp.
|
inlinevirtual |
Implements IwxMapItem.
Reimplemented in CGroupMapWidget::CGroupItem.
Definition at line 80 of file map_item.hpp.
|
inlinevirtual |
Implements IwxMapItem.
Reimplemented in CGroupMapWidget::CGroupItem.
Definition at line 79 of file map_item.hpp.
|
virtual |
Implements IwxMapItem.
Reimplemented in CGroupMapWidget::CGroupItem.
Definition at line 187 of file map_item.cpp.
References SwxMapItemProperties::m_Border, SwxMapItemProperties::m_CenterLabelAndIcon, m_Icon, m_LabelPrefH, m_PrefsDirty, m_Separator, SwxMapItemProperties::m_VertMargin, max(), x_PreferredSeparatorHeight(), and x_UpdatePreferredHeights().
|
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.
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().
|
virtual |
|
protectedvirtual |
Definition at line 235 of file map_item.cpp.
References abs, ewxTruncate_EllipsisAlways, i, int, len, SwxMapItemProperties::m_HorzMargin, m_Label, m_LabelRect, SwxMapItemProperties::m_VertMargin, max(), min(), ncbi::grid::netcache::search::fields::size, text(), ToWxString(), TruncateText(), and WrapText().
|
protectedvirtual |
Reimplemented in CGroupMapWidget::CGroupItem.
Definition at line 354 of file map_item.cpp.
References SwxMapItemProperties::m_BackColor.
Referenced by Draw().
|
protectedvirtual |
Definition at line 342 of file map_item.cpp.
References CSelectionControl::fItemFocused, m_Rect, and SwxMapItemProperties::m_TextColor.
Referenced by Draw().
|
protectedvirtual |
Definition at line 372 of file map_item.cpp.
References GetAverage(), kSepHorzOffset, kSepVertOffset, SwxMapItemProperties::m_BackColor, and SwxMapItemProperties::m_TextColor.
Referenced by Draw().
|
protectedvirtual |
Definition at line 391 of file map_item.cpp.
References abs, ewxTruncate_EllipsisAlways, i, int, len, SwxMapItemProperties::m_HiTextColor, SwxMapItemProperties::m_HorzMargin, SwxMapItemProperties::m_SelTextColor, SwxMapItemProperties::m_TextColor, SwxMapItemProperties::m_VertMargin, max(), min(), text(), ToWxString(), TruncateText(), and WrapText().
Referenced by Draw().
|
protectedvirtual |
Reimplemented in CGroupMapWidget::CGroupItem.
Definition at line 161 of file map_item.cpp.
Referenced by Layout().
|
protectedvirtual |
Definition at line 168 of file map_item.cpp.
References SwxMapItemProperties::m_Border, SwxMapItemProperties::m_HorzMargin, m_Icon, and max().
Referenced by x_UpdatePreferredHeights().
|
protected |
Definition at line 79 of file map_item.cpp.
References m_LabelPrefH, and m_PrefsDirty.
Referenced by CMapItem().
|
protectedvirtual |
Definition at line 217 of file map_item.cpp.
References abs, int, SwxMapItemProperties::m_Font, m_Label, SwxMapItemProperties::m_VertMargin, and WrapText().
Referenced by x_UpdatePreferredHeights().
|
protectedvirtual |
Reimplemented in CGroupMapWidget::CGroupItem.
Definition at line 211 of file map_item.cpp.
References kSeparatorH.
Referenced by Layout(), and PreferredHeight().
|
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().
|
protected |
Definition at line 105 of file map_item.hpp.
Referenced by SetCommand().
|
protected |
Definition at line 106 of file map_item.hpp.
Referenced by SetCommand().
|
protected |
Definition at line 102 of file map_item.hpp.
Referenced by GetDescr().
|
protected |
Definition at line 101 of file map_item.hpp.
Referenced by Draw(), Layout(), PreferredHeight(), SetIcon(), and x_GetTextAreaWidth().
|
protected |
Definition at line 113 of file map_item.hpp.
|
protected |
Definition at line 100 of file map_item.hpp.
Referenced by Draw(), GetLabel(), Layout(), x_CalculateRealTextWidth(), and x_PreferredLabelHeight().
|
protected |
Definition at line 110 of file map_item.hpp.
Referenced by Layout(), PreferredHeight(), x_Init(), and x_UpdatePreferredHeights().
|
protected |
Definition at line 114 of file map_item.hpp.
Referenced by Draw(), Layout(), and x_CalculateRealTextWidth().
|
protected |
Definition at line 109 of file map_item.hpp.
Referenced by Layout(), PreferredHeight(), SetIcon(), x_Init(), and x_UpdatePreferredHeights().
|
protected |
Definition at line 112 of file map_item.hpp.
Referenced by Draw(), GetRect(), Layout(), SetRect(), and x_DrawFocusRect().
|
protected |
Definition at line 103 of file map_item.hpp.
Referenced by Draw(), IsGroupSeparator(), Layout(), and PreferredHeight().