1. RE: Highlighting edittext boxes
- Posted by Don Phillips <Graebel at hotmail.com> Sep 05, 2002
- 436 views
> I have a program with lots of little text boxes on screen. > I can tab from one to another with - guess - the Tab key. > The selected box just shows a dotted rectangle around it, > but I need it to go inverse-video or otherwise highlight > decently so it can be seen easily. I can't find how to do > this among the myriads of Windows messages of various types. > Can anyone advise me? I can do it for a ListView box with advice > from someone here but I forget whom. And it doesn't want to work > with simple edit text boxes. So ... > Andy Drummond Ello Andy, heres a simple short example for ya. ========== include Win32Lib.ew without warning constant MainWin = create( Window, "Testing", NULL, 0.25, 0.25, 0.5, 0.5, 0 ), Edit1 = create( EditText, "text1", MainWin, 10, 10, 150, 20, 0 ), Edit2 = create( EditText, "text2", MainWin, 10, 40, 150, 20, 0 ), Edit3 = create( EditText, "text3", MainWin, 10, 70, 150, 20, 0 ) procedure InverseVideo() atom Void Void = sendMessage( getSelf(), EM_SETSEL, 0, -1 ) end procedure onGotFocus[ Edit1 ] = routine_id( "InverseVideo" ) onGotFocus[ Edit2 ] = routine_id( "InverseVideo" ) onGotFocus[ Edit3 ] = routine_id( "InverseVideo" ) WinMain( MainWin, Normal ) ==========
2. RE: Highlighting edittext boxes
- Posted by Brian Broker <bkb at cnw.com> Sep 05, 2002
- 422 views
Alternatively, you could do it this way: ---------------------------------------- include Win32Lib.ew without warning constant MainWin = create( Window, "Testing", 0, Default, Default, 200, 150, 0 ), Edit1 = create( EditText, "text1", MainWin, 10, 10, 150, 20, 0 ), Edit2 = create( EditText, "text2", MainWin, 10, 40, 150, 20, 0 ), Edit3 = create( EditText, "text3", MainWin, 10, 70, 150, 20, 0 ) procedure InverseVideo(integer self, integer event, sequence parms) setIndex(self,{1,0}) end procedure setHandler({Edit1,Edit2,Edit3},w32HGotFocus, routine_id("InverseVideo")) WinMain( MainWin, Normal ) ---------------------------------------- -- Brian Don Phillips wrote: > > I have a program with lots of little text boxes on screen. > > I can tab from one to another with - guess - the Tab key. > > The selected box just shows a dotted rectangle around it, > > but I need it to go inverse-video or otherwise highlight > > decently so it can be seen easily. I can't find how to do > > this among the myriads of Windows messages of various types. > > Can anyone advise me? I can do it for a ListView box with advice > > from someone here but I forget whom. And it doesn't want to work > > with simple edit text boxes. So ... > > Andy Drummond > > Ello Andy, heres a simple short example for ya. > > ========== > include Win32Lib.ew > without warning > > constant > MainWin = create( Window, "Testing", NULL, 0.25, 0.25, 0.5, 0.5, 0 ), > Edit1 = create( EditText, "text1", MainWin, 10, 10, 150, 20, 0 ), > Edit2 = create( EditText, "text2", MainWin, 10, 40, 150, 20, 0 ), > Edit3 = create( EditText, "text3", MainWin, 10, 70, 150, 20, 0 ) > > procedure InverseVideo() > atom Void > Void = sendMessage( getSelf(), EM_SETSEL, 0, -1 ) > end procedure > onGotFocus[ Edit1 ] = routine_id( "InverseVideo" ) > onGotFocus[ Edit2 ] = routine_id( "InverseVideo" ) > onGotFocus[ Edit3 ] = routine_id( "InverseVideo" ) > > WinMain( MainWin, Normal ) > ========== > >
3. RE: Highlighting edittext boxes
- Posted by Brian Broker <bkb at cnw.com> Sep 05, 2002
- 424 views
And I just thought of another even cleaner method. Just an example of the many possible ways to accomplish the same thing... ---------------------------------------- include Win32Lib.ew without warning constant Win = create( Window, "Test", 0, Default, Default, 200, 150, 0 ), Edt = { create( EditText, "text1", Win, 10, 10, 150, 20, 0 ), create( EditText, "text2", Win, 10, 40, 150, 20, 0 ), create( EditText, "text3", Win, 10, 70, 150, 20, 0 ) } procedure InverseVideo(integer self, integer event, sequence parms) setIndex(self,{1,0}) end procedure setHandler( Edt, w32HGotFocus, routine_id("InverseVideo") ) WinMain( Win, Normal ) ---------------------------------------- -- Brian Brian Broker wrote: > Alternatively, you could do it this way: > ---------------------------------------- > include Win32Lib.ew > without warning > > constant > MainWin = create( Window, "Testing", 0, Default, Default, > 200, 150, 0 ), > Edit1 = create( EditText, "text1", MainWin, 10, 10, 150, 20, 0 ), > Edit2 = create( EditText, "text2", MainWin, 10, 40, 150, 20, 0 ), > Edit3 = create( EditText, "text3", MainWin, 10, 70, 150, 20, 0 ) > > procedure InverseVideo(integer self, integer event, sequence parms) > setIndex(self,{1,0}) > end procedure > setHandler({Edit1,Edit2,Edit3},w32HGotFocus, > routine_id("InverseVideo")) > > WinMain( MainWin, Normal ) > ---------------------------------------- > > -- Brian
4. RE: Highlighting edittext boxes
- Posted by Andy Drummond <kestrelandy at xalt.co.uk> Sep 06, 2002
- 439 views
Brian, Thanks for the ideas - I will try them as soon as I can. I thought it better to say thanks now as it's the weekend here now so I'll not be doing it till Wednesday (!) now. Thanks again. Andy Brian Broker wrote: > And I just thought of another even cleaner method. Just an example of > the many possible ways to accomplish the same thing... > ---------------------------------------- > include Win32Lib.ew > without warning > > constant > Win = create( Window, "Test", 0, Default, Default, 200, 150, 0 ), > Edt = { create( EditText, "text1", Win, 10, 10, 150, 20, 0 ), > create( EditText, "text2", Win, 10, 40, 150, 20, 0 ), > create( EditText, "text3", Win, 10, 70, 150, 20, 0 ) } > > procedure InverseVideo(integer self, integer event, sequence parms) > setIndex(self,{1,0}) > end procedure > setHandler( Edt, w32HGotFocus, routine_id("InverseVideo") ) > > WinMain( Win, Normal ) > ---------------------------------------- > -- Brian > Brian Broker wrote: > > Alternatively, you could do it this way: > > ---------------------------------------- > > include Win32Lib.ew > > without warning > > > > constant > > MainWin = create( Window, "Testing", 0, Default, Default, > > 200, 150, 0 ), > > Edit1 = create( EditText, "text1", MainWin, 10, 10, 150, 20, 0 ), > > Edit2 = create( EditText, "text2", MainWin, 10, 40, 150, 20, 0 ), > > Edit3 = create( EditText, "text3", MainWin, 10, 70, 150, 20, 0 ) > > > > procedure InverseVideo(integer self, integer event, sequence parms) > > setIndex(self,{1,0}) > > end procedure > > setHandler({Edit1,Edit2,Edit3},w32HGotFocus, > > routine_id("InverseVideo")) > > > > WinMain( MainWin, Normal ) > > ---------------------------------------- > > > > -- Brian > >