When a window is clicked which widget gets focus

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

When a window is clicked which widget gets focus

Postby a62754 » Fri Aug 13, 2010 1:21 am

Hi
If we have a CwForm with widgets on it (CwText) and the cursor is blinking in one of the text boxes, i go to another window and then come back (click on the window) the window somehow knows which widget should have the cursor input when focus returns.
I want to know which api to use to get this information - for an open window that does not have focus, which widget would get the focus if the window is clicked.
I looked at paintDo: (wm_paint) to see how the logic flows - couldn't see where its setting the focus on a particular widget. I also couldn't see any related methods in the widget class or shell class or form class.
Thanks in advanace.
Jaspreet
a62754
 
Posts: 18
Joined: Thu Jul 01, 2010 2:03 am

Re: When a window is clicked which widget gets focus

Postby a62754 » Sun Aug 15, 2010 9:31 pm

I have found one possible solution to this problem....
The CwShell class has an OSWidget inside it - the OSShell - in this object there's a variable focusWidget that contains the last focussed widget.
There's no method available to access this object - so i'm reluctant to use this object outside of the class.
but, this is one possible solution.

let me know if someone else finds something else.

thanks
a62754
 
Posts: 18
Joined: Thu Jul 01, 2010 2:03 am


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: No registered users and 1 guest

cron