nobody at rubyforge.org
2007-Jan-06 01:11 UTC
[Wxruby-development] [836] trunk/wxsugar/lib/wx_sugar: Make :validator and :name sugary ctor args work for Controls classes
<!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>[836] trunk/wxsugar/lib/wx_sugar: Make :validator and :name sugary ctor args work for Controls classes</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>836</dd> <dt>Author</dt> <dd>brokentoy</dd> <dt>Date</dt> <dd>2007-01-05 20:11:43 -0500 (Fri, 05 Jan 2007)</dd> </dl> <h3>Log Message</h3> <pre>Make :validator and :name sugary ctor args work for Controls classes</pre> <h3>Modified Paths</h3> <ul> <li><a href="#trunkwxsugarlibwx_sugarkeyword_classesrb">trunk/wxsugar/lib/wx_sugar/keyword_classes.rb</a></li> <li><a href="#trunkwxsugarlibwx_sugarkeyword_constructorsrb">trunk/wxsugar/lib/wx_sugar/keyword_constructors.rb</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="trunkwxsugarlibwx_sugarkeyword_classesrb"></a> <div class="modfile"><h4>Modified: trunk/wxsugar/lib/wx_sugar/keyword_classes.rb (835 => 836)</h4> <pre class="diff"><span> <span class="info">--- trunk/wxsugar/lib/wx_sugar/keyword_classes.rb        2007-01-06 00:39:19 UTC (rev 835) +++ trunk/wxsugar/lib/wx_sugar/keyword_classes.rb        2007-01-06 01:11:43 UTC (rev 836) </span><span class="lines">@@ -78,6 +78,18 @@ </span><span class="cx"> end </span><span class="cx"> </span><span class="cx"> # wxSplashScreen         Splash screen class </span><ins>+# FIXME - this probably won''t work at present because the ''parent'' arg +# comes in a funny place in this class''s ctor +# +# WxSugar.define_keyword_ctors(''SplashScreen'') do +# wx_ctor_params :bitmap => Wx::NULL_BITMAP +# wx_ctor_params :splashstyle, :milliseconds, :id => 1 +# wx_ctor_params :parent => nil +# wx_ctor_params :title => '''' +# wx_ctor_params :pos, :size +# wx_ctor_params :style => Wx::SIMPLE_BORDER|Wx::FRAME_NO_TASKBAR|Wx::STAY_ON_TOP +# end + </ins><span class="cx"> # wxPropertySheetDialog         Property sheet dialog </span><span class="cx"> # wxTipWindow         Shows text in a small window </span><span class="cx"> </span><span class="lines">@@ -255,18 +267,19 @@ </span><span class="cx"> WxSugar.define_keyword_ctors(''Button'') do </span><span class="cx"> wx_ctor_params :label => '''' </span><span class="cx"> wx_ctor_params :pos, :size, :style </span><del>-# wx_ctor_params :validator, :name => ''button'' </del><ins>+ wx_ctor_params :validator, :name => ''button'' </ins><span class="cx"> end </span><span class="cx"> </span><span class="cx"> # Push button control, displaying a bitmap </span><span class="cx"> WxSugar.define_keyword_ctors(''BitmapButton'') do </span><span class="cx"> wx_ctor_params :bitmap, :pos, :size, :style => Wx::BU_AUTODRAW </span><ins>+ wx_ctor_params :validator, :name => ''button'' </ins><span class="cx"> end </span><span class="cx"> </span><span class="cx"> # A button which stays pressed when clicked by user. </span><span class="cx"> WxSugar.define_keyword_ctors(''ToggleButton'') do </span><span class="cx"> wx_ctor_params :label, :pos, :size, :style </span><del>- # wx_ctor_params :validator, :name => ''checkBox'' </del><ins>+ wx_ctor_params :validator, :name => ''checkBox'' </ins><span class="cx"> end </span><span class="cx"> </span><span class="cx"> # Control showing an entire calendar month </span><span class="lines">@@ -280,27 +293,27 @@ </span><span class="cx"> WxSugar.define_keyword_ctors(''CheckBox'') do </span><span class="cx"> wx_ctor_params :label => '''' </span><span class="cx"> wx_ctor_params :pos, :size, :style </span><del>- # wx_ctor_params :validator => Wx::DEFAULT_VALIDATOR, :name => ''checkBox'' </del><ins>+ wx_ctor_params :validator, :name => ''checkBox'' </ins><span class="cx"> end </span><span class="cx"> </span><span class="cx"> # A listbox with a checkbox to the left of each item </span><span class="cx"> WxSugar.define_keyword_ctors(''CheckListBox'') do          </span><span class="cx"> wx_ctor_params :pos, :size, :choices, :style </span><del>- # wx_ctor_params :validator, :name => ''listBox'' </del><ins>+ wx_ctor_params :validator, :name => ''listBox'' </ins><span class="cx"> end </span><span class="cx"> </span><span class="cx"> # wxChoice         Choice control (a combobox without the editable area) </span><span class="cx"> WxSugar.define_keyword_ctors(''Choice'') do </span><span class="cx"> wx_ctor_params :pos, :size, :choices, :style </span><del>-# wx_ctor_params :validator, :name => ''choice'' </del><ins>+ wx_ctor_params :validator, :name => ''choice'' </ins><span class="cx"> end </span><span class="cx"> </span><span class="cx"> # wxComboBox         A choice with an editable area </span><span class="cx"> WxSugar.define_keyword_ctors(''ComboBox'') do </span><span class="cx"> wx_ctor_params :value => '''' </span><span class="cx"> wx_ctor_params :pos, :size, :choices => [] </span><del>- wx_ctor_params :style -# wx_ctor_params :validator, :name => ''comboBox'' </del><ins>+ wx_ctor_params :style + wx_ctor_params :validator, :name => ''comboBox'' </ins><span class="cx"> end </span><span class="cx"> </span><span class="cx"> # wxDatePickerCtrl         Small date picker control </span><span class="lines">@@ -309,7 +322,7 @@ </span><span class="cx"> # remaining </span><span class="cx"> WxSugar.define_keyword_ctors(''Gauge'') do </span><span class="cx"> wx_ctor_params :range, :pos, :size, :style => Wx::GA_HORIZONTAL </span><del>- # wx_ctor_params :validator, :name </del><ins>+ wx_ctor_params :validator, :name </ins><span class="cx"> end </span><span class="cx"> </span><span class="cx"> # wxGenericDirCtrl         A control for displaying a directory tree </span><span class="lines">@@ -329,12 +342,13 @@ </span><span class="cx"> WxSugar.define_keyword_ctors(''ListBox'') do </span><span class="cx"> wx_ctor_params :pos, :size, :choices => [] </span><span class="cx"> wx_ctor_params :style </span><ins>+ wx_ctor_params :validator, :name => ''listBox'' </ins><span class="cx"> end </span><span class="cx"> </span><span class="cx"> # wxListCtrl         A control for displaying lists of strings and/or icons, plus a multicolumn report view </span><span class="cx"> WxSugar.define_keyword_ctors(''ListCtrl'') do </span><span class="cx"> wx_ctor_params :pos, :size, :style => Wx::LC_ICON </span><del>-# wx_ctor_params :validator, :name => ''listCtrlNameStr'' </del><ins>+ wx_ctor_params :validator, :name => ''listCtrl'' </ins><span class="cx"> end </span><span class="cx"> </span><span class="cx"> # wxListView         A simpler interface (facade for wxListCtrl in report mode </span><span class="lines">@@ -342,7 +356,7 @@ </span><span class="cx"> # wxTreeCtrl         Tree (hierarchy) control </span><span class="cx"> WxSugar.define_keyword_ctors(''TreeCtrl'') do </span><span class="cx"> wx_ctor_params :pos, :size, :style => Wx::TR_HAS_BUTTONS </span><del>-# wx_ctor_params :validator, :name => ''treeCtrl'' </del><ins>+ wx_ctor_params :validator, :name => ''treeCtrl'' </ins><span class="cx"> end </span><span class="cx"> </span><span class="cx"> # wxSpinCtrl         A spin control - i.e. spin button and text control </span><span class="lines">@@ -381,14 +395,14 @@ </span><span class="cx"> wx_ctor_params :pos, :size, :choices => [] </span><span class="cx"> wx_ctor_params :major_dimension => 0 </span><span class="cx"> wx_ctor_params :style => Wx::RA_SPECIFY_COLS </span><del>- # wx_ctor_params :validator, :name => ''radioBox'' </del><ins>+ wx_ctor_params :validator, :name => ''radioBox'' </ins><span class="cx"> end </span><span class="cx"> </span><del>-# wxRadioButton         A round button to be used with others in a mutually exclusive way </del><ins>+# wxRadioButton: A round button used with others in a mutually exclusive way </ins><span class="cx"> WxSugar.define_keyword_ctors(''RadioButton'') do </span><span class="cx"> wx_ctor_params :label => '''' </span><span class="cx"> wx_ctor_params :pos, :size, :style => 0 </span><del>- # wx_ctor_params :validator, :name => ''radioButton'' </del><ins>+ wx_ctor_params :validator, :name => ''radioButton'' </ins><span class="cx"> end </span><span class="cx"> </span><span class="cx"> # wxSlider         A slider that can be dragged by the user </span><span class="lines">@@ -396,10 +410,9 @@ </span><span class="cx"> wx_ctor_params :value => 0 </span><span class="cx"> wx_ctor_params :min_value, :max_value </span><span class="cx"> wx_ctor_params :pos, :size, :style => Wx::SL_HORIZONTAL </span><del>- # wx_ctor_params :validator, :name => ''radioButton'' </del><ins>+ wx_ctor_params :validator, :name => ''slider'' </ins><span class="cx"> end </span><span class="cx"> </span><del>- </del><span class="cx"> # wxSpinButton - Has two small up and down (or left and right) arrow buttons </span><span class="cx"> WxSugar.define_keyword_ctors(''SpinButton'') do </span><span class="cx"> wx_ctor_params :pos, :size, :style => Wx::SP_HORIZONTAL </span><span class="lines">@@ -412,7 +425,7 @@ </span><span class="cx"> WxSugar.define_keyword_ctors(''TextCtrl'') do </span><span class="cx"> wx_ctor_params :value => '''' </span><span class="cx"> wx_ctor_params :pos, :size, :style </span><del>- # wx_ctor_params validator, :name => ''textCtrl'' </del><ins>+ wx_ctor_params :validator, :name => ''textCtrl'' </ins><span class="cx"> end </span><span class="cx"> </span><span class="cx"> # wxHtmlWindow - Control for displaying HTML </span></span></pre></div> <a id="trunkwxsugarlibwx_sugarkeyword_constructorsrb"></a> <div class="modfile"><h4>Modified: trunk/wxsugar/lib/wx_sugar/keyword_constructors.rb (835 => 836)</h4> <pre class="diff"><span> <span class="info">--- trunk/wxsugar/lib/wx_sugar/keyword_constructors.rb        2007-01-06 00:39:19 UTC (rev 835) +++ trunk/wxsugar/lib/wx_sugar/keyword_constructors.rb        2007-01-06 01:11:43 UTC (rev 836) </span><span class="lines">@@ -106,7 +106,7 @@ </span><span class="cx"> :size => Wx::DEFAULT_SIZE, </span><span class="cx"> :pos => Wx::DEFAULT_POSITION, </span><span class="cx"> :style => 0, </span><del>- :validator => nil, # Should be Wx::DefaultValidator </del><ins>+ :validator => Wx::DEFAULT_VALIDATOR, </ins><span class="cx"> :choices => [] # for Choice, ComboBox etc </span><span class="cx"> } </span><span class="cx"> </span></span></pre> </div> </div> </body> </html>
Maybe Matching Threads
- [770] trunk/wxsugar/lib/wx_sugar/keyword_classes.rb: Fix some broken ones (Alex Spelling), add some new & missing ones; add
- [764] trunk/wxsugar/lib/wx_sugar/keyword_classes.rb: Correct duplicate and incorrect definition of SpinCtrl constructor
- [972] trunk/wxsugar/lib/wx_sugar/keyword_classes.rb: Fix missing keyword param for Wx::Gauge
- [805] trunk/wxsugar/lib/wx_sugar/keyword_classes.rb: NULL_BITMAP is now defined when wxruby2 is loaded, so dummy def not needed
- wxSugar control problem