NCBI C++ ToolKit
|
Search Toolkit Book for CSelectionPanel
#include "selection_panel.hpp"
(Private to src/gui/core
.)
Public Types | |
enum | EDisplayMode { eInvalidDisplayMode = -1 , eTable , eBriefText , eText } |
Public Member Functions | |
CSelectionPanel (ISelectionClient *view) | |
virtual void | Create (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize) |
virtual bool | Destroy () |
void | Init () |
Initialises member variables. More... | |
void | CreateControls () |
Creates the controls and sizers. More... | |
void | SetSelectionService (CSelectionService *service) |
void | GetSelection (TConstScopedObjects &buf) const |
void | Update () |
void | OnSelServiceStateChange (CSelectionServiceEvent &update) |
wxWindow * | GetCurrentCtrl () |
IRegSettings interface implementation | |
virtual void | SetRegistryPath (const string ®_path) |
virtual void | LoadSettings () |
virtual void | SaveSettings () const |
Command handlers | |
void | OnContextMenu (wxContextMenuEvent &event) |
void | OnTargetChanged (wxCommandEvent &event) |
void | OnModeChanged (wxCommandEvent &event) |
Public Member Functions inherited from IRegSettings | |
virtual | ~IRegSettings () |
Static Public Attributes | |
static const int | scm_ModeCmd = 13000 |
Protected Types | |
typedef map< int, ISelectionClient * > | TIndexToClient |
Protected Member Functions | |
void | x_InitCurrentWidget () |
bool | x_ResetSelObjects () |
void | x_ResetTargetChoice () |
void | x_ResetObjectWidget () |
void | x_InitTextWidget () |
Protected Attributes | |
ISelectionClient * | m_SelView |
CSelectionService * | m_Service |
TConstScopedObjects | m_SelObjects |
wxChoice * | m_TargetChoice |
CWeakIRef< ISelectionClient > | m_CurrentClientWeakPtr |
EDisplayMode | m_DisplayMode |
CObjectListWidget * | m_ListWidget |
CTextItemPanel * | m_TextWidget |
string | m_RegPath |
std::unique_ptr< async_job > | m_Future |
Definition at line 57 of file selection_panel.hpp.
|
protected |
Definition at line 121 of file selection_panel.hpp.
Enumerator | |
---|---|
eInvalidDisplayMode | |
eTable | |
eBriefText | |
eText |
Definition at line 66 of file selection_panel.hpp.
CSelectionPanel::CSelectionPanel | ( | ISelectionClient * | view | ) |
Definition at line 116 of file selection_panel.cpp.
References Init().
|
virtual |
Definition at line 127 of file selection_panel.cpp.
References CreateControls(), and ncbi::grid::netcache::search::fields::size.
Referenced by CSelectionView::CreateViewWindow().
void CSelectionPanel::CreateControls | ( | ) |
Creates the controls and sizers.
Definition at line 170 of file selection_panel.cpp.
References eBriefText, eTable, eText, ID_COMBOBOX, ID_TABLE, ID_TEXT, ID_TOOLBAR, m_DisplayMode, m_ListWidget, m_TargetChoice, m_TextWidget, scm_ModeCmd, CwxTableListCtrl::SetContextMenuEventPropagation(), CTextItemPanel::SetFont(), Update(), and wxT.
Referenced by Create().
|
virtual |
Definition at line 141 of file selection_panel.cpp.
Referenced by CSelectionView::DestroyViewWindow().
wxWindow * CSelectionPanel::GetCurrentCtrl | ( | ) |
Definition at line 227 of file selection_panel.cpp.
References eTable, m_DisplayMode, m_ListWidget, and m_TextWidget.
void CSelectionPanel::GetSelection | ( | TConstScopedObjects & | buf | ) | const |
Definition at line 274 of file selection_panel.cpp.
References buf, context, eTable, CTextItemPanel::GetContext(), CObjectListWidget::GetSelection(), m_DisplayMode, m_ListWidget, and m_TextWidget.
Referenced by CSelectionView::GetSelection().
void CSelectionPanel::Init | ( | void | ) |
Initialises member variables.
Definition at line 149 of file selection_panel.cpp.
References GetDefaultFileArtProvider(), m_ListWidget, m_Service, m_TargetChoice, m_TextWidget, NULL, wxFileArtProvider::RegisterFileAlias(), and wxT.
|
virtual |
Implements IRegSettings.
Definition at line 262 of file selection_panel.cpp.
References _ASSERT, CGuiRegistry::GetInstance(), CGuiRegistry::GetReadView(), CwxTableListCtrl::LoadTableSettings(), m_ListWidget, and m_RegPath.
Referenced by CSelectionView::LoadSettings().
void CSelectionPanel::OnContextMenu | ( | wxContextMenuEvent & | event | ) |
Definition at line 285 of file selection_panel.cpp.
References CleanupSeparators(), data, and NULL.
void CSelectionPanel::OnModeChanged | ( | wxCommandEvent & | event | ) |
Definition at line 311 of file selection_panel.cpp.
References eTable, m_DisplayMode, m_ListWidget, m_TextWidget, scm_ModeCmd, x_InitTextWidget(), and x_ResetObjectWidget().
void CSelectionPanel::OnSelServiceStateChange | ( | CSelectionServiceEvent & | update | ) |
Definition at line 343 of file selection_panel.cpp.
References _ASSERT, CSelectionServiceEvent::eActiveChanged, CSelectionServiceEvent::eClientAttached, CSelectionServiceEvent::eClientDetached, CSelectionServiceEvent::eSelectionChanged, CSelectionServiceEvent::GetClient(), CEvent::GetID(), CRef< C, Locker >::GetPointerOrNull(), CSelectionService::IsAttached(), CWeakIRef< Interface, Locker >::Lock(), m_CurrentClientWeakPtr, m_SelView, m_Service, NULL, Update(), x_ResetObjectWidget(), and x_ResetTargetChoice().
Referenced by CSelectionView::x_OnSelectionEvent().
void CSelectionPanel::OnTargetChanged | ( | wxCommandEvent & | event | ) |
Definition at line 306 of file selection_panel.cpp.
References x_ResetObjectWidget().
|
virtual |
Implements IRegSettings.
Definition at line 250 of file selection_panel.cpp.
References _ASSERT, CGuiRegistry::GetInstance(), CGuiRegistry::GetWriteView(), m_ListWidget, m_RegPath, and CwxTableListCtrl::SaveTableSettings().
Referenced by CSelectionView::SaveSettings().
Implements IRegSettings.
Definition at line 245 of file selection_panel.cpp.
References m_RegPath.
Referenced by CSelectionView::SetRegistryPath().
void CSelectionPanel::SetSelectionService | ( | CSelectionService * | service | ) |
Definition at line 235 of file selection_panel.cpp.
References m_CurrentClientWeakPtr, m_Service, NULL, and Update().
Referenced by CSelectionView::SetWorkbench().
void CSelectionPanel::Update | ( | void | ) |
Definition at line 387 of file selection_panel.cpp.
References x_ResetObjectWidget(), and x_ResetTargetChoice().
Referenced by CreateControls(), OnSelServiceStateChange(), SetSelectionService(), and CSelectionView::x_OnSelectionEvent().
|
protected |
Definition at line 331 of file selection_panel.cpp.
References eTable, CTextItemPanel::GetContext(), m_DisplayMode, m_ListWidget, m_SelObjects, m_TextWidget, CTextItemPanel::Selecting(), CObjectListWidget::SetObjects(), and x_InitTextWidget().
Referenced by x_ResetObjectWidget().
|
protected |
Definition at line 563 of file selection_panel.cpp.
References context, eBriefText, Error(), ICanceled::IsCanceled(), job_async(), CObjectTextItem::kBrief, CObjectTextItem::kFull, m_DisplayMode, m_Future, m_SelObjects, m_TextWidget, NCBI_REPORT_EXCEPTION, CTextItemPanel::ReportLoading(), result, and CException::what().
Referenced by OnModeChanged(), and x_InitCurrentWidget().
|
protected |
Definition at line 535 of file selection_panel.cpp.
References x_InitCurrentWidget(), and x_ResetSelObjects().
Referenced by OnModeChanged(), OnSelServiceStateChange(), OnTargetChanged(), and Update().
|
protected |
Definition at line 462 of file selection_panel.cpp.
References ACTIVE_VIEW_TARGET_IX, ALL_VIEWS_TARGET_IX, client, CSelectionService::GetClients(), CRef< C, Locker >::GetPointerOrNull(), set< Key, Compare >::insert(), ITERATE, CWeakIRef< Interface, Locker >::Lock(), m_CurrentClientWeakPtr, m_SelObjects, m_SelView, m_Service, m_TargetChoice, and remove_if().
Referenced by x_ResetObjectWidget().
|
protected |
Definition at line 394 of file selection_panel.cpp.
References ACTIVE_VIEW_TARGET_IX, ALL_VIEWS_TARGET_IX, client, CSelectionService::GetClients(), CRef< C, Locker >::GetPointerOrNull(), ISelectionClient::GetSelClientLabel(), ITERATE, CWeakIRef< Interface, Locker >::Lock(), m_CurrentClientWeakPtr, m_SelView, m_Service, m_TargetChoice, NULL, ncbi::grid::netcache::search::fields::size, ToWxString(), and wxT.
Referenced by OnSelServiceStateChange(), and Update().
|
protected |
Definition at line 129 of file selection_panel.hpp.
Referenced by OnSelServiceStateChange(), SetSelectionService(), x_ResetSelObjects(), and x_ResetTargetChoice().
|
protected |
Definition at line 132 of file selection_panel.hpp.
Referenced by CreateControls(), GetCurrentCtrl(), GetSelection(), OnModeChanged(), x_InitCurrentWidget(), and x_InitTextWidget().
|
protected |
Definition at line 139 of file selection_panel.hpp.
Referenced by x_InitTextWidget().
|
protected |
Definition at line 134 of file selection_panel.hpp.
Referenced by CreateControls(), GetCurrentCtrl(), GetSelection(), Init(), LoadSettings(), OnModeChanged(), SaveSettings(), and x_InitCurrentWidget().
|
protected |
Definition at line 137 of file selection_panel.hpp.
Referenced by LoadSettings(), SaveSettings(), and SetRegistryPath().
|
protected |
Definition at line 125 of file selection_panel.hpp.
Referenced by x_InitCurrentWidget(), x_InitTextWidget(), and x_ResetSelObjects().
|
protected |
Definition at line 123 of file selection_panel.hpp.
Referenced by OnSelServiceStateChange(), x_ResetSelObjects(), and x_ResetTargetChoice().
|
protected |
Definition at line 124 of file selection_panel.hpp.
Referenced by Init(), OnSelServiceStateChange(), SetSelectionService(), x_ResetSelObjects(), and x_ResetTargetChoice().
|
protected |
Definition at line 127 of file selection_panel.hpp.
Referenced by CreateControls(), Init(), x_ResetSelObjects(), and x_ResetTargetChoice().
|
protected |
Definition at line 135 of file selection_panel.hpp.
Referenced by CreateControls(), GetCurrentCtrl(), GetSelection(), Init(), OnModeChanged(), x_InitCurrentWidget(), and x_InitTextWidget().
Definition at line 64 of file selection_panel.hpp.
Referenced by CreateControls(), and OnModeChanged().