nobody at rubyforge.org
2006-Dec-03 17:30 UTC
[Wxruby-development] [778] trunk/wxruby2: Remove broken and deprecated LayoutConstraints, update samples & docs
<!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>[778] trunk/wxruby2: Remove broken and deprecated
LayoutConstraints, update samples & docs</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>778</dd>
<dt>Author</dt> <dd>brokentoy</dd>
<dt>Date</dt> <dd>2006-12-03 12:30:10 -0500 (Sun, 03 Dec
2006)</dd>
</dl>
<h3>Log Message</h3>
<pre>Remove broken and deprecated LayoutConstraints, update samples &
docs</pre>
<h3>Modified Paths</h3>
<ul>
<li><a
href="#trunkwxruby2doctextileindividuallayoutconstrainttxtl">trunk/wxruby2/doc/textile/individuallayoutconstraint.txtl</a></li>
<li><a
href="#trunkwxruby2doctextilelayoutconstraintstxtl">trunk/wxruby2/doc/textile/layoutconstraints.txtl</a></li>
<li><a
href="#trunkwxruby2samplesbigdemobigdemorb">trunk/wxruby2/samples/bigdemo/bigdemo.rb</a></li>
<li><a
href="#trunkwxruby2samplesbigdemowxScrolledMessageDialogrbw">trunk/wxruby2/samples/bigdemo/wxScrolledMessageDialog.rbw</a></li>
<li><a
href="#trunkwxruby2samplescontrolscontrolsrb">trunk/wxruby2/samples/controls/controls.rb</a></li>
<li><a
href="#trunkwxruby2swigclassesWindowi">trunk/wxruby2/swig/classes/Window.i</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a
href="#trunkwxruby2samplesbigdemowxLayoutConstraintsrbw">trunk/wxruby2/samples/bigdemo/wxLayoutConstraints.rbw</a></li>
<li><a
href="#trunkwxruby2swigclassesIndividualLayoutConstrainti">trunk/wxruby2/swig/classes/IndividualLayoutConstraint.i</a></li>
<li><a
href="#trunkwxruby2swigclassesLayoutConstraintsi">trunk/wxruby2/swig/classes/LayoutConstraints.i</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a
id="trunkwxruby2doctextileindividuallayoutconstrainttxtl"></a>
<div class="modfile"><h4>Modified:
trunk/wxruby2/doc/textile/individuallayoutconstraint.txtl (777 =>
778)</h4>
<pre class="diff"><span>
<span class="info">---
trunk/wxruby2/doc/textile/individuallayoutconstraint.txtl        2006-12-03
15:49:05 UTC (rev 777)
+++
trunk/wxruby2/doc/textile/individuallayoutconstraint.txtl        2006-12-03
17:30:10 UTC (rev 778)
</span><span class="lines">@@ -1,143 +1,6 @@
</span><span class="cx">
h1(#wxindividuallayoutconstraint). Wx::IndividualLayoutConstraint
</span><span class="cx">
</span><del>-Objects of this class are stored in the
LayoutConstraint class
-as one of eight possible constraints that a window can be involved in.
</del><ins>+*Note:* constraints are deprecated in WxWidgets and are
not supported in
+WxRuby. You should use "sizers":sizer.html instead to create flexible
+resizeable layouts.
</ins><span class="cx">
</span><del>-Constraints are initially set to have the relationship
Unconstrained,
-which means that their values should be calculated by looking at known
constraints.
-
-h2. Derived from
-
-"Object":object.html
-
-h2. See also
-
-"Overview and examples":constraintsoverview.html,
"LayoutConstraints":layoutconstraints.html,
"Window#set_constraints":window.html#Window_setconstraints.
-
-<div id="methods">
-
-h2. Methods
-
-* "IndividualLayoutConstraint.new":#IndividualLayoutConstraint_new
-*
"IndividualLayoutConstraint#above":#IndividualLayoutConstraint_above
-*
"IndividualLayoutConstraint#absolute":#IndividualLayoutConstraint_absolute
-* "IndividualLayoutConstraint#as_is":#IndividualLayoutConstraint_asis
-*
"IndividualLayoutConstraint#below":#IndividualLayoutConstraint_below
-*
"IndividualLayoutConstraint#unconstrained":#IndividualLayoutConstraint_unconstrained
-*
"IndividualLayoutConstraint#left_of":#IndividualLayoutConstraint_leftof
-*
"IndividualLayoutConstraint#percent_of":#IndividualLayoutConstraint_percentof
-*
"IndividualLayoutConstraint#right_of":#IndividualLayoutConstraint_rightof
-*
"IndividualLayoutConstraint#same_as":#IndividualLayoutConstraint_sameas
-* "IndividualLayoutConstraint#set":#IndividualLayoutConstraint_set
-
-</div>
-
-
-Edges and relationships
-
-The _Edge_Edge enumerated type specifies the type of edge or dimension of a
window.
-
-
-|Left|The left edge.|
-|Top|The top edge.|
-|Right|The right edge.|
-|Bottom|The bottom edge.|
-|CentreX|The x-coordinate of the centre of the window.|
-|CentreY|The y-coordinate of the centre of the window.|
-
-
-The _Relationship_Relationship enumerated type specifies the relationship that
-this edge or dimension has with another specified edge or dimension. Normally,
the user
-doesn''t use these directly because functions such as _Below_ and
_RightOf_ are a convenience
-for using the more general _Set_ function.
-
-
-|Unconstrained|The edge or dimension is unconstrained (the default for edges.|
-|AsIs|The edge or dimension is to be taken from the current window position or
size (thedefault for dimensions.|
-|Above|The edge should be above another edge.|
-|Below|The edge should be below another edge.|
-|LeftOf|The edge should be to the left of another edge.|
-|RightOf|The edge should be to the right of another edge.|
-|SameAs|The edge or dimension should be the same as another edge or dimension.|
-|PercentOf|The edge or dimension should be a percentage of another edge or
dimension.|
-|Absolute|The edge or dimension should be a given absolute value.|
-
-
-h3(#IndividualLayoutConstraint_new). IndividualLayoutConstraint.new
-
-h3(#IndividualLayoutConstraint_above). IndividualLayoutConstraint#above
-
- *above*(%(arg-type)Window% otherWin, %(arg-type)Integer% margin = 0)
-
-Constrains this edge to be above the given window, with an
-optional margin. Implicitly, this is relative to the top edge of the other
window.
-
-h3(#IndividualLayoutConstraint_absolute). IndividualLayoutConstraint#absolute
-
- *absolute*(%(arg-type)Integer% value)
-
-Constrains this edge or dimension to be the given absolute value.
-
-h3(#IndividualLayoutConstraint_asis). IndividualLayoutConstraint#as_is
-
- *as_is*()
-
-Sets this edge or constraint to be whatever the window''s value is
-at the moment. If either of the width and height constraints
-are _as is_, the window will not be resized, but moved instead.
-This is important when considering panel items which are intended
-to have a default size, such as a button, which may take its size
-from the size of the button label.
-
-h3(#IndividualLayoutConstraint_below). IndividualLayoutConstraint#below
-
- *below*(%(arg-type)Window% otherWin, %(arg-type)Integer% margin = 0)
-
-Constrains this edge to be below the given window, with an
-optional margin. Implicitly, this is relative to the bottom edge of the other
window.
-
-h3(#IndividualLayoutConstraint_unconstrained).
IndividualLayoutConstraint#unconstrained
-
- *unconstrained*()
-
-Sets this edge or dimension to be unconstrained, that is, dependent on
-other edges and dimensions from which this value can be deduced.
-
-h3(#IndividualLayoutConstraint_leftof). IndividualLayoutConstraint#left_of
-
- *left_of*(%(arg-type)Window% otherWin, %(arg-type)Integer% margin = 0)
-
-Constrains this edge to be to the left of the given window, with an
-optional margin. Implicitly, this is relative to the left edge of the other
window.
-
-h3(#IndividualLayoutConstraint_percentof).
IndividualLayoutConstraint#percent_of
-
- *percent_of*(%(arg-type)Window% otherWin, %(arg-type)Edge% edge,
%(arg-type)Integer% per)
-
-Constrains this edge or dimension to be to a percentage of the given window,
with an
-optional margin.
-
-h3(#IndividualLayoutConstraint_rightof). IndividualLayoutConstraint#right_of
-
- *right_of*(%(arg-type)Window% otherWin, %(arg-type)Integer% margin = 0)
-
-Constrains this edge to be to the right of the given window, with an
-optional margin. Implicitly, this is relative to the right edge of the other
window.
-
-h3(#IndividualLayoutConstraint_sameas). IndividualLayoutConstraint#same_as
-
- *same_as*(%(arg-type)Window% otherWin, %(arg-type)Edge% edge,
%(arg-type)Integer% margin = 0)
-
-Constrains this edge or dimension to be to the same as the edge of the given
window, with an
-optional margin.
-
-h3(#IndividualLayoutConstraint_set). IndividualLayoutConstraint#set
-
- *set*(%(arg-type)Relationship% rel, %(arg-type)Window% otherWin,
%(arg-type)Edge% otherEdge,
- %(arg-type)Integer% value = 0,
- %(arg-type)Integer% margin = 0)
-
-Sets the properties of the constraint. Normally called by one of the
convenience
-functions such as Above, RightOf, SameAs.
-
-
</del></span></pre></div>
<a id="trunkwxruby2doctextilelayoutconstraintstxtl"></a>
<div class="modfile"><h4>Modified:
trunk/wxruby2/doc/textile/layoutconstraints.txtl (777 => 778)</h4>
<pre class="diff"><span>
<span class="info">---
trunk/wxruby2/doc/textile/layoutconstraints.txtl        2006-12-03
15:49:05 UTC (rev 777)
+++
trunk/wxruby2/doc/textile/layoutconstraints.txtl        2006-12-03
17:30:10 UTC (rev 778)
</span><span class="lines">@@ -1,108 +1,5 @@
</span><span class="cx"> h1(#wxlayoutconstraints).
Wx::LayoutConstraints
</span><span class="cx">
</span><del>-*Note:* constraints are now deprecated and you should
use "sizers":sizeroverview.html instead.
-
-Objects of this class can be associated with a window to define its
-layout constraints, with respect to siblings or its parent.
-
-The class consists of the following eight constraints of class
IndividualLayoutConstraint,
-some or all of which should be accessed directly to set the appropriate
-constraints.
-
-
-* *left:* represents the left hand edge of the window
-* *right:* represents the right hand edge of the window
-* *top:* represents the top edge of the window
-* *bottom:* represents the bottom edge of the window
-* *width:* represents the width of the window
-* *height:* represents the height of the window
-* *centreX:* represents the horizontal centre point of the window
-* *centreY:* represents the vertical centre point of the window
-
-
-Most constraints are initially set to have the relationship Unconstrained,
-which means that their values should be calculated by looking at known
constraints.
-The exceptions are _width_ and _height_, which are set to AsIs to
-ensure that if the user does not specify a constraint, the existing
-width and height will be used, to be compatible with panel items which often
-have take a default size. If the constraint is AsIs, the dimension will
-not be changed.
-
-
-
-h2. Derived from
-
-"Object":object.html
-
-h2. See also
-
-"Overview and examples":constraintsoverview.html,
"IndividualLayoutConstraint":individuallayoutconstraint.html,
"Window#set_constraints":window.html#Window_setconstraints
-
-<div id="methods">
-
-h2. Methods
-
-* "LayoutConstraints.new":#LayoutConstraints_new
-* "LayoutConstraints#bottom":#LayoutConstraints_bottom
-* "LayoutConstraints#centre_x":#LayoutConstraints_centrex
-* "LayoutConstraints#centre_y":#LayoutConstraints_centrey
-* "LayoutConstraints#height":#LayoutConstraints_height
-* "LayoutConstraints#left":#LayoutConstraints_left
-* "LayoutConstraints#right":#LayoutConstraints_right
-* "LayoutConstraints#top":#LayoutConstraints_top
-* "LayoutConstraints#width":#LayoutConstraints_width
-
-</div>
-
-
-h3(#LayoutConstraints_new). LayoutConstraints.new
-
-h3(#LayoutConstraints_bottom). LayoutConstraints#bottom
-
-IndividualLayoutConstraintbottom
-
-Constraint for the bottom edge.
-
-h3(#LayoutConstraints_centrex). LayoutConstraints#centre_x
-
-IndividualLayoutConstraintcentreX
-
-Constraint for the horizontal centre point.
-
-h3(#LayoutConstraints_centrey). LayoutConstraints#centre_y
-
-IndividualLayoutConstraintcentreY
-
-Constraint for the vertical centre point.
-
-h3(#LayoutConstraints_height). LayoutConstraints#height
-
-IndividualLayoutConstraintheight
-
-Constraint for the height.
-
-h3(#LayoutConstraints_left). LayoutConstraints#left
-
-IndividualLayoutConstraintleft
-
-Constraint for the left-hand edge.
-
-h3(#LayoutConstraints_right). LayoutConstraints#right
-
-IndividualLayoutConstraintright
-
-Constraint for the right-hand edge.
-
-h3(#LayoutConstraints_top). LayoutConstraints#top
-
-IndividualLayoutConstrainttop
-
-Constraint for the top edge.
-
-h3(#LayoutConstraints_width). LayoutConstraints#width
-
-IndividualLayoutConstraintwidth
-
-Constraint for the width.
-
-
</del><ins>+*Note:* constraints are deprecated in WxWidgets and are
not supported in
+WxRuby. You should use "sizers":sizer.html instead to create flexible
+resizeable layouts.
</ins></span></pre></div>
<a id="trunkwxruby2samplesbigdemobigdemorb"></a>
<div class="modfile"><h4>Modified:
trunk/wxruby2/samples/bigdemo/bigdemo.rb (777 => 778)</h4>
<pre class="diff"><span>
<span class="info">---
trunk/wxruby2/samples/bigdemo/bigdemo.rb        2006-12-03
15:49:05 UTC (rev 777)
+++
trunk/wxruby2/samples/bigdemo/bigdemo.rb        2006-12-03
17:30:10 UTC (rev 778)
</span><span class="lines">@@ -146,7 +146,6 @@
</span><span class="cx"> #
''Layoutf'',
</span><span class="cx"> #
''RowColSizer'',
</span><span class="cx">
''Sizers'',
</span><del>- ''wxLayoutConstraints'',
</del><span class="cx"> #
''wxScrolledPanel'',
</span><span class="cx"> #
''wxXmlResource'',
</span><span class="cx"> #
''wxXmlResourceHandler'',
</span></span></pre></div>
<a
id="trunkwxruby2samplesbigdemowxLayoutConstraintsrbw"></a>
<div class="delfile"><h4>Deleted:
trunk/wxruby2/samples/bigdemo/wxLayoutConstraints.rbw (777 => 778)</h4>
<pre class="diff"><span>
<span class="info">---
trunk/wxruby2/samples/bigdemo/wxLayoutConstraints.rbw        2006-12-03
15:49:05 UTC (rev 777)
+++
trunk/wxruby2/samples/bigdemo/wxLayoutConstraints.rbw        2006-12-03
17:30:10 UTC (rev 778)
</span><span class="lines">@@ -1,114 +0,0 @@
</span><del>-#!/usr/bin/env ruby
-
-begin
- require ''wx''
-rescue LoadError => no_wx_err
- begin
- require ''rubygems''
- require ''wx''
- rescue LoadError
- raise no_wx_err
- end
-end
-
-class TestLayoutConstraints < Wx::Panel
- def initialize(parent)
- super(parent, -1)
- set_auto_layout(true)
- evt_button(100) {|event| on_button(event)}
-
- set_background_colour(Wx::Colour.new("MEDIUM ORCHID"))
-
- @panelA = Wx::Window.new(self, -1, Wx::DEFAULT_POSITION,
Wx::DEFAULT_SIZE, Wx::SIMPLE_BORDER)
- @panelA.set_background_colour(Wx::BLUE)
- txt = Wx::StaticText.new(@panelA, -1, "Resize the window and
see\nwhat happens... Notice that\nthere is no OnSize handler.",
- Wx::Point.new(5,5), Wx::Size.new(-1,50))
- txt.set_background_colour(Wx::BLUE)
- txt.set_foreground_colour(Wx::WHITE)
-
- lc = Wx::LayoutConstraints.new()
- lc.top.same_as(self, Wx::LAYOUT_TOP, 10)
- lc.left.same_as(self, Wx::LAYOUT_LEFT, 10)
- lc.bottom.same_as(self, Wx::LAYOUT_BOTTOM, 10)
- lc.right.percent_of(self, Wx::LAYOUT_RIGHT, 50)
- @panelA.set_constraints(lc)
-
- @panelB = Wx::Window.new(self, -1, Wx::DEFAULT_POSITION,
Wx::DEFAULT_SIZE, Wx::SIMPLE_BORDER)
- @panelB.set_background_colour(Wx::RED)
- lc = Wx::LayoutConstraints.new()
- lc.top.same_as(self, Wx::LAYOUT_TOP, 10)
- lc.right.same_as(self, Wx::LAYOUT_RIGHT, 10)
- lc.bottom.percent_of(self, Wx::LAYOUT_BOTTOM, 30)
- lc.left.right_of(@panelA, 10)
- @panelB.set_constraints(lc)
-
- @panelC = Wx::Window.new(self, -1, Wx::DEFAULT_POSITION,
Wx::DEFAULT_SIZE,
- Wx::SIMPLE_BORDER)
- @panelC.set_background_colour(Wx::WHITE)
- lc = Wx::LayoutConstraints.new()
- lc.top.below(@panelB, 10)
- lc.right.same_as(self, Wx::LAYOUT_RIGHT, 10)
- lc.bottom.same_as(self, Wx::LAYOUT_BOTTOM, 10)
- lc.left.right_of(@panelA, 10)
- @panelC.set_constraints(lc)
-
- b = Wx::Button.new(@panelA, 100, '' Panel A '')
- lc = Wx::LayoutConstraints.new()
- lc.centre_x.same_as(@panelA, Wx::LAYOUT_CENTRE_X)
- lc.centre_y.same_as(@panelA, Wx::LAYOUT_CENTRE_Y)
- lc.height.as_is()
- lc.width.percent_of(@panelA, Wx::LAYOUT_WIDTH, 50)
- b.set_constraints(lc)
-
- b = Wx::Button.new(@panelB, 100, '' Panel B '')
- lc = Wx::LayoutConstraints.new()
- lc.top.same_as(@panelB, Wx::LAYOUT_TOP, 2)
- lc.right.same_as(@panelB, Wx::LAYOUT_RIGHT, 4)
- lc.height.as_is()
- lc.width.as_is()
- b.set_constraints(lc)
-
- @panelD = Wx::Window.new(@panelC, -1, Wx::DEFAULT_POSITION,
Wx::DEFAULT_SIZE,
- Wx::SIMPLE_BORDER)
- @panelD.set_background_colour(Wx::GREEN)
- Wx::StaticText.new(@panelD, -1, "Panel D", Wx::Point.new(4,
4)).set_background_colour(Wx::GREEN)
-
- b = Wx::Button.new(@panelC, 100, '' Panel C '')
- lc = Wx::LayoutConstraints.new()
- lc.top.below(@panelD)
- lc.left.right_of(@panelD)
- lc.height.as_is()
- lc.width.as_is()
- b.set_constraints(lc)
-
- lc = Wx::LayoutConstraints.new()
- lc.bottom.percent_of(@panelC, Wx::LAYOUT_HEIGHT, 50)
- lc.right.percent_of(@panelC, Wx::LAYOUT_WIDTH, 50)
- lc.height.same_as(b, Wx::LAYOUT_HEIGHT)
- lc.width.same_as(b, Wx::LAYOUT_WIDTH)
- @panelD.set_constraints(lc)
-
- end
-
- def on_button(event)
-
- end
-end
-
-module Demo
- def Demo.run(frame, nb, log)
- win = TestLayoutConstraints.new(nb)
- return win
- end
-
- def Demo.overview
- return ""
- end
-end
-
-
-if __FILE__ == $0
- run_solo_lib = File.join( File.dirname(__FILE__), ''run.rb'')
- load run_solo_lib
- run File.basename($0)
-end
</del></span></pre></div>
<a
id="trunkwxruby2samplesbigdemowxScrolledMessageDialogrbw"></a>
<div class="modfile"><h4>Modified:
trunk/wxruby2/samples/bigdemo/wxScrolledMessageDialog.rbw (777 =>
778)</h4>
<pre class="diff"><span>
<span class="info">---
trunk/wxruby2/samples/bigdemo/wxScrolledMessageDialog.rbw        2006-12-03
15:49:05 UTC (rev 777)
+++
trunk/wxruby2/samples/bigdemo/wxScrolledMessageDialog.rbw        2006-12-03
17:30:10 UTC (rev 778)
</span><span class="lines">@@ -12,31 +12,29 @@
</span><span class="cx"> end
</span><span class="cx">
</span><span class="cx"> class ScrolledMessageDialog <
Wx::Dialog
</span><del>- def initialize(parent, msg, caption, pos =
Wx::DEFAULT_POSITION, size = Wx::Size.new(500,300))
</del><ins>+ def initialize(parent, msg, caption,
+ pos = Wx::DEFAULT_POSITION,
+ size = Wx::Size.new(500,300) )
</ins><span class="cx"> super(parent, -1, caption,
pos, size)
</span><span class="cx"> x,y = pos.x, pos.y
</span><span class="cx"> if x == -1 and y == -1
</span><span class="cx">
center_on_screen(Wx::BOTH)
</span><span class="cx"> end
</span><del>- text = Wx::TextCtrl.new(self, -1, msg,
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE, Wx::TE_MULTILINE | Wx::TE_READONLY)
- ok = Wx::Button.new(self, Wx::ID_OK, "OK")
- lc = Wx::LayoutConstraints.new()
- lc.top.same_as(self, Wx::LAYOUT_TOP, 5)
- lc.bottom.same_as(ok, Wx::LAYOUT_TOP, 5)
- lc.right.same_as(self, Wx::LAYOUT_RIGHT, 5)
- lc.left.same_as(self, Wx::LAYOUT_LEFT, 5)
-
- text.set_constraints(lc)
-
- lc = Wx::LayoutConstraints.new()
- lc.bottom.same_as(self, Wx::LAYOUT_BOTTOM, 5)
- lc.centre_x.percent_of(self, Wx::LAYOUT_WIDTH, 50)
- lc.width.absolute(80)
- lc.height.absolute(25)
-
- ok.set_constraints(lc)
- set_auto_layout(true)
- layout()
</del><ins>+ sizer = Wx::BoxSizer.new(Wx::VERTICAL)
+ text = Wx::TextCtrl.new(self, -1, msg,
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
+ Wx::TE_MULTILINE|Wx::TE_READONLY)
+
+ sizer.add(text, 1, Wx::EXPAND|Wx::ALL, 5)
+
+ button_sizer = Wx::StdDialogButtonSizer.new
+ button_sizer.add_button( Wx::Button.new(self, Wx::ID_OK,
"OK") )
+ button_sizer.realize
+
+ sizer.add(button_sizer, 0, Wx::EXPAND|Wx::ALL, 5)
+
+ set_sizer(sizer)
+ layout
</ins><span class="cx"> end
</span><span class="cx"> end
</span><span class="cx">
</span><span class="lines">@@ -49,7 +47,8 @@
</span><span class="cx"> end
</span><span class="cx">
</span><span class="cx"> def Demo.overview
</span><del>- return "Ported from wxPython. Many thanks
again to Robin Dunn!"
</del><ins>+ return "A simple ruby example of a custom
dialog displaying a " +
+ "long message in a scrolled TextCtrl"
</ins><span class="cx"> end
</span><span class="cx"> end
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwxruby2samplescontrolscontrolsrb"></a>
<div class="modfile"><h4>Modified:
trunk/wxruby2/samples/controls/controls.rb (777 => 778)</h4>
<pre class="diff"><span>
<span class="info">---
trunk/wxruby2/samples/controls/controls.rb        2006-12-03
15:49:05 UTC (rev 777)
+++
trunk/wxruby2/samples/controls/controls.rb        2006-12-03
17:30:10 UTC (rev 778)
</span><span class="lines">@@ -90,24 +90,7 @@
</span><span class="cx">
</span><span class="cx"> Image_List, Image_Choice,
Image_Combo, Image_Text, Image_Radio, Image_Gauge, Image_Max = (0..6).to_a
</span><span class="cx">
</span><del>-def Myset_client_data(name,control)
- # NOTE: get_client_data and set_client_data have been removed from wxRuby
0.4
- # because they could cause crashes
- return
-
-# count = control.get_count()
-# for n in 0 ... count
-# s = sprintf("%s client data for ''%s''",
-# name, control.get_string(n))
-# control.set_client_data(n, s)
- # NOTE: As of wxRuby 0.2, the following will demonstrate the
- # set_client_data and get_client_data are unreliable. Specifically,
- # garbage collection will release the stored data! 2004-03-29 kbs
- #GC.start
-# end
-end
</del><span class="cx">
</span><del>-
</del><span class="cx"> # a button which intercepts double
clicks (for testing...)
</span><span class="cx"> class MyButton < Button
</span><span class="cx"> def
initialize(parent,id,label = EmptyString,pos = DEFAULT_POSITION,size =
DEFAULT_SIZE)
</span><span class="lines">@@ -247,8 +230,6 @@
</span><span class="cx">
Point.new(10,90), Size.new(120,70),
</span><span class="cx">
choices, LB_SORT )
</span><span class="cx">
</span><del>- Myset_client_data("listbox",
@m_listbox)
- Myset_client_data("listbox", @m_listboxSorted)
</del><span class="cx">
</span><span class="cx">
@m_listbox.set_cursor(CROSS_CURSOR)
</span><span class="cx">
</span><span class="lines">@@ -281,9 +262,6 @@
</span><span class="cx"> @m_choiceSorted =
Choice.new( panel, ID_CHOICE_SORTED, Point.new(10,70), Size.new(120,-1),
</span><span class="cx">
choices, CB_SORT )
</span><span class="cx">
</span><del>- Myset_client_data("choice",
@m_choice)
- Myset_client_data("choice", @m_choiceSorted)
-
</del><span class="cx"> @m_choice.set_selection(2)
</span><span class="cx">
@m_choice.set_background_colour(Colour.new("red"))
</span><span class="cx"> Button.new( panel,
ID_CHOICE_SEL_NUM, "Select #&2", Point.new(180,30),
Size.new(140,30) )
</span><span class="lines">@@ -409,11 +387,8 @@
</span><span class="cx">
</span><span class="cx"> #
bmpBtn.set_bitmap_selected(bmp2)
</span><span class="cx"> #
bmpBtn.set_bitmap_focus(bmp3)
</span><del>-
-if !(RUBY_PLATFORM =~ /darwin/)
- ToggleButton.new(panel, ID_BUTTON_LABEL,
- "&Toggle label", Point.new(250,
20))
-end
</del><ins>+ ToggleButton.new(panel, ID_BUTTON_LABEL,
+ "&Toggle label", Point.new(250, 20))
</ins><span class="cx"> @m_label =
StaticText.new(panel, -1, "Label with some long text",
</span><span class="cx">
Point.new(250, 60), DEFAULT_SIZE,
</span><span class="cx">
ALIGN_RIGHT)
</span><span class="lines">@@ -421,31 +396,6 @@
</span><span class="cx">
</span><span class="cx">
@m_notebook.add_page(panel, "BitmapXXX")
</span><span class="cx">
</span><del>- # layout constraints
-
- panel = Panel.new(@m_notebook)
- panel.set_auto_layout( TRUE )
-
- c = LayoutConstraints.new
- c.top.same_as( panel, LAYOUT_TOP, 10 )
- c.height.as_is( )
- c.left.same_as( panel, LAYOUT_LEFT, 10 )
- c.width.percent_of( panel, LAYOUT_WIDTH, 40 )
-
- pMyButton = Button.new(panel, ID_BUTTON_TEST1, "Test Button
&1" )
- pMyButton.set_constraints( c )
-
- c = LayoutConstraints.new
- c.top.same_as( panel, LAYOUT_TOP, 10 )
- c.bottom.same_as( panel, LAYOUT_BOTTOM, 10 )
- c.right.same_as( panel, LAYOUT_RIGHT, 10 )
- c.width.percent_of( panel, LAYOUT_WIDTH, 40 )
-
- pMyButton2 = Button.new(panel, ID_BUTTON_TEST2, "Test Button
&2" )
- pMyButton2.set_constraints( c )
-
- @m_notebook.add_page(panel, "layoutConstraint")
-
</del><span class="cx"> # sizer
</span><span class="cx">
</span><span class="cx"> panel =
Panel.new(@m_notebook)
</span></span></pre></div>
<a
id="trunkwxruby2swigclassesIndividualLayoutConstrainti"></a>
<div class="delfile"><h4>Deleted:
trunk/wxruby2/swig/classes/IndividualLayoutConstraint.i (777 =>
778)</h4>
<pre class="diff"><span>
<span class="info">---
trunk/wxruby2/swig/classes/IndividualLayoutConstraint.i        2006-12-03
15:49:05 UTC (rev 777)
+++
trunk/wxruby2/swig/classes/IndividualLayoutConstraint.i        2006-12-03
17:30:10 UTC (rev 778)
</span><span class="lines">@@ -1,10 +0,0 @@
</span><del>-# Copyright 2004-2005 by Kevin Smith
-# released under the MIT-style wxruby2 license
-
-%include "../common.i"
-
-%module(directors="1") wxIndividualLayoutConstraint
-
-%import "include/wxObject.h"
-
-%include "include/wxIndividualLayoutConstraint.h"
</del></span></pre></div>
<a id="trunkwxruby2swigclassesLayoutConstraintsi"></a>
<div class="delfile"><h4>Deleted:
trunk/wxruby2/swig/classes/LayoutConstraints.i (777 => 778)</h4>
<pre class="diff"><span>
<span class="info">---
trunk/wxruby2/swig/classes/LayoutConstraints.i        2006-12-03
15:49:05 UTC (rev 777)
+++
trunk/wxruby2/swig/classes/LayoutConstraints.i        2006-12-03
17:30:10 UTC (rev 778)
</span><span class="lines">@@ -1,12 +0,0 @@
</span><del>-# Copyright 2004-2005 by Kevin Smith
-# released under the MIT-style wxruby2 license
-
-%include "../common.i"
-
-%module(directors="1") wxLayoutConstraints
-
-//%include "include/wxIndividualLayoutConstraint.h"
-
-%import "include/wxObject.h"
-
-%include "include/wxLayoutConstraints.h"
</del></span></pre></div>
<a id="trunkwxruby2swigclassesWindowi"></a>
<div class="modfile"><h4>Modified:
trunk/wxruby2/swig/classes/Window.i (777 => 778)</h4>
<pre class="diff"><span>
<span class="info">---
trunk/wxruby2/swig/classes/Window.i        2006-12-03
15:49:05 UTC (rev 777)
+++
trunk/wxruby2/swig/classes/Window.i        2006-12-03
17:30:10 UTC (rev 778)
</span><span class="lines">@@ -11,6 +11,9 @@
</span><span class="cx"> %ignore
wxWindow::PopEventHandler;
</span><span class="cx"> # %ignore wxWindow::SetCaret;
</span><span class="cx">
</span><ins>+// LayoutConstraints are deprecated and not supported
in WxRuby
+%ignore wxWindow::SetConstraints;
+
</ins><span class="cx"> // only support the variants that
return an object
</span><span class="cx"> %ignore wxWindow::GetSize(int*
width , int* height ) const;
</span><span class="cx"> %ignore
wxWindow::GetPosition(int* x , int* y ) const;
</span></span></pre>
</div>
</div>
</body>
</html>
