Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

child window does not receive

Posted on 1997-09-12
3
Medium Priority
?
379 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 1140 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

636 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