Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » LineEdit, EditFields, DocEdit » EditField & K_ENTER example (?)
EditField & K_ENTER example (?) [message #19168] Sun, 16 November 2008 15:58 Go to next message
sapiency is currently offline  sapiency
Messages: 56
Registered: September 2008
Member
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
Re: EditField & K_ENTER example (?) [message #19261 is a reply to message #19168] Sun, 23 November 2008 18:43 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11830
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

Re: EditField & K_ENTER example (?) [message #19272 is a reply to message #19261] Sun, 23 November 2008 22:01 Go to previous message
sapiency is currently offline  sapiency
Messages: 56
Registered: September 2008
Member
luzr wrote on Sun, 23 November 2008 18:43



(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).


Wink you are right.

luzr wrote on Sun, 23 November 2008 18:43



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


ok ... I'm learning more and more Wink. I solved my problem by moving Focus to the parent. In my case just SetFocus().

regards

Reinhard
Previous Topic: Focus Event Handling in Edit Fields
Next Topic: EditString and custom msg on status bar
Goto Forum:
  


Current Time: Mon Apr 22 00:09:52 CEST 2019

Total time taken to generate the page: 0.00656 seconds