Solved

child window does not receive

Posted on 1997-09-12
3
362 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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

773 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