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

Search Toolkit Book for CGridWidget

#include <gui/widgets/grid_widget/grid_widget.hpp>

+ Inheritance diagram for CGridWidget:
+ Collaboration diagram for CGridWidget:

Public Member Functions

 CGridWidget ()
 
 CGridWidget (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxBORDER_NONE)
 
 ~CGridWidget ()
 
bool Create (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxBORDER_NONE)
 
void CreateControls ()
 Creates the controls and sizers. More...
 
void Init (ITableData &table_data, ICommandProccessor *cmdProccessor)
 
void SetTableSelection (ITableSelection *tableSelection)
 
void UseFixedFont ()
 
void ShowGridLines (bool show)
 
void SetUseCursorSelection (bool useCursorSelection)
 
size_t SetSelection (CSelectionEvent &evt)
 
void GetSelection (CSelectionEvent &evt) const
 Get all selected objects. More...
 
void GetSelectedObjects (TConstScopedObjects &objects) const
 
void GetSelectedRows (set< int > &rows) const
 
void GetSelectedObjectsOrdered (TConstScopedObjects &objects)
 Get objects in a priority order (favor row selections) More...
 
void OnGridCellRightClick (wxGridEvent &evt)
 
void OnGridCellLeftDClick (wxGridEvent &evt)
 
void OnGridLabelLeftDClick (wxGridEvent &evt)
 
void OnGridSelectCell (wxGridEvent &evt)
 
void OnGridRangeSelect (wxGridRangeSelectEvent &evt)
 
void OnExportToCSV (wxCommandEvent &event)
 
void OnSearchIncludeCellValue (wxCommandEvent &event)
 
void OnSearchExcludeCellValue (wxCommandEvent &event)
 
void OnTimer (wxTimerEvent &event)
 
void OnHyperlinkHover (wxHyperlinkEvent &event)
 
void OnCopy (wxCommandEvent &event)
 
void OnUpdateCopy (wxUpdateUIEvent &event)
 
void OnRefreshClick (wxCommandEvent &event)
 
void ShowRefreshButton (bool show)
 
void HideSelectAll (void)
 Hide the Select All checkbox from the user. More...
 
void SetEventExt (IGridEvtExt *evtExt)
 
void ScrollToRow (int row_idx)
 
CGridGetGrid ()
 
IRegSettings interface implementation
virtual void SetRegistryPath (const string &reg_path)
 
virtual void LoadSettings ()
 
virtual void SaveSettings () const
 
IQueryWidget interface implementation
virtual string GetSearchHelpAddr () const
 Return web-address for the help page that disusses help for the specific widget. More...
 
virtual void QueryStart ()
 Disable any widgets that the user should not use during the query. More...
 
virtual void QueryEnd (CMacroQueryExec *exec)
 Re-enable any widgets disabled during the query. More...
 
void IterateSelection (int dir)
 Advance to previous/next selected row from query (in current sort order) More...
 
virtual void SetSelectAll (bool b)
 Set to true to show all rows selected by most recent query as selected. More...
 
virtual void SetHideUnselected (bool b)
 If true, only rows that were selected by prevous query will be shown. More...
 
- Public Member Functions inherited from CEventHandler
 CEventHandler ()
 CEventHandler. More...
 
virtual ~CEventHandler ()
 
virtual void AddListener (CEventHandler *listener, int pool_name=ePool_Default)
 Add a listener. More...
 
virtual void RemoveListener (CEventHandler *listener)
 Remove a listener. More...
 
virtual void RemoveAllListeners (void)
 
virtual bool HasListener (CEventHandler *listener, int pool_name=ePool_Default) const
 returns "true" if the given listener belongs to the specified pool More...
 
virtual const TListenersGetListeners (int pool_name=ePool_Default) const
 returns a set of listeners fro the specified pool More...
 
virtual bool OnEvent (CEvent *evt)
 Processes en event. Returns "true" if event has been processed. More...
 
virtual bool Dispatch (CEvent *evt, EDispatch disp_how=eDispatch_Default, int pool_name=ePool_Default)
 Dispatches an event to the listeners (but does not handle it). More...
 
virtual bool Send (CEvent *evt, EDispatch disp_how=eDispatch_Default, int pool_name=ePool_Default)
 Sends an event synchronously. More...
 
virtual bool Send (CEvent *evt, int pool_name)
 
void Post (CRef< CEvent > evt, EDispatch disp_how=eDispatch_Default, int pool_name=ePool_Default)
 Handles an event asynchronously (process and/or dispatch). More...
 
- Public Member Functions inherited from IRegSettings
virtual ~IRegSettings ()
 
- Public Member Functions inherited from IQueryWidget
 IQueryWidget ()
 
virtual ~IQueryWidget ()
 
virtual void DlgOverlayFix (wxWindow *win)
 let widget send fake resize to fix windows opengl bug. More...
 

Protected Member Functions

void x_InitGrid (ICommandProccessor *cmdProccessor)
 
void x_GetSelectedRows (set< int > &rows) const
 
void x_CompleteQuery ()
 
void x_ScrollToRow (int row_idx)
 
void x_UpdateRowsToSelection (bool b)
 
void x_LeftClick (int Row, int modifiers)
 
void x_LeftDClick (int Row)
 
bool x_GetRectSelection (vector< int > &rows, vector< int > &cols)
 
- Protected Member Functions inherited from CEventHandler
virtual const SEvtMapGetEventMap () const
 
void x_DeclareDead ()
 Removes itself unavailable for async event delivery. More...
 
void x_AddListenerToPool (CEventHandler *listener, int pool_name)
 

Protected Attributes

CGridm_Grid
 the grid widget More...
 
CIRef< ITableDatam_TableData
 interface to the table data (unsorted) More...
 
CwxGridTableAdapterm_GridAdapter
 adapter that matches the grid cells to sorted entries from m_TableData More...
 
CIRef< ITableSelectionm_TableSelection
 post-cell select timer More...
 
wxTimer m_Timer
 
wxBoxSizer * m_ToolbarSizer
 toolbar that contains the query toolbar and additional buttons added by AddControl() (Refresh) More...
 
CQueryParsePanelm_QueryPanel
 controls assigned to the toolbar: More...
 
wxStaticLine * m_StaticLine
 
wxButton * m_RefreshButton
 
string m_RegPath
 
bool m_SelectAll
 when true, rows selected from query panel are all shown as selected More...
 
bool m_ShowSelectAll
 when true (by default) the Select All checkbox is shown More...
 
int m_PopupGridX
 Remember location of cell from popup (right click) so we can use that location (potentially) in function called by popup. More...
 
int m_PopupGridY
 
CRef< CTDQueryDataSourcem_QueryDS
 
CIRef< IGridEvtExtm_GridEvtExt
 
bool m_isShowRefreshButton
 
bool m_isShowGridLines
 
- Protected Attributes inherited from CEventHandler
TPools m_Pools
 

Private Types

enum  { ID_REFRESH_BUTTON = 13027 }
 

Private Attributes

bool m_UseCursorSelection
 

Additional Inherited Members

- Public Types inherited from CEventHandler
enum  EDispatch { eDispatch_SelfOnly , eDispatch_AllHandlers , eDispatch_FirstHandler , eDispatch_Default = eDispatch_AllHandlers }
 enum controlling dispatching strategies More...
 
enum  EPoolName {
  ePool_Default = 0 , ePool_Parent , ePool_Child , ePool_Sibling ,
  ePool_NextAvailable
}
 Identifiers for standard pools. More...
 
typedef vector< CEventHandler * > TListeners
 
typedef map< int, TListenersTPools
 
typedef list< AutoPtr< SPostRequest > > TPostRequests
 
typedef std::map< CEventHandler *, intTHandlerToCount
 
typedef void(* FOnPostCallback) ()
 
- Static Public Member Functions inherited from CEventHandler
static bool HandlePostRequest ()
 
static void ClearPostQueue ()
 erases all events from the queue More...
 
static void DestroyPostQueue ()
 
- Static Protected Attributes inherited from CEventHandler
static const SEvtMap sm_EvtMap
 

Detailed Description

Definition at line 82 of file grid_widget.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
ID_REFRESH_BUTTON 

! how do the numbers get assigned so they do not clash?

Definition at line 222 of file grid_widget.hpp.

Constructor & Destructor Documentation

◆ CGridWidget() [1/2]

CGridWidget::CGridWidget ( )

Definition at line 91 of file grid_widget.cpp.

◆ CGridWidget() [2/2]

CGridWidget::CGridWidget ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxBORDER_NONE 
)

Definition at line 109 of file grid_widget.cpp.

References Create(), and ncbi::grid::netcache::search::fields::size.

◆ ~CGridWidget()

CGridWidget::~CGridWidget ( )

Definition at line 124 of file grid_widget.cpp.

References m_GridEvtExt, m_QueryPanel, and CEventHandler::RemoveListener().

Member Function Documentation

◆ Create()

bool CGridWidget::Create ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxBORDER_NONE 
)

Definition at line 134 of file grid_widget.cpp.

References CreateControls(), and ncbi::grid::netcache::search::fields::size.

Referenced by CGridWidget().

◆ CreateControls()

void CGridWidget::CreateControls ( )

Creates the controls and sizers.

Definition at line 164 of file grid_widget.cpp.

References m_Grid, and wxID_ANY.

Referenced by Create().

◆ GetGrid()

CGrid* CGridWidget::GetGrid ( )
inline

Definition at line 168 of file grid_widget.hpp.

References m_Grid.

Referenced by CVcfTableView::x_OnDataChanged().

◆ GetSearchHelpAddr()

virtual string CGridWidget::GetSearchHelpAddr ( ) const
inlinevirtual

Return web-address for the help page that disusses help for the specific widget.

The default ("") will hide the help icon.

Reimplemented from IQueryWidget.

Definition at line 144 of file grid_widget.hpp.

References string.

◆ GetSelectedObjects()

void CGridWidget::GetSelectedObjects ( TConstScopedObjects objects) const

◆ GetSelectedObjectsOrdered()

void CGridWidget::GetSelectedObjectsOrdered ( TConstScopedObjects objects)

Get objects in a priority order (favor row selections)

Definition at line 630 of file grid_widget.cpp.

References _TRACE, CwxGridTableAdapter::GetOriginalRow(), i, ITableData::kObject, m_Grid, m_GridAdapter, m_TableData, SConstScopedObject::object, and row.

◆ GetSelectedRows()

void CGridWidget::GetSelectedRows ( set< int > &  rows) const

◆ GetSelection()

void CGridWidget::GetSelection ( CSelectionEvent evt) const

◆ HideSelectAll()

void CGridWidget::HideSelectAll ( void  )
inline

Hide the Select All checkbox from the user.

Definition at line 163 of file grid_widget.hpp.

References m_ShowSelectAll.

◆ Init()

void CGridWidget::Init ( ITableData table_data,
ICommandProccessor cmdProccessor 
)

◆ IterateSelection()

void CGridWidget::IterateSelection ( int  dir)
virtual

Advance to previous/next selected row from query (in current sort order)

Reimplemented from IQueryWidget.

Definition at line 471 of file grid_widget.cpp.

References CwxGridTableAdapter::GetCurrentRow(), IGridTableAdapter::GetCurrentSelection(), CQueryParsePanel::IsSelectAll(), CwxGridTableAdapter::IterateSelection(), m_Grid, m_GridAdapter, m_QueryPanel, and x_ScrollToRow().

Referenced by x_CompleteQuery().

◆ LoadSettings()

void CGridWidget::LoadSettings ( )
virtual

Implements IRegSettings.

Definition at line 792 of file grid_widget.cpp.

Referenced by x_InitGrid().

◆ OnCopy()

void CGridWidget::OnCopy ( wxCommandEvent &  event)

◆ OnExportToCSV()

void CGridWidget::OnExportToCSV ( wxCommandEvent &  event)

◆ OnGridCellLeftDClick()

void CGridWidget::OnGridCellLeftDClick ( wxGridEvent &  evt)

Definition at line 315 of file grid_widget.cpp.

References x_LeftDClick().

◆ OnGridCellRightClick()

void CGridWidget::OnGridCellRightClick ( wxGridEvent &  evt)

◆ OnGridLabelLeftDClick()

void CGridWidget::OnGridLabelLeftDClick ( wxGridEvent &  evt)

Definition at line 320 of file grid_widget.cpp.

References x_LeftDClick().

◆ OnGridRangeSelect()

void CGridWidget::OnGridRangeSelect ( wxGridRangeSelectEvent &  evt)

Definition at line 355 of file grid_widget.cpp.

References m_Timer, s_BlockSelChangeUpdate, and x_LeftClick().

◆ OnGridSelectCell()

void CGridWidget::OnGridSelectCell ( wxGridEvent &  evt)

Definition at line 345 of file grid_widget.cpp.

References m_Timer, s_BlockSelChangeUpdate, and x_LeftClick().

◆ OnHyperlinkHover()

void CGridWidget::OnHyperlinkHover ( wxHyperlinkEvent &  event)

◆ OnRefreshClick()

void CGridWidget::OnRefreshClick ( wxCommandEvent &  event)

◆ OnSearchExcludeCellValue()

void CGridWidget::OnSearchExcludeCellValue ( wxCommandEvent &  event)

◆ OnSearchIncludeCellValue()

void CGridWidget::OnSearchIncludeCellValue ( wxCommandEvent &  event)

◆ OnTimer()

void CGridWidget::OnTimer ( wxTimerEvent &  event)

◆ OnUpdateCopy()

void CGridWidget::OnUpdateCopy ( wxUpdateUIEvent &  event)

Definition at line 1032 of file grid_widget.cpp.

◆ QueryEnd()

void CGridWidget::QueryEnd ( CMacroQueryExec exec)
virtual

Re-enable any widgets disabled during the query.

Reimplemented from IQueryWidget.

Definition at line 378 of file grid_widget.cpp.

References m_Grid, and x_CompleteQuery().

◆ QueryStart()

void CGridWidget::QueryStart ( )
virtual

Disable any widgets that the user should not use during the query.

Reimplemented from IQueryWidget.

Definition at line 373 of file grid_widget.cpp.

References m_Grid.

◆ SaveSettings()

void CGridWidget::SaveSettings ( ) const
virtual

◆ ScrollToRow()

void CGridWidget::ScrollToRow ( int  row_idx)
inline

Definition at line 166 of file grid_widget.hpp.

References x_ScrollToRow().

◆ SetEventExt()

void CGridWidget::SetEventExt ( IGridEvtExt evtExt)

Definition at line 150 of file grid_widget.cpp.

References m_GridEvtExt, and CRef< C, Locker >::Reset().

Referenced by ON_EVENT().

◆ SetHideUnselected()

void CGridWidget::SetHideUnselected ( bool  b)
virtual

If true, only rows that were selected by prevous query will be shown.

Reimplemented from IQueryWidget.

Definition at line 487 of file grid_widget.cpp.

References b, m_Grid, m_SelectAll, SetSelectAll(), and x_UpdateRowsToSelection().

Referenced by x_CompleteQuery().

◆ SetRegistryPath()

void CGridWidget::SetRegistryPath ( const string reg_path)
virtual

◆ SetSelectAll()

void CGridWidget::SetSelectAll ( bool  b)
virtual

Set to true to show all rows selected by most recent query as selected.

Reimplemented from IQueryWidget.

Definition at line 440 of file grid_widget.cpp.

References b, CwxGridTableAdapter::GetCurrentRow(), IGridTableAdapter::GetCurrentSelection(), CTDQueryDataSource::GetQueryResults(), i, m_Grid, m_GridAdapter, m_QueryDS, m_SelectAll, and x_ScrollToRow().

Referenced by SetHideUnselected().

◆ SetSelection()

size_t CGridWidget::SetSelection ( CSelectionEvent evt)

◆ SetTableSelection()

void CGridWidget::SetTableSelection ( ITableSelection tableSelection)
inline

Definition at line 103 of file grid_widget.hpp.

References m_TableSelection, and CRef< C, Locker >::Reset().

Referenced by CTableView::InitView(), and ON_EVENT().

◆ SetUseCursorSelection()

void CGridWidget::SetUseCursorSelection ( bool  useCursorSelection)
inline

Definition at line 108 of file grid_widget.hpp.

References m_UseCursorSelection.

◆ ShowGridLines()

void CGridWidget::ShowGridLines ( bool  show)
inline

Definition at line 106 of file grid_widget.hpp.

References m_isShowGridLines.

◆ ShowRefreshButton()

void CGridWidget::ShowRefreshButton ( bool  show)
inline

Definition at line 161 of file grid_widget.hpp.

References m_isShowRefreshButton.

◆ UseFixedFont()

void CGridWidget::UseFixedFont ( )

Definition at line 181 of file grid_widget.cpp.

References m_Grid.

◆ x_CompleteQuery()

void CGridWidget::x_CompleteQuery ( )
protected

◆ x_GetRectSelection()

bool CGridWidget::x_GetRectSelection ( vector< int > &  rows,
vector< int > &  cols 
)
protected

◆ x_GetSelectedRows()

void CGridWidget::x_GetSelectedRows ( set< int > &  rows) const
protected

◆ x_InitGrid()

void CGridWidget::x_InitGrid ( ICommandProccessor cmdProccessor)
protected

◆ x_LeftClick()

void CGridWidget::x_LeftClick ( int  Row,
int  modifiers 
)
protected

◆ x_LeftDClick()

void CGridWidget::x_LeftDClick ( int  Row)
protected

◆ x_ScrollToRow()

void CGridWidget::x_ScrollToRow ( int  row_idx)
protected

Definition at line 703 of file grid_widget.cpp.

References m_Grid.

Referenced by IterateSelection(), ScrollToRow(), and SetSelectAll().

◆ x_UpdateRowsToSelection()

void CGridWidget::x_UpdateRowsToSelection ( bool  b)
protected

Member Data Documentation

◆ m_Grid

CGrid* CGridWidget::m_Grid
protected

◆ m_GridAdapter

CwxGridTableAdapter* CGridWidget::m_GridAdapter
protected

◆ m_GridEvtExt

CIRef<IGridEvtExt> CGridWidget::m_GridEvtExt
protected

Definition at line 217 of file grid_widget.hpp.

Referenced by SetEventExt(), and ~CGridWidget().

◆ m_isShowGridLines

bool CGridWidget::m_isShowGridLines
protected

Definition at line 219 of file grid_widget.hpp.

Referenced by ShowGridLines(), and x_InitGrid().

◆ m_isShowRefreshButton

bool CGridWidget::m_isShowRefreshButton
protected

Definition at line 218 of file grid_widget.hpp.

Referenced by ShowRefreshButton(), and x_InitGrid().

◆ m_PopupGridX

int CGridWidget::m_PopupGridX
protected

Remember location of cell from popup (right click) so we can use that location (potentially) in function called by popup.

Definition at line 212 of file grid_widget.hpp.

Referenced by OnGridCellRightClick(), OnSearchExcludeCellValue(), and OnSearchIncludeCellValue().

◆ m_PopupGridY

int CGridWidget::m_PopupGridY
protected

◆ m_QueryDS

CRef<CTDQueryDataSource> CGridWidget::m_QueryDS
protected

Definition at line 215 of file grid_widget.hpp.

Referenced by SetSelectAll(), x_CompleteQuery(), and x_InitGrid().

◆ m_QueryPanel

CQueryParsePanel* CGridWidget::m_QueryPanel
protected

◆ m_RefreshButton

wxButton* CGridWidget::m_RefreshButton
protected

Definition at line 202 of file grid_widget.hpp.

Referenced by x_InitGrid().

◆ m_RegPath

string CGridWidget::m_RegPath
protected

Definition at line 204 of file grid_widget.hpp.

Referenced by SetRegistryPath(), and x_InitGrid().

◆ m_SelectAll

bool CGridWidget::m_SelectAll
protected

when true, rows selected from query panel are all shown as selected

Definition at line 206 of file grid_widget.hpp.

Referenced by SetHideUnselected(), SetSelectAll(), and x_InitGrid().

◆ m_ShowSelectAll

bool CGridWidget::m_ShowSelectAll
protected

when true (by default) the Select All checkbox is shown

Definition at line 208 of file grid_widget.hpp.

Referenced by HideSelectAll(), and x_InitGrid().

◆ m_StaticLine

wxStaticLine* CGridWidget::m_StaticLine
protected

Definition at line 201 of file grid_widget.hpp.

Referenced by x_InitGrid().

◆ m_TableData

CIRef<ITableData> CGridWidget::m_TableData
protected

interface to the table data (unsorted)

Definition at line 186 of file grid_widget.hpp.

Referenced by GetSelectedObjects(), GetSelectedObjectsOrdered(), GetSelection(), Init(), OnGridCellRightClick(), SetSelection(), and x_InitGrid().

◆ m_TableSelection

CIRef<ITableSelection> CGridWidget::m_TableSelection
protected

post-cell select timer

Definition at line 191 of file grid_widget.hpp.

Referenced by GetSelection(), SetSelection(), and SetTableSelection().

◆ m_Timer

wxTimer CGridWidget::m_Timer
protected

Definition at line 193 of file grid_widget.hpp.

Referenced by OnGridRangeSelect(), and OnGridSelectCell().

◆ m_ToolbarSizer

wxBoxSizer* CGridWidget::m_ToolbarSizer
protected

toolbar that contains the query toolbar and additional buttons added by AddControl() (Refresh)

Definition at line 197 of file grid_widget.hpp.

Referenced by x_InitGrid().

◆ m_UseCursorSelection

bool CGridWidget::m_UseCursorSelection
private

Definition at line 227 of file grid_widget.hpp.

Referenced by SetUseCursorSelection(), and x_GetSelectedRows().


The documentation for this class was generated from the following files:
Modified on Sun Apr 14 05:28:28 2024 by modify_doxy.py rev. 669887