wxruby 1.9.6-x86-mswin32-60 → 1.9.7-x86-mswin32-60
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/wx/version.rb +1 -1
- data/lib/wxruby2.exp +0 -0
- data/lib/wxruby2.lib +0 -0
- data/lib/wxruby2.so +0 -0
- data/samples/dragdrop/dragdrop.rb +177 -0
- data/temp/Rakefile +16 -0
- data/temp/msvcp80.dll +0 -0
- data/temp/msvcr80.dll +0 -0
- data/temp/wxruby2.so.manifest +13 -0
- metadata +20 -6
data/lib/wx/version.rb
CHANGED
data/lib/wxruby2.exp
CHANGED
Binary file
|
data/lib/wxruby2.lib
CHANGED
Binary file
|
data/lib/wxruby2.so
CHANGED
Binary file
|
@@ -0,0 +1,177 @@
|
|
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
|
+
# This sample demonstrates the use of the Clipboard and Drag and Drop
|
11
|
+
# classes. Whilst the functionality of these is slightly different, they
|
12
|
+
# are both based around the use of the DataObject classes to exchange
|
13
|
+
# data of various sorts between applications (i.e. into and out of
|
14
|
+
# wxRuby)
|
15
|
+
|
16
|
+
# A ListBox that collects file names dropped onto it
|
17
|
+
class FileDropList < Wx::ListBox
|
18
|
+
def initialize(*args)
|
19
|
+
super
|
20
|
+
# Set the handler for drag and drop actions
|
21
|
+
self.drop_target = ListFileDropTarget.new(self)
|
22
|
+
end
|
23
|
+
|
24
|
+
# The class that actually handles the dropped files; it keeps a
|
25
|
+
# reference to the ListBox, and appends items as they are added
|
26
|
+
class ListFileDropTarget < Wx::FileDropTarget
|
27
|
+
def initialize(list)
|
28
|
+
super()
|
29
|
+
@list = list
|
30
|
+
end
|
31
|
+
|
32
|
+
# This method is overridden to specify what happens when a file is
|
33
|
+
# dropped
|
34
|
+
def on_drop_files(x, y, files)
|
35
|
+
files.each { | file | @list.append(file) }
|
36
|
+
true # currently need to return boolean from this method
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
class FileDropPane < Wx::Panel
|
42
|
+
LABEL = "Drag and drop files from Explorer/Finder/etc to here\n" +
|
43
|
+
"to add them to the list."
|
44
|
+
def initialize(parent)
|
45
|
+
super
|
46
|
+
sizer = Wx::BoxSizer.new(Wx::VERTICAL)
|
47
|
+
txt = Wx::StaticText.new( self, :label => LABEL)
|
48
|
+
sizer.add(txt, 0, Wx::ALL, 4)
|
49
|
+
|
50
|
+
@drop = FileDropList.new(self)
|
51
|
+
sizer.add(@drop, 1, Wx::GROW|Wx::ALL, 4)
|
52
|
+
self.sizer = sizer
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# A canvas which can display a pasted image
|
57
|
+
class PasteCanvas < Wx::Window
|
58
|
+
attr_accessor :bitmap
|
59
|
+
def initialize(parent)
|
60
|
+
super(parent, :style => Wx::SUNKEN_BORDER)
|
61
|
+
self.size = [ 200, 200 ]
|
62
|
+
@bitmap = Wx::NULL_BITMAP
|
63
|
+
evt_paint :on_paint
|
64
|
+
end
|
65
|
+
|
66
|
+
def on_paint(evt)
|
67
|
+
paint do | dc |
|
68
|
+
dc.clear
|
69
|
+
if bitmap.ok?
|
70
|
+
dc.draw_bitmap(bitmap, 0, 0, false)
|
71
|
+
end
|
72
|
+
dc.pen = Wx::BLACK_PEN
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
# A Notebook panel to hold an image-paste canvas
|
78
|
+
class PastePane < Wx::Panel
|
79
|
+
LABEL = "Use the buttons below to paste text and images from\n" +
|
80
|
+
"the system clipboard, and then to copy them back."
|
81
|
+
def initialize(parent)
|
82
|
+
super
|
83
|
+
sizer = Wx::BoxSizer.new(Wx::VERTICAL)
|
84
|
+
txt = Wx::StaticText.new( self, :label => LABEL)
|
85
|
+
sizer.add(txt, 0, Wx::ALL, 4)
|
86
|
+
|
87
|
+
# Sizer for displaying text and image from the clipboard
|
88
|
+
paste_sizer = Wx::FlexGridSizer.new(2, 2, 2, 2)
|
89
|
+
paste_sizer.add_growable_col(0, 1)
|
90
|
+
paste_sizer.add_growable_col(1, 1)
|
91
|
+
paste_sizer.add_growable_row(1)
|
92
|
+
|
93
|
+
paste_sizer.add( Wx::StaticText.new(self, :label => 'Clipboard text') )
|
94
|
+
paste_sizer.add( Wx::StaticText.new(self, :label => 'Clipboard image') )
|
95
|
+
|
96
|
+
# Target for displaying text from the clipboard
|
97
|
+
@text = Wx::TextCtrl.new(self, :style => Wx::TE_MULTILINE)
|
98
|
+
paste_sizer.add(@text, 1, Wx::GROW)
|
99
|
+
|
100
|
+
# Target for displaying images from the clipboard
|
101
|
+
@canvas = PasteCanvas.new(self)
|
102
|
+
paste_sizer.add(@canvas, 1, Wx::GROW)
|
103
|
+
|
104
|
+
sizer.add(paste_sizer, 1, Wx::ALL|Wx::GROW, 4)
|
105
|
+
|
106
|
+
button_sizer = Wx::BoxSizer.new(Wx::HORIZONTAL)
|
107
|
+
|
108
|
+
@paste_bt = Wx::Button.new(self, :label => 'Paste')
|
109
|
+
evt_button @paste_bt, :on_paste
|
110
|
+
button_sizer.add(@paste_bt, 0, Wx::ALL, 4)
|
111
|
+
|
112
|
+
@copy_img_bt = Wx::Button.new(self, :label => 'Copy image')
|
113
|
+
evt_button @copy_img_bt, :on_copy_image
|
114
|
+
button_sizer.add(@copy_img_bt, 0, Wx::ALL, 4)
|
115
|
+
|
116
|
+
@copy_txt_bt = Wx::Button.new(self, :label => 'Copy text')
|
117
|
+
evt_button @copy_txt_bt, :on_copy_text
|
118
|
+
button_sizer.add(@copy_txt_bt, 0, Wx::ALL, 4)
|
119
|
+
|
120
|
+
sizer.add(button_sizer, 0)
|
121
|
+
self.sizer = sizer
|
122
|
+
end
|
123
|
+
|
124
|
+
# Receive data from the clipboard
|
125
|
+
def on_paste(evt)
|
126
|
+
# Temporarily open the clipboard
|
127
|
+
Wx::Clipboard.open do | clip |
|
128
|
+
# Test if bitmap data is available on the clipboard; if so, copy
|
129
|
+
if clip.supported?(Wx::DF_BITMAP)
|
130
|
+
bmp = Wx::BitmapDataObject.new
|
131
|
+
clip.get_data(bmp) # Fill the data object with bitmap`
|
132
|
+
@canvas.bitmap = bmp.bitmap
|
133
|
+
@canvas.refresh
|
134
|
+
end
|
135
|
+
# Test if text data is available on the clipboard; if so, copy
|
136
|
+
if clip.supported?(Wx::DF_TEXT)
|
137
|
+
txt = Wx::TextDataObject.new
|
138
|
+
clip.get_data(txt) # Fill the data object with text
|
139
|
+
@text.value = txt.text
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
# Paste an image to the clipboard
|
145
|
+
def on_copy_image
|
146
|
+
Wx::Clipboard.open do | clip |
|
147
|
+
clip.data = Wx::BitmapDataObject.new(@canvas.bitmap)
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
# Paste text to the clipboard
|
152
|
+
def on_copy_text
|
153
|
+
Wx::Clipboard.open do | clip |
|
154
|
+
clip.data = Wx::TextDataObject.new(@text.value)
|
155
|
+
end
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
class DataObjectFrame < Wx::Frame
|
160
|
+
def initialize(parent)
|
161
|
+
super
|
162
|
+
panel = Wx::Panel.new(self)
|
163
|
+
panel.sizer = Wx::BoxSizer.new(Wx::VERTICAL)
|
164
|
+
nb = Wx::Notebook.new(panel)
|
165
|
+
panel.sizer.add(nb, 1, Wx::ALL|Wx::GROW, 8)
|
166
|
+
fd = FileDropPane.new(nb)
|
167
|
+
nb.add_page(fd, 'Drag and Drop')
|
168
|
+
cv = PastePane.new(nb)
|
169
|
+
nb.add_page(cv, 'Clipboard')
|
170
|
+
# urldrop = URLDropList.new(self)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
Wx::App.run do
|
175
|
+
frame = DataObjectFrame.new(nil)
|
176
|
+
frame.show
|
177
|
+
end
|
data/temp/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# This is a temporary rakefile to install the Microsoft v8 runtime
|
2
|
+
require 'rbconfig'
|
3
|
+
task :default do
|
4
|
+
mv 'msvcp80.dll', Config::CONFIG['bindir']
|
5
|
+
mv 'msvcr80.dll', Config::CONFIG['bindir']
|
6
|
+
ruby_manifest = File.join(Config::CONFIG['bindir'], 'ruby.exe.manifest')
|
7
|
+
if File.exists? ruby_manifest
|
8
|
+
mv ruby_manifest, ruby_manifest + ".old"
|
9
|
+
end
|
10
|
+
cp 'wxruby2.so.manifest', ruby_manifest
|
11
|
+
rubyw_manifest = File.join(Config::CONFIG['bindir'], 'rubyw.exe.manifest')
|
12
|
+
if File.exists? rubyw_manifest
|
13
|
+
mv rubyw_manifest, rubyw_manifest + ".old"
|
14
|
+
end
|
15
|
+
cp 'wxruby2.so.manifest', rubyw_manifest
|
16
|
+
end
|
data/temp/msvcp80.dll
ADDED
Binary file
|
data/temp/msvcr80.dll
ADDED
Binary file
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
|
2
|
+
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
|
3
|
+
<dependency>
|
4
|
+
<dependentAssembly>
|
5
|
+
<assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50608.0' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
|
6
|
+
</dependentAssembly>
|
7
|
+
</dependency>
|
8
|
+
<dependency>
|
9
|
+
<dependentAssembly>
|
10
|
+
<assemblyIdentity type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*' />
|
11
|
+
</dependentAssembly>
|
12
|
+
</dependency>
|
13
|
+
</assembly>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wxruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.7
|
5
5
|
platform: x86-mswin32-60
|
6
6
|
authors:
|
7
7
|
- wxRuby development team
|
@@ -9,16 +9,24 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-05-
|
12
|
+
date: 2008-05-10 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rake
|
17
|
+
version_requirement:
|
18
|
+
version_requirements: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: "0"
|
23
|
+
version:
|
16
24
|
description: wxRuby allows the creation of graphical user interface (GUI) applications via the wxWidgets library. wxRuby provides native-style GUI windows, dialogs and controls on platforms including Windows, OS X and Linux.
|
17
25
|
email: support@wxruby.org
|
18
26
|
executables: []
|
19
27
|
|
20
|
-
extensions:
|
21
|
-
|
28
|
+
extensions:
|
29
|
+
- temp/Rakefile
|
22
30
|
extra_rdoc_files: []
|
23
31
|
|
24
32
|
files:
|
@@ -220,6 +228,8 @@ files:
|
|
220
228
|
- samples/dialogs
|
221
229
|
- samples/dialogs/dialogs.rb
|
222
230
|
- samples/dialogs/tips.txt
|
231
|
+
- samples/dragdrop
|
232
|
+
- samples/dragdrop/dragdrop.rb
|
223
233
|
- samples/drawing
|
224
234
|
- samples/drawing/graphics_drawing.rb
|
225
235
|
- samples/drawing/images.rb
|
@@ -286,6 +296,10 @@ files:
|
|
286
296
|
- samples/xrc/xrc_sample.rb
|
287
297
|
- README
|
288
298
|
- LICENSE
|
299
|
+
- temp/msvcp80.dll
|
300
|
+
- temp/msvcr80.dll
|
301
|
+
- temp/Rakefile
|
302
|
+
- temp/wxruby2.so.manifest
|
289
303
|
has_rdoc: false
|
290
304
|
homepage: http://wxruby.org/
|
291
305
|
post_install_message:
|