wxruby 1.9.9-x86-mingw32 → 1.9.10-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. data/LICENSE +53 -53
  2. data/README +297 -297
  3. data/lib/wx.rb +53 -53
  4. data/lib/wx/classes/bitmap.rb +29 -1
  5. data/lib/wx/classes/clipboard.rb +19 -3
  6. data/lib/wx/classes/colour.rb +6 -4
  7. data/lib/wx/classes/data_object.rb +14 -0
  8. data/lib/wx/classes/data_object_simple.rb +6 -0
  9. data/lib/wx/classes/dataformat.rb +23 -0
  10. data/lib/wx/classes/evthandler.rb +31 -4
  11. data/lib/wx/classes/genericdirctrl.rb +36 -0
  12. data/lib/wx/classes/grid.rb +8 -0
  13. data/lib/wx/classes/hboxsizer.rb +6 -0
  14. data/lib/wx/classes/icon.rb +12 -1
  15. data/lib/wx/classes/image.rb +13 -1
  16. data/lib/wx/classes/listctrl.rb +12 -0
  17. data/lib/wx/classes/point.rb +8 -0
  18. data/lib/wx/classes/rect.rb +10 -1
  19. data/lib/wx/classes/richtextctrl.rb +22 -0
  20. data/lib/wx/classes/size.rb +9 -0
  21. data/lib/wx/classes/sizer.rb +18 -3
  22. data/lib/wx/classes/toolbar.rb +4 -6
  23. data/lib/wx/classes/vboxsizer.rb +6 -0
  24. data/lib/wx/classes/window.rb +7 -0
  25. data/lib/wx/classes/xmlresource.rb +17 -0
  26. data/lib/wx/helpers.rb +16 -1
  27. data/lib/wx/keyword_ctors.rb +3 -2
  28. data/lib/wx/keyword_defs.rb +27 -5
  29. data/lib/wx/version.rb +1 -1
  30. data/lib/wxruby2.so +0 -0
  31. data/samples/SAMPLES-LICENSE.TXT +17 -17
  32. data/samples/bigdemo/About.rbw +39 -39
  33. data/samples/bigdemo/ColorPanel.rbw +23 -23
  34. data/samples/bigdemo/GridSimple.rbw +78 -78
  35. data/samples/bigdemo/MDIDemo.rbw +57 -57
  36. data/samples/bigdemo/PopupMenu.rbw +149 -149
  37. data/samples/bigdemo/Sizers.rbw +543 -543
  38. data/samples/bigdemo/bigdemo.rb +823 -823
  39. data/samples/bigdemo/demoTemplate.rbw +33 -33
  40. data/samples/bigdemo/icons/choice.xpm +27 -27
  41. data/samples/bigdemo/icons/combo.xpm +27 -27
  42. data/samples/bigdemo/icons/copy.xpm +25 -25
  43. data/samples/bigdemo/icons/cut.xpm +24 -24
  44. data/samples/bigdemo/icons/gauge.xpm +27 -27
  45. data/samples/bigdemo/icons/help.xpm +25 -25
  46. data/samples/bigdemo/icons/list.xpm +27 -27
  47. data/samples/bigdemo/icons/mondrian.xpm +44 -44
  48. data/samples/bigdemo/icons/new.xpm +24 -24
  49. data/samples/bigdemo/icons/ogl.ico +0 -0
  50. data/samples/bigdemo/icons/ogl.xpm +45 -45
  51. data/samples/bigdemo/icons/open.xpm +26 -26
  52. data/samples/bigdemo/icons/paste.xpm +38 -38
  53. data/samples/bigdemo/icons/preview.xpm +26 -26
  54. data/samples/bigdemo/icons/print.xpm +26 -26
  55. data/samples/bigdemo/icons/radio.xpm +27 -27
  56. data/samples/bigdemo/icons/robert.xpm +415 -415
  57. data/samples/bigdemo/icons/save.xpm +25 -25
  58. data/samples/bigdemo/icons/smiles.xpm +39 -39
  59. data/samples/bigdemo/icons/smiley.xpm +42 -42
  60. data/samples/bigdemo/icons/stattext.xpm +24 -24
  61. data/samples/bigdemo/icons/test2.bmp +0 -0
  62. data/samples/bigdemo/icons/test2.xpm +79 -79
  63. data/samples/bigdemo/icons/text.xpm +27 -27
  64. data/samples/bigdemo/icons/tog1.xpm +38 -38
  65. data/samples/bigdemo/icons/tog2.xpm +38 -38
  66. data/samples/bigdemo/icons/wxwin16x16.xpm +25 -25
  67. data/samples/bigdemo/tips.txt +7 -7
  68. data/samples/bigdemo/utils.rb +11 -11
  69. data/samples/bigdemo/wxButton.rbw +64 -64
  70. data/samples/bigdemo/wxCalendarCtrl.rbw +60 -60
  71. data/samples/bigdemo/wxCheckBox.rbw +50 -50
  72. data/samples/bigdemo/wxCheckListBox.rbw +65 -75
  73. data/samples/bigdemo/wxChoice.rbw +47 -47
  74. data/samples/bigdemo/wxColourDialog.rbw +31 -31
  75. data/samples/bigdemo/wxComboBox.rbw +77 -77
  76. data/samples/bigdemo/wxDialog.rbw +74 -74
  77. data/samples/bigdemo/wxDirDialog.rbw +29 -29
  78. data/samples/bigdemo/wxFileDialog.rbw +37 -37
  79. data/samples/bigdemo/wxFileDialog_Save.rbw +35 -35
  80. data/samples/bigdemo/wxFindReplaceDialog.rbw +82 -82
  81. data/samples/bigdemo/wxFontDialog.rbw +173 -173
  82. data/samples/bigdemo/wxFrame.rbw +53 -53
  83. data/samples/bigdemo/wxGauge.rbw +71 -71
  84. data/samples/bigdemo/wxGrid.rbw +66 -66
  85. data/samples/bigdemo/wxListBox.rbw +140 -140
  86. data/samples/bigdemo/wxListCtrl_virtual.rbw +112 -107
  87. data/samples/bigdemo/wxMDIWindows.rbw +50 -50
  88. data/samples/bigdemo/wxMenu.rbw +236 -236
  89. data/samples/bigdemo/wxMessageDialog.rbw +27 -27
  90. data/samples/bigdemo/wxMultipleChoiceDialog.rbw +32 -32
  91. data/samples/bigdemo/wxNotebook.rbw +136 -136
  92. data/samples/bigdemo/wxProgressDialog.rbw +43 -43
  93. data/samples/bigdemo/wxRadioBox.rbw +72 -72
  94. data/samples/bigdemo/wxRadioButton.rbw +125 -125
  95. data/samples/bigdemo/wxSashWindow.rbw +2 -2
  96. data/samples/bigdemo/wxScrolledMessageDialog.rbw +57 -57
  97. data/samples/bigdemo/wxScrolledWindow.rbw +199 -199
  98. data/samples/bigdemo/wxSingleChoiceDialog.rbw +33 -33
  99. data/samples/bigdemo/wxSlider.rbw +42 -42
  100. data/samples/bigdemo/wxSpinButton.rbw +50 -50
  101. data/samples/bigdemo/wxSpinCtrl.rbw +51 -51
  102. data/samples/bigdemo/wxSplitterWindow.rbw +63 -63
  103. data/samples/bigdemo/wxStaticBitmap.rbw +51 -51
  104. data/samples/bigdemo/wxStaticText.rbw +55 -55
  105. data/samples/bigdemo/wxStatusBar.rbw +126 -126
  106. data/samples/bigdemo/wxTextCtrl.rbw +149 -149
  107. data/samples/bigdemo/wxTextEntryDialog.rbw +31 -31
  108. data/samples/bigdemo/wxToggleButton.rbw +49 -49
  109. data/samples/bigdemo/wxToolBar.rbw +131 -131
  110. data/samples/bigdemo/wxTreeCtrl.rbw +191 -190
  111. data/samples/calendar/calendar.rb +256 -271
  112. data/samples/caret/caret.rb +282 -282
  113. data/samples/caret/mondrian.xpm +44 -44
  114. data/samples/controls/controls.rb +1136 -1136
  115. data/samples/controls/get_item_sample.rb +87 -87
  116. data/samples/controls/icons/choice.xpm +27 -27
  117. data/samples/controls/icons/combo.xpm +27 -27
  118. data/samples/controls/icons/gauge.xpm +27 -27
  119. data/samples/controls/icons/list.xpm +27 -27
  120. data/samples/controls/icons/radio.xpm +27 -27
  121. data/samples/controls/icons/stattext.xpm +24 -24
  122. data/samples/controls/icons/text.xpm +27 -27
  123. data/samples/controls/mondrian.xpm +44 -44
  124. data/samples/dialogs/dialogs.rb +797 -723
  125. data/samples/dialogs/tips.txt +18 -18
  126. data/samples/drawing/images.rb +37 -37
  127. data/samples/etc/activation.rb +102 -102
  128. data/samples/etc/choice.rb +67 -67
  129. data/samples/etc/miniframe.rb +79 -79
  130. data/samples/etc/sash.rb +130 -130
  131. data/samples/etc/scrollwin.rb +110 -110
  132. data/samples/etc/system_settings.rb +252 -252
  133. data/samples/etc/toolbar_sizer_additem.rb +55 -0
  134. data/samples/etc/wizard.rb +74 -74
  135. data/samples/event/update_ui_event.rb +70 -0
  136. data/samples/grid/gridtablebase.rb +43 -29
  137. data/samples/listbook/listbook.rb +174 -174
  138. data/samples/listbook/listbook.xrc +370 -370
  139. data/samples/mdi/mdi.rb +85 -77
  140. data/samples/minimal/minimal.rb +77 -77
  141. data/samples/minimal/nothing.rb +16 -16
  142. data/samples/text/format-text-bold.png +0 -0
  143. data/samples/text/format-text-italic.png +0 -0
  144. data/samples/text/format-text-underline.png +0 -0
  145. data/samples/text/rich_textctrl.rb +98 -0
  146. data/samples/text/textctrl.rb +111 -113
  147. data/samples/text/unicode.rb +242 -242
  148. data/samples/text/utf8.txt +14 -14
  149. data/samples/treectrl/treectrl.rb +1166 -1174
  150. data/samples/xrc/samples.xrc +46 -46
  151. data/samples/xrc/xrc_sample.rb +76 -96
  152. metadata +15 -3
@@ -7,6 +7,18 @@ class Wx::ListCtrl
7
7
  0.upto(item_count - 1) { | i | yield i }
8
8
  end
9
9
 
10
+ # Returns an Array containing the indexes of the currently selected
11
+ # items
12
+ def get_selections
13
+ selections = []
14
+ item = get_next_item(-1, Wx::LIST_NEXT_BELOW, Wx::LIST_STATE_SELECTED)
15
+ while item >= 0
16
+ selections << item
17
+ item = get_next_item(item, Wx::LIST_NEXT_BELOW, Wx::LIST_STATE_SELECTED)
18
+ end
19
+ selections
20
+ end
21
+
10
22
  # Stub version for LC_VIRTUAL controls that does nothing; may be
11
23
  # overridden in subclasses.
12
24
  def on_get_item_attr(i)
@@ -4,6 +4,14 @@ class Wx::Point
4
4
  "#<Wx::Point: (#{x}, #{y})>"
5
5
  end
6
6
 
7
+ # Correct comparison for Points - same if same x and y
8
+ def ==(other)
9
+ unless other.kind_of?(Wx::Point)
10
+ Kernel.raise TypeError, "Cannot compare Point to #{other}"
11
+ end
12
+ x == other.x and y == other.y
13
+ end
14
+
7
15
  # Return a new Wx::Point with the x and y parameters both divided by
8
16
  # parameter +div+, which should be a Numeric
9
17
  def /(div)
@@ -4,7 +4,16 @@ class Wx::Rect
4
4
  def to_s
5
5
  "#<Wx::Rect: (#{get_left}, #{get_top}) (#{get_right}, #{get_bottom})>"
6
6
  end
7
-
7
+
8
+ # Correct comparison for Wx::Rect, are the same if have the same
9
+ # position and the same size
10
+ def ==(other)
11
+ unless other.kind_of?(Wx::Rect)
12
+ Kernel.raise TypeError, "Cannot compare Rect to #{other}"
13
+ end
14
+ get_left == other.get_left and get_top == other.get_top and
15
+ get_right = other.get_right and get_bottom == other.get_bottom
16
+ end
8
17
  # More ruby-ish names
9
18
  alias :contains? :contains
10
19
  end
@@ -38,4 +38,26 @@ class Wx::RichTextCtrl
38
38
  Kernel.raise RuntimeError, "Could not retrieve style at position #{pos}"
39
39
  end
40
40
  end
41
+
42
+ # Fix to accept a single +pos+ argument and return a Wx::Rect
43
+ wx_car_pos_for_index = self.instance_method(:get_caret_position_for_index)
44
+ define_method(:get_caret_position_for_index) do | pos |
45
+ rect = Wx::Rect.new
46
+ if wx_car_pos_for_index.bind(self).call(pos, rect)
47
+ return rect
48
+ else
49
+ Kernel.raise RuntimeError, "Could not rect for position #{pos}"
50
+ end
51
+ end
52
+
53
+ # Fix to return a pair of col, row values
54
+ wx_pos_to_xy = self.instance_method(:position_to_xy)
55
+ define_method(:position_to_xy) do | pos |
56
+ success, x, y = wx_pos_to_xy.bind(self).call(pos)
57
+ if success
58
+ return x, y
59
+ else
60
+ Kernel.raise RuntimeError, "Could not convert position #{pos} to x, y"
61
+ end
62
+ end
41
63
  end
@@ -1,8 +1,17 @@
1
1
  class Wx::Size
2
+ # More informative output for inspect etc
2
3
  def to_s
3
4
  "#<Wx::Size: (#{get_width}, #{get_height})>"
4
5
  end
5
6
 
7
+ # Compare with another size
8
+ def ==(other)
9
+ unless other.kind_of?(Wx::Size)
10
+ Kernel.raise TypeError, "Cannot compare Size to #{other}"
11
+ end
12
+ get_x == other.get_x and get_y == other.get_y
13
+ end
14
+
6
15
  # Return a new Wx::Size with the width and height values both divided
7
16
  # by parameter +div+, which should be a Numeric
8
17
  def /(div)
@@ -11,12 +11,27 @@ class Wx::Sizer
11
11
  def add_item(item, *mixed_args)
12
12
  args = Wx::args_as_list(ADD_ITEM_PARAMS, *mixed_args)
13
13
 
14
- # Call add to append if default position
14
+ full_args = []
15
+
16
+ # extract the width and the height in the case of a spacer
17
+ # defined as an array
18
+ if item.kind_of?(Array)
19
+ Kernel.raise ArgumentError,
20
+ "Invalid Sizer specification : [width, height] expected" if item.size != 2
21
+ full_args << item[0] << item[1]
22
+ else
23
+ full_args << item
24
+ end
25
+
26
+ # update the full arguments list with the optional arguments (except index)
15
27
  idx = args.shift
28
+ full_args.concat(args)
29
+
30
+ # Call add to append if default position
16
31
  if idx == -1
17
- add(item, *args)
32
+ add(*full_args)
18
33
  else
19
- insert(idx, item, *args)
34
+ insert(idx, *full_args)
20
35
  end
21
36
  end
22
37
  end
@@ -5,21 +5,19 @@ class Wx::ToolBar
5
5
  ADD_ITEM_PARAMS = [ Wx::Parameter[ :position, -1 ],
6
6
  Wx::Parameter[ :id, -1 ],
7
7
  Wx::Parameter[ :label, "" ],
8
- Wx::Parameter[ :bitmap, Wx::NULL_BITMAP ],
9
8
  Wx::Parameter[ :bitmap2, Wx::NULL_BITMAP ],
10
9
  Wx::Parameter[ :kind, Wx::ITEM_NORMAL ],
11
10
  Wx::Parameter[ :short_help, "" ],
12
11
  Wx::Parameter[ :long_help, "" ],
13
12
  Wx::Parameter[ :client_data, nil ] ]
14
13
 
15
- def add_item(*mixed_args)
14
+ def add_item(bitmap, *mixed_args)
16
15
  args = Wx::args_as_list(ADD_ITEM_PARAMS, *mixed_args)
17
- if args[3] == Wx::NULL_BITMAP
18
- Kernel.raise ArgumentError, "Main button bitmap may not be NULL"
19
- end
20
16
 
21
- # Call add_tool to append if default position
22
17
  pos = args.shift
18
+ args.insert(2, bitmap)
19
+
20
+ # Call add_tool to append if default position
23
21
  if pos == -1
24
22
  add_tool(*args)
25
23
  else
@@ -0,0 +1,6 @@
1
+ # Just a shortcut version for creating a vertical box sizer
2
+ class Wx::VBoxSizer < Wx::BoxSizer
3
+ def initialize
4
+ super(Wx::VERTICAL)
5
+ end
6
+ end
@@ -11,6 +11,13 @@ class Wx::Window
11
11
  # In case a more explicit option is preferred.
12
12
  alias :wx_id :get_id
13
13
 
14
+ # The name of Wx::Window#raise conflicts with Ruby's core Kernel#raise
15
+ # method. This can cause unexpected errors when undecorated #raise is
16
+ # used inside a Window method. For wxRuby 2.0 it's too late to remove
17
+ # Window#raise completely, but for now, offer alternatives to
18
+ # raise/lower that could replace them in future versions.
19
+ alias :bring_to_front :raise
20
+ alias :send_to_back :lower
14
21
 
15
22
  # Recursively searches all windows below +self+ and returns the first
16
23
  # window which has the id +an_id+. This corresponds to the find_window
@@ -34,4 +34,21 @@ class Wx::XmlResource
34
34
  end
35
35
  fname
36
36
  end
37
+
38
+ # Returns a Wx::Wizard object from the element named +name+ in the
39
+ # loaded XRC file. The Wizard will have the parent +parent+.
40
+ #
41
+ # This method is not available in wxWidgets, but is here for
42
+ # completeness and also to document how to use load_object (see
43
+ # below).
44
+ def load_wizard(parent, name)
45
+ wiz = Wx::Wizard.new()
46
+ load_wizard_subclass(wiz, parent, name)
47
+ wiz
48
+ end
49
+
50
+ # Completes the loading of a incomplete instance of Wx::Wizard.
51
+ def load_wizard_subclass(wizard, parent, name)
52
+ load_object(wizard, parent, name, "wxWizard")
53
+ end
37
54
  end
@@ -8,7 +8,6 @@ module Wx
8
8
  # structs containing the keyword name and default value for each
9
9
  # possible argument. +mixed_args+ is an array which may optionally end
10
10
  # with a set of named arguments
11
-
12
11
  def self.args_as_list(param_spec, *mixed_args)
13
12
  # get keyword arguments from mixed args if supplied, else empty
14
13
  kwa = mixed_args.last.kind_of?(Hash) ? mixed_args.pop : {}
@@ -27,4 +26,20 @@ module Wx
27
26
  Kernel.raise ArgumentError,
28
27
  "Bad arg composition of #{mixed_args.inspect}"
29
28
  end
29
+
30
+ # Given an integer constant +int_const+, returns an array Wx constant
31
+ # names which have this value. If a string +prefix+ is supplied, find
32
+ # only constants whose names begin with this prefix. For example,
33
+ # passing "EVT" would return only constants with a name like
34
+ # Wx::EVT_XXX
35
+ #
36
+ # This is primarily useful for debugging, when an unknown constant is
37
+ # returned, eg as an event type id.
38
+ def self.find_const(sought, prefix = "")
39
+ consts = constants.grep(/\A#{prefix}/)
40
+ consts.find_all do | c |
41
+ c_val = const_get(c)
42
+ c_val.instance_of?(Fixnum) and c_val == sought
43
+ end
44
+ end
30
45
  end
@@ -122,8 +122,9 @@ module Wx
122
122
  # API constructor
123
123
  def wx_ctor_params(*params)
124
124
  self.param_spec += params.map do | param |
125
- param.kind_of?(Hash) ? Parameter[*param.to_a.flatten] :
126
- Parameter[param, STANDARD_DEFAULTS[param] ]
125
+ param.kind_of?(Hash) ?
126
+ Parameter[ param.keys.first, param.values.first ] :
127
+ Parameter[ param, STANDARD_DEFAULTS[param] ]
127
128
  end
128
129
  end
129
130
 
@@ -156,19 +156,29 @@ Wx::define_keyword_ctors('ToolBarTool') do
156
156
  wx_ctor_params :long_help => ''
157
157
  end
158
158
 
159
+ # Similar to notebook but using choice control
160
+ Wx::define_keyword_ctors('Choicebook') do
161
+ wx_ctor_params :id, :pos, :size, :style, :name => 'choiceBook'
162
+ end
163
+
159
164
  # Notebook class
160
165
  Wx::define_keyword_ctors('Notebook') do
161
166
  wx_ctor_params :id, :pos, :size, :style, :name => 'noteBook'
162
167
  end
163
168
 
164
- # Similar to notebook but using list control - undocumented
169
+ # Similar to notebook but using list control
165
170
  Wx::define_keyword_ctors('Listbook') do
166
171
  wx_ctor_params :id, :pos, :size, :style, :name => 'listBook'
167
172
  end
168
173
 
169
- # Similar to notebook but using choice control
170
- Wx::define_keyword_ctors('Choicebook') do
171
- wx_ctor_params :id, :pos, :size, :style, :name => 'choiceBook'
174
+ # Similar to notebook but using toolbar
175
+ Wx::define_keyword_ctors('Toolbook') do
176
+ wx_ctor_params :id, :pos, :size, :style, :name => 'toolBook'
177
+ end
178
+
179
+ # Similar to notebook but using tree control
180
+ Wx::define_keyword_ctors('Treebook') do
181
+ wx_ctor_params :id, :pos, :size, :style, :name => 'treeBook'
172
182
  end
173
183
 
174
184
  # wxSashWindow: Window with four optional sashes that can be dragged
@@ -268,7 +278,6 @@ Wx::define_keyword_ctors('PrintDialog') do
268
278
  wx_ctor_params :data
269
279
  end
270
280
 
271
-
272
281
  # Simple message box dialog
273
282
  Wx::define_keyword_ctors('MessageDialog') do
274
283
  wx_ctor_params :message => ''
@@ -277,6 +286,13 @@ Wx::define_keyword_ctors('MessageDialog') do
277
286
  wx_ctor_params :pos
278
287
  end
279
288
 
289
+ # Property editing dialog
290
+ Wx::define_keyword_ctors('PropertySheetDialog') do
291
+ wx_ctor_params :id, :title
292
+ wx_ctor_params :pos, :size, :style => Wx::DEFAULT_DIALOG_STYLE
293
+ wx_ctor_params :name => 'propertySheetDialog'
294
+ end
295
+
280
296
  ### CONTROLS
281
297
 
282
298
  # Push button control, displaying text
@@ -517,6 +533,11 @@ Wx::define_keyword_ctors('HtmlListBox') do
517
533
  wx_ctor_params :id, :pos, :size, :style, :name => 'HtmlListBoxNameStr'
518
534
  end
519
535
 
536
+ Wx::define_keyword_ctors('DatePickerCtrl') do
537
+ wx_ctor_params :id, :dt => Time.now
538
+ wx_ctor_params :pos, :size, :style, :validator, :name => 'dateCtrl'
539
+ end
540
+
520
541
  Wx::define_keyword_ctors('RichTextCtrl') do
521
542
  wx_ctor_params :id, :value => ''
522
543
  wx_ctor_params :pos, :size, :style => Wx::TE_MULTILINE
@@ -531,6 +552,7 @@ Wx::define_keyword_ctors('RichTextStyleListCtrl') do
531
552
  wx_ctor_params :id, :pos, :size, :style
532
553
  end
533
554
 
555
+
534
556
  # FIXME - SymbolPickerDialog is hard to because the parent argument is
535
557
  # in a strange place.
536
558
 
@@ -1,3 +1,3 @@
1
1
  module Wx
2
- WXRUBY_VERSION = '1.9.9'
2
+ WXRUBY_VERSION = '1.9.10'
3
3
  end
Binary file
@@ -1,18 +1,18 @@
1
- wxRuby2 Sample Code
2
- Copyright (c) 2004-2006 Kevin B. Smith
3
-
4
- Permission is hereby granted, free of charge, to any person obtaining
5
- a copy of this software, to deal in the Software without restriction,
6
- including without limitation the rights to use, copy, modify, merge,
7
- publish, distribute, sublicense, and/or sell copies of any portion of
8
- this Software, and to permit persons to whom the Software is furnished
9
- to do so. This copyright notice need not be retained in any derived
10
- work.
11
-
12
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
13
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
15
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
16
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
17
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
1
+ wxRuby2 Sample Code
2
+ Copyright (c) 2004-2006 Kevin B. Smith
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining
5
+ a copy of this software, to deal in the Software without restriction,
6
+ including without limitation the rights to use, copy, modify, merge,
7
+ publish, distribute, sublicense, and/or sell copies of any portion of
8
+ this Software, and to permit persons to whom the Software is furnished
9
+ to do so. This copyright notice need not be retained in any derived
10
+ work.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
13
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
15
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
16
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
17
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
18
18
  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,39 +1,39 @@
1
- module About
2
-
3
- class MyAboutBox < Wx::Dialog
4
- def initialize(parent)
5
- super(parent, -1, "About the WxRuby Demo.")
6
- sizer = Wx::BoxSizer.new(Wx::HORIZONTAL)
7
- set_size(Wx::Size.new(510,310))
8
- headerFont = Wx::Font.new(36, Wx::SWISS, Wx::NORMAL, Wx::NORMAL)
9
- bodyFont = Wx::Font.new(12, Wx::SWISS, Wx::NORMAL, Wx::NORMAL)
10
- title = Wx::StaticText.new(self, -1, "WxRuby Demo!", Wx::Point.new(20, 20))
11
- title.set_font(headerFont)
12
-
13
- rVersion = Wx::StaticText.new(self, -1, "Running on Ruby version " + VERSION + " on " + RUBY_PLATFORM, Wx::Point.new(20,100))
14
- rVersion.set_font(bodyFont)
15
- rVersion.set_foreground_colour(Wx::RED)
16
-
17
- wxVersion = Wx::StaticText.new(self, -1, Wx::VERSION_STRING, Wx::Point.new(20,120))
18
- wxVersion.set_font(bodyFont)
19
- wxVersion.set_foreground_colour(Wx::BLUE)
20
-
21
- str = "Welcome to the WxRuby Demo! This demo has been ported from the \nwxPython demo created by ROBIN DUNN (http://www.wxpython.org).\nGo ahead and click on each demo via the tree or the demo menu.\nLook at the source code - it is an excellent way to learn WxRuby!\n\nPorted by Robert Paul Carlin"
22
- body = Wx::StaticText.new(self, -1, str, Wx::Point.new(20, 160))
23
- body.set_font(bodyFont)
24
-
25
- self.centre_on_parent(Wx::BOTH)
26
-
27
-
28
- end
29
-
30
-
31
- end
32
-
33
- end
34
-
35
- if __FILE__ == $0
36
- run_solo_lib = File.join( File.dirname(__FILE__), 'run.rb')
37
- load run_solo_lib
38
- run File.basename($0)
39
- end
1
+ module About
2
+
3
+ class MyAboutBox < Wx::Dialog
4
+ def initialize(parent)
5
+ super(parent, -1, "About the WxRuby Demo.")
6
+ sizer = Wx::BoxSizer.new(Wx::HORIZONTAL)
7
+ set_size(Wx::Size.new(510,310))
8
+ headerFont = Wx::Font.new(36, Wx::SWISS, Wx::NORMAL, Wx::NORMAL)
9
+ bodyFont = Wx::Font.new(12, Wx::SWISS, Wx::NORMAL, Wx::NORMAL)
10
+ title = Wx::StaticText.new(self, -1, "WxRuby Demo!", Wx::Point.new(20, 20))
11
+ title.set_font(headerFont)
12
+
13
+ rVersion = Wx::StaticText.new(self, -1, "Running on Ruby version " + RUBY_VERSION + " on " + RUBY_PLATFORM, Wx::Point.new(20,100))
14
+ rVersion.set_font(bodyFont)
15
+ rVersion.set_foreground_colour(Wx::RED)
16
+
17
+ wxVersion = Wx::StaticText.new(self, -1, Wx::VERSION_STRING, Wx::Point.new(20,120))
18
+ wxVersion.set_font(bodyFont)
19
+ wxVersion.set_foreground_colour(Wx::BLUE)
20
+
21
+ str = "Welcome to the WxRuby Demo! This demo has been ported from the \nwxPython demo created by ROBIN DUNN (http://www.wxpython.org).\nGo ahead and click on each demo via the tree or the demo menu.\nLook at the source code - it is an excellent way to learn WxRuby!\n\nPorted by Robert Paul Carlin"
22
+ body = Wx::StaticText.new(self, -1, str, Wx::Point.new(20, 160))
23
+ body.set_font(bodyFont)
24
+
25
+ self.centre_on_parent(Wx::BOTH)
26
+
27
+
28
+ end
29
+
30
+
31
+ end
32
+
33
+ end
34
+
35
+ if __FILE__ == $0
36
+ run_solo_lib = File.join( File.dirname(__FILE__), 'run.rb')
37
+ load run_solo_lib
38
+ run File.basename($0)
39
+ end
@@ -1,23 +1,23 @@
1
- #!/usr/bin/env ruby
2
- # wxRuby2 Sample Code. Copyright (c) 2004-2008 wxRuby development team
3
- # Freely reusable code: see SAMPLES-LICENSE.TXT for details
4
- begin
5
- require 'rubygems'
6
- rescue LoadError
7
- end
8
- require 'wx'
9
-
10
-
11
-
12
- class ColoredPanel < Wx::Window
13
- def initialize(parent, color)
14
- super(parent, -1, Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE, Wx::SIMPLE_BORDER)
15
- set_background_colour(color)
16
- end
17
- end
18
-
19
- if __FILE__ == $0
20
- run_solo_lib = File.join( File.dirname(__FILE__), 'run.rb')
21
- load run_solo_lib
22
- run File.basename($0)
23
- end
1
+ #!/usr/bin/env ruby
2
+ # wxRuby2 Sample Code. Copyright (c) 2004-2008 wxRuby development team
3
+ # Freely reusable code: see SAMPLES-LICENSE.TXT for details
4
+ begin
5
+ require 'rubygems'
6
+ rescue LoadError
7
+ end
8
+ require 'wx'
9
+
10
+
11
+
12
+ class ColoredPanel < Wx::Window
13
+ def initialize(parent, color)
14
+ super(parent, -1, Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE, Wx::SIMPLE_BORDER)
15
+ set_background_colour(color)
16
+ end
17
+ end
18
+
19
+ if __FILE__ == $0
20
+ run_solo_lib = File.join( File.dirname(__FILE__), 'run.rb')
21
+ load run_solo_lib
22
+ run File.basename($0)
23
+ end