ALBA
albaGUIMDIFrame.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGUIMDIFrame
5 Authors: Silvano Imboden
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16#ifndef __albaGUIMDIFrame_H__
17#define __albaGUIMDIFrame_H__
18//----------------------------------------------------------------------------
19// Include:
20//----------------------------------------------------------------------------
21#include <wx/laywin.h>
22#include <wx/mdi.h>
23#include <vector>
24#include "albaGUIDockManager.h"
25#include "albaServiceClient.h"
26
27
28//----------------------------------------------------------------------------
29// forward reference
30//----------------------------------------------------------------------------
31class albaObserver;
32class vtkAlgorithm;
33class vtkViewport;
34class vtkObject;
35class albaGUIMDIFrameCallback;
36class vtkAlgorithm;
37class albaGUI;
43class ALBA_EXPORT albaGUIMDIFrame: public wxMDIParentFrame, public albaServiceClient
44{
45 public:
47 albaGUIMDIFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style=0);
50
52 void SetListener(albaObserver *Listener) {m_Listener = Listener;};
53
55 albaGUIDockManager& GetDockManager() {return m_DockManager;};
56
58 void OnQuit();
59
62 void AddDockPane(wxWindow *window, wxPaneInfo& pane_info, const wxString &menu = _("&View"), const wxString &subMenu = wxEmptyString);
63
65 void RemoveDockPane(wxString pane_name);
66
68 void ShowDockPane(wxString pane_name, bool show = true);
70 void ShowDockPane(wxWindow *window, bool show = true);
71
73 bool DockPaneIsShown(wxString pane_name);
75 bool DockPaneIsShown(wxWindow *window);
76
78 void Busy();
79
81 void Ready();
82
85
88
90 void ProgressBarSetVal(int progress);
91
94
96 void ProgressBarSetText(wxString *msg);
97
100
102 void RenderEnd();
103
104//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
105#ifdef ALBA_USE_VTK
106//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
107
109 void BindToProgressBar(vtkObject* vtkobj);
110
112 void BindToProgressBar(vtkAlgorithm* filter);
113
115 void BindToProgressBar(vtkViewport* ren);
116
118 void OnSize(wxSizeEvent& event);
119
120protected:
121 albaGUIMDIFrameCallback *m_StartCallback;
122 albaGUIMDIFrameCallback *m_EndCallback; ;
123 albaGUIMDIFrameCallback *m_ProgressCallback;
124
125//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
126#endif //ALBA_USE_VTK
127//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
128protected:
129
131 void OnMenu(wxCommandEvent& e);
132
134 void OnMenuOp(wxCommandEvent& e);
135
137 void OnMenuView(wxCommandEvent& e);
138
140 void OnUpdateUI(wxUpdateUIEvent& e);
141
143 void OnCloseWindow(wxCloseEvent& event);
144
146 void OnSashDrag(wxSashEvent& event);
147
149 void OnLayout(wxCommandEvent& event);
150
152 void OnIdle(wxIdleEvent& event);
153
155 void FreeMemorySizeOnIdle(wxIdleEvent& event);
156
158 void OnDropFile(wxDropFilesEvent &event);
159
162
165
167 void OnMenuWizard(wxCommandEvent& e);
168
169
171
172 // added members to handle the progress bar
173 bool *m_Busy;
174 wxPanel *m_BusyPanel;
175 wxStaticText *m_BusyLabel;
176 wxGauge *m_Gauge;
177 std::vector<int> m_PBCalls;
179
182
183 // AUI Layout Manager - //SIL. 23-may-2006 :
185
187 DECLARE_EVENT_TABLE()
188};
189#endif
class name: albaGUIDockManager Represent a frame manager for gui dock elements.
Class Name: albaGUIMDIFrame.
bool DockPaneIsShown(wxString pane_name)
tell if a given Dockable Pane is shown – the Paneis specified by name
void AddDockPane(wxWindow *window, wxPaneInfo &pane_info, const wxString &menu=_("&View"), const wxString &subMenu=wxEmptyString)
add a new Dockable Pane containing the given Window.
void OnCloseWindow(wxCloseEvent &event)
Send the MENU_FILE_QUIT event.
void ProgressBarSetText(wxString *msg)
Set the progress text for the progress bar.
void ShowDockPane(wxWindow *window, bool show=true)
Show/Hide a Dockable Pane – the Pane is specified by content.
albaGUIMDIFrame(const wxString &title, const wxPoint &pos, const wxSize &size, long style=0)
constructor.
wxPanel * m_BusyPanel
albaObserver * m_Listener
void FreeMemorySizeOnIdle(wxIdleEvent &event)
Update the memory status on the status bas , with information that needs to walk the heap (bad perfor...
void OnDropFile(wxDropFilesEvent &event)
Send an event to open the msf or zip file.
void OnUpdateUI(wxUpdateUIEvent &e)
Send the UI event.
albaGUIDockManager m_DockManager
void Ready()
End the progress.
void LayoutWindow()
Redraw widgets on interface.
void OnSashDrag(wxSashEvent &event)
Redraw sash panels.
void OnMenuOp(wxCommandEvent &e)
Send the 'Operations' men event.
void OnMenuView(wxCommandEvent &e)
Send the 'Views' men event.
void OnMenu(wxCommandEvent &e)
Send the men event.
void ProgressBarHide()
Hide the progress bar.
void OnIdle(wxIdleEvent &event)
Update the memory status on the status bas.
void ProgressBarSetVal(int progress)
Set the progress value for the progress bar.
int m_MemoryLimitAlert
Used to alert the user when memory decrease under this limit value.
void RenderStart()
Start rendering progress.
bool DockPaneIsShown(wxWindow *window)
tell if a given Dockable Pane is shown – the Pane is specified by content
~albaGUIMDIFrame()
destructor.
void OnLayout(wxCommandEvent &event)
Call LayoutWindow method.
albaGUIDockManager & GetDockManager()
Retrieve the Docking Manager.
void CreateStatusbar()
Create the status bar on main application frame.
void RenderEnd()
End rendering progress.
void SetListener(albaObserver *Listener)
Set the listener object, i.e.
void ShowDockPane(wxString pane_name, bool show=true)
Show/Hide a Dockable Pane – the Pane is specified by name.
void OnQuit()
must be called @ shutdown
void ProgressBarShow()
Show the progress bar.
void Busy()
Show the 'Busy' text on the status bar.
wxStaticText * m_BusyLabel
int ProgressBarGetStatus()
Get the progress bar status.
void RemoveDockPane(wxString pane_name)
remove a Dockable Pane - the contained window is not destroyed
std::vector< int > m_PBCalls
void OnMenuWizard(wxCommandEvent &e)
Send the 'Wizard' men event.
albaGUI is a panel with function to easily create GUI.
Definition: albaGUI.h:110
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36
class name: wxPaneInfo This class define properties of a pane.