Board index » cppbuilder » [Fwd: Docking Windows:How do I react to a Floating Window]

[Fwd: Docking Windows:How do I react to a Floating Window]

Quote
-------- Original Message --------
Subject: Docking Windows:How do I react to a Floating Window
Date: Wed, 30 Aug 2000 12:17:02 -0400
From: James Williams <j...@creditview.no>

Newsgroups: borland.public.cppbuilder.graphics

Hello,

How can I get a message indicating that a floating docking window has
been closed?  What I am trying to do is have a View menu which indicates
the state of a dockable window.  When the use has one of these windows
undocked(floating), and clicks the close button, I want to responde to
that event by setting the checked state of the menu item to not checked.

Regards,

James

 

Re:[Fwd: Docking Windows:How do I react to a Floating Window]


Quote
> How can I get a message indicating that a floating docking window has
> been closed?  What I am trying to do is have a View menu which indicates
> the state of a dockable window.  When the use has one of these windows
> undocked(floating), and clicks the close button, I want to responde to
> that event by setting the checked state of the menu item to not checked.

Hi James,
The easiest way I can think of, if the menu itself is not dynamic, is a)
include the header for the class that has the menu in the implementation
file for the window class that you want to respond to when it is closing, b)
add an event handler to the window that is closing for the OnClose event, c)
add code to the handler that sets the checked state of the relevant menu
item appropriately (which is why you want the header file for the window
that has the menu included - so you have access to the relevant menu item -
when BCB adds these controls, they are added as published properties), or
you can add a public inline function to the main window which is invoked by
the child window when it is closed, which effectively does the same thing.

Cheers,

Ted

R.E. Byers
rtby...@bconnex.net

Other Threads