Dan Jiang | 13 Dec 2010 01:26
Picon

RE: Dialog activation issue (hard problem?)


Found this article:http://chabster.blogspot.com/2010/03/focus-and-window-activation-in-win32.html
It seems I need to handle WM_ACTIVATE? i.e.,  on receving one the messages, instead of passing the control to
default dialog procedure, I need to call SetFocus on the GUI widget that was clicked?
Thanks,
Dennis
> To: wtl@...
> From: danjiang@...
> Date: Sun, 12 Dec 2010 19:12:06 -0500
> Subject: RE: [wtl] Dialog activation issue (hard problem?)
> 
> 
> Hi Joe,
> Thanks for the suggestions! The number of dialogs involved is over 15. So converting each of them into a
CWindow is out of question due to amount of work involved. The dialogs and 3D canvas do share the same parent
but they do not live on same levels.
> Handing activation click sounds a way to go. Do you know what message is translated into dialog activation
click? WM_MOUSEDOWN?
> Thanks again,
> Dennis
> 
> To: wtl@...
> From: joe@...
> Date: Sun, 12 Dec 2010 05:35:46 -0800
> Subject: Re: [wtl] Dialog activation issue (hard problem?)
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  
> 
> 
> 
>   
> 
> 
>     
>       
>       
>       Dennis,
> 
> 
> 
> It sounds like you should be able to solve this by putting both "parts" 
> 
> into the same top-level window. What classes are you using for the two 
> 
> parts? I think you might need to move from a Dialog to a different 
> 
> window type, but otherwise, the only thing you should have to do is 
> 
> create a common parent to both "parts". Windows likes embedding windows 
> 
> within windows...
> 
> 
> 
> Another option to explore would be to handle the activation click on the 
> 
> dialog box explicitly, passing it through to the appropriate child 
> 
> widget, rather than capturing the mouse. I'm not fluent in the details 
> 
> it would take to do that, but I'd try it if switching from a dialog and 
> 
> making a common parent doesn't work.
> 
> 
> 
> -j
> 
> 
> 
> Joe Andrieu
> 
> joe@...
> 
> +1 (805) 705-8651
> 
> 
> 
> On 12/12/2010 3:32 AM, dennisyjiang wrote:
> 
> > Hi Everyone,
> 
> >
> 
> > I have this problem for a long time and hope to find a solution for it. It is very cumbersome to describe, so
please bear with me.
> 
> >
> 
> > I have developed a CAD application using WTL. The screen is divided into two parts. The main window on left
size is a 3D canvas. The right side is 3DS like interface that uses an embedded tab control/view to host
various GUI pages. Each page hosts one or more dialogs which itself host various UI wedgets, eg. radio
button, edit control.
> 
> >
> 
> > The problem: every time I want access any non-hot tracking UI wedgets, I have to double click it: 1st time
to activate the dialog, 2nd time to actually use the GUI control itself.
> 
> >
> 
> > This is very annoying as user would not expect double clicks. My way of getting around this is to use
SetCapture for mouse and SetFocus for keyboard on mouse move or mouse enter event. I do this both for the
embedded dialogs and for the 3D canvas window. That is,when mouse enters the embedded dialogs,
SetCapture and SetFocus is called to set focus/capture to the dialog where mouse cursor is. When the mouse
is moved back into the 3D canvas, I do the same. This introduce another annoyance: when the mouse cursor is
moved back to 3D canvas, any floating non-modal dialog will NOT get focus, unless the mouse cursor is set to
a hot-tracking widget (e.g. a button that reacts to mouse enter event) in the non-modal dialog. This means
I have to make all controls in the non-modal dialog track with
  the mouse movement. But as the application must run as an ActiveX control in another host, I have no controls
to any non-modal dialog displayed by the 3rd party host.
> 
> >
> 
> > Is there any way to get around this problem? I can give you access to my software if my explanation of the
problem is not clear enough.
> 
> >
> 
> > I know this is probably not WTL problem per se. But as the entire application is built with WTL, I think my
question is still relevant. Any help is appreciated.
> 
> >
> 
> > Yours truely,
> 
> >
> 
> > Dan
> 
> >
> 
> >
> 
> >
> 
> > ------------------------------------
> 
> >
> 
> > Yahoo! Groups Links
> 
> >
> 
> >
> 
> >
> 
> >    
> 
> 
> 
> 
> 
>     
>      
> 
>     
>     
> 
> 
> 
> 
> 
> 
>    		 	   		  
> 
> [Non-text portions of this message have been removed]
> 
> 
> 
> ------------------------------------
> 
> Yahoo! Groups Links
> 
> 
> 
 		 	   		  

[Non-text portions of this message have been removed]

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    wtl-digest@... 
    wtl-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    wtl-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/


Gmane