00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00035 #ifndef __vtkKWUserInterfaceManagerNotebook_h
00036 #define __vtkKWUserInterfaceManagerNotebook_h
00037
00038 #include "vtkKWUserInterfaceManager.h"
00039
00040 class vtkKWApplication;
00041 class vtkKWIcon;
00042 class vtkKWNotebook;
00043 class vtkKWUserInterfacePanel;
00044 class vtkKWWidget;
00045 class vtkKWUserInterfaceManagerNotebookInternals;
00046
00047 class KWWIDGETS_EXPORT vtkKWUserInterfaceManagerNotebook : public vtkKWUserInterfaceManager
00048 {
00049 public:
00050 static vtkKWUserInterfaceManagerNotebook* New();
00051 vtkTypeRevisionMacro(vtkKWUserInterfaceManagerNotebook,vtkKWUserInterfaceManager);
00052 void PrintSelf(ostream& os, vtkIndent indent);
00053
00055
00058 virtual void SetNotebook(vtkKWNotebook*);
00059 vtkGetObjectMacro(Notebook, vtkKWNotebook);
00061
00065 virtual void Create(vtkKWApplication *app);
00066
00068
00075 virtual int AddPage(vtkKWUserInterfacePanel *panel,
00076 const char *title,
00077 const char *balloon = 0,
00078 vtkKWIcon *icon = 0);
00080
00082
00090 virtual vtkKWWidget* GetPageWidget(int id);
00091 virtual vtkKWWidget* GetPageWidget(vtkKWUserInterfacePanel *panel,
00092 const char *title);
00094
00101 virtual vtkKWWidget *GetPagesParentWidget(vtkKWUserInterfacePanel *panel);
00102
00104
00114 virtual void RaisePage(int id);
00115 virtual void RaisePage(vtkKWUserInterfacePanel *panel,
00116 const char *title);
00118
00120
00134 virtual int ShowPanel(vtkKWUserInterfacePanel *panel);
00135 virtual int HidePanel(vtkKWUserInterfacePanel *panel);
00136 virtual int IsPanelVisible(vtkKWUserInterfacePanel *panel);
00137 virtual int RaisePanel(vtkKWUserInterfacePanel *panel);
00139
00144 virtual void UpdatePanel(vtkKWUserInterfacePanel *panel);
00145
00148 virtual vtkKWUserInterfacePanel* GetPanelFromPageId(int page_id);
00149
00151
00154 virtual void SetEnableDragAndDrop(int);
00155 vtkBooleanMacro(EnableDragAndDrop, int);
00156 vtkGetMacro(EnableDragAndDrop, int);
00158
00160
00161 virtual void DragAndDropEndCallback(
00162 int x, int y,
00163 vtkKWWidget *widget, vtkKWWidget *anchor, vtkKWWidget *target);
00165
00167
00169 virtual int GetNumberOfDragAndDropEntries();
00170 virtual int DeleteAllDragAndDropEntries();
00172
00174
00179 virtual int GetDragAndDropEntry(
00180 int idx,
00181 ostream &widget_label,
00182 ostream &from_panel_name,
00183 ostream &from_page_title,
00184 ostream &from_after_widget_label,
00185 ostream &to_panel_name,
00186 ostream &to_page_title,
00187 ostream &to_after_widget_label);
00188 virtual int DragAndDropWidget(
00189 const char *widget_label,
00190 const char *from_panel_name,
00191 const char *from_page_title,
00192 const char *from_after_widget_label,
00193 const char *to_panel_name,
00194 const char *to_page_title,
00195 const char *to_after_widget_label);
00197
00199
00201 vtkBooleanMacro(LockDragAndDropEntries, int);
00202 vtkSetMacro(LockDragAndDropEntries, int);
00203 vtkGetMacro(LockDragAndDropEntries, int);
00205
00206
00207
00208
00209
00210
00211 class WidgetLocation
00212 {
00213 public:
00214 WidgetLocation();
00215 void Empty();
00216
00217 int PageId;
00218 vtkKWWidget *AfterWidget;
00219 };
00220
00221
00222
00223
00224
00225 class DragAndDropEntry
00226 {
00227 public:
00228 DragAndDropEntry();
00229
00230 vtkKWWidget *Widget;
00231 WidgetLocation FromLocation;
00232 WidgetLocation ToLocation;
00233 };
00234
00235
00236
00237 protected:
00238 vtkKWUserInterfaceManagerNotebook();
00239 ~vtkKWUserInterfaceManagerNotebook();
00240
00245 virtual int RemovePageWidgets(vtkKWUserInterfacePanel *panel);
00246
00247 vtkKWNotebook *Notebook;
00248
00250
00251 virtual void UpdatePanelDragAndDrop(vtkKWUserInterfacePanel *panel);
00252 int EnableDragAndDrop;
00253 int LockDragAndDropEntries;
00255
00256
00257
00259
00264 virtual int CanWidgetBeDragAndDropped(
00265 vtkKWWidget *widget, vtkKWWidget **anchor = 0);
00267
00271 virtual char* GetDragAndDropWidgetLabel(vtkKWWidget *widget);
00272
00273
00274
00275 vtkKWUserInterfaceManagerNotebookInternals *Internals;
00276 friend class vtkKWUserInterfaceManagerNotebookInternals;
00277
00279
00280 virtual int GetDragAndDropWidgetLocation(
00281 vtkKWWidget *widget, WidgetLocation *loc);
00283
00285
00287 virtual vtkKWWidget* GetDragAndDropWidgetFromLabelAndLocation(
00288 const char *widget_label, const WidgetLocation *loc_hint);
00290
00292 DragAndDropEntry* GetLastDragAndDropEntry(vtkKWWidget *Widget);
00293
00296 virtual int IsDragAndDropWidgetAtOriginalLocation(vtkKWWidget *widget);
00297
00299
00301 int AddDragAndDropEntry(
00302 vtkKWWidget *Widget,
00303 const WidgetLocation *from_loc,
00304 const WidgetLocation *to_loc);
00306
00308
00311 virtual int DragAndDropWidget(
00312 vtkKWWidget *widget,
00313 const WidgetLocation *from_loc,
00314 const WidgetLocation *to_loc);
00316
00317
00318
00319 private:
00320
00321 vtkKWUserInterfaceManagerNotebook(const vtkKWUserInterfaceManagerNotebook&);
00322 void operator=(const vtkKWUserInterfaceManagerNotebook&);
00323 };
00324
00325 #endif
00326