Home » U++ Library support » LineEdit, EditFields, DocEdit » EditField & K_ENTER example (?)
Re: EditField & K_ENTER example (?) [message #19261 is a reply to message #19168] |
Sun, 23 November 2008 18:43 |
|
mirek
Messages: 13980 Registered: November 2005
|
Ultimate Member |
|
|
sapiency wrote on Sun, 16 November 2008 09:58 | Hi,
attached you can find a little example using overloading of Key
with an EditField.
Is this consistent with common using in upp?
But there is still one point which doesn't work as I want. How can I remove the Focus from the editfield? it should to be shown as you see it when the gui is startet, with focus on no element or the focus should be moved to the next element. In this case you see the difference because it is aligned right in the code.
regards
reinhard
|
It is ok.
(this part is a little bit crazy:
std::stringstream ssStream(~tmp);
ssStream >> _count;
_edit.SetData(Sprintf("%d",_count));
- using EditInt would be much easier IMO).
You cannot really 'remove' focus, but you can set it to something else.
There is also one more complicated aspect - TopWindow remembers that last child with focus before it was deactivated - and it is independent from being "open" (otherwise, only "open" widgets can have focus). When it reactivates, it restores focucs to that widget.
You can affect it by calling TopWindow::ActiveFocus(ctrl) - that is practically similar to calling ctrl.SetFocus(), but can be called at any time. When TopWindow gets activated, w will have focus (if it is active, it is same as SetFocus).
Mirek
[Updated on: Sun, 23 November 2008 18:44] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Tue May 14 13:18:09 CEST 2024
Total time taken to generate the page: 0.02517 seconds
|