Solved

child window does not receive

Posted on 1997-09-12
3
359 Views
Last Modified: 2013-12-26
My main window is derived from TDecoratedFrame with a TTabControl client window.

Within this client I show some child windows (derived from TWindow).
I want to know when these child windows are activated, deactivated or when they get or loose the input focus.
The childs are receiving mouse messages, but none of WM_ACTIVATE, WM_SETFOCUS or WM_KILLFOCUS.

What is wrong? Is it me or the OWL?
0
Comment
Question by:markusk
3 Comments
 
LVL 3

Expert Comment

by:msmits
ID: 1299388
Are these child windows the complete dialog windows that represent a Tab or are they individual controls?

When they are the child windows for the Tab, you should use activation event notification functions from the tab controls.
The dialog window itself seldomly receive the focus, as it will be the first control in that window that receives the focus.

0
 
LVL 3

Accepted Solution

by:
LucHoltkamp earned 380 total points
ID: 1299389
I assume you want to make a tabbed window, just like borland's messagewindow in the BC5 IDE.

The TabContol doesn't give your client TWindow's focus, or controls it's hiding and showing, it doesn't contain the window's. It's just a simple graphic that sends a message to it's parentwindow if you click on one of the tabs. You have to deal with focus, hiding and showing yourself in the eventhandler. And you have to add a container (Array<TWindow> for example) to the parentwindow to store the clients.
The event the TabControl sends is EV_TCN_SELCHANGE (see help for details). In the eventhandler you must hide/show the windows with TWindow::ShowWindow and enable/disable them with TWindow::EnableWindow. Finally you can set focus with TWindow::SetFocus.
There is an simple example "tabctrl.ide" in the BC5\EXAMPLES\OWL\CLASSES directory. They use a TDialog as parentwindow, because this easier than a TWindow (or TDecoratedFrame) as parent. In the TDecoratedFrame case you also have to handle the EV_WM_SIZE message, because you have to do your own layout, resizing and moving the TabControl and clientWindows if the size changes.
One more thing: you shouldn't make the TabControl the TDecoratedFrame's clientwindow, because the whole clientrectangular will be filled with your TabControl, leaving no space for the client TWindows you want to tab. Don't use a clientwindow at all.
If this is not enough info to get you started, notify me and I will mail you a implementation (source and simple exe)of a TabWindow, that acts just like Borland MessageWindow in the IDE. Perhaps you have to adapt it a little, but a would give you a good startingpoint.
.luc.
0
 

Author Comment

by:markusk
ID: 1299390
Good answer.

But what I'm going to do is a bit different from a simple tabbed window.

First, I need a TTabControl as client window. In the TabControl's client area I show some child windows (depending on the current selection).

Some of the tabs have more than one child window. I just wanted to keep track of which one is active to show some kind of border around this window.

I solved the problem with WM_LBUTTONDOWN/WM_RBUTTONDOWN messages. When one of these events occur in my child window, I remove the border from the previous "focus-child" (a static class member shows me which one), and change the style of the current active child.

This works fine, and the result is exactly what I want. I just didn't recognize, that the TabControl does not give the focus to his child windows.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Article by: Matthew
I am a very big proponent of technology compliance standards and strive to meet such criteria in all of my work. That includes my site, which is 100% XHTML 1.0 compliant as determined by the World Wide Web Consortium. https://www.matthewstevenkel…
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now