1. RE: Clearing Text Box
- Posted by Brian Broker <bkb at cnw.com> Oct 15, 2003
- 427 views
clear() is intended to clear *selected* text from an object. It's intended to be used as an editing procedure like copy, cut, paste, etc. Your problem is likely related to which control has focus. You should probably just setText(control,"") to avoid any such problems. -- Brian ronaustin wrote: > This program contains only two fields, Code and Desc. I get them > through > the SleText control. After the info is written out I want to clear > these > controls. I added the following to the process that writes out the > record: > > clear(Code) > clear(Desc) > > Only the Code control gets cleared unless after I enter the Desc I hit > TAB twice to highlight the Desc control. Then both fields are cleared. > What am I doing wrong?
2. RE: Clearing Text Box
- Posted by Brian Broker <bkb at cnw.com> Oct 16, 2003
- 411 views
No... then you are just making an alias for setText(control,""). Then you'd have to write another function to do what clear() currently does (clear_selected_text()?). Then to be consistent you'll have to rename copy() to copy_selected_text() and cut() to cut_selected_text()... I'd just leave it. clear() works properly as documented. -- Brian Derek Parnell wrote: > > This is a poll. > > Would people like clear(SleText/MleText) to clear the whole field if > nothing is currently selected in the field? > > -- > Derek > >
3. RE: Clearing Text Box
- Posted by Brian Broker <bkb at cnw.com> Oct 16, 2003
- 433 views
After re-reading your question (and noting the *if*) I guess it's not quite an alias for setText(control,"") but I still think you should leave it alone. What if I don't want to clear if nothing is selected? Then I'd need an extra check to see if anything was selected... -- Brian earlier I wrote: > > > No... then you are just making an alias for setText(control,""). Then > you'd have to write another function to do what clear() currently does > (clear_selected_text()?). Then to be consistent you'll have to rename > copy() to copy_selected_text() and cut() to cut_selected_text()... > > I'd just leave it. clear() works properly as documented. > > -- Brian > > Derek Parnell wrote: > > > > This is a poll. > > > > Would people like clear(SleText/MleText) to clear the whole field if > > nothing is currently selected in the field? > > > > -- > > Derek > > > >