Project VisualuRuby(tmp-name)
|
|
[Japanese Page]
short comment(2009/02/08)
vrswin090207 is the snapshot tarball for ruby-1.9.1
Known problems
Cause SEGV when using ActiveX with Ruby's thread.
Deadlocks happen by calling SendMessage() or functions that call it internally from non-owner thread of the window. (ruby-1.9)
INDEX
In this page
another page
screenshots(I'll create another page about them)
"VisualuRuby" is a GUI library on MS Windows for Ruby.
The project has two part, one is "swin" which is about ruby extension library,
the other is "vruby" : a set of vr* series of ruby scripts which wrap swin.
The event handling style is like that of VisualBasic.
Most Frequently Answered Questions
Q: Can I have more English documentations?
A: Now I'm working for it.
Q: Can I get some help at ruby scripting on VisualStudio?
A: No. This project has nothing to do with VisualStudio.
Q: You mis-spelling the project name, don't you?
A: No. This project name is 'VisualuRuby'
- Win32 environment
- FYI, my environment is on Win98.
- Ruby interpreter
- There are some ruby interpreters, mswin32/mingw32/cygwin/...
- I'm using its cygwin version.
- swin
- This is a DLL for this project and by this project.
- This is included by some binary distributions of ruby interpreters on Windows.
- You can make this DLL with a C compiler.
You don't need another additional DLL.
SIMPLE!!
with swin
- create/show/destroy window.
- add child window(button/combobox/treeview and so on) on the window.
- event handling for window's messages. (WM_LBUTTONUP,WM_COMMAND,...)
- making a subclass of system-define window class.
- creating menues.
- creating common dialog (not all dialogs)
- drawing the window using pen,brush,font,..
- bitmap class is prepared.
- handling idleloop in messageloop
- handling Ctrl-C in messageloop
- creating modal dialog
- using printer
with vruby
- programming with visualbasic-like style.(visualbasic is Microsoft's product)
- easily creating window.
- easily creating controls on the window.
- easily handling messages to the window.
- layout manager(?) available
- playing multimedia files (AVI/WAV/MP3/...) available with MCI
- owner-draw (button)
- dde (execute/poke/request client, execute server)
- arrayed control supported
- Drag &Drop (file/OLE)
- MultiThreading (I'm sorry mswin/mingw ruby is hard to use this because of longjmp() problem, but a patch for ruby has already realized for 1.6.7)
- And so on,
These two scripts provides a same window to capture WM_COMMAND message sent by a Button.
swin
require 'swin'
WM_COMMAND = 0x00000111
WS_VISIBLECHILD = 0x50000000
BS_PUSHBUTTON = 0x00000000
RFactory=SWin::LWFactory.new(SWin::Application.hInstance)
mw=RFactory.newwindow(nil)
mw.caption="Window Caption"
mw.move(300,200,400,400)
mw.create
bn=RFactory.newwindow(mw)
bn.classname="BUTTON"
bn.caption="Button1"
bn.etc=1234 #control id
bn.style=WS_VISIBLECHILD | BS_PUSHBUTTON
bn.move 80,50,80,40
bn.create
mw.addEvent WM_COMMAND
def mw.msghandler(msg) #msg has attrs of hWnd,msg,wParam,lParam
if msg.msg==WM_COMMAND then
messageBox "Button Pushed"
end
end
mw.show
SWin::Application.messageloop
|
vruby
require 'vr/vruby'
require 'vr/vrcontrol'
class MyForm < VRForm
def construct
self.caption="Window Caption"
self.move(300,200,400,400)
addControl(VRButton,"btn1","Button1",80,50,80,40)
end
def btn1_clicked
messageBox "Button Pushed"
end
end
VRLocalScreen.showForm(MyForm)
VRLocalScreen.messageloop
|
You can get the products from Ruby Application Archives, but the latest version may be not available there.
And I'm sorry that I'm afraid I'll miss to update this English page.
The real latest version is available at download page in Japanese .
The archives are in two style: lzh and zip
source files of "swin" and five test scripts in lzh.
or
(zip)
- (62kB) 09/02/07 version (yyyy/mm/dd).
scripts of vruby and test scripts in lzh.
or
(zip)
- (98kB) 08/02/29
set of sample scripts. (zip)
(30kB) 08/02/29
- English sample description is available.
- Some scripts file include SJIS-coded Japanese Text. Use -Ks option for ruby.
Yukimi-sake is developing GUI builder "FormDesigner" for this project. (Screen capture:Screen capture 2)
He is also distributing compiled html help(chm) about this project.
The vruby's reference is included in the script in RD format as comments.
- I understand that method namings are not good because there are no consistent way, so the method names may be changed.
- There are English documents about vruby part, but no English documents for
swin part.
Email: nyasu@osk.3web.ne.jp