EditText Focus & Highlighting

new topic     » topic index » view thread      » older message » newer message

Hi,

When any message is displayed ( message_box() ) on an EditText using events like w32HLostFocus, irrespective of the focus being returned to same control or the next in order, the cursor or text highlighting (e.g. using setFocus() and setIndex(x, {1,0})) are not displayed within that EditText. The user gets confused about the current active control.

Clicking/Double clicking on that EditText is expected to restore the cursor/highlighting within the same. Though visual confirmation is not present, this is working, as one can click within the EditText at desired point and insert text. Also, even if entire text within the EditText is selected but not indicated so on screen, pressing space key deletes the entire contents of the EditText.

This behaviour is not present when the validation returns true.

e.g.

--  code generated by Win32Lib IDE v1.0.4 Build July-06-2008 
 
constant TheProgramType="exw" 
 
without type_check 
without warning 
 
include win32lib.ew as win32lib 
 
-------------------------------------------------------------------------------- 
--  Window Window1 
constant Window1 = createEx( Window, "Window1", 0, Default, Default, 499, 129, 0, 0 ) 
constant Combo16 = createEx( Combo, "Combo16", Window1, 12, 36, 148, 20*6, 0, 0 ) 
constant EditText17 = createEx( EditText, "EditText17", Window1, 176, 36, 140, 20, 0, 0 ) 
constant EditText18 = createEx( EditText, "EditText18", Window1, 332, 36, 148, 20, 0, 0 ) 
--------------------------------------------------------- 
-------------------------------------------------------------------------------- 
procedure EditText17_onLostFocus (integer self, integer event, sequence params)--params is () 
	if length(getText(self)) < 11 then 
		VOID = message_box("Length should be >= 11", "Msg", MB_ICONINFORMATION) 
		setFocus(self) 
		setIndex(self, {1, 0}) 
	end if 
end procedure 
setHandler( EditText17, w32HLostFocus, routine_id("EditText17_onLostFocus")) 
--------------------------------------------------------- 
 
WinMain( Window1,Normal ) 

Thanks & Regards, Rad.

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu