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 GViewI *Parent,
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, _Resizable;
00215 int ModalStatus;
00216
00217 #if WIN32NATIVE
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 (
00249 OsView ParentHnd = 0
00250 );
00251
00256 virtual int DoModeless();
00257
00259 virtual void EndModal(int Code = 0);
00260
00262 virtual void EndModeless(int Code = 0);
00263
00264 int OnEvent(GMessage *Msg);
00265 bool OnRequestClose(bool OsClose);
00266 void OnPosChange();
00267
00268 #if defined(MAC)
00269 void OnPaint(GSurface *pDC);
00270 #elif defined(__GTK_H__)
00271 bool IsResizeable();
00272 void IsResizeable(bool r);
00273 #endif
00274 };
00275
00277 class LgiClass GControl :
00278 public GView
00279 {
00280 friend class GDialog;
00281
00282 protected:
00283 #if defined BEOS
00284 bigtime_t Sys_LastClick;
00285 void MouseClickEvent(bool Down);
00286 #elif WIN32NATIVE
00287 GWin32Class *SubClass;
00288 #endif
00289
00290 GdcPt2 SizeOfStr(char *Str);
00291
00292 public:
00293 #if WIN32NATIVE
00294
00295 GControl(char *SubClassName = 0);
00296
00297 #else
00298
00299 GControl(OsView view = 0);
00300
00301 #endif
00302
00303 ~GControl();
00304
00305 int OnEvent(GMessage *Msg);
00306 };
00307
00309
00310 #if defined WIN32
00311 #define LGI_BUTTON "LGI_Button"
00312 #define LGI_EDITBOX "LGI_Editbox"
00313 #define LGI_CHECKBOX "LGI_CheckBox"
00314 #define LGI_TEXT "LGI_Text"
00315 #define LGI_RADIOGROUP "LGI_RadioGroup"
00316 #define LGI_TABCONTROL "LGI_TabControl"
00317 #define LGI_TABPAGE "LGI_TabPage"
00318 #define LGI_SLIDER "LGI_Slider"
00319 #define LGI_COMBO "LGI_Combo"
00320 #define LGI_BITMAP "LGI_Bitmap"
00321 #define LGI_LIST "LGI_ListView"
00322 #define LGI_TREE "LGI_TreeView"
00323 #define LGI_PROGRESS "LGI_Progress"
00324 #define LGI_SCROLLBAR "LGI_ScrollBar"
00325 #endif
00326
00328
00329 #ifdef MAC
00330
00331 struct GLabelData
00332 {
00333 GView *Ctrl;
00334 GSurface *pDC;
00335 GRect r;
00336 int Justification;
00337
00338 GLabelData()
00339 {
00340 Justification = 0;
00341 r.ZOff(0, 0);
00342 pDC = 0;
00343 Ctrl = 0;
00344 }
00345 };
00346
00347 void LgiLabelProc( const Rect *r,
00348 ThemeButtonKind kind,
00349 const ThemeButtonDrawInfo *info,
00350 UInt32 UserData,
00351 SInt16 depth,
00352 Boolean ColourDev);
00353
00354 extern ThemeButtonDrawUPP LgiLabelUPP;
00355
00356 #endif
00357
00358 #endif
00359