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 GAutoString *Name = 0,
00057 char *TagList = 0
00058 );
00059 };
00060
00208 class LgiClass GDialog :
00209 public GWindow,
00210 public GLgiRes,
00211 public ResObject
00212 {
00213 friend class GControl;
00214
00215 private:
00216 bool IsModal, _Resizable;
00217 int ModalStatus;
00218
00219 #if WIN32NATIVE
00220
00221 GMem *Mem;
00222
00223 #elif defined BEOS
00224
00225 sem_id ModalSem;
00226 int ModalRet;
00227
00228 #endif
00229
00230 protected:
00232 bool LoadFromResource
00233 (
00235 int Resource,
00237 char *TagList = 0
00238 );
00239
00240 public:
00242 GDialog();
00243
00245 ~GDialog();
00246
00250 virtual int DoModal
00251 (
00253 OsView ParentHnd = 0
00254 );
00255
00260 virtual int DoModeless();
00261
00263 virtual void EndModal(int Code = 0);
00264
00266 virtual void EndModeless(int Code = 0);
00267
00268 int OnEvent(GMessage *Msg);
00269 bool OnRequestClose(bool OsClose);
00270 void OnPosChange();
00271
00272 #if defined(MAC)
00273 void OnPaint(GSurface *pDC);
00274 #elif defined(__GTK_H__)
00275 bool IsResizeable();
00276 void IsResizeable(bool r);
00277 #endif
00278 };
00279
00281 class LgiClass GControl :
00282 public GView
00283 {
00284 friend class GDialog;
00285
00286 protected:
00287 #if defined BEOS
00288 bigtime_t Sys_LastClick;
00289 void MouseClickEvent(bool Down);
00290 #elif WIN32NATIVE
00291 GWin32Class *SubClass;
00292 #endif
00293
00294 GdcPt2 SizeOfStr(const char *Str);
00295
00296 public:
00297 #if WIN32NATIVE
00298
00299 GControl(char *SubClassName = 0);
00300
00301 #else
00302
00303 GControl(OsView view = 0);
00304
00305 #endif
00306
00307 ~GControl();
00308
00309 int OnEvent(GMessage *Msg);
00310 };
00311
00313
00314 #if defined WIN32
00315 #define LGI_BUTTON "LGI_Button"
00316 #define LGI_EDITBOX "LGI_Editbox"
00317 #define LGI_CHECKBOX "LGI_CheckBox"
00318 #define LGI_TEXT "LGI_Text"
00319 #define LGI_RADIOGROUP "LGI_RadioGroup"
00320 #define LGI_TABCONTROL "LGI_TabControl"
00321 #define LGI_TABPAGE "LGI_TabPage"
00322 #define LGI_SLIDER "LGI_Slider"
00323 #define LGI_COMBO "LGI_Combo"
00324 #define LGI_BITMAP "LGI_Bitmap"
00325 #define LGI_LIST "LGI_ListView"
00326 #define LGI_TREE "LGI_TreeView"
00327 #define LGI_PROGRESS "LGI_Progress"
00328 #define LGI_SCROLLBAR "LGI_ScrollBar"
00329 #endif
00330
00332
00333 #ifdef MAC
00334
00335 struct GLabelData
00336 {
00337 GView *Ctrl;
00338 GSurface *pDC;
00339 GRect r;
00340 int Justification;
00341
00342 GLabelData()
00343 {
00344 Justification = 0;
00345 r.ZOff(0, 0);
00346 pDC = 0;
00347 Ctrl = 0;
00348 }
00349 };
00350
00351 void LgiLabelProc( const Rect *r,
00352 ThemeButtonKind kind,
00353 const ThemeButtonDrawInfo *info,
00354 UInt32 UserData,
00355 SInt16 depth,
00356 Boolean ColourDev);
00357
00358 extern ThemeButtonDrawUPP LgiLabelUPP;
00359
00360 #endif
00361
00362 #endif
00363