Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FormWindow.cpp
Go to the documentation of this file.
1 /* Project nGenEx
2  Destroyer Studios LLC
3  Copyright © 1997-2004. All Rights Reserved.
4 
5  SUBSYSTEM: nGenEx.lib
6  FILE: Form.cpp
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  Form Window class
13 */
14 
15 #include "MemDebug.h"
16 #include "FormWindow.h"
17 #include "Screen.h"
18 #include "DataLoader.h"
19 #include "Font.h"
20 #include "FontMgr.h"
21 
22 #include "Button.h"
23 #include "ComboBox.h"
24 #include "EditBox.h"
25 #include "ImageBox.h"
26 #include "ListBox.h"
27 #include "RichTextBox.h"
28 #include "Slider.h"
29 
30 // +--------------------------------------------------------------------+
31 
32 FormWindow::FormWindow(Screen* screen, int ax, int ay, int aw, int ah,
33 DWORD aid, DWORD s, ActiveWindow* pParent)
34 : ActiveWindow(screen, ax, ay, aw, ah, aid, s, pParent)
35 {
36  char buf[32];
37  sprintf_s(buf, "Form %d", id);
38  desc = buf;
39 }
40 
41 // +--------------------------------------------------------------------+
42 
44 {
45 }
46 
47 // +--------------------------------------------------------------------+
48 
49 void
51 {
52 }
53 
54 // +--------------------------------------------------------------------+
55 
56 void
58 {
59  Hide();
60  children.destroy();
61 }
62 
63 // +--------------------------------------------------------------------+
64 
65 void
67 {
68  if (ctrl) {
69  if (!children.contains(ctrl))
70  children.append(ctrl);
71 
72  ctrl->SetForm(this);
73 
74  if (!shown)
75  ctrl->Hide();
76  }
77 }
78 
79 // +--------------------------------------------------------------------+
80 
81 Button*
82 FormWindow::CreateButton(const char* btn_text, int ax, int ay, int aw, int ah, DWORD aid, DWORD pid)
83 {
84  Button* button = 0;
85  ActiveWindow* parent = this;
86 
87  if (pid)
88  parent = FindControl(pid);
89 
90  button = new(__FILE__,__LINE__) Button(parent, ax, ay, aw, ah, aid);
91 
92  if (button) {
93  button->SetForm(this);
94  button->SetText(btn_text);
95 
96  if (!shown)
97  button->Hide();
98  }
99 
100  return button;
101 }
102 
103 // +--------------------------------------------------------------------+
104 
105 ImageBox*
106 FormWindow::CreateImageBox(const char* lbl_text, int ax, int ay, int aw, int ah, DWORD aid, DWORD pid)
107 {
108  ImageBox* image = 0;
109  ActiveWindow* parent = this;
110 
111  if (pid)
112  parent = FindControl(pid);
113 
114  image = new(__FILE__,__LINE__) ImageBox(parent, ax, ay, aw, ah, aid);
115 
116  if (image) {
117  image->SetForm(this);
118  image->SetText(lbl_text);
119 
120  if (!shown)
121  image->Hide();
122  }
123 
124  return image;
125 }
126 
127 // +--------------------------------------------------------------------+
128 
130 FormWindow::CreateLabel(const char* label_text, int ax, int ay, int aw, int ah, DWORD aid, DWORD pid, DWORD astyle)
131 {
132  ActiveWindow* label = 0;
133  ActiveWindow* parent = this;
134 
135  if (pid)
136  parent = FindControl(pid);
137 
138  label = new(__FILE__,__LINE__) ActiveWindow(screen, ax, ay, aw, ah, aid, astyle, parent);
139 
140  if (label) {
141  label->SetForm(this);
142  label->SetText(label_text);
143 
144  if (!shown)
145  label->Hide();
146  }
147 
148  return label;
149 }
150 
151 // +--------------------------------------------------------------------+
152 
153 ListBox*
154 FormWindow::CreateListBox(const char* lbl_text, int ax, int ay, int aw, int ah, DWORD aid, DWORD pid)
155 {
156  ListBox* list = 0;
157  ActiveWindow* parent = this;
158 
159  if (pid)
160  parent = FindControl(pid);
161 
162  list = new(__FILE__,__LINE__) ListBox(parent, ax, ay, aw, ah, aid);
163 
164  if (list) {
165  list->SetForm(this);
166 
167  if (!shown)
168  list->Hide();
169  }
170 
171  return list;
172 }
173 
174 // +--------------------------------------------------------------------+
175 
176 ComboBox*
177 FormWindow::CreateComboBox(const char* lbl_text, int ax, int ay, int aw, int ah, DWORD aid, DWORD pid)
178 {
179  ComboBox* combo = 0;
180  ActiveWindow* parent = this;
181 
182  if (pid)
183  parent = FindControl(pid);
184 
185  combo = new(__FILE__,__LINE__) ComboBox(parent, ax, ay, aw, ah, aid);
186 
187  if (combo) {
188  combo->SetForm(this);
189  combo->SetLabel(lbl_text);
190 
191  if (!shown)
192  combo->Hide();
193  }
194 
195  return combo;
196 }
197 
198 // +--------------------------------------------------------------------+
199 
200 EditBox*
201 FormWindow::CreateEditBox(const char* lbl_text, int ax, int ay, int aw, int ah, DWORD aid, DWORD pid)
202 {
203  EditBox* edit = 0;
204  ActiveWindow* parent = this;
205 
206  if (pid)
207  parent = FindControl(pid);
208 
209  edit = new(__FILE__,__LINE__) EditBox(parent, ax, ay, aw, ah, aid);
210 
211  if (edit) {
212  edit->SetForm(this);
213  edit->SetText(lbl_text);
214 
215  if (!shown)
216  edit->Hide();
217  }
218 
219  return edit;
220 }
221 
222 // +--------------------------------------------------------------------+
223 
225 FormWindow::CreateRichTextBox(const char* label_text, int ax, int ay, int aw, int ah, DWORD aid, DWORD pid, DWORD astyle)
226 {
227  RichTextBox* rtb = 0;
228  ActiveWindow* parent = this;
229 
230  if (pid)
231  parent = FindControl(pid);
232 
233  rtb = new(__FILE__,__LINE__) RichTextBox(parent, ax, ay, aw, ah, aid, astyle);
234 
235  if (rtb) {
236  rtb->SetForm(this);
237  rtb->SetText(label_text);
238 
239  if (!shown)
240  rtb->Hide();
241  }
242 
243  return rtb;
244 }
245 
246 // +--------------------------------------------------------------------+
247 
248 Slider*
249 FormWindow::CreateSlider(const char* label_text, int ax, int ay, int aw, int ah, DWORD aid, DWORD pid, DWORD astyle)
250 {
251  Slider* slider = 0;
252  ActiveWindow* parent = this;
253 
254  if (pid)
255  parent = FindControl(pid);
256 
257  slider = new(__FILE__,__LINE__) Slider(parent, ax, ay, aw, ah, aid);
258 
259  if (slider) {
260  slider->SetForm(this);
261 
262  if (!shown)
263  slider->Hide();
264  }
265 
266  return slider;
267 }
268 
269 // +--------------------------------------------------------------------+
270 
271 void
273 {
274  if (def.GetRect().w > 0 && def.GetRect().h > 0) {
275  // if form size is specified in def, and it is
276  // smaller than the current screen size,
277  // center the form on the display:
278 
279  Rect r = def.GetRect();
280 
281  if (r.w < screen->Width()) {
282  r.x = (screen->Width() - r.w) / 2;
283  }
284  else {
285  r.x = 0;
286  r.w = screen->Width();
287  }
288 
289  if (r.h < screen->Height()) {
290  r.y = (screen->Height() - r.h) / 2;
291  }
292  else {
293  r.y = 0;
294  r.h = screen->Height();
295  }
296 
297  MoveTo(r);
298  }
299 
300  SetMargins(def.GetMargins());
303  SetCells(def.GetCells());
306 
307  UseLayout(def.GetLayout().x_mins,
308  def.GetLayout().y_mins,
309  def.GetLayout().x_weights,
310  def.GetLayout().y_weights);
311 
312  if (def.GetTexture().length() > 0) {
313  DataLoader* loader = DataLoader::GetLoader();
314  loader->SetDataPath("Screens/");
315  loader->LoadTexture(def.GetTexture(), texture);
316  loader->SetDataPath("");
317  }
318 
319  SetBackColor(def.GetBackColor());
320  SetForeColor(def.GetForeColor());
321 
322  Font* f = FontMgr::Find(def.GetFont());
323  if (f) SetFont(f);
324 
326 
327  ListIter<CtrlDef> ctrl = def.GetControls();
328  while (++ctrl) {
329  switch (ctrl->GetType()) {
330  case WIN_DEF_FORM:
331  case WIN_DEF_LABEL:
332  default:
333  CreateDefLabel(*ctrl);
334  break;
335 
336  case WIN_DEF_BUTTON:
337  CreateDefButton(*ctrl);
338  break;
339 
340  case WIN_DEF_COMBO:
341  CreateDefCombo(*ctrl);
342  break;
343 
344  case WIN_DEF_IMAGE:
345  CreateDefImage(*ctrl);
346  break;
347 
348  case WIN_DEF_EDIT:
349  CreateDefEdit(*ctrl);
350  break;
351 
352  case WIN_DEF_LIST:
353  CreateDefList(*ctrl);
354  break;
355 
356  case WIN_DEF_SLIDER:
357  CreateDefSlider(*ctrl);
358  break;
359 
360  case WIN_DEF_RICH:
361  CreateDefRichText(*ctrl);
362  break;
363  }
364  }
365 
367  DoLayout();
368  CalcGrid();
369 }
370 
371 // +--------------------------------------------------------------------+
372 
373 void
375 {
376  ActiveWindow* ctrl = CreateLabel(def.GetText(),
377  def.GetX(),
378  def.GetY(),
379  def.GetW(),
380  def.GetH(),
381  def.GetID(),
382  def.GetParentID(),
383  def.GetStyle());
384 
385  ctrl->SetAltText(def.GetAltText());
386  ctrl->SetBackColor(def.GetBackColor());
387  ctrl->SetForeColor(def.GetForeColor());
388  ctrl->SetTextAlign(def.GetTextAlign());
389  ctrl->SetSingleLine(def.GetSingleLine());
390  ctrl->SetTransparent(def.GetTransparent());
391  ctrl->SetHidePartial(def.GetHidePartial());
392 
393  ctrl->SetMargins(def.GetMargins());
394  ctrl->SetTextInsets(def.GetTextInsets());
395  ctrl->SetCellInsets(def.GetCellInsets());
396  ctrl->SetCells(def.GetCells());
397  ctrl->SetFixedWidth(def.GetFixedWidth());
398  ctrl->SetFixedHeight(def.GetFixedHeight());
399 
400  ctrl->UseLayout(def.GetLayout().x_mins,
401  def.GetLayout().y_mins,
402  def.GetLayout().x_weights,
403  def.GetLayout().y_weights);
404 
405  if (def.GetTexture().length() > 0) {
406  Bitmap* ctrl_tex = 0;
407  DataLoader* loader = DataLoader::GetLoader();
408  loader->SetDataPath("Screens/");
409  loader->LoadTexture(def.GetTexture(), ctrl_tex);
410  loader->SetDataPath("");
411 
412  ctrl->SetTexture(ctrl_tex);
413  }
414 
415  Font* f = FontMgr::Find(def.GetFont());
416  if (f) ctrl->SetFont(f);
417 }
418 
419 void
421 {
422  Button* ctrl = CreateButton(def.GetText(),
423  def.GetX(),
424  def.GetY(),
425  def.GetW(),
426  def.GetH(),
427  def.GetID(),
428  def.GetParentID());
429 
430  if (def.GetStandardImage().length()) {
431  DataLoader* loader = DataLoader::GetLoader();
432  loader->SetDataPath("Screens/");
433 
434  Bitmap* bmp = 0;
435  loader->LoadTexture(def.GetStandardImage(), bmp);
436  ctrl->SetStandardImage(bmp);
437 
438  if (def.GetActivatedImage().length()) {
439  loader->LoadTexture(def.GetActivatedImage(), bmp);
440  ctrl->SetActivatedImage(bmp);
441  }
442 
443  if (def.GetTransitionImage().length()) {
444  loader->LoadTexture(def.GetTransitionImage(), bmp);
445  ctrl->SetTransitionImage(bmp);
446  }
447 
448  loader->SetDataPath("");
449  }
450 
451  ctrl->SetAltText(def.GetAltText());
452  ctrl->SetEnabled(def.IsEnabled());
453  ctrl->SetBackColor(def.GetBackColor());
454  ctrl->SetForeColor(def.GetForeColor());
455  ctrl->SetTextAlign(def.GetTextAlign());
456  ctrl->SetSingleLine(def.GetSingleLine());
457 
458  ctrl->SetBevelWidth(def.GetBevelWidth());
459  ctrl->SetDropShadow(def.GetDropShadow());
460  ctrl->SetSticky(def.GetSticky());
461  ctrl->SetTransparent(def.GetTransparent());
462  ctrl->SetHidePartial(def.GetHidePartial());
464 
465  ctrl->SetMargins(def.GetMargins());
466  ctrl->SetTextInsets(def.GetTextInsets());
467  ctrl->SetCellInsets(def.GetCellInsets());
468  ctrl->SetCells(def.GetCells());
469  ctrl->SetFixedWidth(def.GetFixedWidth());
470  ctrl->SetFixedHeight(def.GetFixedHeight());
471 
472  if (def.GetPicture().length() > 0) {
473  Bitmap pict;
474  int type = def.GetPictureType();
475 
476  DataLoader* loader = DataLoader::GetLoader();
477  loader->SetDataPath("Screens/");
478  loader->LoadBitmap(def.GetPicture(), pict, type);
479  loader->SetDataPath("");
480 
481  ctrl->SetPicture(pict);
482  }
483 
484  Font* f = FontMgr::Find(def.GetFont());
485  if (f) ctrl->SetFont(f);
486 }
487 
488 void
490 {
491  ImageBox* ctrl = CreateImageBox(def.GetText(),
492  def.GetX(),
493  def.GetY(),
494  def.GetW(),
495  def.GetH(),
496  def.GetID(),
497  def.GetParentID());
498 
499  ctrl->SetAltText(def.GetAltText());
500  ctrl->SetBackColor(def.GetBackColor());
501  ctrl->SetForeColor(def.GetForeColor());
502  ctrl->SetStyle(def.GetStyle());
503  ctrl->SetTextAlign(def.GetTextAlign());
504  ctrl->SetSingleLine(def.GetSingleLine());
505  ctrl->SetTransparent(def.GetTransparent());
506  ctrl->SetHidePartial(def.GetHidePartial());
507 
508  ctrl->SetMargins(def.GetMargins());
509  ctrl->SetTextInsets(def.GetTextInsets());
510  ctrl->SetCellInsets(def.GetCellInsets());
511  ctrl->SetCells(def.GetCells());
512  ctrl->SetFixedWidth(def.GetFixedWidth());
513  ctrl->SetFixedHeight(def.GetFixedHeight());
514 
515  if (def.GetPicture().length() > 0) {
516  Bitmap picture;
517 
518  DataLoader* loader = DataLoader::GetLoader();
519  loader->SetDataPath("Screens/");
520  loader->LoadBitmap(def.GetPicture(), picture);
521  loader->SetDataPath("");
522 
523  ctrl->SetPicture(picture);
524  }
525 
526  Font* f = FontMgr::Find(def.GetFont());
527  if (f) ctrl->SetFont(f);
528 }
529 
530 void
532 {
533  ListBox* ctrl = CreateListBox(def.GetText(),
534  def.GetX(),
535  def.GetY(),
536  def.GetW(),
537  def.GetH(),
538  def.GetID(),
539  def.GetParentID());
540 
541  ctrl->SetAltText(def.GetAltText());
542  ctrl->SetEnabled(def.IsEnabled());
543  ctrl->SetBackColor(def.GetBackColor());
544  ctrl->SetForeColor(def.GetForeColor());
545  ctrl->SetStyle(def.GetStyle());
546  ctrl->SetTextAlign(def.GetTextAlign());
547  ctrl->SetTransparent(def.GetTransparent());
548  ctrl->SetHidePartial(def.GetHidePartial());
549 
550  ctrl->SetLineHeight(def.GetLineHeight());
551  ctrl->SetShowHeadings(def.GetShowHeadings());
552  ctrl->SetLeading(def.GetLeading());
553  ctrl->SetMultiSelect(def.GetMultiSelect());
554  ctrl->SetDragDrop(def.GetDragDrop());
556  ctrl->SetSmoothScroll(def.GetSmoothScroll());
557  ctrl->SetItemStyle(def.GetItemStyle());
558  ctrl->SetSelectedStyle(def.GetSelectedStyle());
559 
560  ctrl->SetMargins(def.GetMargins());
561  ctrl->SetTextInsets(def.GetTextInsets());
562  ctrl->SetCellInsets(def.GetCellInsets());
563  ctrl->SetCells(def.GetCells());
564  ctrl->SetFixedWidth(def.GetFixedWidth());
565  ctrl->SetFixedHeight(def.GetFixedHeight());
566 
567  if (def.GetTexture().length() > 0) {
568  Bitmap* ctrl_tex = 0;
569  DataLoader* loader = DataLoader::GetLoader();
570  loader->SetDataPath("Screens/");
571  loader->LoadTexture(def.GetTexture(), ctrl_tex);
572  loader->SetDataPath("");
573 
574  ctrl->SetTexture(ctrl_tex);
575  }
576 
577  int ncols = def.NumColumns();
578  for (int i = 0; i < ncols; i++) {
579  ColumnDef* col = def.GetColumn(i);
580  ctrl->AddColumn(col->title, col->width, col->align, col->sort);
581 
582  if (col->use_color)
583  ctrl->SetColumnColor(i, col->color);
584  }
585 
586  int nitems = def.NumItems();
587  for (int i = 0; i < nitems; i++)
588  ctrl->AddItem(def.GetItem(i));
589 
590  Font* f = FontMgr::Find(def.GetFont());
591  if (f) ctrl->SetFont(f);
592 }
593 
594 void
596 {
597  ComboBox* ctrl = CreateComboBox(def.GetText(),
598  def.GetX(),
599  def.GetY(),
600  def.GetW(),
601  def.GetH(),
602  def.GetID(),
603  def.GetParentID());
604 
605  ctrl->SetAltText(def.GetAltText());
606  ctrl->SetEnabled(def.IsEnabled());
607  ctrl->SetBackColor(def.GetBackColor());
608  ctrl->SetForeColor(def.GetForeColor());
609  ctrl->SetTextAlign(def.GetTextAlign());
610 
611  ctrl->SetActiveColor(def.GetActiveColor());
612  ctrl->SetBorderColor(def.GetBorderColor());
613  ctrl->SetBorder(def.GetBorder());
614  ctrl->SetBevelWidth(def.GetBevelWidth());
615  ctrl->SetTransparent(def.GetTransparent());
616  ctrl->SetHidePartial(def.GetHidePartial());
617 
618  ctrl->SetMargins(def.GetMargins());
619  ctrl->SetTextInsets(def.GetTextInsets());
620  ctrl->SetCellInsets(def.GetCellInsets());
621  ctrl->SetCells(def.GetCells());
622  ctrl->SetFixedWidth(def.GetFixedWidth());
623  ctrl->SetFixedHeight(def.GetFixedHeight());
624 
625  int nitems = def.NumItems();
626  for (int i = 0; i < nitems; i++)
627  ctrl->AddItem(def.GetItem(i));
628 
629  Font* f = FontMgr::Find(def.GetFont());
630  if (f) ctrl->SetFont(f);
631 }
632 
633 void
635 {
636  EditBox* ctrl = CreateEditBox(def.GetText(),
637  def.GetX(),
638  def.GetY(),
639  def.GetW(),
640  def.GetH(),
641  def.GetID(),
642  def.GetParentID());
643 
644  ctrl->SetAltText(def.GetAltText());
645  ctrl->SetEnabled(def.IsEnabled());
646  ctrl->SetBackColor(def.GetBackColor());
647  ctrl->SetForeColor(def.GetForeColor());
648  ctrl->SetStyle(def.GetStyle());
649  ctrl->SetSingleLine(def.GetSingleLine());
650  ctrl->SetTextAlign(def.GetTextAlign());
651  ctrl->SetTransparent(def.GetTransparent());
652  ctrl->SetHidePartial(def.GetHidePartial());
653  ctrl->SetPasswordChar(def.GetPasswordChar());
654 
655  ctrl->SetMargins(def.GetMargins());
656  ctrl->SetTextInsets(def.GetTextInsets());
657  ctrl->SetCellInsets(def.GetCellInsets());
658  ctrl->SetCells(def.GetCells());
659  ctrl->SetFixedWidth(def.GetFixedWidth());
660  ctrl->SetFixedHeight(def.GetFixedHeight());
661 
662  ctrl->SetLineHeight(def.GetLineHeight());
664  ctrl->SetSmoothScroll(def.GetSmoothScroll());
665 
666  if (def.GetTexture().length() > 0) {
667  Bitmap* ctrl_tex = 0;
668  DataLoader* loader = DataLoader::GetLoader();
669  loader->SetDataPath("Screens/");
670  loader->LoadTexture(def.GetTexture(), ctrl_tex);
671  loader->SetDataPath("");
672 
673  ctrl->SetTexture(ctrl_tex);
674  }
675 
676  Font* f = FontMgr::Find(def.GetFont());
677  if (f) ctrl->SetFont(f);
678 }
679 
680 void
682 {
683  Slider* ctrl = CreateSlider(def.GetText(),
684  def.GetX(),
685  def.GetY(),
686  def.GetW(),
687  def.GetH(),
688  def.GetID(),
689  def.GetParentID());
690 
691 
692  ctrl->SetAltText(def.GetAltText());
693  ctrl->SetEnabled(def.IsEnabled());
694  ctrl->SetBackColor(def.GetBackColor());
695  ctrl->SetForeColor(def.GetForeColor());
696 
697  ctrl->SetActive(def.GetActive());
698  ctrl->SetOrientation(def.GetOrientation());
699  ctrl->SetFillColor(def.GetActiveColor());
700  ctrl->SetBorderColor(def.GetBorderColor());
701  ctrl->SetBorder(def.GetBorder());
702  ctrl->SetStyle(def.GetStyle());
703  ctrl->SetTransparent(def.GetTransparent());
704  ctrl->SetHidePartial(def.GetHidePartial());
705  ctrl->SetNumLeds(def.GetNumLeds());
706 
707  ctrl->SetMargins(def.GetMargins());
708  ctrl->SetTextInsets(def.GetTextInsets());
709  ctrl->SetCellInsets(def.GetCellInsets());
710  ctrl->SetCells(def.GetCells());
711  ctrl->SetFixedWidth(def.GetFixedWidth());
712  ctrl->SetFixedHeight(def.GetFixedHeight());
713 
714  Font* f = FontMgr::Find(def.GetFont());
715  if (f) ctrl->SetFont(f);
716 }
717 
718 void
720 {
721  RichTextBox* ctrl = CreateRichTextBox(def.GetText(),
722  def.GetX(),
723  def.GetY(),
724  def.GetW(),
725  def.GetH(),
726  def.GetID(),
727  def.GetParentID(),
728  def.GetStyle());
729 
730  ctrl->SetAltText(def.GetAltText());
731  ctrl->SetBackColor(def.GetBackColor());
732  ctrl->SetForeColor(def.GetForeColor());
733  ctrl->SetLineHeight(def.GetLineHeight());
734  ctrl->SetLeading(def.GetLeading());
736  ctrl->SetSmoothScroll(def.GetSmoothScroll());
737  ctrl->SetTextAlign(def.GetTextAlign());
738  ctrl->SetTransparent(def.GetTransparent());
739  ctrl->SetHidePartial(def.GetHidePartial());
740 
741  ctrl->SetMargins(def.GetMargins());
742  ctrl->SetTextInsets(def.GetTextInsets());
743  ctrl->SetCellInsets(def.GetCellInsets());
744  ctrl->SetCells(def.GetCells());
745  ctrl->SetFixedWidth(def.GetFixedWidth());
746  ctrl->SetFixedHeight(def.GetFixedHeight());
747 
748  if (def.GetTexture().length() > 0) {
749  Bitmap* ctrl_tex = 0;
750  DataLoader* loader = DataLoader::GetLoader();
751  loader->SetDataPath("Screens/");
752  loader->LoadTexture(def.GetTexture(), ctrl_tex);
753  loader->SetDataPath("");
754 
755  ctrl->SetTexture(ctrl_tex);
756  }
757 
758  Font* f = FontMgr::Find(def.GetFont());
759  if (f) ctrl->SetFont(f);
760 
761  for (int i = 0; i < def.NumTabs(); i++)
762  ctrl->SetTabStop(i, def.GetTab(i));
763 }
764 
765 // +--------------------------------------------------------------------+
766 
767 void
769 {
770  Destroy();
771  Init(def);
772 }
773 
774 // +--------------------------------------------------------------------+
775 
778 {
779  return FindChild(id);
780 }
781 
782 
783 // +--------------------------------------------------------------------+
784 
787 {
788  ActiveWindow* mouse_tgt = 0;
789 
791  while (++iter) {
792  ActiveWindow* test = iter.value();
793  if (test->TargetRect().Contains(x,y)) {
794  mouse_tgt = test;
795 
796  while (test) {
797  test = test->FindChild(x,y);
798 
799  if (test)
800  mouse_tgt = test;
801  }
802  }
803  }
804 
805  return mouse_tgt;
806 }
807 
808 
809