Re: Edit Box/Text Area Selection API

Marc Strämke <[email protected]> Thu, 09 Oct 2003 13:45:36 +0200
Newsgroups gmane.comp.embedded.stk.gui.devel
Message-ID <[email protected]>
Christopher Slade wrote:
> I just wanted to pass the API I had in mind for selecting text in an
> edit box or text area
> 
> 
> To set the text
> void selection(int start, int end)
> 
> To get the current selection
> int selection_start()
> int selection_end()
The obvious alternative would be to return a std::pair or a boost 
touple, seems "righter" to me *g*
> 
> And also to get the currently selected text
> 
> std:wstring selection()
This is a bit confusing imo, selected_text() or something like that 
seems better.
> (which will return nothing if nothing is selected)
> 
> Let me know what you think.
> Thanks, Chris