Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Help needed to set the focus
Help needed to set the focus [message #21137] |
Mon, 04 May 2009 21:38 |
JoseB
Messages: 37 Registered: March 2009
|
Member |
|
|
Hi all,
I have an application which have a menu that each menu option opens a modal dialog.
On the MainApp class file I declare a dialog in this way:
header:
WithSettingsDlgLayout<TopWindow> m_dlgSettings;
cpp:
void MyApp::OnMenuOptionSettings(void)
{
ActiveFocus(m_dlgSettings.edLang);
m_dlgSettings.edLang.SetFocus();
m_dlgSettings.ok<<= THISBACK(OnSettingsOK);
m_dlgSettings.cancel<<= THISBACK(OnSettingsCancel);
m_dlgSettings.Execute();
}
Well, for the first time that the dialog is opened, focus is on the edLang edit box, but if the focus is in other edit box
when closing the dialog, on the next time the dialog is open the focus is on that edit box and not on the edLang, even executing the
code of OnMenuOptionSettings(void).
It seems that the dialog (m_dlgSettings) saves state.
Do I have to clear the state when closing the dialog?
How to hanlde this?
Should i use ActiveFocus or SetFocus.
I tried to put
ActiveFocus(m_dlgSettings.edLang);
m_dlgSettings.edLang.SetFocus();
before the Close call (to close the dialog) but it doesnt work.
Should I use a pointer instead of a class member variable and destroy the pointer on close()?
It seems that is hard to handle focus.
Thank you
JoseB
[Updated on: Mon, 04 May 2009 21:39] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Fri Apr 26 21:39:37 CEST 2024
Total time taken to generate the page: 0.04434 seconds
|