@
Samples and Descriptions
|
These are the sample scripts using VisualuRuby(temp-name) to understand what this project can do and how to use it.
Some of them use a console and Japanese text so that you might have to use ruby from console (don't use rubyw.exe) and add -Ks option to ruby.
Using console is not necessary for this project. You can use rubyw.exe without using console function "print", "puts" or "p" in the script.
-
sample.rb /
sample2.rb
- a sample in the archive using standard controls. the window size is default size on your system.
-
Moving group box and capturing window resizing
- Button's description is in Japanese that means "to left" and "to right".
-
extension of checkbox
- Opens a dialog when you check/uncheck the checkbox.
You can extend controls like this.
-
sample of treeview and listview
- Explorer like treeview and listview in two paned window.
- This sample script accepts the argument for the top directory.
- Using simple way, it takes a lot of times when you set the directory
that has a lot of files. Sometimes ruby may die by stack overflow.
- Opens message box with double clicking a listview item.
- You may have some warnings "marshal format is old", It uses marshal format of ruby-1.4.
-
sample of common controls
- various common controls.
-
sample of menu
- Create menus, disable menus, modifies menus.
-
sample of common dialogs
- You can view bitmap files with selecting menu [Open] from [File] to
open open-file-common-dialog.
-
sample using VRBitmapPanel and VRCommonDialog
- VRBitmapPanel is bitmap displaying control.
- And uses various common dialogs.
-
sample of playing multimedia files
- Using MCI.
- On my system, I can play avi,mpg,mov,mid,mp3,wav files.
This may play whatever files the mediaplayer can play.
-
using modal dialog
- Example to use dialogs. The same dialog appears 4 times, and they are
"using Class" and "using Module" case of each "modal dialog" and "modeless dialog".
- Example for using template is followed to the 4 dialogs,
-
Using tab control
-
using RichEdit
- Displays formatted rich text. Now you can set the format of the text but it's very hard to retrieve it. Because it cannot be retrieved as RTF.
-
using tooltip
- Assignes tooltips for each control. And the background color of tooltip is modified. Tooltip can be assigned on the area of window.
- The tooltip for the button indicates how many times it is clicked.
-
using rebar
- I don't know the name for this control. rebar? coolbar?
-
using scrollbars
- Using vertical scrollbar and horizontal scrollbar as control.
I don't know why "changed" event is fired twice.
-
ActiveX control
- Using InternetExplorer component in the window.
The ActiveX controls must be known its ProgID and specified in the script.
The events are also specified in the script with EventSink ProgID.
-
event handling of grand-child's event
- This is the same layout window of the last window in sample of resizelayout manager. VRPanel send the button event to its parent.
-
capturing key inputs by subclass-ing
- Captures WM_CHAR to the edit control.
- Also you can enum windows' message handling window.(useful for debug?)
-
forwarding events
- The events from the control on a Panel or Groupbox is forwarding to the parent of that Panel or Groupbox.
- Defines a Panel as a control contains a button and an editbox, and make it on a Form. The event from the button is handled on the Form.
-
arrayed control
-
Handling WM_CTLCOLOR
- This sample and VRCtlColor is contributed by Shigitani-san
- The window has 2 VREdit and the focused one is changed color.
-
Three windows using resize layout manager
- screen capture
-
sample of resize grid layout manager
- grid layout manager virtually makes grid on the window and arranges
the controls on the grid.
- Additionally prints current time on the titlebar caption in idle time.
-
sample of two paned window
- You can move the separation line.
-
using layout frame
- layout frame is like resize layout manager but it is not resized automatically by window resizing.
- This can use only the specified area instead of all client area and can be used in nested style.
- In this sample, VRResizeable captures the window resizing and resizes the outer layout frame by its size.
-
using paned frame
- Classes for 2-paned or many-paned window. These can use in combination of
paned frames to implement many-paned window.
This script makes 4-paned window.
- This is a kind of layout frame that described above, so that these classes
do noting with window resizing by itself.
-
GraphExplorer(exaggerated name)
- Mathematic function graph is drawn in the upper side of the window.
And on the downside the buttons are layouted to move the view of the function.
- This window is sensitive its resizing and re-draws the graph according to
its window size. If you modified @graph.xstep to larger number, the drawing will get faster.
- screen capture
-
sample of offscreen bitmap (Memory DC)
- You can draw lines by cliking the white area. The color and the width of the lines can be changed. This doesn't make original window class, so background color is default gray. This causes some blinking.
- Didn't you make this kind of programs on basic or another old languages?
-
font changable clock
- You can change the font for displaying the time by font select common dialog.
- This sample creates original window class.
-
owner-drawn button
-
using priner
- prints all usable printers to console, retrieves default printer, opens page setting window and draw a circle on the paper whose diameter is 100mm.
- Drawing method is same as a window.
-
Sensing modification of edit control and Setting file list in listbox and sample of groupbox.
- I've forgot why I make this as sample.
-
handling Control-C
- You can handles Control-C in messageloop.
- On Win9x, Control-C is handled immediately.
- On Win2K, Control-C is handled after the window receives a message.
-
File Drop from explorer.
- Shows text files contents with dropping files on the window.
- On Win9x, over 64KB file is not acceptable because of the limitation
of the edit control.
-
NetscapeNavigator Navigator
- Navigates NetscapeNavigator using DDE.
- Before running this script, run Netscape.
- The Netscape is navigated to the URL you select in the combobox.
-
DDE-execute server and its client.
- There two windows. The left one has the buttons to publish dde command and the right is plane window that is dde server. The bottom button "test" sends
dde execute to the right plain window.
- The other three buttons are the client of Microsoft Excel. Runs Excel with new document first.
- POKE button sets "POKE" string at R1C1 on Sheet1 in Book1. REQUEST button retrieves the data at R1C1. EXECUTE sends "1243" as key inputting.
-
changes the font of button
- changes into large font for the button but this is not owner-drawn button.
-
observation of clipboard(only text)
- This is historical clipboard utility.
- When texts set in the clipboard, the text is added in the listbox.
You can select the listbox item to set the text into the clipboard.
-
OLE drag-and-drop
- Test of OLE drag and drop.
- The upper area of the window is drop area that can accept texts, files
and netscape bookmarks. The lower area is draggable area that brings
text and a file(autoexec.bat). If your system doesn't have autoexec.bat,
please modify the script.
-
create/delete/modify icons in tasktray.
- 4 buttons means "add trayicon", "delete trayicon", "modify trayicon" and
"set this window in tasktray." You can add trayicons until you are satisfied.
- Each trayicon has its menu, but only the first icon and "to tray" icon
have effective menu.(the others' are dummy menu)
- This script doesn't delete trayicon automatically at the time of finish.
Please finish from trayicon menu.
back
Email: nyasu@osk.3web.ne.jp