wrb 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README +28 -0
- data/Rakefile +66 -0
- data/bin/wrb +41 -0
- data/bin/wrb.bat +6 -0
- data/ext/rwin/aatree.c +192 -0
- data/ext/rwin/aatree.h +55 -0
- data/ext/rwin/extconf.rb +47 -0
- data/ext/rwin/rw_api.c +2058 -0
- data/ext/rwin/rw_devices.c +215 -0
- data/ext/rwin/rw_gdiplus.h +278 -0
- data/ext/rwin/rw_graphics.c +1583 -0
- data/ext/rwin/rw_resources.c +1988 -0
- data/ext/rwin/rw_ubfuncs.c +281 -0
- data/ext/rwin/rw_windows.c +1936 -0
- data/ext/rwin/rwin.c +451 -0
- data/ext/rwin/rwin.h +442 -0
- data/lib/rwin.rb +820 -0
- data/lib/wrb.rb +20 -0
- data/lib/wrb/applications/frmdesigner/angle.cur +0 -0
- data/lib/wrb/applications/frmdesigner/angle2.cur +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Button.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Button.rb +34 -0
- data/lib/wrb/applications/frmdesigner/controls/Checkbox.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Checkbox.rb +10 -0
- data/lib/wrb/applications/frmdesigner/controls/Combobox.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Combobox.rb +88 -0
- data/lib/wrb/applications/frmdesigner/controls/ComboboxEx.rb +97 -0
- data/lib/wrb/applications/frmdesigner/controls/Comboboxex.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/DateTimePicker.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/DateTimePicker.rb +11 -0
- data/lib/wrb/applications/frmdesigner/controls/Edit.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Edit.rb +8 -0
- data/lib/wrb/applications/frmdesigner/controls/Groupbox.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Groupbox.rb +9 -0
- data/lib/wrb/applications/frmdesigner/controls/Hotkeyctrl.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Hotkeyctrl.rb +9 -0
- data/lib/wrb/applications/frmdesigner/controls/Imagelist.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Imagelist.rb +115 -0
- data/lib/wrb/applications/frmdesigner/controls/Listbox.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Listbox.rb +77 -0
- data/lib/wrb/applications/frmdesigner/controls/Listview.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Listview.rb +157 -0
- data/lib/wrb/applications/frmdesigner/controls/Menu.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Menu.rb +198 -0
- data/lib/wrb/applications/frmdesigner/controls/Menubar.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Menubar.rb +9 -0
- data/lib/wrb/applications/frmdesigner/controls/MonthCalender.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Monthcalender.rb +9 -0
- data/lib/wrb/applications/frmdesigner/controls/Panel.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Panel.rb +30 -0
- data/lib/wrb/applications/frmdesigner/controls/Progressbar.rb +10 -0
- data/lib/wrb/applications/frmdesigner/controls/Radiobutton.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Radiobutton.rb +13 -0
- data/lib/wrb/applications/frmdesigner/controls/Rebar.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Rebar.rb +162 -0
- data/lib/wrb/applications/frmdesigner/controls/Splitter.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Splitter.rb +66 -0
- data/lib/wrb/applications/frmdesigner/controls/Static.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Static.rb +9 -0
- data/lib/wrb/applications/frmdesigner/controls/Statusbar.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Statusbar.rb +103 -0
- data/lib/wrb/applications/frmdesigner/controls/Tabctrl.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Tabctrl.rb +136 -0
- data/lib/wrb/applications/frmdesigner/controls/Timer.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Timer.rb +36 -0
- data/lib/wrb/applications/frmdesigner/controls/Toolbar.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Toolbar.rb +165 -0
- data/lib/wrb/applications/frmdesigner/controls/Trackbar.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Trackbar.rb +34 -0
- data/lib/wrb/applications/frmdesigner/controls/Treeview.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Treeview.rb +107 -0
- data/lib/wrb/applications/frmdesigner/controls/Updown.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/Updown.rb +31 -0
- data/lib/wrb/applications/frmdesigner/controls/default.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/progressbar.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/controls/unselect.bmp +0 -0
- data/lib/wrb/applications/frmdesigner/fddialogs.rb +87 -0
- data/lib/wrb/applications/frmdesigner/fdesign.rb +1315 -0
- data/lib/wrb/applications/frmdesigner/fdmodules.rb +1394 -0
- data/lib/wrb/applications/frmdesigner/fdparseform.rb +197 -0
- data/lib/wrb/applications/frmdesigner/img13.bmp +0 -0
- data/lib/wrb/base.rb +1294 -0
- data/lib/wrb/combocommon.rb +77 -0
- data/lib/wrb/commctrlconst.rb +139 -0
- data/lib/wrb/commdlg.rb +77 -0
- data/lib/wrb/components/animate.rb +114 -0
- data/lib/wrb/components/bitmap.rb +116 -0
- data/lib/wrb/components/button.rb +134 -0
- data/lib/wrb/components/canvas.rb +266 -0
- data/lib/wrb/components/checkbox.rb +118 -0
- data/lib/wrb/components/choosecolordlg.rb +87 -0
- data/lib/wrb/components/choosefontdlg.rb +142 -0
- data/lib/wrb/components/clipboard.rb +174 -0
- data/lib/wrb/components/combobox.rb +282 -0
- data/lib/wrb/components/comboboxex.rb +574 -0
- data/lib/wrb/components/cursor.rb +91 -0
- data/lib/wrb/components/datetimepicker.rb +197 -0
- data/lib/wrb/components/ddeclient.rb +180 -0
- data/lib/wrb/components/ddeserver.rb +131 -0
- data/lib/wrb/components/dialog.rb +228 -0
- data/lib/wrb/components/edit.rb +412 -0
- data/lib/wrb/components/font.rb +35 -0
- data/lib/wrb/components/form.rb +65 -0
- data/lib/wrb/components/groupbox.rb +122 -0
- data/lib/wrb/components/header.rb +479 -0
- data/lib/wrb/components/hotkeyctrl.rb +72 -0
- data/lib/wrb/components/icon.rb +109 -0
- data/lib/wrb/components/imagelist.rb +396 -0
- data/lib/wrb/components/inifile.rb +97 -0
- data/lib/wrb/components/listbox.rb +149 -0
- data/lib/wrb/components/listview.rb +1467 -0
- data/lib/wrb/components/menu.rb +592 -0
- data/lib/wrb/components/menubar.rb +84 -0
- data/lib/wrb/components/monthcalender.rb +164 -0
- data/lib/wrb/components/openfilenamedlg.rb +147 -0
- data/lib/wrb/components/pager.rb +199 -0
- data/lib/wrb/components/panel.rb +103 -0
- data/lib/wrb/components/picture.rb +55 -0
- data/lib/wrb/components/printdlg.rb +148 -0
- data/lib/wrb/components/printdlgex.rb +117 -0
- data/lib/wrb/components/printer.rb +97 -0
- data/lib/wrb/components/progressbar.rb +140 -0
- data/lib/wrb/components/radiobutton.rb +49 -0
- data/lib/wrb/components/rebar.rb +830 -0
- data/lib/wrb/components/registry.rb +408 -0
- data/lib/wrb/components/richedit.rb +1181 -0
- data/lib/wrb/components/savefilenamedlg.rb +27 -0
- data/lib/wrb/components/scintilla.rb +1298 -0
- data/lib/wrb/components/scrollbar.rb +239 -0
- data/lib/wrb/components/splitter.rb +494 -0
- data/lib/wrb/components/static.rb +198 -0
- data/lib/wrb/components/statusbar.rb +490 -0
- data/lib/wrb/components/tabctrl.rb +686 -0
- data/lib/wrb/components/timer.rb +117 -0
- data/lib/wrb/components/toolbar.rb +1107 -0
- data/lib/wrb/components/tooltip.rb +651 -0
- data/lib/wrb/components/trackbar.rb +298 -0
- data/lib/wrb/components/treeview.rb +845 -0
- data/lib/wrb/components/updown.rb +198 -0
- data/lib/wrb/ddeml.rb +241 -0
- data/lib/wrb/documents/animate.html +46 -0
- data/lib/wrb/documents/bitmap.html +69 -0
- data/lib/wrb/documents/button.html +78 -0
- data/lib/wrb/documents/canvas.html +137 -0
- data/lib/wrb/documents/checkbox.html +77 -0
- data/lib/wrb/documents/choosecolordlg.html +29 -0
- data/lib/wrb/documents/choosefontdlg.html +31 -0
- data/lib/wrb/documents/clipboard.html +31 -0
- data/lib/wrb/documents/combobox.html +117 -0
- data/lib/wrb/documents/comboboxex.html +139 -0
- data/lib/wrb/documents/control.html +53 -0
- data/lib/wrb/documents/cursor.html +45 -0
- data/lib/wrb/documents/datetimepicker.html +70 -0
- data/lib/wrb/documents/ddeclient.html +33 -0
- data/lib/wrb/documents/ddeserver.html +26 -0
- data/lib/wrb/documents/dialog.html +78 -0
- data/lib/wrb/documents/edit.html +169 -0
- data/lib/wrb/documents/empty.html +11 -0
- data/lib/wrb/documents/favicon.png +0 -0
- data/lib/wrb/documents/font.html +38 -0
- data/lib/wrb/documents/form.html +63 -0
- data/lib/wrb/documents/groupbox.html +57 -0
- data/lib/wrb/documents/header.html +85 -0
- data/lib/wrb/documents/hotkeyctrl.html +42 -0
- data/lib/wrb/documents/icon.html +45 -0
- data/lib/wrb/documents/imagelist.html +101 -0
- data/lib/wrb/documents/images/button.png +0 -0
- data/lib/wrb/documents/images/checkbox.png +0 -0
- data/lib/wrb/documents/images/combobox.png +0 -0
- data/lib/wrb/documents/images/comboboxex.png +0 -0
- data/lib/wrb/documents/images/datetimepicker.png +0 -0
- data/lib/wrb/documents/images/edit.png +0 -0
- data/lib/wrb/documents/images/groupbox.png +0 -0
- data/lib/wrb/documents/images/hotkeyctrl.png +0 -0
- data/lib/wrb/documents/images/listbox.png +0 -0
- data/lib/wrb/documents/images/listview.png +0 -0
- data/lib/wrb/documents/images/menu.png +0 -0
- data/lib/wrb/documents/images/menubar.png +0 -0
- data/lib/wrb/documents/images/monthcalender.png +0 -0
- data/lib/wrb/documents/images/progressbar.png +0 -0
- data/lib/wrb/documents/images/radiobutton.png +0 -0
- data/lib/wrb/documents/images/rebar.png +0 -0
- data/lib/wrb/documents/images/richedit.png +0 -0
- data/lib/wrb/documents/images/splitter.png +0 -0
- data/lib/wrb/documents/images/static.png +0 -0
- data/lib/wrb/documents/images/statusbar.png +0 -0
- data/lib/wrb/documents/images/tabctrl.png +0 -0
- data/lib/wrb/documents/images/toolbar.png +0 -0
- data/lib/wrb/documents/images/tooltip.png +0 -0
- data/lib/wrb/documents/images/trackbar.png +0 -0
- data/lib/wrb/documents/images/treeview.png +0 -0
- data/lib/wrb/documents/images/updown.png +0 -0
- data/lib/wrb/documents/index.html +155 -0
- data/lib/wrb/documents/inifile.html +36 -0
- data/lib/wrb/documents/license.txt +22 -0
- data/lib/wrb/documents/listbox.html +96 -0
- data/lib/wrb/documents/listview.html +277 -0
- data/lib/wrb/documents/make_doc.rb +596 -0
- data/lib/wrb/documents/menu.html +144 -0
- data/lib/wrb/documents/menubar.html +54 -0
- data/lib/wrb/documents/monthcalender.html +48 -0
- data/lib/wrb/documents/openfilenamedlg.html +36 -0
- data/lib/wrb/documents/pager.html +63 -0
- data/lib/wrb/documents/panel.html +32 -0
- data/lib/wrb/documents/picture.html +48 -0
- data/lib/wrb/documents/printdlg.html +35 -0
- data/lib/wrb/documents/printdlgex.html +35 -0
- data/lib/wrb/documents/printer.html +40 -0
- data/lib/wrb/documents/progressbar.html +69 -0
- data/lib/wrb/documents/radiobutton.html +51 -0
- data/lib/wrb/documents/rebar.html +143 -0
- data/lib/wrb/documents/registry.html +36 -0
- data/lib/wrb/documents/richedit.html +232 -0
- data/lib/wrb/documents/samples/editimg.bmp +0 -0
- data/lib/wrb/documents/samples/editimg.iml +0 -0
- data/lib/wrb/documents/samples/fileimg.bmp +0 -0
- data/lib/wrb/documents/samples/fileimg.iml +0 -0
- data/lib/wrb/documents/samples/sample_button.rb +21 -0
- data/lib/wrb/documents/samples/sample_checkbox.rb +18 -0
- data/lib/wrb/documents/samples/sample_combobox.rb +18 -0
- data/lib/wrb/documents/samples/sample_comboboxex.rb +23 -0
- data/lib/wrb/documents/samples/sample_datetimepicker.rb +11 -0
- data/lib/wrb/documents/samples/sample_edit.rb +25 -0
- data/lib/wrb/documents/samples/sample_groupbox.rb +19 -0
- data/lib/wrb/documents/samples/sample_hotkeyctrl.rb +12 -0
- data/lib/wrb/documents/samples/sample_listbox.rb +12 -0
- data/lib/wrb/documents/samples/sample_listview.rb +32 -0
- data/lib/wrb/documents/samples/sample_menu.rb +21 -0
- data/lib/wrb/documents/samples/sample_menubar.rb +23 -0
- data/lib/wrb/documents/samples/sample_monthcalender.rb +11 -0
- data/lib/wrb/documents/samples/sample_progressbar.rb +14 -0
- data/lib/wrb/documents/samples/sample_radiobutton.rb +14 -0
- data/lib/wrb/documents/samples/sample_rebar.rb +25 -0
- data/lib/wrb/documents/samples/sample_richedit.rb +60 -0
- data/lib/wrb/documents/samples/sample_splitter.rb +33 -0
- data/lib/wrb/documents/samples/sample_static.rb +15 -0
- data/lib/wrb/documents/samples/sample_statusbar.rb +17 -0
- data/lib/wrb/documents/samples/sample_tabctrl.rb +19 -0
- data/lib/wrb/documents/samples/sample_toolbar.rb +29 -0
- data/lib/wrb/documents/samples/sample_tooltip.rb +50 -0
- data/lib/wrb/documents/samples/sample_trackbar.rb +30 -0
- data/lib/wrb/documents/samples/sample_treeview.rb +19 -0
- data/lib/wrb/documents/samples/sample_updown.rb +18 -0
- data/lib/wrb/documents/samples/sampleimg16.iml +0 -0
- data/lib/wrb/documents/samples/sampleimg32.iml +0 -0
- data/lib/wrb/documents/samples/samplemg16.png +0 -0
- data/lib/wrb/documents/samples/samplemg32.png +0 -0
- data/lib/wrb/documents/samples/wrb.ico +0 -0
- data/lib/wrb/documents/savefilenamedlg.html +19 -0
- data/lib/wrb/documents/scrollbar.html +60 -0
- data/lib/wrb/documents/splitter.html +96 -0
- data/lib/wrb/documents/static.html +84 -0
- data/lib/wrb/documents/statusbar.html +110 -0
- data/lib/wrb/documents/tabctrl.html +151 -0
- data/lib/wrb/documents/timer.html +43 -0
- data/lib/wrb/documents/toolbar.html +181 -0
- data/lib/wrb/documents/tooltip.html +131 -0
- data/lib/wrb/documents/trackbar.html +107 -0
- data/lib/wrb/documents/treeview.html +210 -0
- data/lib/wrb/documents/updown.html +85 -0
- data/lib/wrb/documents/wincontrol.html +258 -0
- data/lib/wrb/documents/window.html +499 -0
- data/lib/wrb/documents/wrb.css +228 -0
- data/lib/wrb/gmem.rb +26 -0
- data/lib/wrb/imecommon.rb +59 -0
- data/lib/wrb/listcommon.rb +185 -0
- data/lib/wrb/lzss.rb +126 -0
- data/lib/wrb/scrollinfo.rb +142 -0
- data/lib/wrb/toplevelcommon.rb +634 -0
- metadata +315 -0
@@ -0,0 +1,651 @@
|
|
1
|
+
require 'wrb'
|
2
|
+
require 'wrb/commctrlconst'
|
3
|
+
|
4
|
+
module WR
|
5
|
+
module RC
|
6
|
+
TTS_ALWAYSTIP = 0x1
|
7
|
+
TTS_NOPREFIX = 0x2
|
8
|
+
TTS_NOANIMATE = 0x10
|
9
|
+
TTS_NOFADE = 0x20
|
10
|
+
TTS_BALLOON = 0x40
|
11
|
+
TTS_CLOSE = 0x80
|
12
|
+
|
13
|
+
TTF_IDISHWND = 0x1
|
14
|
+
TTF_CENTERTIP = 0x2
|
15
|
+
TTF_RTLREADING = 0x4
|
16
|
+
TTF_SUBCLASS = 0x10
|
17
|
+
TTF_TRACK = 0x20
|
18
|
+
TTF_ABSOLUTE = 0x80
|
19
|
+
TTF_TRANSPARENT = 0x100
|
20
|
+
TTF_PARSELINKS = 0x1000
|
21
|
+
TTF_DI_SETITEM = 0x8000
|
22
|
+
|
23
|
+
TTDT_AUTOMATIC = 0
|
24
|
+
TTDT_RESHOW = 1
|
25
|
+
TTDT_AUTOPOP = 2
|
26
|
+
TTDT_INITIAL = 3
|
27
|
+
|
28
|
+
TTI_NONE = 0
|
29
|
+
TTI_INFO = 1
|
30
|
+
TTI_WARNING = 2
|
31
|
+
TTI_ERROR = 3
|
32
|
+
TTI_INFO_LARGE = 4
|
33
|
+
TTI_WARNING_LARGE = 5
|
34
|
+
TTI_ERROR_LARGE = 6
|
35
|
+
|
36
|
+
TTM_ACTIVATE = WM_USER+1
|
37
|
+
TTM_SETDELAYTIME = WM_USER+3
|
38
|
+
TTM_ADDTOOLA = WM_USER+4
|
39
|
+
TTM_ADDTOOLW = WM_USER+50
|
40
|
+
TTM_DELTOOLA = WM_USER+5
|
41
|
+
TTM_DELTOOLW = WM_USER+51
|
42
|
+
TTM_NEWTOOLRECTA = WM_USER+6
|
43
|
+
TTM_NEWTOOLRECTW = WM_USER+52
|
44
|
+
TTM_RELAYEVENT = WM_USER+7
|
45
|
+
TTM_GETTOOLINFOA = WM_USER+8
|
46
|
+
TTM_GETTOOLINFOW = WM_USER+53
|
47
|
+
TTM_SETTOOLINFOA = WM_USER+9
|
48
|
+
TTM_SETTOOLINFOW = WM_USER+54
|
49
|
+
TTM_HITTESTA = WM_USER+10
|
50
|
+
TTM_HITTESTW = WM_USER+55
|
51
|
+
TTM_GETTEXTA = WM_USER+11
|
52
|
+
TTM_GETTEXTW = WM_USER+56
|
53
|
+
TTM_UPDATETIPTEXTA = WM_USER+12
|
54
|
+
TTM_UPDATETIPTEXTW = WM_USER+57
|
55
|
+
TTM_GETTOOLCOUNT = WM_USER+13
|
56
|
+
TTM_ENUMTOOLSA = WM_USER+14
|
57
|
+
TTM_ENUMTOOLSW = WM_USER+58
|
58
|
+
TTM_GETCURRENTTOOLA = WM_USER+15
|
59
|
+
TTM_GETCURRENTTOOLW = WM_USER+59
|
60
|
+
TTM_WINDOWFROMPOINT = WM_USER+16
|
61
|
+
TTM_TRACKACTIVATE = WM_USER+17
|
62
|
+
TTM_TRACKPOSITION = WM_USER+18
|
63
|
+
TTM_SETTIPBKCOLOR = WM_USER+19
|
64
|
+
TTM_SETTIPTEXTCOLOR = WM_USER+20
|
65
|
+
TTM_GETDELAYTIME = WM_USER+21
|
66
|
+
TTM_GETTIPBKCOLOR = WM_USER+22
|
67
|
+
TTM_GETTIPTEXTCOLOR = WM_USER+23
|
68
|
+
TTM_SETMAXTIPWIDTH = WM_USER+24
|
69
|
+
TTM_GETMAXTIPWIDTH = WM_USER+25
|
70
|
+
TTM_SETMARGIN = WM_USER+26
|
71
|
+
TTM_GETMARGIN = WM_USER+27
|
72
|
+
TTM_POP = WM_USER+28
|
73
|
+
TTM_UPDATE = WM_USER+29
|
74
|
+
TTM_GETBUBBLESIZE = WM_USER+30
|
75
|
+
TTM_ADJUSTRECT = WM_USER+31
|
76
|
+
TTM_SETTITLEA = WM_USER+32
|
77
|
+
TTM_SETTITLEW = WM_USER+33
|
78
|
+
TTM_POPUP = WM_USER+34
|
79
|
+
TTM_GETTITLE = WM_USER+35
|
80
|
+
|
81
|
+
TTM_SETWINDOWTHEME = CCM_SETWINDOWTHEME
|
82
|
+
|
83
|
+
if RWin::UNICODE
|
84
|
+
TTM_ADDTOOL = TTM_ADDTOOLW
|
85
|
+
TTM_DELTOOL = TTM_DELTOOLW
|
86
|
+
TTM_NEWTOOLRECT = TTM_NEWTOOLRECTW
|
87
|
+
TTM_GETTOOLINFO = TTM_GETTOOLINFOW
|
88
|
+
TTM_SETTOOLINFO = TTM_SETTOOLINFOW
|
89
|
+
TTM_HITTEST = TTM_HITTESTW
|
90
|
+
TTM_GETTEXT = TTM_GETTEXTW
|
91
|
+
TTM_UPDATETIPTEXT = TTM_UPDATETIPTEXTW
|
92
|
+
TTM_ENUMTOOLS = TTM_ENUMTOOLSW
|
93
|
+
TTM_GETCURRENTTOOL = TTM_GETCURRENTTOOLW
|
94
|
+
TTM_SETTITLE = TTM_SETTITLEW
|
95
|
+
else
|
96
|
+
TTM_ADDTOOL = TTM_ADDTOOLA
|
97
|
+
TTM_DELTOOL = TTM_DELTOOLA
|
98
|
+
TTM_NEWTOOLRECT = TTM_NEWTOOLRECTA
|
99
|
+
TTM_GETTOOLINFO = TTM_GETTOOLINFOA
|
100
|
+
TTM_SETTOOLINFO = TTM_SETTOOLINFOA
|
101
|
+
TTM_HITTEST = TTM_HITTESTA
|
102
|
+
TTM_GETTEXT = TTM_GETTEXTA
|
103
|
+
TTM_UPDATETIPTEXT = TTM_UPDATETIPTEXTA
|
104
|
+
TTM_ENUMTOOLS = TTM_ENUMTOOLSA
|
105
|
+
TTM_GETCURRENTTOOL = TTM_GETCURRENTTOOLA
|
106
|
+
TTM_SETTITLE = TTM_SETTITLEA
|
107
|
+
end
|
108
|
+
|
109
|
+
TTN_FIRST = -520
|
110
|
+
TTN_GETDISPINFOA = TTN_FIRST-0
|
111
|
+
TTN_GETDISPINFOW = TTN_FIRST-10
|
112
|
+
TTN_SHOW = TTN_FIRST-1
|
113
|
+
TTN_POP = TTN_FIRST-2
|
114
|
+
TTN_LINKCLICK = TTN_FIRST-3
|
115
|
+
|
116
|
+
if RWin::UNICODE
|
117
|
+
TTN_GETDISPINFO = TTN_GETDISPINFOW
|
118
|
+
else
|
119
|
+
TTN_GETDISPINFO = TTN_GETDISPINFOA
|
120
|
+
end
|
121
|
+
TTN_NEEDTEXT = TTN_GETDISPINFO
|
122
|
+
|
123
|
+
LPSTR_TEXTCALLBACK = -1
|
124
|
+
end
|
125
|
+
|
126
|
+
# A small window that appears automatically, or pops up, when the user pauses the mouse pointer over a tool or some other UI element.
|
127
|
+
# <br>See also <a href="https://docs.microsoft.com/en-us/windows/desktop/Controls/
|
128
|
+
# window-controls"> Windows Control section of Microsoft Docs.</a>
|
129
|
+
class Tooltip < WinControl
|
130
|
+
|
131
|
+
if APP::COMCTL_MAJOR_VERSION < 6
|
132
|
+
TOOLINFO = API.defstruct "
|
133
|
+
UINT cbSize;
|
134
|
+
UINT uFlags;
|
135
|
+
HWND hwnd;
|
136
|
+
UINT_PTR uId;
|
137
|
+
RECT rect;
|
138
|
+
HINSTANCE hinst;
|
139
|
+
LPTSTR lpszText;
|
140
|
+
LPARAM lParam;"
|
141
|
+
else
|
142
|
+
TOOLINFO = API.defstruct "
|
143
|
+
UINT cbSize;
|
144
|
+
UINT uFlags;
|
145
|
+
HWND hwnd;
|
146
|
+
UINT_PTR uId;
|
147
|
+
RECT rect;
|
148
|
+
HINSTANCE hinst;
|
149
|
+
LPTSTR lpszText;
|
150
|
+
LPARAM lParam;
|
151
|
+
void *lpReserved;"
|
152
|
+
end
|
153
|
+
|
154
|
+
TTGETTITLE = API.defstruct "
|
155
|
+
DWORD dwSize;
|
156
|
+
UINT uTitleBitmap;
|
157
|
+
UINT cch;
|
158
|
+
TCHAR *pszTitle;"
|
159
|
+
|
160
|
+
TTHITTESTINFO = API.defstruct "
|
161
|
+
HWND hwnd;
|
162
|
+
POINT pt;
|
163
|
+
TOOLINFO ti;"
|
164
|
+
|
165
|
+
NMTTDISPINFO = API.defstruct "
|
166
|
+
NMHDR hdr;
|
167
|
+
LPTSTR lpszText;
|
168
|
+
TCHAR szText;
|
169
|
+
HINSTANCE hinst;
|
170
|
+
UINT uFlags;
|
171
|
+
LPARAM lParam;"
|
172
|
+
|
173
|
+
# The wrapper of the TOOLINFO and a holder of control ID
|
174
|
+
class Tip
|
175
|
+
include RC
|
176
|
+
TtfStyles = {
|
177
|
+
:idishwnd => TTF_IDISHWND,
|
178
|
+
:centertip => TTF_CENTERTIP,
|
179
|
+
:rtlreading => TTF_RTLREADING,
|
180
|
+
:suclass => TTF_SUBCLASS,
|
181
|
+
:track => TTF_TRACK,
|
182
|
+
:absolute => TTF_ABSOLUTE,
|
183
|
+
:transparent => TTF_TRANSPARENT,
|
184
|
+
:parselinks => TTF_PARSELINKS,
|
185
|
+
:di_setitem => TTF_DI_SETITEM
|
186
|
+
}
|
187
|
+
|
188
|
+
attr_reader :_itemwnd
|
189
|
+
|
190
|
+
def initialize(*args)
|
191
|
+
@_owner = args.shift if args[0].is_a?(Tooltip)
|
192
|
+
if args.size == 1
|
193
|
+
if args[0].is_a?(Integer) || args[0].is_a?(RWin::Window)
|
194
|
+
id = args[0]
|
195
|
+
@toolinfo = TOOLINFO[TOOLINFO::Size, 0, @_owner.parent._hwnd]
|
196
|
+
if id.is_a?(Integer)
|
197
|
+
@toolinfo.uId = id
|
198
|
+
else
|
199
|
+
@toolinfo.uFlags = TTF_IDISHWND
|
200
|
+
@toolinfo.uId = id._hwnd
|
201
|
+
end
|
202
|
+
return
|
203
|
+
end
|
204
|
+
end
|
205
|
+
f = 0
|
206
|
+
while args.last.is_a?(Symbol)
|
207
|
+
f |= TtfStyles[args.pop].to_i
|
208
|
+
end
|
209
|
+
f = TTF_SUBCLASS if f == 0
|
210
|
+
@_itemwnd, @_text, @_flags, @_data = args
|
211
|
+
if @_itemwnd.is_a?(Array)
|
212
|
+
@_rect = RECT[@_itemwnd]
|
213
|
+
@_itemwnd = @_owner._get_newest_tip_id if @_owner
|
214
|
+
elsif @_itemwnd.is_a?(RECT)
|
215
|
+
@_rect = @_itemwnd
|
216
|
+
@_itemwnd = @_owner._get_newest_tip_id if @_owner
|
217
|
+
# @_itemwnd = 0
|
218
|
+
end
|
219
|
+
@_flags = @_falgs || 0
|
220
|
+
raise ArgumentError, "Num of arguments must be 2 or more" if @_text.nil?
|
221
|
+
@_flags |= f
|
222
|
+
end
|
223
|
+
#
|
224
|
+
def owner=(onr)
|
225
|
+
@_owner = onr
|
226
|
+
@_itemwnd = @_owner._get_newest_tip_id if @_rect
|
227
|
+
end
|
228
|
+
|
229
|
+
def delete() #; dp "@%p", [@toolinfo.hwnd, @toolinfo.uId]
|
230
|
+
if @_owner.alive?
|
231
|
+
@_owner.SendMessage(TTM_DELTOOL, 0, @toolinfo)
|
232
|
+
else
|
233
|
+
@_owner.delete(@_itemwnd)
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
def text()
|
238
|
+
if @_owner.alive?
|
239
|
+
buff = TCHAR[256] # No way to get size of buffer.
|
240
|
+
@toolinfo.lpszText = buff
|
241
|
+
@_owner.SendMessage(TTM_GETTEXT, buff.size, @toolinfo)
|
242
|
+
buff.to_s
|
243
|
+
else
|
244
|
+
@_text
|
245
|
+
end
|
246
|
+
end
|
247
|
+
def text=(txt)
|
248
|
+
if @_owner.alive?
|
249
|
+
@toolinfo.lpszText = txt
|
250
|
+
@_owner.SendMessage(TTM_UPDATETIPTEXT, 0, @toolinfo)
|
251
|
+
else
|
252
|
+
@_text = txt
|
253
|
+
end
|
254
|
+
end
|
255
|
+
|
256
|
+
def rect=(*args)
|
257
|
+
args = args[0] if args[0].is_a?(Array)
|
258
|
+
@toolinfo.rect = args[0].is_a?(RECT) ? args[0] : RECT[*args]
|
259
|
+
if @_owner.alive?
|
260
|
+
@_owner.SendMessage(TTM_NEWTOOLRECT, 0, @toolinfo)
|
261
|
+
else
|
262
|
+
@_rect = args
|
263
|
+
end
|
264
|
+
end
|
265
|
+
def rect()
|
266
|
+
if @_owner.alive?
|
267
|
+
@_owner.SendMessage(TTM_GETTOOLINFO, 0, @toolinfo)
|
268
|
+
@toolinfo.rect
|
269
|
+
else
|
270
|
+
@_rect
|
271
|
+
end
|
272
|
+
end
|
273
|
+
|
274
|
+
#
|
275
|
+
def _tooltipinfo #; dp "@%p, %#x", @_owner.owner, @_owner.owner._hwnd
|
276
|
+
ti = TOOLINFO[TOOLINFO::Size, @_flags]
|
277
|
+
ti.uFlags = TTF_SUBCLASS
|
278
|
+
ti.hwnd = @_owner.owner._hwnd
|
279
|
+
if @_itemwnd.is_a?(Integer)
|
280
|
+
ti.uId = @_itemwnd
|
281
|
+
else
|
282
|
+
ti.uFlags |= TTF_IDISHWND
|
283
|
+
ti.uId = @_itemwnd._hwnd
|
284
|
+
end
|
285
|
+
ti.rect = @_rect if @_rect
|
286
|
+
ti.hinst = APP.hInstance
|
287
|
+
ti.lpszText = @_text
|
288
|
+
lparam = @_data.__id__
|
289
|
+
@_owner._ar_data << @_data if (lparam&1)==0 && lparam>NilID
|
290
|
+
ti.lParam = lparam
|
291
|
+
ti
|
292
|
+
end
|
293
|
+
end #class Tip
|
294
|
+
|
295
|
+
######################### Main ######################
|
296
|
+
|
297
|
+
PreDefinedEvents = {
|
298
|
+
:getdispinfo => [WM_NOTIFY, TTN_GETDISPINFO, 'xs', NMTTDISPINFO],
|
299
|
+
:show => [WM_NOTIFY, TTN_SHOW, 'xs', NMHDR],
|
300
|
+
:pop => [WM_NOTIFY, TTN_POP, 'xs', NMHDR],
|
301
|
+
:linkclick => [WM_NOTIFY, TTN_LINKCLICK],
|
302
|
+
:needtext => [WM_NOTIFY, TTN_NEEDTEXT, 'xs', NMTTDISPINFO]
|
303
|
+
}
|
304
|
+
|
305
|
+
attr_reader :indexes, :_ar_data
|
306
|
+
|
307
|
+
def initialize(*args)
|
308
|
+
super(*args)
|
309
|
+
@_style = (self.style & 0xffff) | WS_POPUP | TTS_ALWAYSTIP
|
310
|
+
@_classname = "tooltips_class32"
|
311
|
+
@_exstyle = WS_EX_TOPMOST | WS_EX_TOOLWINDOW
|
312
|
+
@_owner = @__remain_arg__ if @__remain_arg__
|
313
|
+
@_tips = []
|
314
|
+
@_acceptable_events = PreDefinedEvents.dup
|
315
|
+
@_ar_data = []
|
316
|
+
end
|
317
|
+
#
|
318
|
+
def owner()
|
319
|
+
@_owner
|
320
|
+
end
|
321
|
+
#
|
322
|
+
def owner=(win)
|
323
|
+
@_owner = win
|
324
|
+
end
|
325
|
+
#
|
326
|
+
def create(*args)
|
327
|
+
etc = self.idcmd # fails to create if idcmd != 0
|
328
|
+
self.idcmd = 0
|
329
|
+
if @_parent.event_registered?(idcmd, WM_NOTIFY, TTM_DELTOOL, "__deletool__", self)
|
330
|
+
@_parent.register_event(self.idcmd, WM_NOTIFY, TTM_DELTOOL, "__deletool__", 'xs',
|
331
|
+
TOOLINFO, self) # for internal use
|
332
|
+
end
|
333
|
+
super
|
334
|
+
self.idcmd = etc
|
335
|
+
@_owner ||= self.parent
|
336
|
+
@_tips.each{|tip|
|
337
|
+
SendMessage(TTM_ADDTOOL, 0, tip._tooltipinfo)
|
338
|
+
}
|
339
|
+
@_owner.tooltips = self if @_owner && @_owner.respond_to?(:tooltips=)
|
340
|
+
title = @_title if @_title
|
341
|
+
delaytimes = @_delaytimes if @_delaytimes
|
342
|
+
colors = @_colors if @_colors
|
343
|
+
maxtipwidth = @_maxtipwidth if @_maxtipwidth
|
344
|
+
windowtheme = @_windowtheme if @_windowtheme # Not work?
|
345
|
+
end
|
346
|
+
|
347
|
+
# Registers a tip with a tooltip control.<br>
|
348
|
+
# Arguments can be an array of [ID_or_Control_or_RECT, tip_text]
|
349
|
+
def add(*args)
|
350
|
+
args = args[0] if args[0].is_a?(Array)
|
351
|
+
tip = Tip.new(*args)
|
352
|
+
tip.owner = self
|
353
|
+
alive? ? SendMessage(TTM_ADDTOOL, 0, tip._tooltipinfo) : @_tips << tip
|
354
|
+
end
|
355
|
+
alias << add
|
356
|
+
|
357
|
+
# Deletes a tip specifiled <i>arg</i> in this tooltip control.<br>
|
358
|
+
# Give a RWin::Window or a integer for ID as <i>arg</i>.
|
359
|
+
# If no argument given, deletes self.
|
360
|
+
def delete(arg=nil)
|
361
|
+
return super() if arg.nil?
|
362
|
+
if alive?
|
363
|
+
tti = TOOLINFO[TOOLINFO::Size, 0, @_owner._hwnd,
|
364
|
+
arg.is_a?(RWin::Window) ? arg._hwnd : arg]
|
365
|
+
SendMessage(TTM_DELTOOL, 0, tti)
|
366
|
+
else
|
367
|
+
idx = @_tips.index{|tip| tip._itemwnd == arg}
|
368
|
+
@_tips.delete_at(idx) #; dp "@%p, %p", idx, @_tips
|
369
|
+
end
|
370
|
+
end
|
371
|
+
|
372
|
+
# Retreives a Tip specified <i>id</i> in this tooltip control.
|
373
|
+
# The id can be an Integer as index or hwnd, or a RW::Window.
|
374
|
+
def fetch(id)
|
375
|
+
if id.is_a?(Integer) && id<ModParent::ItemBaseID
|
376
|
+
if alive?
|
377
|
+
SendMessage(TTM_ENUMTOOLS, id, tti=TOOLINFO[TOOLINFO::Size])
|
378
|
+
Tip.new(self, tti.uId)
|
379
|
+
else
|
380
|
+
@_tips[id]
|
381
|
+
end
|
382
|
+
else
|
383
|
+
alive? ? Tip.new(self, id) : @_tips.find{|tip| tip._itemwnd == id}
|
384
|
+
end
|
385
|
+
end
|
386
|
+
alias [] fetch
|
387
|
+
|
388
|
+
# Retreives a number of tips of this tooltip control.
|
389
|
+
def count()
|
390
|
+
alive? ? SendMessage(TTM_GETTOOLCOUNT, 0, 0) : @_tips.size
|
391
|
+
end
|
392
|
+
|
393
|
+
# each(){|tip| ... }
|
394
|
+
# Performs the block for each <i>tip</i> in this tooltips as a block parameter.
|
395
|
+
def each()
|
396
|
+
if alive?
|
397
|
+
count.times{|i|
|
398
|
+
SendMessage(TTM_ENUMTOOLS, i, tti=TOOLINFO[TOOLINFO::Size])
|
399
|
+
yield Tip.new(self, tti.uId)
|
400
|
+
}
|
401
|
+
else
|
402
|
+
@_tips.each{|i| yield i}
|
403
|
+
end
|
404
|
+
end
|
405
|
+
|
406
|
+
# Retrieve information concerning the title of a tooltip control.
|
407
|
+
# Returns an array of [String, Icon]
|
408
|
+
def title()
|
409
|
+
if alive?
|
410
|
+
buff = TCHAR[256] # No way to get size of buffer.
|
411
|
+
ttg = TTGETTITLE[TTGETTITLE::Size, 0, buff.size, buff]
|
412
|
+
SendMessage(TTM_GETTITLE, 0, ttg)
|
413
|
+
[buff.to_s, APP.hrsc2ref(ttg.uTitleBitmap) || ttg.uTitleBitmap]
|
414
|
+
else
|
415
|
+
@_title
|
416
|
+
end
|
417
|
+
end
|
418
|
+
|
419
|
+
# title=(text, icon=nil)
|
420
|
+
# Adds a title string and standard icon to this tooltip.
|
421
|
+
def title=(*args)
|
422
|
+
txt, icon = args[0]
|
423
|
+
if alive?
|
424
|
+
hicon = (icon.is_a?(Integer) || icon.nil?) ? icon : icon.hicon
|
425
|
+
SendMessage(TTM_SETTITLE, hicon.to_i, txt.to_s)
|
426
|
+
else
|
427
|
+
@_title = [icon, txt]
|
428
|
+
end
|
429
|
+
end
|
430
|
+
|
431
|
+
# delaytimes=(initial, reshow, autopop)
|
432
|
+
# Sets the initial, pop-up, and reshow durations for this tooltip control.
|
433
|
+
def delaytimes=(*args)
|
434
|
+
args = args[0] if args[0].is_a?(Array)
|
435
|
+
initial, reshow, autopop = args # Unit is millisec.
|
436
|
+
if alive?
|
437
|
+
if initial == :automatic
|
438
|
+
SendMessage(TTM_SETDELAYTIME, TTDT_AUTOMATIC, 0)
|
439
|
+
else
|
440
|
+
SendMessage(TTM_SETDELAYTIME, TTDT_INITIAL, initial ? initial.to_i : -1)
|
441
|
+
SendMessage(TTM_SETDELAYTIME, TTDT_RESHOW, reshow ? reshow.to_i : -1)
|
442
|
+
SendMessage(TTM_SETDELAYTIME, TTDT_AUTOPOP, autopop ? autopop.to_i : -1)
|
443
|
+
end
|
444
|
+
else
|
445
|
+
@_delaytimes = [initial, reshow, autopop]
|
446
|
+
end
|
447
|
+
end
|
448
|
+
# Retrieves the initial, pop-up, and reshow durations currently set for this tooltip control.
|
449
|
+
# Retruns array of [initial, reshow, autopop].
|
450
|
+
def delaytimes()
|
451
|
+
if alive?
|
452
|
+
initial = SendMessage(TTM_SETDELAYTIME, TTDT_INITIAL, 0)
|
453
|
+
reshow = SendMessage(TTM_SETDELAYTIME, TTDT_RESHOW, 0)
|
454
|
+
autopop = SendMessage(TTM_SETDELAYTIME, TTDT_AUTOPOP, 0)
|
455
|
+
[initial, reshow, autopop]
|
456
|
+
else
|
457
|
+
@_delaytimes
|
458
|
+
end
|
459
|
+
end
|
460
|
+
|
461
|
+
# Sets the maximum width for this tooltip window.
|
462
|
+
def maxtipwidth=(width)
|
463
|
+
alive? ? SendMessage(TTM_SETMAXTIPWIDTH, 0, width) : @_maxtipwidth = width
|
464
|
+
end
|
465
|
+
|
466
|
+
# Retrieves the maximum width for this tooltip window.
|
467
|
+
def maxtipwidth
|
468
|
+
alive? ? SendMessage(TTM_GETMAXTIPWIDTH, 0, 0) : @_maxtipwidth
|
469
|
+
end
|
470
|
+
|
471
|
+
# Tests a point to determine whether it is within the bounding rectangle of the specified tip and, if it is, retrieves information about the tip.
|
472
|
+
def hittest(x, y)
|
473
|
+
hi = TTHITTESTINFO[@_owner._hwnd, POINT[x, y], TOOLINFO[TOOLINFO::Size]]
|
474
|
+
r = SendMessage(TTM_HITTEST, 0, hi)
|
475
|
+
r==0 ? nil : Tip.new(self, hi.ti.uId)
|
476
|
+
end
|
477
|
+
|
478
|
+
# Following methods has no effect when the application runs on Windows Vista
|
479
|
+
# or later and visual styles are enabled for the tooltip.
|
480
|
+
|
481
|
+
|
482
|
+
def margin()
|
483
|
+
if alive?
|
484
|
+
rect = RECT[args]
|
485
|
+
SendMessage(TTM_SETMARGIN, 0, rect)
|
486
|
+
rect.to_a
|
487
|
+
else
|
488
|
+
@_margin
|
489
|
+
end
|
490
|
+
end
|
491
|
+
# These have no effects when the applidation runs on the visual styles.
|
492
|
+
def margin=(*args)
|
493
|
+
args = args[0] if args[0].is_a?(Array)
|
494
|
+
if alive?
|
495
|
+
rect = RECT[args]
|
496
|
+
SendMessage(TTM_SETMARGIN, 0, rect)
|
497
|
+
else
|
498
|
+
@_margin = args
|
499
|
+
end
|
500
|
+
end
|
501
|
+
|
502
|
+
def colors()
|
503
|
+
if alive?
|
504
|
+
fore = SendMessage(TTM_GETTIPTEXTCOLOR, 0, 0)
|
505
|
+
back = SendMessage(TTM_SETTIPBKCOLOR, 0, 0)
|
506
|
+
[fore, back]
|
507
|
+
else
|
508
|
+
@_colors
|
509
|
+
end
|
510
|
+
end
|
511
|
+
# These have no effects when the applidation runs on the visual styles.
|
512
|
+
def colors=(*args)
|
513
|
+
fore, back = args[0]
|
514
|
+
if alive?
|
515
|
+
SendMessage(TTM_SETTIPTEXTCOLOR, fore, 0) if fore
|
516
|
+
SendMessage(TTM_SETTIPBKCOLOR, back, 0) if back
|
517
|
+
else
|
518
|
+
@_colors = [fore, back]
|
519
|
+
end
|
520
|
+
end
|
521
|
+
|
522
|
+
#
|
523
|
+
def windowtheme=(theme) # Not work...
|
524
|
+
if alive?
|
525
|
+
SendMessage(TTM_SETWINDOWTHEME, 0, theme)
|
526
|
+
else
|
527
|
+
@_windowtheme = theme
|
528
|
+
end
|
529
|
+
end
|
530
|
+
#
|
531
|
+
def _get_newest_tip_id()
|
532
|
+
r = 0
|
533
|
+
if alive?
|
534
|
+
count.times{|i|
|
535
|
+
SendMessage(TTM_ENUMTOOLS, i, tti=TOOLINFO[TOOLINFO::Size])
|
536
|
+
uid = tti.uId
|
537
|
+
r = uid if tti.uFlags&TTF_IDISHWND==0 && uid<ModParent::ItemBaseID && r<uid
|
538
|
+
}
|
539
|
+
r + 1
|
540
|
+
else
|
541
|
+
each{|i| r += 1 if !i.is_a?(Window) && !i.is_a?(Integer)}
|
542
|
+
r
|
543
|
+
end
|
544
|
+
end
|
545
|
+
|
546
|
+
|
547
|
+
WinStyles = {
|
548
|
+
:alwaystip => TTS_ALWAYSTIP,
|
549
|
+
:noprefix => TTS_NOPREFIX,
|
550
|
+
:noamimate => TTS_NOANIMATE,
|
551
|
+
:nofade => TTS_NOFADE,
|
552
|
+
:balloon => TTS_BALLOON,
|
553
|
+
:close => TTS_CLOSE
|
554
|
+
}
|
555
|
+
|
556
|
+
protected
|
557
|
+
def _apply_options(arg)
|
558
|
+
if st = WinStyles[arg]
|
559
|
+
self.style |= st
|
560
|
+
end
|
561
|
+
# super
|
562
|
+
end
|
563
|
+
|
564
|
+
private
|
565
|
+
def __deltool__(ti)
|
566
|
+
return unless @_ar_data # recycled?
|
567
|
+
data = ObjectSpace._id2ref(ti.lParam) rescue nil
|
568
|
+
if data && n = @_ar_data.index(data) #; dp "@%p, %p, %p", data, n, @_ar_data
|
569
|
+
@_ar_data.delete_at(n)
|
570
|
+
end
|
571
|
+
end
|
572
|
+
end
|
573
|
+
end
|
574
|
+
|
575
|
+
module WR
|
576
|
+
class Form1 < Form
|
577
|
+
def initialize
|
578
|
+
resize 640, 480
|
579
|
+
self.font = Font["Meiryo", 18]
|
580
|
+
self.events = :paint
|
581
|
+
|
582
|
+
_<< Toolbar[:toolbar1, '',0,0,100,30, :tooltips]
|
583
|
+
_toolbar1.imagelist = :systemlarge
|
584
|
+
_toolbar1 << [:btnew, :filenew]
|
585
|
+
_toolbar1 << [:btopen, :fileopen]
|
586
|
+
_toolbar1 << [:btsave, :filesave]
|
587
|
+
|
588
|
+
_<< Button[:button1, "Delet tip", 100, 100, 100, 30]
|
589
|
+
_<< Button[:button2, "Hittest", 100, 150, 100, 30]
|
590
|
+
|
591
|
+
_<< Statusbar[:stb1, 'Part1', 0, 0, 100, 24]
|
592
|
+
_stb1 << [[100, 'part2'], [100, 'part3']]
|
593
|
+
_<< Tooltip[:tooltip0, '', 0, 0, 0, 0, :noprefix]
|
594
|
+
_tooltip0 << [_stb1, "Statusbar!"]
|
595
|
+
_tooltip0.events = :getdispinfo, :show
|
596
|
+
|
597
|
+
_<< Tooltip[:tooltip1, '', 0,0,0,0,:balloon]
|
598
|
+
_tooltip1 << [_button1, "shown tip by control!"]
|
599
|
+
_tooltip1 << [_button2, "shown tip by control!"]
|
600
|
+
_tooltip1 << [RECT[0,100,100,200], "shown tip by area1!"]
|
601
|
+
_tooltip1 << [RECT[0,200,100,300], "shown tip by area2!"]
|
602
|
+
|
603
|
+
_<< Tooltip[:tooltip2, '',0,0,0,0, _toolbar1]
|
604
|
+
_tooltip2 << [_toolbar1.btnew.idcmd, "New!"]
|
605
|
+
_tooltip2 << [_toolbar1.btopen.idcmd, "Open!"]
|
606
|
+
_tooltip2 << [_toolbar1.btsave.idcmd, "Save!"]
|
607
|
+
_tooltip1[0].text += ' (added)'
|
608
|
+
end
|
609
|
+
|
610
|
+
def created()
|
611
|
+
# dpp APP::COMCTL_MAJOR_VERSION, APP::COMCTL_MINOR_VERSION
|
612
|
+
# _toolbar1.tooltips = _tooltip2
|
613
|
+
end
|
614
|
+
|
615
|
+
def tooltip0_getdispinfo(nm)
|
616
|
+
dpp nm.to_hsh
|
617
|
+
end
|
618
|
+
|
619
|
+
def tooltip0_show(nm)
|
620
|
+
dpp nm.to_hsh
|
621
|
+
end
|
622
|
+
|
623
|
+
def self_paint(cv)
|
624
|
+
cv.SetFont(self.font)
|
625
|
+
cv.FillRect(0, 100, 100, 200, 0xffffff)
|
626
|
+
cv.FillRect(0, 100, 50, 150, 0xffffff)
|
627
|
+
cv.DrawText("tooltip area1", 10, 160, 90, 180)
|
628
|
+
cv.SetBrush(0xffffd0)
|
629
|
+
cv.FillRect(0, 200, 100, 300, 0xffffd0)
|
630
|
+
cv.DrawText("tooltip area2", 10, 240, 90, 260)
|
631
|
+
end
|
632
|
+
|
633
|
+
def button1_clicked(*)
|
634
|
+
return _tooltip1.delete
|
635
|
+
dp "@%p", _tooltip1[_button1]
|
636
|
+
_tooltip1[_button1].delete
|
637
|
+
_tooltip1[1].delete
|
638
|
+
end
|
639
|
+
|
640
|
+
def button2_clicked(*)
|
641
|
+
_tooltip1.colors = 0x0000ff, 0xffffff
|
642
|
+
_tooltip1.windowtheme = 'Windows Calssic'
|
643
|
+
_tooltip1.each{|i| p i.text}
|
644
|
+
dp "@%p", _tooltip1.hittest(30, 120)
|
645
|
+
dp "@%p", _tooltip1.hittest(50, 250)
|
646
|
+
_tooltip1.delaytimes = 100, 500, 1000
|
647
|
+
_tooltip1[0].rect = 0, 100, 50, 150
|
648
|
+
end
|
649
|
+
self.start
|
650
|
+
end
|
651
|
+
end if $0 == __FILE__
|