OWLNext    7.0
Borland's Object Windows Library for the modern age
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
flatctrl.h
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// ObjectWindows 1998 by Yura Bidus
3//
4/// \file
5/// Another implementation of Flat controls.
6/// It use ideas from Joseph Parrello, Dieter Windau,and Kirk Stowell
7///
8/// Definition of classes TFlatComboBox,TFlatEdit, TFlatListBox
9/// Definition of classes TGadgetComboBox, TGadgetEdit, TGadgetListBox
10//------------------------------------------------------------------------------
11
12#if !defined(OWL_FLATCTRL_H)
13#define OWL_FLATCTRL_H
14
15#include <owl/private/defs.h>
16#if defined(BI_HAS_PRAGMA_ONCE)
17# pragma once
18#endif
19
20#include <owl/combobox.h>
21#include <owl/edit.h>
22#include <owl/gadgetwi.h>
23#include <owl/bitset.h>
24
25
26namespace owl {
27
28#include <owl/preclass.h>
29
30/// \addtogroup newctrl
31/// @{
32
33class _OWLCLASS TFlatPainter : public TBitFlags<uint>{
34 public:
36 void SetFlatStyle(bool flat=true);
37 bool GetFlatStyle();
38
39 protected:
40 virtual bool IsFlat();
41 void Paint(TDC& dc, TRect& rect);
42 bool IdleAction(long idleCount);
43
44 enum TState{
45 fpFlatLook= 0x0001,
46 fpMouseIn = 0x0002,
47 };
48};
49
51 public:
52 TFlatComboBox(TWindow* parent, int id, int x, int y, int w, int h,
53 uint32 style, uint textLimit, TModule* module=0);
55 TModule* module = 0);
56
57 auto IdleAction(long idleCount) -> bool override;
58
59 protected:
60 void SetupWindow() override;
61 void EvPaint();
62
64};
65
66//
67/// For use with TGadgetWindow
68//
70 public:
71 TGadgetComboBox(TWindow* parent, int id, int x, int y, int w, int h,
72 uint32 style, uint textLimit, TModule* module=0);
74 TModule* module = 0);
75
76 protected:
77 virtual bool IsFlat();
78};
79
80//
81//
82//
83class _OWLCLASS TFlatEdit : public TEdit, public TFlatPainter {
84 public:
85 TFlatEdit(TWindow* parent, int id, LPCTSTR text, int x, int y, int w, int h,
86 uint textLimit=0, bool multiline=false,TModule* module=0);
87
89 TWindow* parent,
90 int id,
91 const tstring& text,
92 int x, int y, int w, int h,
93 uint textLimit = 0,
94 bool multiline = false,
95 TModule* = 0);
96
97 TFlatEdit(TWindow* parent, int resourceId, uint textLimit = 0,
98 TModule* module = 0);
99
100 auto IdleAction(long idleCount) -> bool override;
101
102 protected:
103 void SetupWindow() override;
104 void EvPaint();
105
107};
108
109//
110/// For use with TGadgetWindow
111//
113 public:
114 TGadgetEdit(TWindow* parent, int id, LPCTSTR text, int x, int y,
115 int w, int h, uint textLimit=0, bool multiline=false,
116 TModule* module=0);
117
119 TWindow* parent,
120 int id,
121 const tstring& text,
122 int x, int y, int w, int h,
123 uint textLimit = 0,
124 bool multiline = false,
125 TModule* = 0);
126
127 TGadgetEdit(TWindow* parent, int resourceId, uint textLimit = 0,
128 TModule* module = 0);
129
130 protected:
131 virtual bool IsFlat();
132};
133
134//
135/// \class TFlatListBox
136// ~~~~~ ~~~~~~~~~~~~
137//
139 public:
140 TFlatListBox(TWindow* parent, int Id, int x, int y, int w, int h,
141 TModule* module = 0);
142 TFlatListBox(TWindow* parent, int resourceId, TModule* module = 0);
143
144 auto IdleAction(long idleCount) -> bool override;
145
146 protected:
147 void SetupWindow() override;
148 void EvPaint();
149
151};
152
153//
154/// For use with TGadgetWindow
155//
157 public:
158 TGadgetListBox(TWindow* parent, int Id, int x, int y, int w, int h, TModule* module = 0);
159 TGadgetListBox(TWindow* parent, int resourceId, TModule* module = 0);
160
161 protected:
162 virtual bool IsFlat();
163};
164
165/// @}
166
167#include <owl/posclass.h>
168
169//
170// Inline functions
171//
172
173//
174// class TFlatPainter
175// ~~~~~ ~~~~~~~~~~~~
176//
177inline bool
179{
180 return IsFlat();
181}
182
183//
184inline bool
186{
187 return IsSet(fpFlatLook);
188}
189
190//
191// class TFlatComboBox
192// ~~~~~ ~~~~~~~~~~~~~
193//
194
195//
196inline
197TFlatComboBox::TFlatComboBox(TWindow* parent, int id, int x, int y, int w, int h,
198 uint32 style, uint textLimit, TModule* module)
199:
200 TComboBox(parent, id, x, y, w, h, style, textLimit,module)
201{
202}
203
204//
205inline
207 TModule* module)
208:
209 TComboBox(parent,resourceId, textLen,module)
210{
211}
212
213//
214inline bool
220
221
222//
223// class TGadgetComboBox
224// ~~~~~ ~~~~~~~~~~~~~~~
225//
226
227//
228inline
229TGadgetComboBox::TGadgetComboBox(TWindow* parent, int id, int x, int y, int w,
230 int h, uint32 style, uint textLimit, TModule* module)
231:
232 TFlatComboBox(parent, id, x, y, w, h,style, textLimit, module)
233{
234}
235
236//
237inline
239 TModule* module)
240:
241 TFlatComboBox(parent, resourceId, textLen, module)
242{
243}
244
245//
246// class TFlatEdit
247// ~~~~~ ~~~~~~~~~
248//
249
250//
251inline
252TFlatEdit::TFlatEdit(TWindow* parent, int id, LPCTSTR text, int x, int y, int w,
253 int h, uint textLimit, bool multiline,TModule* module)
254:
255 TEdit(parent,id,text,x,y,w,h,textLimit,multiline,module)
256{
257}
258
259inline
261 TWindow* parent,
262 int id,
263 const tstring& text,
264 int x, int y, int w, int h,
266 bool multiline,
267 TModule* module
268 )
269 : TEdit(parent, id, text, x, y, w, h, textLimit, multiline, module)
270{}
271
272//
273inline
275 TModule* module)
276:
277 TEdit(parent, resourceId, textLimit, module)
278{
279}
280
281//
282inline bool
288
289//
290// class TGadgetEdit
291// ~~~~~ ~~~~~~~~~~~
292//
293
294//
295inline
296TGadgetEdit::TGadgetEdit(TWindow* parent, int id, LPCTSTR text, int x, int y,
297 int w, int h, uint textLimit, bool multiline, TModule* module)
298:
299 TFlatEdit(parent, id, text, x, y,w, h, textLimit, multiline, module)
300{
301}
302
303inline
305 TWindow* parent,
306 int id,
307 const tstring& text,
308 int x, int y, int w, int h,
310 bool multiline,
311 TModule* module
312 )
313 : TFlatEdit(parent, id, text, x, y, w, h, textLimit, multiline, module)
314{}
315
316//
317inline
319 TModule* module)
320:
321 TFlatEdit(parent, resourceId, textLimit,module)
322{
323}
324
325//
326// class TFlatListBox
327// ~~~~~ ~~~~~~~~~~~~
328//
329
330//
331inline
332TFlatListBox::TFlatListBox(TWindow* parent, int Id, int x, int y, int w, int h,
333 TModule* module)
334:
335 TListBox(parent, Id, x, y, w, h, module)
336{
337}
338
339//
340inline
342:
343 TListBox(parent, resourceId, module)
344{
345}
346
347//
348inline bool
354
355//
356// class TGadgetListBox
357// ~~~~~ ~~~~~~~~~~~~~~
358//
359inline
360TGadgetListBox::TGadgetListBox(TWindow* parent, int Id, int x, int y, int w,
361 int h, TModule* module)
362:
363 TFlatListBox(parent, Id, x, y, w, h, module)
364{
365}
366
367//
368inline
370:
371 TFlatListBox(parent, resourceId, module)
372{
373}
374
375//
376//
377//
378} // OWL namespace
379
380#endif // OWL_FLATCTRL_H
Definition of a bit set and a character set.
For example:
Definition bitset.h:143
bool IsSet(uint t) const
Return true of the ON bits of the parameter are currently enabled.
Definition bitset.h:198
You can use TComboBox to create a combo box or a combo box control in a parent TWindow,...
Definition combobox.h:47
TDC is the root class for GDI DC wrappers.
Definition dc.h:64
A TEdit is an interface object that represents an edit control interface element.
Definition edit.h:34
auto IdleAction(long idleCount) -> bool override
Definition flatctrl.h:215
TFlatComboBox(TWindow *parent, int id, int x, int y, int w, int h, uint32 style, uint textLimit, TModule *module=0)
Definition flatctrl.h:197
DECLARE_RESPONSE_TABLE(TFlatComboBox)
DECLARE_RESPONSE_TABLE(TFlatEdit)
auto IdleAction(long idleCount) -> bool override
Definition flatctrl.h:283
TFlatEdit(TWindow *parent, int id, LPCTSTR text, int x, int y, int w, int h, uint textLimit=0, bool multiline=false, TModule *module=0)
Definition flatctrl.h:252
TFlatListBox(TWindow *parent, int Id, int x, int y, int w, int h, TModule *module=0)
Definition flatctrl.h:332
DECLARE_RESPONSE_TABLE(TFlatListBox)
auto IdleAction(long idleCount) -> bool override
Definition flatctrl.h:349
bool IdleAction(long idleCount)
Definition flatctrl.cpp:48
virtual bool IsFlat()
Definition flatctrl.h:185
bool GetFlatStyle()
Definition flatctrl.h:178
For use with TGadgetWindow.
Definition flatctrl.h:69
TGadgetComboBox(TWindow *parent, int id, int x, int y, int w, int h, uint32 style, uint textLimit, TModule *module=0)
Definition flatctrl.h:229
For use with TGadgetWindow.
Definition flatctrl.h:112
TGadgetEdit(TWindow *parent, int id, LPCTSTR text, int x, int y, int w, int h, uint textLimit=0, bool multiline=false, TModule *module=0)
Definition flatctrl.h:296
For use with TGadgetWindow.
Definition flatctrl.h:156
TGadgetListBox(TWindow *parent, int Id, int x, int y, int w, int h, TModule *module=0)
Definition flatctrl.h:360
An interface object that represents a corresponding list box element.
Definition listbox.h:43
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition module.h:75
TRect is a mathematical class derived from tagRect.
Definition geometry.h:308
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition window.h:414
virtual bool IdleAction(long idleCount)
Called when no messages are waiting to be processed, IdleAction performs idle processing as long as t...
Definition window.cpp:671
Definition of class TComboBox and TComboBoxData the base class for all combobox controls.
Definition of class TEdit.
Definition of TGadgetList, TGadgetWindow & TGadgetWindowFont A list holding gadgets,...
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
unsigned long uint32
Definition number.h:34
std::string tstring
Definition defs.h:79
unsigned int uint
Definition number.h:25
#define _OWLCLASS
Definition defs.h:338