Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MDI and TForm.Window

17 views
Skip to first unread message

Jan Emil Larsen

unread,
Jan 14, 2003, 4:21:44 PM1/14/03
to
Is it possible to achieve the effect of TForm.WindowMenu in an app without a
TMainMenu, but with a ActionManager/ActionMainMenuBar?
Ie a Window-menu that automatically and dynamically contains the current
open MDI child windows?

Kurt Barthelmess (TeamB)

unread,
Jan 14, 2003, 6:16:34 PM1/14/03
to

Yes and No<g>. Yes, provided you maintain the menu yourself. No, if
you want it done automatically for you.

Good luck.

Kurt

Jan Emil Larsen

unread,
Jan 15, 2003, 2:24:16 AM1/15/03
to
"Kurt Barthelmess (TeamB)" <kbarth...@compuserve.com> wrote in message
news:3e249a0e...@newsgroups.borland.com...

Thank you for clarifying this.

Could anyone clarify what the purpose and possible function of the property
"WindowMenu" in a TActionMainMenuBar is? The source (ActnMenu.pas) seems to
indicate a function related to MDI, but I see no further description or
effect of assigning a value to the property.


Ken White

unread,
Jan 15, 2003, 8:28:48 AM1/15/03
to
Jan,

> Could anyone clarify what the purpose and possible function of the
property
> "WindowMenu" in a TActionMainMenuBar is? The source (ActnMenu.pas)
seems to
> indicate a function related to MDI, but I see no further description
or
> effect of assigning a value to the property.

Exactly that of TMainMenu.WindowMenu; support for MDI child windows in a
MDI application.

Ken
---
Ken White
kwh...@adpsi.com

Clipper Functions for Delphi and C++ Builder
http://www.adpsi.com

Jan Emil Larsen

unread,
Jan 15, 2003, 8:41:00 AM1/15/03
to

"Ken White" <kwh...@adpsi.com> wrote in message
news:3e25620f$1...@newsgroups.borland.com...
> Jan,

> Exactly that of TMainMenu.WindowMenu; support for MDI child windows in a
> MDI application.

But how?
I have an ActionManager with an ActionMainMenuBar that contain a (standard)
Window-menu (action-class). Setting the property
ActionMainMenuBar.WindowMenu = 'Window' does not give the expected
behaviour....

Ken (or anyone), could you be more specific (online Help has next to
nothing...) ?

Ken White

unread,
Jan 15, 2003, 1:06:26 PM1/15/03
to
Jan,

> But how?
> I have an ActionManager with an ActionMainMenuBar that contain a
(standard)
> Window-menu (action-class). Setting the property
> ActionMainMenuBar.WindowMenu = 'Window' does not give the expected
> behaviour....
>
> Ken (or anyone), could you be more specific (online Help has next to
> nothing...) ?

Ok. First things first. This *is* a MDI app we're discussing, right?
(The form that the ActionMainMenuBar is on is of FormStyle fsMDIForm.)

Secondly, have you gotten the latest Action* updates from Steve
Trefethan's site (http://www.geocities.com/delphihelp)? There was a fix
related to MDI menus in there somewhere.

Ok. If the answers to both questions above are 'Yes', we're ready to go.
<g>

You need to create at least one item on your ActionMainMenuBar 'Window'
menu. There has to be *at least* one sub-item. With MDI apps, you
usually want at least two (Tile and Cascade). It's also usually
customary to add a separator as the last item. (The 'at least one
sub-item' should be documented in the Delphi help, IMO - it's a common
problem.)

Now set your 'WindowMenu' property on the main (MDI parent) form to the
above 'Window' menu item.

You should be set to go. Running your app and creating a MDI child
window should automagically add it to the Window menu of the parent
window, and closing a child window should automatically remove it.

HTH,

Jan Emil Larsen

unread,
Jan 15, 2003, 2:31:46 PM1/15/03
to
"Ken White" <kwh...@adpsi.com> skrev i en meddelelse
news:3e25a321$1...@newsgroups.borland.com...

All the above was already done (but it is NOT the WindowMenu-property on the
MDI MainForm that is in play).

But this was the error: In the ActionMainMenuBar, the propety WindowMenu
should be the caption of the menuitem.
I had WindowMenu = 'Window' (as this was how the caption appeared on the
menu bar). But the caption was in fact '&Window' !
With WindowMenu '&Window' all is (of course) fine.

Thank you Ken for making me look a bit closer ....


0 new messages