00001
00008 #ifndef __LGI_WIDGETS_H
00009 #define __LGI_WIDGETS_H
00010
00012 #ifdef IDM_STATIC
00013 #undef IDM_STATIC
00014 #endif
00015 #define IDM_STATIC -1
00016
00018 class GDialog;
00019 #if defined WIN32
00020 class GDlgFunc;
00021 #endif
00022 class GListItem;
00023 class GTreeItem;
00024
00025 class GButton;
00026 class GEdit;
00027 class GCheckBox;
00028 class GText;
00029 class GRadioGroup;
00030 class GRadioButton;
00031 class GTabView;
00032 class GTabPage;
00033 class GSlider;
00034 class GCombo;
00035 class GBitmap;
00036 class GList;
00037 class GTree;
00038
00040
00042 class LgiClass GLgiRes
00043 {
00044 public:
00046 bool LoadFromResource
00047 (
00049 int Resource,
00051 List<GView> &Children,
00053 GRect *Pos = 0,
00055 char *Name = 0
00056 );
00057 };
00058
00206 class LgiClass GDialog :
00207 public GWindow,
00208 public GLgiRes,
00209 public ResObject
00210 {
00211 friend class GControl;
00212
00213 private:
00214 bool IsModal;
00215 int ModalStatus;
00216
00217 #if defined WIN32
00218
00219 GMem *Mem;
00220
00221 #elif defined BEOS
00222
00223 sem_id ModalSem;
00224 int ModalRet;
00225
00226 #endif
00227
00228 protected:
00230 bool LoadFromResource
00231 (
00233 int Resource
00234 );
00235
00236 public:
00238 GDialog();
00239
00241 ~GDialog();
00242
00246 virtual int DoModal();
00247
00252 virtual int DoModeless();
00253
00255 virtual void EndModal(int Code = 0);
00256
00258 virtual void EndModeless(int Code = 0);
00259
00260 int OnEvent(GMessage *Msg);
00261 bool OnRequestClose(bool OsClose);
00262 void OnPosChange();
00263 };
00264
00266 class LgiClass GControl :
00267 public GView
00268 {
00269 friend class GDialog;
00270
00271 protected:
00272 #if defined BEOS
00273 bigtime_t Sys_LastClick;
00274 void MouseClickEvent(bool Down);
00275 #elif defined WIN32
00276 GWin32Class *SubClass;
00277 #endif
00278
00279 GdcPt2 SizeOfStr(char *Str);
00280
00281 public:
00282 #if defined WIN32
00283
00284 GControl(char *SubClassName = 0);
00285
00286 #else
00287
00288 GControl(OsView view);
00289
00290 #endif
00291
00292 ~GControl();
00293
00294 int OnEvent(GMessage *Msg);
00295
00296 #if defined BEOS // FIXME: Should be in GView?
00297 bool Attach(GView *parent);
00298 #endif
00299 };
00300
00302
00303 #if defined WIN32
00304 #define LGI_BUTTON "LGI_Button"
00305 #define LGI_EDITBOX "LGI_Editbox"
00306 #define LGI_CHECKBOX "LGI_CheckBox"
00307 #define LGI_TEXT "LGI_Text"
00308 #define LGI_RADIOGROUP "LGI_RadioGroup"
00309 #define LGI_TABCONTROL "LGI_TabControl"
00310 #define LGI_TABPAGE "LGI_TabPage"
00311 #define LGI_SLIDER "LGI_Slider"
00312 #define LGI_COMBO "LGI_Combo"
00313 #define LGI_BITMAP "LGI_Bitmap"
00314 #define LGI_LIST "LGI_ListView"
00315 #define LGI_TREE "LGI_TreeView"
00316 #define LGI_PROGRESS "LGI_Progress"
00317 #define LGI_SCROLLBAR "LGI_ScrollBar"
00318 #endif
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347 #endif
00348