OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
bardescr.cpp
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectWindows
3// Copyright (c) 1998 by Yura Bidus, All Rights Reserved
4//
5/// \file
6/// Implementation of class TBarDescr
7//----------------------------------------------------------------------------
8
9#include <owl/pch.h>
10
11#include <owl/resource.h>
12#include <owl/celarray.h>
13#include <owl/gadget.h>
14#include <owl/buttonga.h>
15#include <owl/gadgetwi.h>
16#include <owl/functor.h>
17#include <owl/bardescr.h>
18#include <owl/template.h>
19#include <owl/functor.h>
20#include <owl/glyphbtn.h>
21#include "strmresid.h"
22
23namespace owl {
24
26/// \cond
27struct __TBarDescrGdNode {
28 __TBarDescrGdNode(TGadget* gd, bool ug): Gadget(gd),UseGlyph(ug){}
29 ~__TBarDescrGdNode();
30 TGadget* Gadget;
31 bool UseGlyph;
32};
33//
34__TBarDescrGdNode::~__TBarDescrGdNode()
35{
36 delete Gadget;
37}
38//
39class TBarDescrGdArray: public TIPtrArray<__TBarDescrGdNode*>{ // internal usage
40 public:
41 TBarDescrGdArray(int count):TIPtrArray<__TBarDescrGdNode*>(count){}
42};
43/// \endcond
44
45//
46//
47//
48static TGadget* CreateGadget(int index, int id, bool& usecell)
49{
50 usecell = false;
51 if(id == 0)
52 return new TSeparatorGadget;
53 usecell = true;
54 return new TButtonGadget(index,
55 id,
57 false,
59}
60
61// -----------------------------------------------------------------------------
62////////////////////////////////////////////////////////////////////////////////
63// class TBarDescr
64// ~~~~~ ~~~~~~~~~
65
66/// \class TBarDescr
67/// TBarDescr describes your control bar and its functional groups. TBarDescr
68/// provides an easy way for you to group gadgets on your control bar and to add new
69/// groups to an existing control bar. It uses a resource ID to identify the bar
70/// resource and an array of count values to indicate the number of gadgets in each
71/// group on the control bar.
72///
73/// The TGroup enum enumerates the six basic functional groups on a control bar:
74/// File, Edit, Container, Object, Window, and Help. TBarDescr's constructors simply
75/// initialize the members based on the arguments passed.
76///
77/// TFrameWindow::MergeBar actually performs the real work of merging the gadgets
78/// groups.
79///
80/// For a single document application (SDI), the gadgets are merged as soon as you
81/// load the application. See the sample program, bardescm, for an example of MDI
82/// control bar merging, and bardescr, for an example of SDI control bar merging.
83///
84/// One technique you can use to create a control bar involves invoking the
85/// TBarDescr constructor and passing the number of group counts for each gadgets
86/// selection.
87///
88/// For example, if your original gadgets groups included these items:
89/// \image html bm78.BMP
90/// you might use the following group counts:
91/// <TABLE>
92/// <TR><TD>Group</TD> <TD>Count</TD> <TD>Menu</TD></TR>
93/// <TR><TD>FileGroup</TD> <TD>1</TD> <TD>File</TD></TR>
94/// <TR><TD>EditGroup</TD> <TD>2</TD> <TD>Edit Search</TD></TR>
95/// <TR><TD>ContainerGroup</TD> <TD>1</TD> <TD>View</TD></TR>
96/// <TR><TD>ObjectGroup</TD> <TD>3</TD> <TD>Page Paragraph Word</TD></TR>
97/// <TR><TD>WindowGroup</TD> <TD>1</TD> <TD>Window</TD></TR>
98/// <TR><TD>HelpGroup</TD> <TD>1</TD> <TD>Help</TD></TR>
99/// </TABLE>
100/// You would then invoke the constructor this way:
101/// \code
102/// TBarDescr(IDM_MYMENU, 1, 2, 1, 3, 1, 1)
103/// \endcode
104/// You can build the previous control bar by merging two control bars. When a zero
105/// is passed in the TBarDescr's constructor, the group indicated by the zero is
106/// filled in by the child control bar's group, if an item is specified, when the
107/// bar merging occurs. Set your application's parent frame control bar by
108/// specifying these gadget groups:
109/// \image html bm79.BMP
110/// and passing these group counts in the constructor:
111/// \code
112/// TBarDescr(IDM_FRAME, 1, 0, 1, 0, 1, 1)
113/// \endcode
114/// Set the word-processor child control bar this way:
115/// \image html bm80.BMP
116/// and pass these values in the constructor:
117/// \code
118/// TBarDescr(IDM_WPROC, 0, 2, 0, 3, 0, 1)
119/// \endcode
120/// If no child is active, only the frame menu will be active. When the word
121/// processor's child window becomes active, the child control bar is merged with
122/// the frame bar. Every group that is 0 in the child control bar leaves the
123/// parent's group intact. The previous example interleaves every group except for
124/// the last group, the Help group, in which the child replaces the frame bar.
125///
126/// By convention, the even groups (File, Container, Window) usually belong to the
127/// outside frame or container, and the odd groups (Edit, Object, Help) belong to
128/// the child or contained group.
129///
130/// If a -1 is used in a group count, the merger eliminates the parent's group
131/// without replacing it. For example, another child control bar, such as a
132/// calculator, could be added to your application in this way:
133/// \image html bm81.BMP
134/// \code
135/// TBarDescr(IDM_WCALC, 0, 1, -1, 1, 0, 1)
136/// \endcode
137/// In this example, the child's control group contributes nothing from the
138/// container group, and the parent's container group is removed. This produces a
139/// merged bar (with the View control bar selection eliminated as a result of the
140/// -1) that looks like this:
141/// \image html bm82.BMP
142///
143/// If you want to merge the following parent gadget groups
144/// \image html bm79.BMP
145/// with these paint window gadget groups,
146/// \image html bm83.BMP
147/// pass the following group counts in the constructor:
148/// \code
149/// TBarDescr(IDM_WPAINT, 0, 1, 0, 2, 0, 1)
150/// \endcode
151/// This produces the following merged control bar:
152/// \image html bm84.BMP
153///
154/// The simplest way to add groups to a control bar involves defining the control
155/// groups and adding separators in a resource file. Insert the term BUTTON -1
156/// between each gadgets group and an additional separator if one of the gadgets
157/// groups is not present. For example, the resource file for Step 13 of the
158/// ObjectWindows tutorial defines the following gadgets groups and separators:
159/// \code
160/// IDB_DVMDI TOOLBAR 20, 20
161/// {
162/// BUTTON CM_FILENEW
163/// BUTTON CM_FILEOPEN
164/// BUTTON CM_FILESAVE
165/// BUTTON CM_FILESAVEAS
166/// SEPARATOR
167/// BUTTON -1
168/// BUTTON -1
169/// BUTTON CM_ABOUT
170/// BUTTON -1
171/// }
172/// IDB_DVMDI BITMAP "dvmain.bmp"
173/// \endcode
174/// You can see the separators by loading Step13.rc into Resource Workshop.
175///
176/// Step13.cpp uses these commands from the resource file to set the main window and
177/// its menu, passing IDM_MDICMNDS as the parameter to SetMenuDescr function, as
178/// follows:
179/// \code
180/// frame->SetBarDescr(new TBarDescr(IDB_DVMDI));
181/// \endcode
182/// It produces the following menu groups:
183/// \image html bm85.BMP
184///
185/// TBarDescr's functions let you perform control bar merging similar to menu
186/// merging. That is, you can merge control bars from a MDI frame window, with
187/// those of an the MDI child window. When child is selected, the control bars of
188/// the child window merges with that of the frame window.
189
190
191
192
193
194/// Default constructor for a TBarDescr object. No menu resources or groups are
195/// specified. Constructs an empty control bar. For internal use only.
197:
198 BarRes(0),
199 CelArray(0),
200 Id(0),
201 Module(0)
202{
203 GadgetFunctor = new TGadgetFunctor;
204 SetBuilder(TGadget_FUNCTOR(CreateGadget));
205 Gadgets = new TBarDescrGdArray(5);
206 for (int i = 0; i < NumGroups; i++)
207 GroupCount[i] = 0;
208
209}
210// -----------------------------------------------------------------------------
211/// Not implemented. Forbidden and protected contructor.
213:
214 Id(bar.Id),
215 Module(bar.Module)
216{
217 GadgetFunctor = new TGadgetFunctor;
218 SetBuilder(TGadget_FUNCTOR(CreateGadget));
219
220 Gadgets = new TBarDescrGdArray(5);
221 BarRes = new TToolbarRes(*bar.BarRes);
222
223 CHECK(BarRes->IsOK());
224 { // map colors
225 TBtnBitmap bitmap(BarRes->GetBitmap(),
228 }
229 CelArray = new TCelArray(&BarRes->GetBitmap(),
230 BarRes->GetCount(),
231 TSize(BarRes->GetWidth(), BarRes->GetHeight()),
232 TPoint(0, 0), // offset
233 BarRes->GetBitmap().Height()/BarRes->GetHeight());
235}
236// -----------------------------------------------------------------------------
237/// Creates a control bar descriptor from the controlbar resource specified in the
238/// id parameter. Calls the function ExtractGroups to extract the group counts based
239/// on the separator items in the control bar.
241:
242 Id(barResId),
243 Module(module),
244 BarRes(0),
245 CelArray(0)
246{
247 GadgetFunctor = new TGadgetFunctor;
248 SetBuilder(TGadget_FUNCTOR(CreateGadget));
249
250 Gadgets = new TBarDescrGdArray(5);
251
252 SetBitmap(barResId, module);
253
255}
256// -----------------------------------------------------------------------------
257/// Constructs a control bar descriptor from the resource indicated by id. Places
258/// the gadgets in groups according the values of the fg, eg, cg, of, wg, and hg
259/// parameters. The fg, eg, cg, of, wg, and hg parameters represent the functional
260/// groups identified by the TGroup enum. Calls the function ExtractGroups to
261/// extract the group counts based on the separator items in the menu bar.
262TBarDescr::TBarDescr(TResId id, int fg, int eg, int cg, int og, int wg,
263 int hg, TModule* module)
264:
265 Id(id),
266 Module(module),
267 BarRes(0),
268 CelArray(0)
269{
270 GadgetFunctor = new TGadgetFunctor;
271 SetBuilder(TGadget_FUNCTOR(CreateGadget));
272
273 Gadgets = new TBarDescrGdArray(5);
274
275 SetBitmap(id, module);
276
277 if (!ExtractGroups()) {
278 GroupCount[FileGroup] = fg;
279 GroupCount[EditGroup] = eg;
280 GroupCount[ContainerGroup] = cg;
281 GroupCount[ObjectGroup] = og;
282 GroupCount[WindowGroup] = wg;
283 GroupCount[HelpGroup] = hg;
284 }
285}
286// -----------------------------------------------------------------------------
287/// Destroys the TBarDescr object.
289{
290 delete Gadgets;
291 delete BarRes;
292 delete CelArray;
293 delete GadgetFunctor;
294}
295//
297{
298 *GadgetFunctor = functor;
299}
300// -----------------------------------------------------------------------------
301/// Set new bitmap for use in gadgets.
302bool
304{
305 delete BarRes;
306 BarRes = 0;
307 Module = module;
308
309 // Load toolbar resource
310 // NOTE: Don't let TToolbarRes own bitmap, we'll give it to TCelArray
311 // instead.
312 BarRes = new TToolbarRes(module ? module->GetHandle() : 0,
313 newResId,
315
316 if (BarRes->IsOK()){
317 delete CelArray;
318 CelArray = 0;
319 { // map colors
320 TBtnBitmap bitmap(BarRes->GetBitmap(),
323 }
324 CelArray = new TCelArray(&BarRes->GetBitmap(), BarRes->GetCount(),
325 TSize(BarRes->GetWidth(), BarRes->GetHeight()),
326 TPoint(0, 0), // offset
327 BarRes->GetBitmap().Height()/BarRes->GetHeight());
328 return true;
329 }
330 return false;
331}
332//
333static void CreateGadgets(TBarDescrGdArray* array, const TGadgetFunctor& builder,
334 TToolbarRes* barRes)
335{
336 for (int i=0,j=0; i < barRes->GetCount(); i++) {
337 if(barRes->GetIds()[i] == uint16(-1))
338 continue;
339
340 bool usecell;
341 TGadget* gd = (builder)(j, barRes->GetIds()[i], usecell);
342 array->Add(new __TBarDescrGdNode(gd,usecell));
343
344 if(usecell)
345 j++;
346 }
347}
348// -----------------------------------------------------------------------------
349/// Inserts into destWindow's gadgets.
350bool
352{
353 // Build toolbar from resource and from descriptor string
354 if (BarRes && BarRes->IsOK()) {
355 if(!Gadgets->Size())
356 CreateGadgets(Gadgets, *GetBuilder(), BarRes);
357
358 int numRows = BarRes->GetBitmap().Height()/BarRes->GetHeight();
359 TCelArray* cellArray = new TCelArray(TSize(BarRes->GetWidth(), BarRes->GetHeight()),
360 0, BarRes->GetCount(), 5, numRows);
361 cellArray->RemoveAll();
362 destWindow.SetCelArray(cellArray);
363 for (int i=0,j=0; i < (int)Gadgets->Size(); i++){
364 destWindow.Insert(*(*Gadgets)[i]->Gadget);
365 if((*Gadgets)[i]->UseGlyph)
366 cellArray->Add(*CelArray, j++);
367 }
368 return true;
369 }
370 return false;
371}
372// -----------------------------------------------------------------------------
373/// Merges this gadgets and sourceBarDescr gadgets and inserts them into
374/// destWindow's gadgets.
375bool
376TBarDescr::Merge(const TBarDescr& srcBarDescr, TGadgetWindow& destWindow)
377{
378 if (BarRes && BarRes->IsOK()){
379
380 RemoveGadgets(destWindow);
381
382 if(!srcBarDescr.Gadgets->Size())
383 CreateGadgets(srcBarDescr.Gadgets, *((TBarDescr&)srcBarDescr).GetBuilder(),
384 srcBarDescr.BarRes);
385
386 TCelArray& cellArray = destWindow.GetCelArray();
387
388 cellArray.RemoveAll();
389
390 int gdIndex1 = 0;
391 int gdIndex2 = 0;
392 int cellIndex = 0;
393 int cellIndex1 = 0;
394 int cellIndex2 = 0;
395
396 for (int g = 0; g < NumGroups; g++){
397 if (srcBarDescr.GroupCount[g] > 0){
398 for (int i=0; i < srcBarDescr.GroupCount[g]; i++){
399 __TBarDescrGdNode* node = (*srcBarDescr.Gadgets)[gdIndex1];
400 destWindow.Insert(*node->Gadget);
401 if(node->UseGlyph){
402 cellArray.Add(*srcBarDescr.CelArray, cellIndex1);
403 TButtonGadget* bg = TYPESAFE_DOWNCAST(node->Gadget, TButtonGadget);
404 if(bg)
405 bg->SetGlyphIndex(cellIndex);
406 cellIndex++;
407 cellIndex1++;
408 }
409 gdIndex1++;
410 }
411 }
412 else if (srcBarDescr.GroupCount[g] == 0 && GroupCount[g] > 0) {
413 for (int i=0; i < GroupCount[g]; i++){
414 __TBarDescrGdNode* node = (*Gadgets)[gdIndex2];
415 destWindow.Insert(*node->Gadget);
416 if(node->UseGlyph){
417 cellArray.Add(*CelArray, cellIndex2);
418 TButtonGadget* bg = TYPESAFE_DOWNCAST(node->Gadget, TButtonGadget);
419 if(bg)
420 bg->SetGlyphIndex(cellIndex);
421 cellIndex++;
422 cellIndex2++;
423 }
424 gdIndex2++;
425 }
426 }
427 }
428 destWindow.Invalidate();
429 destWindow.LayoutSession();
430 destWindow.UpdateWindow();
431 return true;
432 }
433 return false;
434}
435// -----------------------------------------------------------------------------
436/// Removes the gadgets in destWindow and then inserts these gadgets.
437bool
439{
440 if (BarRes && BarRes->IsOK()){
441
442 RemoveGadgets(destWindow);
443
444 TCelArray& cellArray = destWindow.GetCelArray();
445 cellArray.RemoveAll();
446
447 int gdIndex = 0;
448 int cellIndex = 0;
449 for (int g=0; g < NumGroups; g++){
450 if(GroupCount[g]!= 0){
451 for (int i=0; i < GroupCount[g]; i++){
452 __TBarDescrGdNode* node = (*Gadgets)[gdIndex];
453 destWindow.Insert(*node->Gadget);
454 if(node->UseGlyph){
455 cellArray.Add(*CelArray, cellIndex);
456 TButtonGadget* bg = TYPESAFE_DOWNCAST(node->Gadget, TButtonGadget);
457 if(bg)
458 bg->SetGlyphIndex(cellIndex);
459 cellIndex++;
460 }
461 gdIndex++;
462 }
463 }
464 }
465 destWindow.Invalidate();
466 destWindow.LayoutSession();
467 destWindow.UpdateWindow();
468 return true;
469 }
470 return false;
471}
472// -----------------------------------------------------------------------------
473/// Removes all gadgets from destWindow.
474bool
476{
477 TGadget* gadget = destWindow.FirstGadget();
478 if(gadget && gadget->GetId() == IDG_FLATHANDLE)
479 gadget = gadget->NextGadget();
480 while (gadget) {
481 TGadget* tmp = gadget;
482 gadget = gadget->NextGadget();
483 destWindow.Remove(*tmp);
484 }
485 return true;
486}
487//
488/// Scan bar looking for separators that signify group divisions
489/// return whether we found any at all
490//
491/// Extracts the group counts from the loaded menu bar by counting the number of
492/// menus between separator items. After the group counts are extracted, the
493/// separators are removed. Returns true if separators (groups) were found; false
494/// otherwise.
495bool
497{
498 if (!BarRes)
499 return false; // no bar to extract from...
500
501 // walk BarRes & remove separators, setting up count as we go.
502 //
503 int itemCount = BarRes->GetCount();
504 int g = 0;
505 int count = 0;
506 for (int i = 0; i < itemCount;i++) {
507 if (BarRes->GetIds()[i] == uint16(-1)){
508 if (g < NumGroups)
509 GroupCount[g++] = count;
510 count = 0;
511 }
512 else
513 count++;
514 }
515 // Leave if no separators were found
516 //
517 bool retval = true;
518 if (!g)
519 retval = false;
520
521 // Get trailing group
522 //
523 if (g < NumGroups)
524 GroupCount[g++] = count;
525
526 // Finish zeroing groups
527 //
528 for (; g < NumGroups; g++)
529 GroupCount[g] = 0;
530 return retval;
531}
532
533//
534//
535//
536#if OWL_PERSISTENT_STREAMS
537//
538/// Extract the menu descriptor from the persistent stream.
539//
542{
543 TResId id;
544 is >> id;
545 b.Id = InternStreamedResId_(id);
546 is >> b.Module;
547 b.BarRes = new TToolbarRes((b.Module ? b.Module->GetHandle() : 0), b.Id, NoAutoDelete);
548 { // map colors
549 TBtnBitmap bitmap(b.BarRes->GetBitmap(), TColor::LtGray, NoAutoDelete);
550 }
551 int numRows = b.BarRes->GetBitmap().Height()/b.BarRes->GetHeight();
552 b.CelArray = new TCelArray(&b.BarRes->GetBitmap(),b.BarRes->GetCount(),
553 TSize(b.BarRes->GetWidth(), b.BarRes->GetHeight()),
554 TPoint(0, 0), // offset
555 numRows);
556
557 for (int i = 0; i < TBarDescr::NumGroups; i++)
558 is >> b.GroupCount[i];
559
560 return is;
561}
562
563//
564/// Insert the menu descriptor into the persistent stream.
565//
567operator <<(opstream& os, const TBarDescr& b)
568{
569 os << b.Id;
570 os << b.Module;
571 for (int i = 0; i < TBarDescr::NumGroups; i++)
572 os << b.GroupCount[i];
573 return os;
574}
575
576#endif
577
578} // OWL namespace
579
580/* ========================================================================== */
Class definition for TBarDescr.
#define TGadget_FUNCTOR(func)
Definition bardescr.h:31
Definition of class TButtonGadget.
Definition of a bitmap Cel array class.
#define CHECK(condition)
Definition checks.h:239
Descriptor of Bar Implementation.
Definition bardescr.h:71
void SetBuilder(const TGadgetFunctor &functor)
Definition bardescr.cpp:296
bool ExtractGroups()
Scan bar looking for separators that signify group divisions return whether we found any at all.
Definition bardescr.cpp:496
virtual bool Restore(TGadgetWindow &destWindow)
Removes the gadgets in destWindow and then inserts these gadgets.
Definition bardescr.cpp:438
TGadgetFunctor * GetBuilder()
Definition bardescr.h:151
@ FileGroup
Index of the File gadget group count.
Definition bardescr.h:78
@ EditGroup
Index of the Edit gadget group count.
Definition bardescr.h:79
@ HelpGroup
Index of the Help gadget group count.
Definition bardescr.h:83
@ NumGroups
Total number of groups.
Definition bardescr.h:84
@ WindowGroup
Index of the Window gadget group count.
Definition bardescr.h:82
@ ObjectGroup
Index of the Object gadget group count.
Definition bardescr.h:81
@ ContainerGroup
Index of the Container gadget group count.
Definition bardescr.h:80
virtual bool Merge(const TBarDescr &sourceBarDescr, TGadgetWindow &destWindow)
Merges this gadgets and sourceBarDescr gadgets and inserts them into destWindow's gadgets.
Definition bardescr.cpp:376
virtual ~TBarDescr()
Destroys the TBarDescr object.
Definition bardescr.cpp:288
TBarDescr()
Default constructor for a TBarDescr object.
Definition bardescr.cpp:196
bool RemoveGadgets(TGadgetWindow &destWindow)
Removes all gadgets from destWindow.
Definition bardescr.cpp:475
virtual bool Create(TGadgetWindow &destWindow)
Inserts into destWindow's gadgets.
Definition bardescr.cpp:351
bool SetBitmap(TResId newResId, TModule *module)
Set new bitmap for use in gadgets.
Definition bardescr.cpp:303
int Height() const
Returns the height of this bitmap using GDI's GetObject.
Definition bitmap.cpp:289
TBtnBitmap is an enhanced version of TBitmap with the ability to update the face color of a bitmap to...
Definition glyphbtn.h:49
Derived from TGadget, TButtonGadget represent buttons that you can click on or off.
Definition buttonga.h:65
@ Up
Current state of this button.
Definition buttonga.h:81
@ Command
Basic type of this button.
Definition buttonga.h:70
TButtonGadget(TResId glyphResIdOrIndex, int id, TType type=Command, bool enabled=false, TState state=Up, bool sharedGlyph=false)
Construct a button gadget that loads its own bitmap resource.
Definition buttonga.cpp:107
void SetGlyphIndex(int index)
Definition buttonga.cpp:437
TCelArray is a horizontal array of cels (a unit of animation) created by slicing a portion of or an e...
Definition celarray.h:35
TCelArray(TBitmap *bmp, int numCels, TSize celSize=TSize(), TPoint offset=TPoint(), int numRows=1, TAutoDelete=AutoDelete)
Constructs a TCelArray from a bitmap by slicing the bitmap into a horizontal array of cels of a speci...
Definition celarray.cpp:29
int Add(const TBitmap &image)
Add new cel(s) to the CelArray - return index of new addition.
Definition celarray.cpp:186
bool RemoveAll()
Removes all the cels from the array by calling Remove(-1).
Definition celarray.h:228
static const TColor LtGray
Static TColor object with fixed Value set by RGB(192, 192, 192).
Definition color.h:306
TGadget is the base class for the following derived gadget classes:
Definition gadget.h:120
TGadget * NextGadget()
Returns the next gadget in the list of gadgets.
Definition gadget.h:530
int GetId() const
Gets the ID for the gadget.
Definition gadget.h:406
TGadget * FirstGadget() const
Returns the first gadget of the list.
Definition gadgetwi.h:400
Derived from TWindow, TGadgetWindow maintains a list of tiled gadgets for a window and lets you dynam...
Definition gadgetwi.h:122
void Insert(TGadget &, TPlacement=After, TGadget *sibling=nullptr) override
Inserts a gadget before or after a sibling gadget (TPlacement).
virtual void SetCelArray(TCelArray *sharedCels)
Sets a new Shared CelArray for this gadget window.
auto Remove(TGadget &) -> TGadget *override
Removes a gadget from the gadget window.
virtual TCelArray & GetCelArray(int minX=0, int minY=0)
Gets the Shared CelArray for this gadget window.
virtual void LayoutSession()
LayoutSession is typically called when a change occurs in the size of the margins or gadgets,...
Definition gadgetwi.cpp:357
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition module.h:78
TPoint is a support class, derived from tagPOINT.
Definition geometry.h:87
TSeparatorGadget is a simple class you can use to create a separator between gadgets.
Definition gadget.h:354
The tagSIZE struct is defined as.
Definition geometry.h:234
TSize()
Default constructor that does nothing.
Definition geometry.h:1406
TToolbarRes(HINSTANCE hInst, TResId id, TAutoDelete del=AutoDelete)
Definition resource.cpp:173
ushort * GetIds() const
Definition resource.cpp:226
TBitmap & GetBitmap()
Definition resource.cpp:207
int GetCount() const
Definition resource.cpp:217
int GetWidth() const
Definition resource.cpp:235
int GetHeight() const
Definition resource.cpp:244
void UpdateWindow()
Updates the client area of the specified window by immediately sending a WM_PAINT message.
Definition window.h:2901
virtual void Invalidate(bool erase=true)
Invalidates (mark for painting) the entire client area of a window.
Definition window.h:2822
ipstream, a specialized input stream derivative of pstream, is the base class for reading (extracting...
Definition objstrm.h:391
Base class for writing streamable objects.
Definition objstrm.h:480
C++ Functor template implementation.
Base class TGadget and simple derived TSeparatorGadget.
#define IDG_FLATHANDLE
The ID for a flat bar handle.
Definition gadget.h:37
Definition of TGadgetList, TGadgetWindow & TGadgetWindowFont A list holding gadgets,...
Definition of class TGlyphButton.
@ NoAutoDelete
Definition gdibase.h:70
THandle GetHandle() const
Return the instance handle of the library module represented by the TModule obect.
Definition module.h:1236
Object Windows Library (OWLNext Core).
Definition animctrl.h:22
owl::opstream & operator<<(owl::opstream &os, const TColor &c)
Insert the color value into a persistent output stream.
Definition color.h:498
OWL_DIAGINFO
Definition animctrl.cpp:14
TFunctor3< TGadget *, int, int, bool & > TGadgetFunctor
Definition bardescr.h:29
unsigned short uint16
Definition number.h:33
owl::ipstream & operator>>(owl::ipstream &is, TColor &c)
Extract the color value from a persistent input stream.
Definition color.h:489
auto InternStreamedResId_(TResId id) -> TResId
Definition strmresid.h:37
#define _OWLCFUNC(p)
Definition defs.h:342
#define TYPESAFE_DOWNCAST(object, toClass)
Definition defs.h:269
Defines classes handling Windows resources.
Private helper for reading resource identifiers from persistent streams.
Definition of container classes used and made available by OWL.