1 #ifndef GUI_WIDGETS_WX___MAP_CONTROL__HPP
2 #define GUI_WIDGETS_WX___MAP_CONTROL__HPP
41 #include <wx/scrolwin.h>
64 public wxScrolledCanvas,
103 const wxPoint& pos = wxDefaultPosition,
104 const wxSize&
size = wxDefaultSize,
105 long style = wxHSCROLL | wxVSCROLL | wxTAB_TRAVERSAL |
106 wxWANTS_CHARS | wxFULL_REPAINT_ON_RESIZE,
107 const wxString& name =
wxT(
"mapcontrol"));
110 virtual void SetColumnWidth(
int w,
bool update =
true);
111 virtual void SetMaxItemHeight(
int h,
bool update =
true);
117 virtual void LockUpdates(
bool lock =
true);
119 virtual TIndex GetItemsCount()
const;
121 virtual TItemRef GetItem(
TIndex index);
122 virtual TCItemRef GetItem(
TIndex index)
const;
126 virtual void DeleteItem(
TIndex index);
128 virtual void DeleteAllItems();
131 virtual bool Layout();
137 void OnPaint(wxPaintEvent& event);
138 void OnSize(wxSizeEvent& event);
140 void UpdateSelection();
145 TItemRef x_GetItem(
TIndex index);
146 TCItemRef x_GetItem(
TIndex index)
const;
148 bool x_IsUpdatesLocked()
const;
150 virtual void x_InitItemProperties();
151 virtual void x_DrawSeparationLines(wxDC& dc);
152 virtual void x_DrawItemsRange(wxDC& dc,
TIndex from,
TIndex to);
155 virtual wxSize x_CalculateLayout(
int width,
int height);
157 virtual void x_DoDefaultActionOnSelected();
170 void OnContextMenu(wxContextMenuEvent& event);
171 void OnFocusChanged(wxFocusEvent& event);
173 void OnLeftDoubleClick(wxMouseEvent& evt);
174 void OnMouseUp(wxMouseEvent& evt);
175 void OnMouseWheel(wxMouseEvent& event);
177 void OnMouseMove(wxMouseEvent& event);
178 void OnMouseLeave(wxMouseEvent& event);
182 void x_UpdateHotItem(wxPoint ms_pos);
CMapControl owns all its items.
SwxMapItemProperties m_ItemProps
@ eAdjustHorzSize
widget adjusts its model space so that its horizontal size fits into available viewport
SProperties & GetProperties()
CIRef< IwxMapItem > TItemRef
vector< TItemRef > TItems
this is kind of Model
CConstIRef< IwxMapItem > TCItemRef
TIndex GetHotIndex() const
virtual TIndex GetSelectedIndex() const
virtual void x_UpdateItems(TIndexVector &indexes)=0
void OnMouseDown(wxMouseEvent &event)
Event handling.
virtual int x_GetIndexByWindowPos(int win_x, int win_y, bool clip=false)=0
virtual void x_MakeVisible(TIndex index)=0
virtual void x_UpdateItemsRange(TIndex start, TIndex end)=0
virtual void x_SendSelectionEvent(TIndex index)=0
void OnKeyDown(wxKeyEvent &event)
IwxMapItem Abstarct item of the Map Control.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define NCBI_GUIWIDGETS_WX_EXPORT
const struct ncbi::grid::netcache::search::fields::SIZE size
int m_ItemOffsetY
horz space between an item and separation line or border
int m_ItemOffsetX
vertical space between separation lines and the borders
bool m_SeparateGroups
vert space around an item
int m_SepLineWidth
max item height
int m_SepLineVertOffset
width of the separation line between the columns
SwxMapItemProperties - properties of the IwxMapItem.