00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00022 #ifndef __vtkKWMenu_h
00023 #define __vtkKWMenu_h
00024
00025 #include "vtkKWCoreWidget.h"
00026
00027 class KWWIDGETS_EXPORT vtkKWMenu : public vtkKWCoreWidget
00028 {
00029 public:
00030 static vtkKWMenu* New();
00031 vtkTypeRevisionMacro(vtkKWMenu,vtkKWCoreWidget);
00032 void PrintSelf(ostream& os, vtkIndent indent);
00033
00035 virtual void Create(vtkKWApplication* app);
00036
00038
00039 void AddSeparator();
00040 void InsertSeparator(int position);
00042
00044
00045 void AddCascade(const char* label, vtkKWMenu*,
00046 int underline, const char* help = 0);
00047 void InsertCascade(int position, const char* label, vtkKWMenu*,
00048 int underline, const char* help = 0 );
00049 int GetCascadeIndex(vtkKWMenu *);
00051
00053
00054 void SetCascade(int index, vtkKWMenu*);
00055 void SetCascade(const char *label, vtkKWMenu*);
00056 void SetCascade(int index, const char *menu_name);
00057 void SetCascade(const char *label, const char *menu_name);
00059
00064 char* CreateCheckButtonVariable(vtkKWObject* Object, const char* name);
00065 int GetCheckButtonValue(vtkKWObject* Object, const char* name);
00066 void CheckCheckButton(vtkKWObject *Object, const char *name, int val);
00067 void AddCheckButton(const char* label, const char* ButtonVar,
00068 vtkObject* Object,
00069 const char* MethodAndArgString , const char* help = 0);
00070 void AddCheckButton(const char* label, const char* ButtonVar,
00071 vtkObject* Object,
00072 const char* MethodAndArgString , int underline,
00073 const char* help = 0);
00074 void InsertCheckButton(int position,
00075 const char* label, const char* ButtonVar,
00076 vtkObject* Object,
00077 const char* MethodAndArgString , const char* help = 0);
00078 void InsertCheckButton(int position,
00079 const char* label, const char* ButtonVar,
00080 vtkObject* Object,
00081 const char* MethodAndArgString ,
00082 int underline, const char* help = 0);
00084
00086
00087 void AddCommand(const char* label, vtkObject* Object,
00088 const char* MethodAndArgString , const char* help = 0);
00089 void AddCommand(const char* label, vtkObject* Object,
00090 const char* MethodAndArgString , int underline,
00091 const char* help = 0);
00092 void InsertCommand(int position, const char* label, vtkObject* Object,
00093 const char* MethodAndArgString , const char* help = 0);
00094 void InsertCommand(int position, const char* label, vtkObject* Object,
00095 const char* MethodAndArgString ,
00096 int underline, const char* help = 0);
00098
00100
00101 void SetEntryCommand(int index, vtkObject* object,
00102 const char* MethodAndArgString);
00103 void SetEntryCommand(const char* item, vtkObject* object,
00104 const char* method);
00105 void SetEntryCommand(int item, const char* method);
00106 void SetEntryCommand(const char* item, const char* method);
00108
00110
00112 char* CreateRadioButtonVariable(vtkKWObject* Object, const char* varname);
00113 int GetRadioButtonValue(vtkKWObject* Object, const char* varname);
00114 void CheckRadioButton(vtkKWObject *Object, const char *varname, int id);
00115 int GetCheckedRadioButtonItem(vtkKWObject *Object, const char *varname);
00116 void AddRadioButton(int value, const char* label, const char* buttonVar,
00117 vtkObject* Called,
00118 const char* MethodAndArgString, const char* help = 0);
00119 void AddRadioButton(int value, const char* label, const char* buttonVar,
00120 vtkObject* Called,
00121 const char* MethodAndArgString, int underline,
00122 const char* help = 0);
00123 void AddRadioButtonImage(int value, const char* imgname,
00124 const char* buttonVar, vtkObject* Called,
00125 const char* MethodAndArgString, const char* help = 0);
00126 void InsertRadioButton(int position, int value, const char* label,
00127 const char* buttonVar, vtkObject* Called,
00128 const char* MethodAndArgString, const char* help = 0);
00129 void InsertRadioButton(int position, int value, const char* label,
00130 const char* buttonVar, vtkObject* Called,
00131 const char* MethodAndArgString,
00132 int underline, const char* help = 0);
00134
00136
00137 void AddGeneric(const char* addtype, const char* label, vtkObject* Object,
00138 const char* MethodAndArgString, const char* extra,
00139 const char* help);
00140 void InsertGeneric(int position, const char* addtype, const char* label,
00141 vtkObject* Object,
00142 const char* MethodAndArgString, const char* extra,
00143 const char* help);
00145
00147
00148 void Invoke(int position);
00149 void Invoke(const char *label);
00151
00153
00156 void DeleteMenuItem(int position);
00157 void DeleteMenuItem(const char *label);
00158 void DeleteAllMenuItems();
00160
00162
00164 int GetIndexOfItem(const char *label);
00165 int GetIndexOfCommand(vtkObject* Object, const char* MethodAndArgString);
00167
00170 const char* GetItemCommand(int idx);
00171
00173
00177 int GetItemLabel(int position, char* label, int maxlen);
00178 const char* GetItemLabel(int position);
00180
00182
00183 int HasItemOption(int position, const char *option);
00184 const char* GetItemOption(int position, const char *option);
00185 const char* GetItemOption(const char *label, const char *option);
00187
00189
00192 void SetItemImage(int position, const char *imagename);
00193 void SetItemImage(const char *label, const char *imagename);
00194 void SetItemImageToPredefinedIcon(int position, int icon_index);
00195 void SetItemImageToPredefinedIcon(const char *label, int icon_index);
00197
00199
00203 void SetItemSelectImage(int position, const char *imagename);
00204 void SetItemSelectImage(const char *label, const char *imagename);
00205 void SetItemSelectImageToPredefinedIcon(int position, int icon_index);
00206 void SetItemSelectImageToPredefinedIcon(const char *label, int icon_index);
00208
00210
00212 void SetItemCompoundMode(int position, int flag);
00213 void SetItemCompoundMode(const char *label, int flag);
00215
00217
00220 void SetItemMarginVisibility(int position, int flag);
00221 void SetItemMarginVisibility(const char *label, int flag);
00223
00225
00227 void SetItemIndicatorVisibility(int position, int flag);
00228 void SetItemIndicatorVisibility(const char *label, int flag);
00230
00232
00233 void SetItemAccelerator(int position, const char *accelerator);
00234 void SetItemAccelerator(const char *label, const char *accelerator);
00236
00238 int HasItem(const char* label);
00239
00241 int GetNumberOfItems();
00242
00244 void DisplayHelp(const char*);
00245
00247
00249 void SetTearOff(int val);
00250 vtkGetMacro(TearOff, int);
00251 vtkBooleanMacro(TearOff, int);
00253
00255
00257 virtual void SetItemState(int index, int state);
00258 virtual void SetItemState(const char *label, int state);
00259 virtual int GetItemState(int index);
00260 virtual int GetItemState(const char *label);
00262
00267 virtual void SetState(int state);
00268
00270 void ConfigureItem(int index, const char*);
00271
00277 virtual void SetEnabled(int);
00278
00287 virtual void UpdateEnableState();
00288
00289 protected:
00290
00291 vtkKWMenu();
00292 ~vtkKWMenu();
00293
00294 int TearOff;
00295
00296 private:
00297 vtkKWMenu(const vtkKWMenu&);
00298 void operator=(const vtkKWMenu&);
00299 };
00300
00301
00302 #endif
00303
00304
00305