Discussion:
[Clanlib-devel] CL_InputBox
Erik Ylvisaker
2005-11-20 18:59:32 UTC
Permalink
Updated CL_InputBox and CL_InputBox_Generic to allow for mouse selection to be implemented in the associated CL_ComponentStyle class.
Erik Ylvisaker
2005-11-20 20:54:46 UTC
Permalink
Ok, a diff file is attached now.

------

Changes to inputbox implementations:

The return value for CL_InputBox::get_marked_text() is changed from const std::string& to std::string. This is because in the implementation it seems easier to calculate the marked text on the fly, so you don't want to return a reference to a local variable which will go out of scope when the implementation function exits. This results in changes to all the files.

CL_InputBox_Generic::get_marked_text() was implemented to return the substring of text that is actually selected.

CL_InputBox_Generic::select_all() was implemented to select all of the text.

CL_InputBox_Generic::deselct() was implemented to deselect the text :)

CL_InputBox_Generic::set_selection(int, int) was implemented to select text from the arguments passed, in a manner which is robust.. ie if start or start + length are beyond the boundaries, they are clamped, if length is negative, then start is interpreted as the end, if length is zero this will clear the selection

CL_InputBox_Generic::set_cursor_position(int) was modified to disallow setting the cursor position beyond the end of the text.

Let me know if there is any questions
-- Erik Ylvisaker
-- ***@physics.ucdavis.edu

Loading...