home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / mswindo / programm / misc / 1340 < prev    next >
Encoding:
Text File  |  1992-08-14  |  2.1 KB  |  68 lines

  1. Newsgroups: comp.windows.ms.programmer,comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!mcsun!sun4nl!rulway.LeidenUniv.nl!rulfc1!jeroenp
  3. From: jeroenp@rulfc1.LeidenUniv.nl (Jeroen W. Pluimers)
  4. Subject: ToolBox with buttons in MDI environment
  5. Message-ID: <1992Aug15.083924.19587@rulway.LeidenUniv.nl>
  6. Sender: root@rulway.LeidenUniv.nl (System PRIVILEGED Account)
  7. Nntp-Posting-Host: rulfc1.leidenuniv.nl
  8. Organization: Dept. FMC, Gorlaeus Labs, Leiden University, The Netherlands
  9. Date: Sat, 15 Aug 92 08:39:24 GMT
  10. Lines: 56
  11.  
  12.  
  13. Hi All,
  14.  
  15.  
  16. I want to make my own ToolBox like BC++ has in an MDI environment.
  17. The code has to work in TPW, but examples in C are welcome too.
  18.  
  19. I tried the followind:
  20.  
  21. constructor TButtonsDialogWindow.init;
  22. begin
  23.   TJanusDialogWindow.Init(aParent, aName, BorStyle);
  24.   SetFlags(wb_MDIChild, False);
  25. end;
  26.  
  27. procedure TButtonsDialogWindow.GetWindowClass(var AWndClass: TWndClass);
  28. begin
  29.   TJanusDialogWindow.GetWindowClass(AWndClass);
  30.   AWndClass.hIcon := LoadIcon(HInstance, MakeIntResource(icButtons));
  31.   { Attr.Style := Attr.Style or ws_Group or ws_TabStop or
  32.                   ws_Child or ws_OverlappedWindow or ws_Visible; }
  33. end;
  34.  
  35. The style is as follows:
  36.  
  37. STYLE WS_CHILD | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX
  38.  
  39.  
  40. And it is used in the main program like this:
  41.  
  42. constructor TMDIdBaseWindow.Init;
  43. begin
  44.    TMDIWindow.Init(ATitle, AMenu);
  45.    Attr.Style := Attr.Style or ws_ClipChildren;
  46.    { ChildMenuPos := 3; }
  47. end;
  48.  
  49. procedure TMDIdBaseWindow.SetupWindow;
  50. begin
  51.   TMDIWindow.SetupWindow;
  52.   { MenuItems(Disable); }
  53.   Application^.MakeWindow(
  54. end;
  55.  
  56.  
  57. The problem is that the ToolBox doesn't get the focused caption (I can press
  58. buttons and move the window), and when the MDI frame is restored from a 
  59. minimized state, the ToolBox sometimes draws partly over the active MDI child.
  60.  
  61. --
  62.     o _   _  _   _   _             voice: +31-2522-20908 (19:00-24:00 UTC)
  63.    / (_' |  (_) (_' | |            snail: P.S.O.
  64. __/                                       attn. Jeroen W. Pluimers
  65.                                           P.O. Box 266
  66. jeroenp@rulfc1.LeidenUniv.nl              2170 AG Sassenheim
  67. jeroen_pluimers@f521.n281.z2.fidonet.org  The Netherlands
  68.