forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Monitoring which of several MDI child windows has focus

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
sparge



Joined: 11 Apr 2005
Posts: 371

PostPosted: Tue Nov 03, 2009 5:56 pm    Post subject: Monitoring which of several MDI child windows has focus Reply with quote

Hi all! It's been a while since I looked in this forum, because I haven't done any work with FTN95 for quite a while; it's good to be back. I've picked up an app I haven't looked at for some time, and I'm trying to grasp a nettle that I shied away from last time.

The app is a basic image processing app, so it creates a number of MDI child windows within the main window, each containing a %gr graphics region with the same associated callback. The main purpose of this callback is to monitor use of the mouse to select a rectangular region of interest within a specific graphic region, and it does this just fine.

For various housekeeping reasons, I want to be able to keep track of which of these windows currently has focus. ClearWin+ provides clearwin_info@ ('FOCUS_WINDOW') which at first sight seems to be the answer - but only if it can be joined up with callback code that is activated when focus changes, and there's the rub. The only way I've found to do this so far is to kludge it! Provided I select a window by clicking in the graphics region, I can pick this up with the associated callback. Clicks anywhere else, in particular in the title bar (which is the intuitive place to click to select a window), I am as yet unable to identify. So I can change focus by clicking on the title bar, but ClearWin+ remains blind to this change unless or until I click in the graphics region. Suffice to say that this all too often causes my app to terminate disgracefully.

Has anyone else wrestled with this problem and come up with a solution? Or can anyone see an obvious-with-hindsight wrinkle that is eluding me? TIA,

Andy
Back to top
View user's profile Send private message Send e-mail
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Wed Nov 04, 2009 11:59 am    Post subject: Reply with quote

Depending upon the application, one way is to have a different callback for each %gr region. Each one sets an ID and then calls the common callback.

If this does not fit your situation it would help if you could post a short sample.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Fri Nov 06, 2009 1:42 pm    Post subject: Reply with quote

Perhaps the answer is for Paul to consider adding a callback option to %ca?

Having an option to make the caption bar to the left of its window, not on top, would make dockable toolbars much easier to program (I imagine).

Eddie
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Fri Nov 06, 2009 2:39 pm    Post subject: Reply with quote

%ca just sets the Microsoft Windows caption text. There is no event that is associated with it apart perhaps the usual mouse events (movement over and clicking on the caption).
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Fri Nov 06, 2009 4:24 pm    Post subject: Reply with quote

Hi Paul,

A fast response to an idle speculation, thanks. Back to the drawing board.

Eddie
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group