U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Widgets - General questions or Mixed problems » SetFocus / ActiveFocus -- difference?
SetFocus / ActiveFocus -- difference? [message #15284] Tue, 15 April 2008 16:33 Go to next message
indiocolifa is currently offline  indiocolifa
Messages: 49
Registered: January 2008
Location: Argentina
Member
I don't understand the difference between:

a_widget.SetFocus();
ActiveFocus(a_widget);


Explanations...?

Thanks! Very Happy
Re: SetFocus / ActiveFocus -- difference? [message #15285 is a reply to message #15284] Tue, 15 April 2008 18:28 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
I think that the difference is:
SetFocus will pass focus to the ctrl and take it from whatever has focus.
ActiveFocus sets the Ctrl that should have focus when the window next gets focus. There is only an immediate focus transition if the window is currently in the foreground.
Re: SetFocus / ActiveFocus -- difference? [message #15292 is a reply to message #15285] Tue, 15 April 2008 21:20 Go to previous messageGo to next message
indiocolifa is currently offline  indiocolifa
Messages: 49
Registered: January 2008
Location: Argentina
Member
I'm posting this because I've a DocEdit control on a form (which already has WantFocus() true) and I can't set the focus with docEditControl.SetFocus(), but it works with ActiveFocus(docEditControl).

Re: SetFocus / ActiveFocus -- difference? [message #15294 is a reply to message #15292] Tue, 15 April 2008 21:26 Go to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
You can SetFocus only to widget that is actually on the screen.

OTOH, ActiveFocus can be used always. Widget will simply get focus next time the parent gets focus.

Mirek
Previous Topic: USB port communication
Next Topic: Equivalent widgets
Goto Forum:
  


Current Time: Sun May 03 17:03:09 GMT+2 2026

Total time taken to generate the page: 0.00563 seconds