00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00020 #ifndef __vtkKWTopLevel_h
00021 #define __vtkKWTopLevel_h
00022
00023 #include "vtkKWCoreWidget.h"
00024
00025 class vtkKWMenu;
00026 class vtkKWTclInteractor;
00027
00028 class KWWidgets_EXPORT vtkKWTopLevel : public vtkKWCoreWidget
00029 {
00030
00031 public:
00032 static vtkKWTopLevel* New();
00033 vtkTypeRevisionMacro(vtkKWTopLevel,vtkKWCoreWidget);
00034 void PrintSelf(ostream& os, vtkIndent indent);
00035
00037
00040 vtkSetStringMacro(WindowClass);
00041 vtkGetStringMacro(WindowClass);
00043
00045
00051 virtual void SetMasterWindow(vtkKWWidget* win);
00052 vtkGetObjectMacro(MasterWindow, vtkKWWidget);
00054
00058 virtual vtkKWApplication* GetApplication();
00059
00062 virtual void Display();
00063
00066 virtual void Withdraw();
00067
00069
00072 vtkSetClampMacro(Modal, int, 0, 1);
00073 vtkBooleanMacro(Modal, int);
00074 vtkGetMacro(Modal, int);
00076
00078
00079 virtual void GetBackgroundColor(double *r, double *g, double *b);
00080 virtual double* GetBackgroundColor();
00081 virtual void SetBackgroundColor(double r, double g, double b);
00082 virtual void SetBackgroundColor(double rgb[3])
00083 { this->SetBackgroundColor(rgb[0], rgb[1], rgb[2]); };
00085
00087
00090 virtual void SetBorderWidth(int);
00091 virtual int GetBorderWidth();
00093
00095
00098 virtual void SetHighlightThickness(int);
00099 virtual int GetHighlightThickness();
00101
00103
00106 virtual void SetRelief(int);
00107 virtual int GetRelief();
00108 virtual void SetReliefToRaised();
00109 virtual void SetReliefToSunken();
00110 virtual void SetReliefToFlat();
00111 virtual void SetReliefToRidge();
00112 virtual void SetReliefToSolid();
00113 virtual void SetReliefToGroove();
00115
00117
00125 virtual void SetPadX(int);
00126 virtual int GetPadX();
00127 virtual void SetPadY(int);
00128 virtual int GetPadY();
00130
00132
00146 enum
00147 {
00148 DisplayPositionDefault = 0,
00149 DisplayPositionMasterWindowCenter = 1,
00150 DisplayPositionMasterWindowCenterFirst = 2,
00151 DisplayPositionScreenCenter = 3,
00152 DisplayPositionScreenCenterFirst = 4,
00153 DisplayPositionPointer = 5
00154 };
00155
00156 vtkSetClampMacro(DisplayPosition, int,
00157 vtkKWTopLevel::DisplayPositionDefault,
00158 vtkKWTopLevel::DisplayPositionPointer);
00159 vtkGetMacro(DisplayPosition, int);
00160 virtual void SetDisplayPositionToDefault()
00161 { this->SetDisplayPosition(
00162 vtkKWTopLevel::DisplayPositionDefault); };
00163 virtual void SetDisplayPositionToMasterWindowCenter()
00164 { this->SetDisplayPosition(
00165 vtkKWTopLevel::DisplayPositionMasterWindowCenter); };
00166 virtual void SetDisplayPositionToMasterWindowCenterFirst()
00167 { this->SetDisplayPosition(
00168 vtkKWTopLevel::DisplayPositionMasterWindowCenterFirst); };
00169 virtual void SetDisplayPositionToScreenCenter()
00170 { this->SetDisplayPosition(
00171 vtkKWTopLevel::DisplayPositionScreenCenter); };
00172 virtual void SetDisplayPositionToScreenCenterFirst()
00173 { this->SetDisplayPosition(
00174 vtkKWTopLevel::DisplayPositionScreenCenterFirst); };
00175 virtual void SetDisplayPositionToPointer()
00176 { this->SetDisplayPosition(
00177 vtkKWTopLevel::DisplayPositionPointer); };
00179
00182 virtual void DeIconify();
00183
00185
00186 virtual void SetTitle(const char *);
00187 vtkGetStringMacro(Title);
00189
00191 virtual void SetTitleToTopLevelTitle(vtkKWWidget*);
00192
00194
00196 virtual int SetPosition(int x, int y);
00197 virtual int GetPosition(int *x, int *y);
00199
00201
00204 virtual int SetSize(int w, int h);
00205 virtual int GetSize(int *w, int *h);
00207
00209
00210 virtual int GetWidth();
00211 virtual int GetHeight();
00213
00215
00220 virtual int SetMinimumSize(int w, int h);
00221 virtual int GetMinimumSize(int *w, int *h);
00223
00225
00231 virtual int SetGeometry(const char *);
00232 virtual const char* GetGeometry();
00234
00236 virtual void Maximize();
00237
00239
00243 virtual void SetHideDecoration(int);
00244 vtkGetMacro(HideDecoration, int);
00245 vtkBooleanMacro(HideDecoration, int);
00247
00250 vtkKWMenu *GetMenu();
00251
00253
00259 virtual void SetDeleteWindowProtocolCommand(
00260 vtkObject *object, const char *method);
00262
00264 virtual void SetIconName(const char *name);
00265
00270 virtual void SetResizable(int w, int h);
00271
00273
00275 virtual vtkKWTclInteractor* GetTclInteractor();
00276 virtual void DisplayTclInteractor();
00278
00285 virtual void UpdateEnableState();
00286
00288
00296 enum
00297 {
00298 DisplayEvent = 5500,
00299 WithdrawEvent,
00300 SlaveDisplayEvent,
00301 SlaveWithdrawEvent
00302 };
00303
00305
00306
00307
00308 protected:
00309 vtkKWTopLevel();
00310 ~vtkKWTopLevel();
00311
00316 virtual void CreateWidget();
00317
00318 vtkKWWidget *MasterWindow;
00319 vtkKWMenu *Menu;
00320
00321 char *Title;
00322 char *WindowClass;
00323
00324 int HideDecoration;
00325 int Modal;
00326 int DisplayPosition;
00327
00329
00333 virtual int GetRequestedWidth();
00334 virtual int GetRequestedHeight();
00336
00339 virtual int ComputeDisplayPosition(int *x, int *y);
00340
00345 virtual void PostCreate();
00346
00347
00348
00349 private:
00350 vtkKWTopLevel(const vtkKWTopLevel&);
00351 void operator=(const vtkKWTopLevel&);
00352 };
00353
00354 #endif
00355