46 #include <wx/msgdlg.h>
47 #include <wx/dialog.h>
73 if (!view->InitView(
objects, 0)) {
80 prj_srv->OnViewAttached(view);
94 "simple_project_view",
100 m_WidgetFactory(widgetFactory),
102 m_CmdHandler(cmdHandler)
113 if (handles.size() > 0) {
128 vector<CIRef<IProjectView>> views;
133 if (&*view->GetScope() == &scope
139 if (pTextView &&
count == 1) {
165 if (
dynamic_cast<wxDialog*
>(
m_Widget) == 0)
return;
168 CWindowManager* windowManager = srv ? srv->GetWindowManager() : 0;
170 windowManager->OnFocusChanged(
m_Widget);
184 prjSrv->ShowView(viewName, widgetFactory,
objects, bFloat);
197 return (
dynamic_cast<wxDialog*
>(
m_Widget) != 0);
212 if (guiWidget) guiWidget->
SetHost(
this);
235 wxMessageBox(
ToWxString(view_name +
": widget not created."),
wxT(
"Simple view error"), wxOK | wxICON_EXCLAMATION);
250 if (!ws)
return false;
254 if (!doc)
return false;
269 if (!guiWidget)
return;
285 if (!guiWidget)
return;
297 if (!guiWidget)
return;
311 if (!guiWidget)
return;
313 vector<TConstScopedObjects> widgetObjects;
315 if (!widgetObjects.empty() && !widgetObjects.back().empty())
316 objs.insert(objs.end(), widgetObjects.back().begin(), widgetObjects.back().end());
322 if (!guiWidget)
return;
324 vector<TConstScopedObjects> widgetObjects;
326 ITERATE(vector<TConstScopedObjects>, it, widgetObjects)
333 if (!guiWidget)
return;
350 if (!guiWidget)
return;
CEvent - generic event implementation TODO TODO - Attachments.
CUndoManager & GetUndoManager()
CProjectService - a service providing API for operations with Workspaces and Projects.
void ActivateProjectView(IProjectView *projectView)
IProjectView * FindView(const CObject &mainObject, const string &viewType)
void RemoveProjectView(IProjectView &view)
removes the view from View manager Service and disconnects it from the project
void FindViews(vector< CIRef< IProjectView > > &projectViews, const CObject &mainObject)
CProjectViewBase - default implementation of IProjectView, the base class for CProjectView and CProje...
virtual void x_ReportInvalidInputData(TConstScopedObjects &objects)
use this function to report incompatible data in InitView()
virtual void OnProjectChanged()
virtual void x_UpdateContentLabel()
virtual string GetClientLabel(IWMClient::ELabel ltype=IWMClient::eDefault) const
returns the client label (name) to be displayed in UI
virtual objects::CScope * x_GetScope() const
virtual void x_AttachToProject(CGBDocument &doc)
virtual void RefreshViewWindow()
virtual bool x_HasProject() const
EEventSubtype GetSubtype() const
CSelectionEvent CSelectionEvent is used for broadcasting selection between views.
void GetAllObjects(TConstObjects &objs) const
void GetOther(TConstObjects &objs) const
bool AddObjectSelection(const CObject &obj)
Base class for all serializable objects.
FWindowFactory m_WidgetFactory
virtual void OnWidgetCommand(const string &command)
void x_ActivateTextView(CProjectService &prjSrv)
virtual void CloseWidget()
IGuiWidgetHost implementation.
CIRef< ISimpleProjectViewCmdHandler > m_CmdHandler
virtual void CreateViewWindow(wxWindow *parent)
create Window corresponding to the view
virtual bool InitView(TConstScopedObjects &objects, const objects::CUser_object *params)
IProjectView implementation.
CSimpleProjectView(const string &viewName, FWindowFactory widgetFactory, ISimpleProjectViewCmdHandler *cmdHandler)
virtual void WidgetActivated()
static CIRef< IProjectView > CreateView(const string &viewName, FWindowFactory widgetFactory, IServiceLocator *serviceLocator, TConstScopedObjects &objects, ISimpleProjectViewCmdHandler *cmdHandler=0, bool bFloat=false)
virtual void DestroyViewWindow()
destroy Window corresponding to the view
virtual void GetSelection(CSelectionEvent &evt) const
ISelectionClient Implementation.
virtual void WidgetSelectionChanged()
virtual void GetActiveObjects(TConstScopedObjects &objects) const
virtual void GetMainObject(TConstScopedObjects &objs) const
Adds the main data objects represented by the client to "objects".
virtual wxWindow * GetWindow()
IWMClient implementation.
virtual void ShowView(const string &viewName, FWindowFactory widgetFactory, TConstScopedObjects &objects, bool bFloat)
CProjectViewTypeDescriptor m_ViewDescr
virtual const CViewTypeDescriptor & GetTypeDescriptor() const
IView implementation.
virtual bool IsADialog() const
returns true if client is a non-modal dioalog
@ eWidgetSelectionChanged
a view has been destroyed
CViewTypeDescriptor - holds description of a view type.
CWindowManager - component controlling windowing of client windows.
IServiceLocator - an abstract mechanism for locating services.
IViewManagerService IViewManagerService manages views in Workbench.
IWClient - abstract Window Manager client.
virtual void SetFingerprint(const string &)
IWindowManagerService Window Manager Service provides access to Window Manager functionality.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
virtual const CObject * x_GetOrigObject() const
CProjectViewBase overridables.
virtual void x_OnSetSelection(CSelectionEvent &evt)
override in derived classes in order to handle selection broadcast
CIRef< T > GetServiceByType()
retrieves a typed reference to a service, the name of C++ type is used as the name of the service.
virtual void AddToWorkbench(IView &view, bool bFloat=false)=0
adds view to Workbench and connects to the services the view must be already initialized
virtual void RemoveFromWorkbench(IView &view)=0
disconnects view from services and removes from the Workbench
vector< CConstRef< CObject > > TConstObjects
virtual const string & GetLabel() const
vector< SConstScopedObject > TConstScopedObjects
virtual bool Send(CEvent *evt, EDispatch disp_how=eDispatch_Default, int pool_name=ePool_Default)
Sends an event synchronously.
@ eEvent_Message
message from one class to another
virtual const CTypeInfo * GetThisTypeInfo(void) const =0
void GetAllTSEs(TTSE_Handles &tses, enum ETSEKind kind=eManualTSEs)
vector< CSeq_entry_Handle > TTSE_Handles
CSeq_entry_Handle GetTopLevelEntry(void) const
Get top level Seq-entry handle.
CConstRef< CSeq_entry > GetCompleteSeq_entry(void) const
Complete and get const reference to the seq-entry.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
TObjectType & GetObject(void) const
Get object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
const string & GetName(void) const
Get name of this type.
wxString ToWxString(const string &s)