CMapControl Class Reference

Search Toolkit Book for CMapControl

#include <map_control.hpp>

Inheritance diagram for CMapControl:

Inheritance graph
[legend]
Collaboration diagram for CMapControl:

Collaboration graph
[legend]
List of all members.

Detailed Description

CMapControl owns all its items.

Definition at line 63 of file map_control.hpp.

Public Types

typedef CIRef< IwxMapItemTItemRef
typedef CConstIRef< IwxMapItemTCItemRef
enum  ESizePolicy { eFixedSize, eAdjustHorzSize, eAdjustVertSize }

Public Member Functions

 CMapControl (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxHSCROLL|wxVSCROLL|wxTAB_TRAVERSAL|wxWANTS_CHARS|wxFULL_REPAINT_ON_RESIZE, const wxString &name=_T("mapcontrol"))
virtual ~CMapControl ()
virtual void SetColumnWidth (int w, bool update=true)
virtual void SetMaxItemHeight (int h, bool update=true)
SPropertiesGetProperties ()
virtual SwxMapItemPropertiesGetMapItemProperties ()
virtual void LockUpdates (bool lock=true)
 block layout and repainting until control is unlocked
virtual TIndex GetItemsCount () const
virtual TItemRef GetItem (TIndex index)
virtual TCItemRef GetItem (TIndex index) const
virtual void AddItem (IwxMapItem *item)
virtual void InsertItem (TIndex index, IwxMapItem *item)
virtual void DeleteItem (TIndex index)
virtual void DeleteItem (IwxMapItem &item)
virtual void DeleteAllItems ()
virtual TIndex GetItemIndex (IwxMapItem &item) const
virtual bool Layout ()
virtual TIndex GetSelectedIndex () const
void OnPaint (wxPaintEvent &event)
void OnSize (wxSizeEvent &event)

Protected Types

typedef vector< TItemRefTItems
 this is kind of Model

Protected Member Functions

void x_Init ()
TItemRef x_GetItem (TIndex index)
TCItemRef x_GetItem (TIndex index) const
bool x_IsUpdatesLocked () const
virtual void x_InitItemProperties ()
virtual void x_DrawSeparationLines (wxDC &dc)
virtual void x_DrawItemsRange (wxDC &dc, TIndex from, TIndex to)
virtual wxSize x_CalculateLayout (int width, int height)
virtual void x_DoDefaultActionOnSelected ()
void OnContextMenu (wxContextMenuEvent &event)
void OnFocusChanged (wxFocusEvent &event)
void OnMouseDown (wxMouseEvent &evt)
 Event handling.
void OnLeftDoubleClick (wxMouseEvent &evt)
void OnMouseUp (wxMouseEvent &evt)
void OnMouseWheel (wxMouseEvent &event)
void OnKeyDown (wxKeyEvent &event)
void OnMouseMove (wxMouseEvent &event)
void x_HorzMoveSelectionBy (int shift, CGUIEvent::EGUIState state)
CSelectionControl pure virtual functions
virtual void x_SendSelectionEvent (TIndex index)
virtual void x_UpdateItems (TIndexVector &indexes)
virtual void x_UpdateItemsRange (TIndex start, TIndex end)
virtual int x_GetIndexByWindowPos (int win_x, int win_y, bool clip=false)
virtual void x_MakeVisible (TIndex index)

Protected Attributes

SProperties m_Properties
SwxMapItemProperties m_ItemProps
TItems m_Items
int m_UpdateLockCounter
wxPoint m_PageInc
int m_HotItem

Private Types

typedef wxScrolledWindow TParent

Private Member Functions

 DECLARE_EVENT_TABLE ()

Classes

struct  SProperties


Member Typedef Documentation

typedef CConstIRef<IwxMapItem> CMapControl::TCItemRef
 

Definition at line 73 of file map_control.hpp.

typedef CIRef<IwxMapItem> CMapControl::TItemRef
 

Definition at line 72 of file map_control.hpp.

typedef vector<TItemRef> CMapControl::TItems [protected]
 

this is kind of Model

Definition at line 186 of file map_control.hpp.

typedef wxScrolledWindow CMapControl::TParent [private]
 

Definition at line 68 of file map_control.hpp.


Member Enumeration Documentation

enum CMapControl::ESizePolicy
 

Enumerator:
eFixedSize 
eAdjustHorzSize  widget adjusts its model space so that its horizontal size fits into available viewport
eAdjustVertSize  widget adjusts its model space so that its vertical size fits into available viewport

Definition at line 75 of file map_control.hpp.


Constructor & Destructor Documentation

CMapControl::CMapControl wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxHSCROLL|wxVSCROLL|wxTAB_TRAVERSAL|wxWANTS_CHARS|wxFULL_REPAINT_ON_RESIZE,
const wxString &  name = _T("mapcontrol")
 

Definition at line 79 of file map_control.cpp.

References x_Init().

CMapControl::~CMapControl  )  [virtual]
 

Definition at line 109 of file map_control.cpp.

References DeleteAllItems(), and LockUpdates().


Member Function Documentation

void CMapControl::AddItem IwxMapItem item  )  [virtual]
 

Definition at line 329 of file map_control.cpp.

References Layout(), m_Items, CSelectionControl::x_InsertItem(), x_IsUpdatesLocked(), and x_UpdateItemsRange().

Referenced by CGroupMapWidget::AddGroup().

CMapControl::DECLARE_EVENT_TABLE  )  [private]
 

void CMapControl::DeleteAllItems  )  [virtual]
 

Definition at line 392 of file map_control.cpp.

References Layout(), m_HotItem, m_Items, CSelectionControl::x_DeleteAllItems(), and x_IsUpdatesLocked().

Referenced by CGroupMapWidget::Clear(), CwxMainFrame::OnCreateMapControlItems(), and ~CMapControl().

void CMapControl::DeleteItem IwxMapItem item  )  [virtual]
 

Definition at line 381 of file map_control.cpp.

References DeleteItem(), GetItemIndex(), Layout(), and x_IsUpdatesLocked().

void CMapControl::DeleteItem TIndex  index  )  [virtual]
 

Definition at line 361 of file map_control.cpp.

References Layout(), m_HotItem, m_Items, CSelectionControl::x_AssertIndexValid(), CSelectionControl::x_DeleteItem(), x_IsUpdatesLocked(), and x_UpdateItemsRange().

Referenced by DeleteItem(), and CGroupMapWidget::x_OnToggleGroup().

CMapControl::TCItemRef CMapControl::GetItem TIndex  index  )  const [virtual]
 

Definition at line 319 of file map_control.cpp.

References m_Items, and CSelectionControl::x_AssertIndexValid().

CMapControl::TItemRef CMapControl::GetItem TIndex  index  )  [virtual]
 

Definition at line 312 of file map_control.cpp.

References m_Items, and CSelectionControl::x_AssertIndexValid().

Referenced by CGroupMapWidget::GetSelectedItem(), and OnMouseMove().

CMapControl::TIndex CMapControl::GetItemIndex IwxMapItem item  )  const [virtual]
 

Definition at line 406 of file map_control.cpp.

References m_Items, and x_GetItem().

Referenced by CGroupMapWidget::AddItem(), DeleteItem(), and CGroupMapWidget::x_OnToggleGroup().

CMapControl::TIndex CMapControl::GetItemsCount  )  const [virtual]
 

Definition at line 306 of file map_control.cpp.

References m_Items.

SwxMapItemProperties & CMapControl::GetMapItemProperties  )  [virtual]
 

Definition at line 140 of file map_control.cpp.

References m_ItemProps.

Referenced by CGroupMapWidget::CGroupMapWidget().

SProperties& CMapControl::GetProperties void   )  [inline]
 

Definition at line 112 of file map_control.hpp.

References m_Properties.

Referenced by CGroupMapWidget::CGroupMapWidget(), CItemSelectionPanel::CreateControls(), CRunToolDlg::CreateControls(), and COpenViewDlg::CreateControls().

CSelectionControl::TIndex CMapControl::GetSelectedIndex  )  const [virtual]
 

Reimplemented from CSelectionControl.

Definition at line 741 of file map_control.cpp.

References CSelectionControl::GetSelectedIndex(), and m_HotItem.

Referenced by CGroupMapWidget::GetSelectedItem().

void CMapControl::InsertItem TIndex  index,
IwxMapItem item
[virtual]
 

Definition at line 344 of file map_control.cpp.

References _VERIFY, Layout(), m_Items, CSelectionControl::x_InsertItem(), x_IsUpdatesLocked(), and x_UpdateItemsRange().

Referenced by CGroupMapWidget::AddItem(), and CGroupMapWidget::x_OnToggleGroup().

bool CMapControl::Layout  )  [virtual]
 

Definition at line 463 of file map_control.cpp.

References x_CalculateLayout().

Referenced by AddItem(), DeleteAllItems(), DeleteItem(), InsertItem(), LockUpdates(), OnSize(), SetColumnWidth(), and SetMaxItemHeight().

void CMapControl::LockUpdates bool  lock = true  )  [virtual]
 

block layout and repainting until control is unlocked

Definition at line 146 of file map_control.cpp.

References Layout(), and m_UpdateLockCounter.

Referenced by CwxMainFrame::OnCreateMapControlItems(), CGroupMapWidget::x_OnToggleGroup(), and ~CMapControl().

void CMapControl::OnContextMenu wxContextMenuEvent &  event  )  [protected]
 

Definition at line 638 of file map_control.cpp.

References LOG_POST.

void CMapControl::OnFocusChanged wxFocusEvent &  event  )  [protected]
 

Definition at line 809 of file map_control.cpp.

void CMapControl::OnKeyDown wxKeyEvent &  event  )  [protected]
 

Reimplemented from CSelectionControl.

Definition at line 778 of file map_control.cpp.

References IsForward(), CSelectionControl::OnKeyDown(), CGUIEvent::wxGetSelectState(), x_DoDefaultActionOnSelected(), and x_HorzMoveSelectionBy().

void CMapControl::OnLeftDoubleClick wxMouseEvent &  evt  )  [protected]
 

Definition at line 663 of file map_control.cpp.

References x_DoDefaultActionOnSelected().

void CMapControl::OnMouseDown wxMouseEvent &  evt  )  [protected]
 

Event handling.

Reimplemented from CSelectionControl.

Definition at line 644 of file map_control.cpp.

References IwxMapItem::OnHotTrack(), CSelectionControl::OnMouseDown(), SetFocus(), x_DoDefaultActionOnSelected(), x_GetIndexByWindowPos(), and x_GetItem().

void CMapControl::OnMouseMove wxMouseEvent &  event  )  [protected]
 

Definition at line 746 of file map_control.cpp.

References GetItem(), m_HotItem, IwxMapItem::OnHotTrack(), x_GetIndexByWindowPos(), x_GetItem(), and x_SendSelectionEvent().

void CMapControl::OnMouseUp wxMouseEvent &  evt  )  [protected]
 

Definition at line 669 of file map_control.cpp.

void CMapControl::OnMouseWheel wxMouseEvent &  event  )  [protected]
 

Definition at line 676 of file map_control.cpp.

References eAdjustHorzSize, m_Items, m_Properties, CMapControl::SProperties::m_SingleColumn, and CMapControl::SProperties::m_SizePolicy.

void CMapControl::OnPaint wxPaintEvent &  event  ) 
 

Definition at line 225 of file map_control.cpp.

References m_Items, x_DrawItemsRange(), x_DrawSeparationLines(), and x_InitItemProperties().

void CMapControl::OnSize wxSizeEvent &  event  ) 
 

Definition at line 300 of file map_control.cpp.

References Layout().

void CMapControl::SetColumnWidth int  w,
bool  update = true
[virtual]
 

Definition at line 119 of file map_control.cpp.

References _ASSERT, Layout(), CMapControl::SProperties::m_ColumnWidth, and m_Properties.

void CMapControl::SetMaxItemHeight int  h,
bool  update = true
[virtual]
 

Definition at line 129 of file map_control.cpp.

References _ASSERT, Layout(), CMapControl::SProperties::m_MaxItemHeight, and m_Properties.

wxSize CMapControl::x_CalculateLayout int  width,
int  height
[protected, virtual]
 

Definition at line 478 of file map_control.cpp.

References CMapControl::SProperties::m_ColumnWidth, CMapControl::SProperties::m_ItemOffsetX, CMapControl::SProperties::m_ItemOffsetY, m_ItemProps, m_Items, CMapControl::SProperties::m_MaxItemHeight, m_Properties, CMapControl::SProperties::m_SeparateGroups, CMapControl::SProperties::m_SepLineWidth, and CMapControl::SProperties::m_SingleColumn.

Referenced by Layout().

void CMapControl::x_DoDefaultActionOnSelected  )  [protected, virtual]
 

Definition at line 156 of file map_control.cpp.

References CSelectionControl::GetSelectedIndexes(), IwxMapItem::OnDefaultAction(), and x_GetItem().

Referenced by OnKeyDown(), OnLeftDoubleClick(), and OnMouseDown().

void CMapControl::x_DrawItemsRange wxDC &  dc,
TIndex  from,
TIndex  to
[protected, virtual]
 

Definition at line 443 of file map_control.cpp.

References CSelectionControl::fWidgetFocused, CSelectionControl::GetItemState(), m_ItemProps, m_Items, and pos.

Referenced by OnPaint().

void CMapControl::x_DrawSeparationLines wxDC &  dc  )  [protected, virtual]
 

Definition at line 264 of file map_control.cpp.

References GetAverage(), CMapControl::SProperties::m_ColumnWidth, m_ItemProps, m_Properties, CMapControl::SProperties::m_SepLineVertOffset, CMapControl::SProperties::m_SepLineWidth, CMapControl::SProperties::m_SingleColumn, and SwxMapItemProperties::m_TextColor.

Referenced by OnPaint().

int CMapControl::x_GetIndexByWindowPos int  win_x,
int  win_y,
bool  clip = false
[protected, virtual]
 

Implements CSelectionControl.

Definition at line 568 of file map_control.cpp.

References m_Items.

Referenced by OnMouseDown(), and OnMouseMove().

CMapControl::TCItemRef CMapControl::x_GetItem TIndex  index  )  const [protected]
 

Definition at line 427 of file map_control.cpp.

References m_Items, and CSelectionControl::x_AssertIndexValid().

CMapControl::TItemRef CMapControl::x_GetItem TIndex  index  )  [protected]
 

Definition at line 417 of file map_control.cpp.

References m_Items, and CSelectionControl::x_AssertIndexValid().

Referenced by GetItemIndex(), OnMouseDown(), OnMouseMove(), and x_DoDefaultActionOnSelected().

void CMapControl::x_HorzMoveSelectionBy int  shift,
CGUIEvent::EGUIState  state
[protected]
 

Definition at line 171 of file map_control.cpp.

References CSelectionControl::GetFocusedIndex(), and m_Items.

Referenced by OnKeyDown().

void CMapControl::x_Init  )  [protected]
 

Definition at line 88 of file map_control.cpp.

References GetAverage(), SwxMapItemProperties::m_BackColor, SwxMapItemProperties::m_Font, m_ItemProps, SwxMapItemProperties::m_MinorFont, SwxMapItemProperties::m_TextColor, and m_UpdateLockCounter.

Referenced by CMapControl().

void CMapControl::x_InitItemProperties  )  [protected, virtual]
 

Definition at line 251 of file map_control.cpp.

References m_ItemProps, SwxMapItemProperties::m_SelBackColor, and SwxMapItemProperties::m_SelTextColor.

Referenced by OnPaint().

bool CMapControl::x_IsUpdatesLocked  )  const [protected]
 

Definition at line 437 of file map_control.cpp.

References m_UpdateLockCounter.

Referenced by AddItem(), DeleteAllItems(), DeleteItem(), and InsertItem().

void CMapControl::x_MakeVisible TIndex  index  )  [protected, virtual]
 

Definition at line 583 of file map_control.cpp.

References m_Items, and CSelectionControl::x_AssertIndexValid().

void CMapControl::x_SendSelectionEvent TIndex  index  )  [protected, virtual]
 

Definition at line 527 of file map_control.cpp.

References GetId().

Referenced by OnMouseMove().

void CMapControl::x_UpdateItems TIndexVector indexes  )  [protected, virtual]
 

Definition at line 537 of file map_control.cpp.

void CMapControl::x_UpdateItemsRange TIndex  start,
TIndex  end
[protected, virtual]
 

Definition at line 543 of file map_control.cpp.

References m_Items.

Referenced by AddItem(), DeleteItem(), and InsertItem().


Member Data Documentation

int CMapControl::m_HotItem [protected]
 

Definition at line 192 of file map_control.hpp.

Referenced by DeleteAllItems(), DeleteItem(), GetSelectedIndex(), and OnMouseMove().

SwxMapItemProperties CMapControl::m_ItemProps [protected]
 

Definition at line 183 of file map_control.hpp.

Referenced by GetMapItemProperties(), x_CalculateLayout(), x_DrawItemsRange(), x_DrawSeparationLines(), x_Init(), and x_InitItemProperties().

TItems CMapControl::m_Items [protected]
 

Definition at line 188 of file map_control.hpp.

Referenced by AddItem(), DeleteAllItems(), DeleteItem(), GetItem(), GetItemIndex(), GetItemsCount(), InsertItem(), OnMouseWheel(), OnPaint(), x_CalculateLayout(), x_DrawItemsRange(), x_GetIndexByWindowPos(), x_GetItem(), x_HorzMoveSelectionBy(), x_MakeVisible(), and x_UpdateItemsRange().

wxPoint CMapControl::m_PageInc [protected]
 

Definition at line 191 of file map_control.hpp.

SProperties CMapControl::m_Properties [protected]
 

Definition at line 181 of file map_control.hpp.

Referenced by GetProperties(), OnMouseWheel(), SetColumnWidth(), SetMaxItemHeight(), x_CalculateLayout(), and x_DrawSeparationLines().

int CMapControl::m_UpdateLockCounter [protected]
 

Definition at line 189 of file map_control.hpp.

Referenced by LockUpdates(), x_Init(), and x_IsUpdatesLocked().


The documentation for this class was generated from the following files:
Generated on Mon Dec 7 12:43:38 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Dec 07 16:23:24 2009 by modify_doxy.py rev. 173732