nobody at rubyforge.org
2007-Mar-21 10:43 UTC
[Wxruby-development] [906] branches/wxruby2/wxwidgets_282: Wx::ComboBox API 2.6 -> 2.8, plus some doc corrections
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!-- #msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; } #msg dt { float: left; width: 6em; font-weight: bold; } #msg dt:after { content:'':'';} #msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; } #msg dl a { font-weight: bold} #msg dl a:link { color:#fc3; } #msg dl a:active { color:#ff0; } #msg dl a:visited { color:#cc6; } h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; } #msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; } #msg ul, pre { overflow: auto; } #header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; } #patch { width: 100%; } #patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;} #patch .propset h4, #patch .binary h4 {margin:0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;} #patch .propset .diff, #patch .binary .diff {padding:10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, .info {color:#888;background:#fff;} --></style> <title>[906] branches/wxruby2/wxwidgets_282: Wx::ComboBox API 2.6 -> 2.8, plus some doc corrections</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>906</dd> <dt>Author</dt> <dd>brokentoy</dd> <dt>Date</dt> <dd>2007-03-21 06:43:28 -0400 (Wed, 21 Mar 2007)</dd> </dl> <h3>Log Message</h3> <pre>Wx::ComboBox API 2.6 -> 2.8, plus some doc corrections</pre> <h3>Modified Paths</h3> <ul> <li><a href="#brancheswxruby2wxwidgets_282doctextilecomboboxtxtl">branches/wxruby2/wxwidgets_282/doc/textile/combobox.txtl</a></li> <li><a href="#brancheswxruby2wxwidgets_282swigclassesComboBoxi">branches/wxruby2/wxwidgets_282/swig/classes/ComboBox.i</a></li> <li><a href="#brancheswxruby2wxwidgets_282swigclassesincludewxComboBoxh">branches/wxruby2/wxwidgets_282/swig/classes/include/wxComboBox.h</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="brancheswxruby2wxwidgets_282doctextilecomboboxtxtl"></a> <div class="modfile"><h4>Modified: branches/wxruby2/wxwidgets_282/doc/textile/combobox.txtl (905 => 906)</h4> <pre class="diff"><span> <span class="info">--- branches/wxruby2/wxwidgets_282/doc/textile/combobox.txtl        2007-03-21 10:22:10 UTC (rev 905) +++ branches/wxruby2/wxwidgets_282/doc/textile/combobox.txtl        2007-03-21 10:43:28 UTC (rev 906) </span><span class="lines">@@ -18,15 +18,15 @@ </span><span class="cx"> </span><span class="cx"> "Object":object.html </span><span class="cx"> </span><del>-h2. Window styles </del><ins>+h2(#window_styles). Window styles </ins><span class="cx"> </span><span class="cx"> </span><span class="cx"> |@CB_SIMPLE@|Creates a combobox with a permanently displayed list. Windows only. | </span><span class="cx"> |@CB_DROPDOWN@|Creates a combobox with a drop-down list.| </span><span class="cx"> |@CB_READONLY@|Same as CB_DROPDOWN but only thestrings specified as the combobox choices can be selected, it is impossible toselect (even from a program) a string which is not in the choices list.| </span><span class="cx"> |@CB_SORT@|Sorts the entries in the list alphabetically.| </span><ins>+|@TE_PROCESS_ENTER@|The control will generatethe event EVT_COMMAND_TEXT_ENTER (otherwise pressing Enter keyis either processed internally by the control or used for navigation betweendialog controls). Windows only.| </ins><span class="cx"> </span><del>- </del><span class="cx"> See also "window styles overview":windowstyles.html. </span><span class="cx"> </span><span class="cx"> h2. Event handling </span><span class="lines">@@ -56,16 +56,18 @@ </span><span class="cx"> * "ComboBox#can_undo":#ComboBox_canundo </span><span class="cx"> * "ComboBox#copy":#ComboBox_copy </span><span class="cx"> * "ComboBox#cut":#ComboBox_cut </span><ins>+* "ComboBox#get_value":#ComboBox_getvalue </ins><span class="cx"> * "ComboBox#get_insertion_point":#ComboBox_getinsertionpoint </span><span class="cx"> * "ComboBox#get_last_position":#ComboBox_getlastposition </span><del>-* "ComboBox#get_value":#ComboBox_getvalue </del><ins>+* "ComboBox#get_current_selection":#ComboBox_getcurrentselection +* "ComboBox#get_selection":#ComboBox_getselectionrange </ins><span class="cx"> * "ComboBox#paste":#ComboBox_paste </span><span class="cx"> * "ComboBox#redo":#ComboBox_redo </span><span class="cx"> * "ComboBox#replace":#ComboBox_replace </span><span class="cx"> * "ComboBox#remove":#ComboBox_remove </span><span class="cx"> * "ComboBox#set_insertion_point":#ComboBox_setinsertionpoint </span><span class="cx"> * "ComboBox#set_insertion_point_end":#ComboBox_setinsertionpointend </span><del>-* "ComboBox#set_selection":#ComboBox_setselection </del><ins>+* "ComboBox#set_selection":#ComboBox_setselectionrange </ins><span class="cx"> * "ComboBox#set_value":#ComboBox_setvalue </span><span class="cx"> * "ComboBox#undo":#ComboBox_undo </span><span class="cx"> </span><span class="lines">@@ -74,36 +76,26 @@ </span><span class="cx"> </span><span class="cx"> h3(#ComboBox_new). ComboBox.new </span><span class="cx"> </span><del>- *ComboBox.new*(%(arg-type)Window% parent, %(arg-type)Integer% id, %(arg-type)String% value = "", - %(arg-type)Point% pos = DEFAULT_POSITION, - %(arg-type)Size% size = DEFAULT_SIZE, - %(arg-type)Integer% n, - %(arg-type)String% choices[], - %(arg-type)Integer% style = 0, - %(arg-type)Validator% validator = DEFAULT_VALIDATOR, - %(arg-type)String% name = "comboBox") - </del><span class="cx"> *ComboBox.new*(%(arg-type)Window% parent, %(arg-type)Integer% id, %(arg-type)String% value, </span><span class="cx"> %(arg-type)Point% pos, </span><span class="cx"> %(arg-type)Size% size, </span><del>- %(arg-type)ArrayString% choices, </del><ins>+ %(arg-type)Array% choices, </ins><span class="cx"> %(arg-type)Integer% style = 0, </span><span class="cx"> %(arg-type)Validator% validator = DEFAULT_VALIDATOR, </span><span class="cx"> %(arg-type)String% name = "comboBox") </span><span class="cx"> </span><del>-Constructor, creating and showing a combobox. </del><ins>+Constructor, creating and showing a combobox. </ins><span class="cx"> </span><span class="cx"> h4. Parameters </span><span class="cx"> </span><del>-* _parent_ Parent window. Must not be NULL. </del><ins>+* _parent_ Parent window. Must not be nil. </ins><span class="cx"> * _id_ Window identifier. A value of -1 indicates a default value. </span><span class="cx"> * _value_ Initial selection string. An empty string indicates no selection. </span><span class="cx"> * _pos_ Window position. </span><span class="cx"> * _size_ Window size. If the default size (-1, -1) is specified then the window is sized </span><span class="cx"> appropriately. </span><del>-* _n_ Number of strings with which to initialise the control. </del><span class="cx"> * _choices_ An array of strings with which to initialise the control. </span><del>-* _style_ Window style. See "ComboBox":combobox.html. </del><ins>+* _style_ Window style. See "ComboBox Window Styles":#window_styles </ins><span class="cx"> * _validator_ Window validator. </span><span class="cx"> * _name_ Window name. </span><span class="cx"> </span><span class="lines">@@ -112,24 +104,8 @@ </span><span class="cx"> "ComboBox#create":combobox.html#ComboBox_create, "Validator":validator.html </span><span class="cx"> </span><span class="cx"> </span><del>- - - - *destructor*() - -Destructor, destroying the combobox. - </del><span class="cx"> h3(#ComboBox_create). ComboBox#create </span><span class="cx"> </span><del>- Boolean *create*(%(arg-type)Window% parent, %(arg-type)Integer% id, %(arg-type)String% value = "", - %(arg-type)Point% pos = DEFAULT_POSITION, - %(arg-type)Size% size = DEFAULT_SIZE, - %(arg-type)Integer% n, - %(arg-type)String% choices[], - %(arg-type)Integer% style = 0, - %(arg-type)Validator% validator = DEFAULT_VALIDATOR, - %(arg-type)String% name = "comboBox") - </del><span class="cx"> Boolean *create*(%(arg-type)Window% parent, %(arg-type)Integer% id, %(arg-type)String% value, </span><span class="cx"> %(arg-type)Point% pos, </span><span class="cx"> %(arg-type)Size% size, </span><span class="lines">@@ -138,14 +114,15 @@ </span><span class="cx"> %(arg-type)Validator% validator = DEFAULT_VALIDATOR, </span><span class="cx"> %(arg-type)String% name = "comboBox") </span><span class="cx"> </span><del>-Creates the combobox for two-step construction. Derived classes -should call or replace this function. See "ComboBox.new":combobox.html#ComboBox_new for further details. </del><ins>+Creates the combobox for two-step construction. Derived classes should call or replace this function. See "ComboBox.new":combobox.html#ComboBox_new for further details. </ins><span class="cx"> </span><span class="cx"> h3(#ComboBox_cancopy). ComboBox#can_copy </span><span class="cx"> </span><span class="cx"> Boolean *can_copy*() </span><span class="cx"> </span><del>-Returns true if the combobox is editable and there is a text selection to copy to the clipboard. </del><ins>+Returns true if the combobox is editable and there is a text selection +to copy to the clipboard. + </ins><span class="cx"> Only available on Windows. </span><span class="cx"> </span><span class="cx"> h3(#ComboBox_cancut). ComboBox#can_cut </span><span class="lines">@@ -188,18 +165,42 @@ </span><span class="cx"> </span><span class="cx"> Copies the selected text to the clipboard and removes the selection. </span><span class="cx"> </span><ins>+h3(#ComboBox_getcurrentselection). ComboBox#get_current_selection + + Integer *get_current_selection*() + +This function does the same things as +"Choice#get_current_selection":choice.html#Choice_getcurrentselection and +returns the item currently selected in the dropdown list if it''s open or the +same thing as "get_selection":#ComboBox_getselection otherwise. + + </ins><span class="cx"> h3(#ComboBox_getinsertionpoint). ComboBox#get_insertion_point </span><span class="cx"> </span><span class="cx"> Integer *get_insertion_point*() </span><span class="cx"> </span><span class="cx"> Returns the insertion point for the combobox''s text field. </span><span class="cx"> </span><ins>+Note: Under MSW, this function always returns 0 if the combobox +doesn''t have the focus. + </ins><span class="cx"> h3(#ComboBox_getlastposition). ComboBox#get_last_position </span><span class="cx"> </span><span class="cx"> "TextPos":textpos.html *get_last_position*() </span><span class="cx"> </span><span class="cx"> Returns the last position in the combobox text field. </span><span class="cx"> </span><ins>+h3(#ComboBox_getselectionrange). ComboBox#get_selection_range + + Integer from, Integer to = *get_selection_range*() + +This is the same as +"TextCtrl#get_selection":textctrl.html#TextCtrl_getselection +for the text control which is part of the combobox, returning the +start and end position of the text selection. + +Currently this method is only implemented in MSW and GTK. + </ins><span class="cx"> h3(#ComboBox_getvalue). ComboBox#get_value </span><span class="cx"> </span><span class="cx"> String *get_value*() </span><span class="lines">@@ -257,7 +258,7 @@ </span><span class="cx"> </span><span class="cx"> Sets the insertion point at the end of the combobox text field. </span><span class="cx"> </span><del>-h3(#ComboBox_setselection). ComboBox#set_selection </del><ins>+h3(#ComboBox_setselectionrange). ComboBox#set_selection_range </ins><span class="cx"> </span><span class="cx"> *set_selection*(%(arg-type)Integer% from, %(arg-type)Integer% to) </span><span class="cx"> </span><span class="lines">@@ -268,8 +269,6 @@ </span><span class="cx"> * _from_ The first position. </span><span class="cx"> * _to_ The second position. </span><span class="cx"> </span><del>- - </del><span class="cx"> h3(#ComboBox_setvalue). ComboBox#set_value </span><span class="cx"> </span><span class="cx"> *set_value*(%(arg-type)String% text) </span></span></pre></div> <a id="brancheswxruby2wxwidgets_282swigclassesComboBoxi"></a> <div class="modfile"><h4>Modified: branches/wxruby2/wxwidgets_282/swig/classes/ComboBox.i (905 => 906)</h4> <pre class="diff"><span> <span class="info">--- branches/wxruby2/wxwidgets_282/swig/classes/ComboBox.i        2007-03-21 10:22:10 UTC (rev 905) +++ branches/wxruby2/wxwidgets_282/swig/classes/ComboBox.i        2007-03-21 10:43:28 UTC (rev 906) </span><span class="lines">@@ -6,7 +6,11 @@ </span><span class="cx"> %module(directors="1") wxComboBox </span><span class="cx"> </span><span class="cx"> %ignore wxComboBox::wxComboBox(); </span><ins>+ +// methods for getting and setting the text selection </ins><span class="cx"> %rename (SetSelectionRange) SetSelection(long from, long to); </span><ins>+%rename (GetSelectionRange) GetSelection(long *from, long *to); +%apply long * OUTPUT { long *from, long *to } </ins><span class="cx"> </span><span class="cx"> </span><span class="cx"> // redundant with good typemaps </span></span></pre></div> <a id="brancheswxruby2wxwidgets_282swigclassesincludewxComboBoxh"></a> <div class="modfile"><h4>Modified: branches/wxruby2/wxwidgets_282/swig/classes/include/wxComboBox.h (905 => 906)</h4> <pre class="diff"><span> <span class="info">--- branches/wxruby2/wxwidgets_282/swig/classes/include/wxComboBox.h        2007-03-21 10:22:10 UTC (rev 905) +++ branches/wxruby2/wxwidgets_282/swig/classes/include/wxComboBox.h        2007-03-21 10:43:28 UTC (rev 906) </span><span class="lines">@@ -10,19 +10,6 @@ </span><span class="cx"> public: </span><span class="cx"> wxComboBox(); </span><span class="cx"> </span><del>- -/* This constructor really doesn''t work due to problems with SWIG typemaps - - wxComboBox(wxWindow *parent, wxWindowID id, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = NULL, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxComboBoxNameStr); -*/ - </del><span class="cx"> /* tweak this signature so it can be used for cases where only </span><span class="cx"> a few parameters are passed */ </span><span class="cx"> wxComboBox(wxWindow *parent, wxWindowID id, </span><span class="lines">@@ -58,8 +45,12 @@ </span><span class="cx"> const wxString& name = wxComboBoxNameStr); </span><span class="cx"> void Copy() ; </span><span class="cx"> void Cut() ; </span><ins>+ int GetCurrentSelection() const; </ins><span class="cx"> long GetInsertionPoint() const; </span><span class="cx"> long GetLastPosition() const; </span><ins>+#if defined(__WXMSW__) || defined (__WXGTK__) + void GetSelection(long *from, long *to) const; +#endif </ins><span class="cx"> wxString GetValue() const; </span><span class="cx"> void Paste() ; </span><span class="cx"> void Replace(long from , long to , const wxString& text ) ; </span></span></pre> </div> </div> </body> </html>
Maybe Matching Threads
- [989] branches/wxruby2/wxwidgets_282: Fix a crasher with misdirected ComboBox#GetSelection method on GTK; clearer
- [909] branches/wxruby2/wxwidgets_282/doc/textile/combobox.txtl: Correct disambiguated method names in methods listing
- [836] trunk/wxsugar/lib/wx_sugar: Make :validator and :name sugary ctor args work for Controls classes
- [744] trunk/wxruby2: get_data support & mem mgmt to all ControlWithItems types, using more
- [966] branches/wxruby2/wxwidgets_282/doc/textile/listbox.txtl: Fix methods which don''t need a ''n'' item for arrays in Ruby