LXRAD 0.7
cwindow.h
Go to the documentation of this file.
1/* ########################################################################
2
3 LXRAD - GUI for X programing
4
5 ########################################################################
6
7 Copyright (c) : 2001 Luis Claudio Gamboa Lopes
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
12 any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
23 For e-mail suggestions : lcgamboa@yahoo.com
24 ######################################################################## */
25
32#ifndef CWINDOW
33#define CWINDOW
34
35#include"ccontrol.h"
36
37#define EVONCREATE (void(CControl::*)(CControl*))
38#define EVONDESTROY (void(CControl::*)(CControl*))
39#define EVONSHOW (void(CControl::*)(CControl*))
40#define EVONHIDE (void(CControl::*)(CControl*))
41#define EVONENTER (void(CControl::*)(CControl*))
42#define EVONLEAVE (void(CControl::*)(CControl*))
43
49class CWindow:public CControl
50{
51protected:
52 lxString Title;
53 unsigned long BorderColor;
54 bool CanDestroy;
55 CWindow *WParent;
56 bool CanExitExclusive;
57 bool OverrideRedirect;
58 int WNumber;
59 float VScale;
60 float HScale;
61 int CEvent (int event);
62 wxWindowDisabler * modalmode;
63public:
64 CWindow (void);
65 ~CWindow (void);
66 void Draw (void);
67 int Create (CControl * control);
68 void Destroy (void);
69 void DestroyChild (CControl * control);
70 void DestroyChilds (void);
71 virtual void WCreate (int WN, CWindow * window = NULL);
72 virtual void WDestroy (void);
73 void Show (void);
74 void ShowExclusive (void);
75 virtual void Hide (void);
76 void HideExclusive (void);
77 void Update (void);
78 int GetWNumber (void);
80 void SetContext (lxStringList context);
81 int LoadXMLContextAndCreateChilds (lxString filename, CControl * ctrl = NULL);
82 void SetFocus (void);
83 void SetControlOnFocus (CControl * control);
84 CControl *GetControlOnFocus (void);
85//propierty
86 virtual wxWindow* GetWWidget (void);
87 void SetCanDestroy (bool candestroy);
88 bool GetCanDestroy (void);
89 void SetOverrideRedirect (bool redirect);
90 bool GetOverrideRedirect (void);
91 bool GetCanExitExclusive(void);
92 void SetSaveUnder (bool saveunder);
93 void SetX (int x);
94 int GetX (void);
95 void SetY (int y);
96 int GetY (void);
97 void SetWidth (uint width);
98 uint GetWidth (void);
99 void SetHeight (uint height);
100 uint GetHeight (void);
101 void SetTitle (const lxString & title);
102 lxString GetTitle (void);
103 int GetHScale (int w);
104 int GetVScale (int h);
105 //operator
106 void *operator new (size_t sz);
107 void operator delete (void *p);
108 void Event (wxEvent & event);
109 //events
110 virtual void on_create (void);
111 virtual void on_destroy (void);
112 virtual void on_show (void);
113 virtual void on_hide (void);
114 virtual void on_enter (void);
115 virtual void on_leave (void);
116
117 void (CControl::*EvOnCreate) (CControl * win);
118 void (CControl::*EvOnDestroy) (CControl * win);
119 void (CControl::*EvOnShow) (CControl * win);
120 void (CControl::*EvOnHide) (CControl * win);
121 void (CControl::*EvOnEnter) (CControl * win);
122 void (CControl::*EvOnLeave) (CControl * win);
123};
124
125
126#endif
Generic Control.
Definition: ccontrol.h:47
Image Control.
Definition: cwindow.h:50
void SetContext(lxStringList context)
lxStringList GetContext(void)