fzeet 0.5.3 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/examples/Command.rbw +2 -2
- data/examples/Control/Button.rbw +33 -11
- data/examples/Control/ComboBox.rbw +30 -0
- data/examples/Control/ComboBoxEx.rbw +30 -0
- data/examples/Control/DateTimePicker.rbw +9 -0
- data/examples/Control/Edit.rbw +18 -0
- data/examples/Control/Header.rbw +9 -0
- data/examples/Control/ListBox.rbw +30 -0
- data/examples/Control/ListView.rbw +11 -0
- data/examples/Control/MonthCalendar.rbw +9 -0
- data/examples/Control/ProgressBar.rbw +22 -0
- data/examples/Control/PropertySheet.rbw +50 -0
- data/examples/Control/Static.rbw +14 -0
- data/examples/Control/SysLink.rbw +9 -0
- data/examples/Control/TreeView.rbw +28 -0
- data/examples/Control/UpDown.rbw +12 -0
- data/examples/Dialog/Dialog.rbw +9 -9
- data/examples/Dialog/DialogApplication.rbw +1 -1
- data/examples/Menu/ContextMenu.rbw +3 -1
- data/examples/Menu/MenuPARGB32.rbw +6 -6
- data/examples/Paint.rbw +9 -0
- data/examples/UIRibbon/ContextPopup.rbw +7 -4
- data/examples/UIRibbon/Control/Button.dll +0 -0
- data/examples/UIRibbon/Control/Button.rb +91 -0
- data/examples/UIRibbon/Control/Button.rbw +20 -0
- data/examples/UIRibbon/Control/Button.xml +247 -0
- data/examples/UIRibbon/Size.rbw +13 -0
- data/examples/res/audio-volume-muted-big.bmp +0 -0
- data/examples/res/audio-volume-muted-small.bmp +0 -0
- data/examples/res/audio-volume-muted.bmp +0 -0
- data/examples/res/go-down-big.bmp +0 -0
- data/examples/res/go-down-small.bmp +0 -0
- data/examples/res/go-down.bmp +0 -0
- data/examples/res/go-jump-big.bmp +0 -0
- data/examples/res/go-jump-small.bmp +0 -0
- data/examples/res/go-jump.bmp +0 -0
- data/examples/res/media-playback-pause-big.bmp +0 -0
- data/examples/res/media-playback-pause-small.bmp +0 -0
- data/examples/res/media-playback-pause.bmp +0 -0
- data/lib/fzeet/Application.rb +4 -2
- data/lib/fzeet/Common.rb +44 -2
- data/lib/fzeet/Control/Button.rb +17 -0
- data/lib/fzeet/Control/ComboBox.rb +46 -0
- data/lib/fzeet/Control/ComboBoxEx.rb +35 -0
- data/lib/fzeet/Control/Common.rb +2 -0
- data/lib/fzeet/Control/DateTimePicker.rb +38 -0
- data/lib/fzeet/Control/Edit.rb +53 -0
- data/lib/fzeet/Control/Header.rb +46 -0
- data/lib/fzeet/Control/ListBox.rb +72 -0
- data/lib/fzeet/Control/ListView.rb +90 -0
- data/lib/fzeet/Control/MonthCalendar.rb +38 -0
- data/lib/fzeet/Control/ProgressBar.rb +40 -0
- data/lib/fzeet/Control/Static.rb +34 -0
- data/lib/fzeet/Control/SysLink.rb +40 -0
- data/lib/fzeet/Control/TreeView.rb +32 -0
- data/lib/fzeet/Control/UpDown.rb +36 -0
- data/lib/fzeet/Control.rb +13 -0
- data/lib/fzeet/UIRibbon.rb +91 -31
- data/lib/fzeet/Window/Common.rb +22 -1
- data/lib/fzeet/Window/View.rb +15 -0
- data/lib/fzeet/Window/WindowMethods.rb +26 -1
- data/lib/fzeet/Window.rb +1 -0
- data/lib/fzeet/windows/comctl/Button.rb +3 -0
- data/lib/fzeet/windows/comctl/ComboBox.rb +12 -0
- data/lib/fzeet/windows/comctl/ComboBoxEx.rb +65 -0
- data/lib/fzeet/windows/comctl/Common.rb +52 -1
- data/lib/fzeet/windows/comctl/DateTimePicker.rb +54 -0
- data/lib/fzeet/windows/comctl/Edit.rb +20 -0
- data/lib/fzeet/windows/comctl/Header.rb +128 -0
- data/lib/fzeet/windows/comctl/ListView.rb +317 -0
- data/lib/fzeet/windows/comctl/MonthCalendar.rb +62 -0
- data/lib/fzeet/windows/comctl/ProgressBar.rb +31 -0
- data/lib/fzeet/windows/comctl/PropertySheet.rb +205 -0
- data/lib/fzeet/windows/comctl/SysLink.rb +34 -0
- data/lib/fzeet/windows/comctl/TreeView.rb +198 -0
- data/lib/fzeet/windows/comctl/UpDown.rb +43 -0
- data/lib/fzeet/windows/comctl.rb +12 -0
- data/lib/fzeet/windows/common.rb +74 -2
- data/lib/fzeet/windows/gdi.rb +2 -0
- data/lib/fzeet/windows/libc.rb +4 -0
- data/lib/fzeet/windows/ole.rb +0 -22
- data/lib/fzeet/windows/shell/Common.rb +2 -0
- data/lib/fzeet/windows/user/Control/Button.rb +6 -0
- data/lib/fzeet/windows/user/Control/ComboBox.rb +72 -0
- data/lib/fzeet/windows/user/Control/Common.rb +1 -1
- data/lib/fzeet/windows/user/Control/Edit.rb +71 -0
- data/lib/fzeet/windows/user/Control/ListBox.rb +78 -0
- data/lib/fzeet/windows/user/Control/Static.rb +49 -0
- data/lib/fzeet/windows/user/Control.rb +4 -0
- data/lib/fzeet/windows/user/Window.rb +47 -0
- metadata +66 -4
data/examples/Command.rbw
CHANGED
@@ -2,7 +2,7 @@ require 'fzeet'
|
|
2
2
|
|
3
3
|
include Fzeet
|
4
4
|
|
5
|
-
Application.run { |window|
|
5
|
+
Application.run { |window| window.dialog = true
|
6
6
|
window.menu = Menu.new.
|
7
7
|
append(:popup, 'Menu&1', PopupMenu.new.
|
8
8
|
append(:string, "Item&1\tAlt+I", :item1)
|
@@ -12,7 +12,7 @@ Application.run { |window|
|
|
12
12
|
[:alt, :I, :item1]
|
13
13
|
)
|
14
14
|
|
15
|
-
Button.new(window, :button1,
|
15
|
+
Button.new(window, :button1, position: [10, 10, 76, 24])
|
16
16
|
|
17
17
|
window.
|
18
18
|
on(:command, :item1) {
|
data/examples/Control/Button.rbw
CHANGED
@@ -2,18 +2,40 @@ require 'fzeet'
|
|
2
2
|
|
3
3
|
include Fzeet
|
4
4
|
|
5
|
-
Application.run { |window|
|
6
|
-
|
7
|
-
message 'on(:command, :button1)'
|
8
|
-
}
|
9
|
-
|
10
|
-
Button.new(window, :button2, x: 10, y: 40, width: 76, height: 24, style: :notify,
|
11
|
-
doubleclicked: -> { message 'on(:command, :button2, :doubleclicked)' }
|
12
|
-
)
|
5
|
+
Application.run { |window| window.dialog = true
|
6
|
+
Application.images[:image] = image = PARGB32.new('../res/go-jump-small.bmp')
|
13
7
|
|
14
|
-
Button.new(window, :
|
8
|
+
Button.new(window, :button1, position: [10, 10, 76, 24])
|
9
|
+
Button.new(window, :button2, style: :notify, position: [10, 40, 76, 24])
|
10
|
+
Button.new(window, :button3, style: [:splitbutton, :bitmap], position: [10, 70, 40, 24]).image = image
|
11
|
+
Button.new(window, :button4, style: :commandlink, position: [10, 100, 200, 60]).note = 'Description...'
|
12
|
+
Button.new(window, :check1, style: :autocheckbox, position: [90, 10, 76, 24])
|
13
|
+
Static.new(window, :static1, position: [170, 10, 76, 24]).text = window[:check1].checked?
|
14
|
+
Button.new(window, :check2, style: :auto3state, position: [90, 40, 76, 24])
|
15
|
+
Static.new(window, :static2, position: [170, 40, 76, 24]).text = window[:check2].checked?
|
16
|
+
Static.new(window, :static3, position: [250, 40, 76, 24]).text = window[:check2].indeterminate?
|
17
|
+
Button.new(window, :radio1, style: [:autoradiobutton, :group], position: [330, 10, 76, 24])
|
18
|
+
Button.new(window, :radio2, style: :autoradiobutton, position: [330, 40, 76, 24]).checked = true
|
19
|
+
Button.new(window, :radio3, style: [:autoradiobutton, :group], position: [330, 70, 76, 24])
|
20
|
+
Button.new(window, :radio4, style: :autoradiobutton, position: [330, 100, 76, 24]).checked = true
|
21
|
+
Button.new(window, :groupbox1, style: :groupbox, position: [410, 10, 150, 110])
|
15
22
|
|
16
|
-
window[:
|
17
|
-
|
23
|
+
window[:button1].on(:clicked) { message 'on(:command, :button1, :clicked)' }
|
24
|
+
window[:button2].on(:doubleclicked) { message 'on(:command, :button2, :doubleclicked)' }
|
25
|
+
window[:button3].
|
26
|
+
on(:clicked) { message 'on(:command, :button3, :clicked)' }.
|
27
|
+
on(:dropdown) { |args| using(
|
28
|
+
PopupMenu.new.
|
29
|
+
append(:string, 'Item&1', :item1)
|
30
|
+
) { |popup|
|
31
|
+
popup.track(window, *args[:sender].position.lb.to_a)
|
32
|
+
}}
|
33
|
+
window[:button4].on(:clicked) { message 'on(:command, :button4, :clicked)' }
|
34
|
+
window[:check1].on(:clicked) { |args| window[:static1].text = args[:sender].checked? }
|
35
|
+
window[:check2].on(:clicked) { |args|
|
36
|
+
window[:static2].text = args[:sender].checked?
|
37
|
+
window[:static3].text = args[:sender].indeterminate?
|
18
38
|
}
|
39
|
+
|
40
|
+
window.on(:command, :item1) { message 'on(:command, :item1)' }
|
19
41
|
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'fzeet'
|
2
|
+
|
3
|
+
include Fzeet
|
4
|
+
|
5
|
+
Application.run { |window| window.dialog = true
|
6
|
+
Static.new(window, :static1, position: [10, 10, 200, 24])
|
7
|
+
ComboBox.new(window, :combobox1, style: :dropdownlist, position: [10, 40, 200, 200])
|
8
|
+
Edit.new(window, :edit1, position: [220, 10, 200, 24])
|
9
|
+
Button.new(window, :add, caption: '&Add', position: [220, 40, 76, 24])
|
10
|
+
Button.new(window, :clear, caption: '&Clear', position: [300, 40, 76, 24])
|
11
|
+
|
12
|
+
window[:combobox1].
|
13
|
+
on(:selchange) { |args| window[:static1].text = args[:sender][:selected] }.
|
14
|
+
append(%w{Item1 Item2}).
|
15
|
+
selected = 1
|
16
|
+
|
17
|
+
window[:edit1].select.focus = true
|
18
|
+
|
19
|
+
window[:add].on(:clicked) {
|
20
|
+
window[:combobox1].append(window[:edit1].text).selected = :last
|
21
|
+
|
22
|
+
window[:edit1].select.focus = true
|
23
|
+
}
|
24
|
+
|
25
|
+
window[:clear].on(:clicked) {
|
26
|
+
[window[:combobox1], window[:static1], window[:edit1]].each(&:clear)
|
27
|
+
|
28
|
+
window[:edit1].focus = true
|
29
|
+
}
|
30
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'fzeet'
|
2
|
+
|
3
|
+
include Fzeet
|
4
|
+
|
5
|
+
Application.run { |window| window.dialog = true
|
6
|
+
Static.new(window, :static1, position: [10, 10, 200, 24])
|
7
|
+
ComboBoxEx.new(window, :combobox1, style: :dropdownlist, position: [10, 40, 200, 200])
|
8
|
+
Edit.new(window, :edit1, position: [220, 10, 200, 24])
|
9
|
+
Button.new(window, :add, caption: '&Add', position: [220, 40, 76, 24])
|
10
|
+
Button.new(window, :clear, caption: '&Clear', position: [300, 40, 76, 24])
|
11
|
+
|
12
|
+
#window[:combobox1].
|
13
|
+
# on(:selchange) { |args| window[:static1].text = args[:sender][:selected] }.
|
14
|
+
# append(%w{Item1 Item2}).
|
15
|
+
# selected = 1
|
16
|
+
|
17
|
+
window[:edit1].select.focus = true
|
18
|
+
|
19
|
+
window[:add].on(:clicked) {
|
20
|
+
#window[:combobox1].append(window[:edit1].text).selected = :last
|
21
|
+
|
22
|
+
window[:edit1].select.focus = true
|
23
|
+
}
|
24
|
+
|
25
|
+
window[:clear].on(:clicked) {
|
26
|
+
[window[:combobox1], window[:static1], window[:edit1]].each(&:clear)
|
27
|
+
|
28
|
+
window[:edit1].focus = true
|
29
|
+
}
|
30
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'fzeet'
|
2
|
+
|
3
|
+
include Fzeet
|
4
|
+
|
5
|
+
Application.run { |window| window.dialog = true
|
6
|
+
Edit.new(window, :edit1, position: [10, 10, 76, 24])
|
7
|
+
Static.new(window, :static1, position: [10, 40, 76, 24])
|
8
|
+
Edit.new(window, :edit2, caption: '', style: :password, position: [10, 70, 76, 24]).cuebanner = 'password'
|
9
|
+
|
10
|
+
window[:edit1].
|
11
|
+
on(:change) { |args| window[:static1].text = args[:sender].text }.
|
12
|
+
select.
|
13
|
+
focus = true
|
14
|
+
|
15
|
+
window[:edit2].on(:setfocus) { |args|
|
16
|
+
args[:sender].showBalloontip('text', 'title')
|
17
|
+
}
|
18
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'fzeet'
|
2
|
+
|
3
|
+
include Fzeet
|
4
|
+
|
5
|
+
Application.run { |window| window.dialog = true
|
6
|
+
Static.new(window, :static1, position: [10, 10, 200, 24])
|
7
|
+
ListBox.new(window, :listbox1, style: [:border, :notify], position: [10, 40, 200, 200])
|
8
|
+
Edit.new(window, :edit1, position: [220, 10, 200, 24])
|
9
|
+
Button.new(window, :add, caption: '&Add', position: [220, 40, 76, 24])
|
10
|
+
Button.new(window, :clear, caption: '&Clear', position: [300, 40, 76, 24])
|
11
|
+
|
12
|
+
window[:listbox1].
|
13
|
+
on(:selchange) { |args| window[:static1].text = args[:sender][:selected] }.
|
14
|
+
append(%w{Item1 Item2}).
|
15
|
+
selected = 1
|
16
|
+
|
17
|
+
window[:edit1].select.focus = true
|
18
|
+
|
19
|
+
window[:add].on(:clicked) {
|
20
|
+
window[:listbox1].append(window[:edit1].text).selected = :last
|
21
|
+
|
22
|
+
window[:edit1].select.focus = true
|
23
|
+
}
|
24
|
+
|
25
|
+
window[:clear].on(:clicked) {
|
26
|
+
[window[:listbox1], window[:static1], window[:edit1]].each(&:clear)
|
27
|
+
|
28
|
+
window[:edit1].focus = true
|
29
|
+
}
|
30
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'fzeet'
|
2
|
+
|
3
|
+
include Fzeet
|
4
|
+
|
5
|
+
Application.run { |window| window.dialog = true
|
6
|
+
ListView.new(window, :listview1, style: [:border, :report], position: [10, 10, 200, 200]).
|
7
|
+
tap { |lv| lv.xstyle << :gridlines << :fullrowselect }.
|
8
|
+
insertColumn(0, 'Column1', 100).insertColumn(1, 'Column2', 100).
|
9
|
+
insertItem(0, 0, 'Item1').insertItem(0, 1, 'Item2').
|
10
|
+
insertItem(1, 0, 'Item3').insertItem(1, 1, 'Item4')
|
11
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'fzeet'
|
2
|
+
|
3
|
+
include Fzeet
|
4
|
+
|
5
|
+
Application.run { |window| window.dialog = true
|
6
|
+
ProgressBar.new(window, :progress1, style: :smooth, position: [10, 10, 200, 24]).step = 1
|
7
|
+
Button.new(window, :progress, position: [215, 10, 76, 24])
|
8
|
+
|
9
|
+
ProgressBar.new(window, :progress2, style: :marquee, position: [10, 40, 200, 24])
|
10
|
+
Button.new(window, :marquee, position: [215, 40, 76, 24])
|
11
|
+
|
12
|
+
window[:progress].on(:clicked) { |args|
|
13
|
+
args[:sender].toggle(:enabled) {
|
14
|
+
100.times { window[:progress1].step!; sleep(0.1) }
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
window[:marquee].on(:clicked) { |args|
|
19
|
+
window[:progress2].toggle(:marquee)
|
20
|
+
args[:sender].pushed = window[:progress2].marquee?
|
21
|
+
}
|
22
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'fzeet'
|
2
|
+
|
3
|
+
include Fzeet
|
4
|
+
|
5
|
+
pointers, pages = [], 3
|
6
|
+
|
7
|
+
Application.run { |window| window.dialog = true
|
8
|
+
psps = Class.new(FFI::Struct) {
|
9
|
+
layout \
|
10
|
+
:array, [Windows::PROPSHEETPAGE, pages]
|
11
|
+
}.new
|
12
|
+
|
13
|
+
dt = Windows::DLGTEMPLATE.new
|
14
|
+
|
15
|
+
dt[:style] = Fzeet.flags([:'3dlook', :control, :child, :tabstop], :ds_, :ws_)
|
16
|
+
dt[:x], dt[:y], dt[:cx], dt[:cy] = 100, 100, 300, 150
|
17
|
+
|
18
|
+
pages.times { |i|
|
19
|
+
psp = psps[:array][i]
|
20
|
+
|
21
|
+
psp[:dwSize] = psp.size
|
22
|
+
psp[:dwFlags] = Fzeet.flags([:dlgindirect, :usetitle], :psp_)
|
23
|
+
psp[:hInstance] = Windows.GetModuleHandle(nil)
|
24
|
+
psp[:template][:pResource] = dt
|
25
|
+
psp[:pszTitle] = pointers.push(FFI::MemoryPointer.from_string("Page#{i + 1}")).last
|
26
|
+
}
|
27
|
+
|
28
|
+
psh = Windows::PROPSHEETHEADER.new
|
29
|
+
|
30
|
+
psh[:dwSize] = psh.size
|
31
|
+
psh[:dwFlags] = Fzeet.flags(:propsheetpage, :psh_)
|
32
|
+
psh[:hwndParent] = window.handle
|
33
|
+
psh[:hInstance] = Windows.GetModuleHandle(nil)
|
34
|
+
psh[:pszCaption] = pointers.push(FFI::MemoryPointer.from_string('Sheet')).last
|
35
|
+
psh[:nPages] = pages
|
36
|
+
psh[:start][:nStartPage] = 1
|
37
|
+
psh[:pages][:ppsp] = psps
|
38
|
+
|
39
|
+
Button.new(window, :sheet, position: [10, 10, 76, 24]) {
|
40
|
+
Windows.DetonateLastError(-1, :PropertySheet, psh)
|
41
|
+
}
|
42
|
+
|
43
|
+
Button.new(window, :wizard, position: [90, 10, 76, 24]) {
|
44
|
+
psh[:dwFlags] |= Windows::PSH_WIZARD
|
45
|
+
Windows.DetonateLastError(-1, :PropertySheet, psh)
|
46
|
+
psh[:dwFlags] &= ~Windows::PSH_WIZARD
|
47
|
+
}
|
48
|
+
|
49
|
+
window.on(:destroy) { pointers.each(&:free) }
|
50
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'fzeet'
|
2
|
+
|
3
|
+
include Fzeet
|
4
|
+
|
5
|
+
Application.run { |window| window.dialog = true
|
6
|
+
Application.images[:image] = image = PARGB32.new('../res/go-next.bmp')
|
7
|
+
|
8
|
+
Static.new(window, :static1, position: [10, 10, 76, 24])
|
9
|
+
Static.new(window, :static2, style: [:notify, :bitmap], position: [10, 40, 76, 24]).image = image
|
10
|
+
Static.new(window, :static3, style: :grayframe, position: [90, 10, 76, 1])
|
11
|
+
Static.new(window, :static4, style: :grayframe, position: [90, 40, 76, 76])
|
12
|
+
|
13
|
+
window[:static2].on(:clicked) { message 'on(:command, :static2, :clicked)' }
|
14
|
+
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
require 'fzeet'
|
2
|
+
|
3
|
+
include Fzeet
|
4
|
+
|
5
|
+
Application.run { |window| window.dialog = true
|
6
|
+
SysLink.new(window, :syslink1, caption: '<a href="http://www.ruby-lang.org/">Ruby</a>', position: [10, 10, 76, 24])
|
7
|
+
|
8
|
+
window[:syslink1].on(:click) { |args| shell(args[:url]) }
|
9
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'fzeet'
|
2
|
+
|
3
|
+
include Fzeet
|
4
|
+
|
5
|
+
Application.run { |window| window.dialog = true
|
6
|
+
TreeView.new(window, :treeview1, style: [:border, :haslines, :linesatroot, :hasbuttons], position: [10, 10, 200, 200])
|
7
|
+
|
8
|
+
tv = window[:treeview1]
|
9
|
+
tvis = Windows::TVINSERTSTRUCT.new
|
10
|
+
tvi = tvis[:item]
|
11
|
+
pointers = []
|
12
|
+
|
13
|
+
tvis[:hInsertAfter] = Windows::TVI_LAST
|
14
|
+
tvi[:mask] = Windows::TVIF_TEXT
|
15
|
+
|
16
|
+
tvis[:hParent] = Windows::TVI_ROOT
|
17
|
+
tvi[:pszText] = pointers.push(FFI::MemoryPointer.from_string('Foo')).last
|
18
|
+
hfoo = tv.sendmsg(:insertitem, 0, tvis.pointer)
|
19
|
+
tvis[:hParent] = hfoo
|
20
|
+
tvi[:pszText] = pointers.push(FFI::MemoryPointer.from_string('Baz')).last
|
21
|
+
hbaz = tv.sendmsg(:insertitem, 0, tvis.pointer)
|
22
|
+
|
23
|
+
tvis[:hParent] = Windows::TVI_ROOT
|
24
|
+
tvi[:pszText] = pointers.push(FFI::MemoryPointer.from_string('Bar')).last
|
25
|
+
hbar = tv.sendmsg(:insertitem, 0, tvis.pointer)
|
26
|
+
|
27
|
+
pointers.each(&:free)
|
28
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'fzeet'
|
2
|
+
|
3
|
+
include Fzeet
|
4
|
+
|
5
|
+
Application.run { |window| window.dialog = true
|
6
|
+
Edit.new(window, :edit1, style: :number, position: [10, 10, 76, 24])
|
7
|
+
UpDown.new(window, :updown1, style: [:setbuddyint, :alignright], position: [90, 10, 76, 24]).tap { |ud|
|
8
|
+
ud.buddy = window[:edit1]
|
9
|
+
ud.range = 42, 45
|
10
|
+
ud.position = 43
|
11
|
+
}
|
12
|
+
}
|
data/examples/Dialog/Dialog.rbw
CHANGED
@@ -2,20 +2,20 @@ require 'fzeet'
|
|
2
2
|
|
3
3
|
include Fzeet
|
4
4
|
|
5
|
-
Application.run { |window|
|
6
|
-
Button.new(window, :modeless,
|
5
|
+
Application.run { |window| window.dialog = true
|
6
|
+
Button.new(window, :modeless, position: [10, 10, 76, 24]) {
|
7
7
|
Dialog.new(window, caption: 'Modeless', x: 100, y: 100) { |args|
|
8
8
|
dialog = args[:window]
|
9
9
|
|
10
|
-
Button.new(dialog, :ok,
|
10
|
+
Button.new(dialog, :ok, position: [228, 242, 76, 24]) {
|
11
11
|
dialog.dispose; window[:modeless].toggle(:enabled)
|
12
12
|
}
|
13
13
|
|
14
|
-
Button.new(dialog, :cancel,
|
14
|
+
Button.new(dialog, :cancel, position: [308, 242, 76, 24]) {
|
15
15
|
dialog.dispose; window[:modeless].toggle(:enabled)
|
16
16
|
}
|
17
17
|
|
18
|
-
Button.new(dialog, :button1,
|
18
|
+
Button.new(dialog, :button1, position: [10, 10, 76, 24]) {
|
19
19
|
dialog.message 'clicked'
|
20
20
|
}
|
21
21
|
}
|
@@ -23,19 +23,19 @@ Application.run { |window|
|
|
23
23
|
window[:modeless].toggle(:enabled)
|
24
24
|
}
|
25
25
|
|
26
|
-
Button.new(window, :modal,
|
26
|
+
Button.new(window, :modal, position: [90, 10, 76, 24]) {
|
27
27
|
message Dialog.new(window, modal: true, caption: 'Modal', x: 150, y: 150) { |args|
|
28
28
|
dialog = args[:window]
|
29
29
|
|
30
|
-
Button.new(dialog, :ok,
|
30
|
+
Button.new(dialog, :ok, position: [228, 242, 76, 24]) {
|
31
31
|
dialog.end(:ok)
|
32
32
|
}
|
33
33
|
|
34
|
-
Button.new(dialog, :cancel,
|
34
|
+
Button.new(dialog, :cancel, position: [308, 242, 76, 24]) {
|
35
35
|
dialog.end(:cancel)
|
36
36
|
}
|
37
37
|
|
38
|
-
Button.new(dialog, :button1,
|
38
|
+
Button.new(dialog, :button1, position: [10, 10, 76, 24]) {
|
39
39
|
dialog.message 'clicked'
|
40
40
|
}
|
41
41
|
}.result.ok?
|
@@ -14,7 +14,7 @@ Dialog.new(nil, modal: true, style: [:overlappedwindow, :center]) { |args|
|
|
14
14
|
append(:string, 'E&xit', :exit)
|
15
15
|
)
|
16
16
|
|
17
|
-
Button.new(dialog, :button1, caption: '&Button1',
|
17
|
+
Button.new(dialog, :button1, caption: '&Button1', position: [10, 10, 76, 24])
|
18
18
|
|
19
19
|
dialog.
|
20
20
|
on(:command, :exit) { dialog.end(:ok) }.
|
@@ -2,8 +2,10 @@ require 'fzeet'
|
|
2
2
|
|
3
3
|
include Fzeet
|
4
4
|
|
5
|
-
Application.run { |window|
|
5
|
+
Application.run(View.new) { |window|
|
6
6
|
window.
|
7
|
+
on(:draw, Control::Font) { |dc| dc.sms 'Right-click (or menu key) for context menu' }.
|
8
|
+
|
7
9
|
on(:contextmenu) { |args| using(
|
8
10
|
PopupMenu.new.
|
9
11
|
append(:string, 'Item&1', :item1)
|
@@ -3,10 +3,10 @@ require 'fzeet'
|
|
3
3
|
include Fzeet
|
4
4
|
|
5
5
|
Application.run { |window|
|
6
|
-
images
|
7
|
-
cut
|
8
|
-
copy
|
9
|
-
paste
|
6
|
+
Application.images.tap { |images|
|
7
|
+
images[:cut] = PARGB32.new('../res/edit-cut.bmp')
|
8
|
+
images[:copy] = PARGB32.new('../res/edit-copy.bmp')
|
9
|
+
images[:paste] = PARGB32.new('../res/edit-paste.bmp')
|
10
10
|
}
|
11
11
|
|
12
12
|
window.menu = Menu.new.
|
@@ -16,7 +16,7 @@ Application.run { |window|
|
|
16
16
|
append(:string, '&Paste', :paste)
|
17
17
|
)
|
18
18
|
|
19
|
-
window.menu.images = images
|
19
|
+
window.menu.images = Application.images
|
20
20
|
|
21
|
-
window.
|
21
|
+
window.stubNotImplementedCommands
|
22
22
|
}
|
data/examples/Paint.rbw
ADDED
@@ -2,11 +2,14 @@ require 'fzeet'
|
|
2
2
|
|
3
3
|
include Fzeet
|
4
4
|
|
5
|
-
Application.run { |window|
|
5
|
+
Application.run(View.new) { |window|
|
6
6
|
UIRibbon.new(window).
|
7
7
|
on(CmdButton1) { message 'on(CmdButton1)' }
|
8
8
|
|
9
|
-
window.
|
10
|
-
|
11
|
-
|
9
|
+
window.
|
10
|
+
on(:draw, Control::Font) { |dc| dc.sms 'Right-click (or menu key) for context menu' }.
|
11
|
+
|
12
|
+
on(:contextmenu) { |args|
|
13
|
+
window.ribbon.contextualUI(CmdContextMap1, args[:x], args[:y])
|
14
|
+
}
|
12
15
|
}
|
Binary file
|
@@ -0,0 +1,91 @@
|
|
1
|
+
# Generated by the UIRibbon build, do NOT modify
|
2
|
+
|
3
|
+
CmdAppMenu = 2
|
4
|
+
CmdQAT = 3
|
5
|
+
CmdTab1 = 4
|
6
|
+
CmdTab1_LabelTitle_RESID = 60001
|
7
|
+
CmdTab1Group1 = 5
|
8
|
+
CmdTab1Group1_LabelTitle_RESID = 60002
|
9
|
+
CmdTab1Group1_LabelDescription_RESID = 60003
|
10
|
+
CmdTab1Group1_TooltipDescription_RESID = 60004
|
11
|
+
CmdTab1Group1_SmallImages_RESID = 60005
|
12
|
+
CmdTab1Group1_SmallImages_120__RESID = 60006
|
13
|
+
CmdTab1Group1_LargeImages_RESID = 60007
|
14
|
+
CmdTab1Group1_LargeImages_120__RESID = 60008
|
15
|
+
CmdTab1Group2 = 6
|
16
|
+
CmdTab1Group2_LabelTitle_RESID = 60009
|
17
|
+
CmdTab1Group2_LabelDescription_RESID = 60010
|
18
|
+
CmdTab1Group2_TooltipDescription_RESID = 60011
|
19
|
+
CmdTab1Group2_SmallImages_RESID = 60012
|
20
|
+
CmdTab1Group2_SmallImages_120__RESID = 60013
|
21
|
+
CmdTab1Group2_LargeImages_RESID = 60014
|
22
|
+
CmdTab1Group2_LargeImages_120__RESID = 60015
|
23
|
+
CmdTab1Group3 = 7
|
24
|
+
CmdTab1Group3_LabelTitle_RESID = 60016
|
25
|
+
CmdTab1Group3_LabelDescription_RESID = 60017
|
26
|
+
CmdTab1Group3_TooltipDescription_RESID = 60018
|
27
|
+
CmdTab1Group3_SmallImages_RESID = 60019
|
28
|
+
CmdTab1Group3_SmallImages_120__RESID = 60020
|
29
|
+
CmdTab1Group3_LargeImages_RESID = 60021
|
30
|
+
CmdTab1Group3_LargeImages_120__RESID = 60022
|
31
|
+
CmdTab1Group4 = 8
|
32
|
+
CmdTab1Group4_LabelTitle_RESID = 60023
|
33
|
+
CmdTab1Group4_LabelDescription_RESID = 60024
|
34
|
+
CmdTab1Group4_TooltipDescription_RESID = 60025
|
35
|
+
CmdTab1Group4_SmallImages_RESID = 60026
|
36
|
+
CmdTab1Group4_SmallImages_120__RESID = 60027
|
37
|
+
CmdTab1Group4_LargeImages_RESID = 60028
|
38
|
+
CmdTab1Group4_LargeImages_120__RESID = 60029
|
39
|
+
CmdTab1Group5 = 9
|
40
|
+
CmdTab1Group5_LabelTitle_RESID = 60030
|
41
|
+
CmdTab1Group5_LabelDescription_RESID = 60031
|
42
|
+
CmdTab1Group5_TooltipDescription_RESID = 60032
|
43
|
+
CmdTab1Group5_SmallImages_RESID = 60033
|
44
|
+
CmdTab1Group5_SmallImages_120__RESID = 60034
|
45
|
+
CmdTab1Group5_LargeImages_RESID = 60035
|
46
|
+
CmdTab1Group5_LargeImages_120__RESID = 60036
|
47
|
+
CmdButton1 = 10
|
48
|
+
CmdButton1_LabelTitle_RESID = 60037
|
49
|
+
CmdButton1_LabelDescription_RESID = 60038
|
50
|
+
CmdButton1_TooltipDescription_RESID = 60039
|
51
|
+
CmdButton1_SmallImages_RESID = 60040
|
52
|
+
CmdButton1_SmallImages_120__RESID = 60041
|
53
|
+
CmdButton1_LargeImages_RESID = 60042
|
54
|
+
CmdButton1_LargeImages_120__RESID = 60043
|
55
|
+
CmdDrop1 = 11
|
56
|
+
CmdDrop1_LabelTitle_RESID = 60044
|
57
|
+
CmdDrop1_LabelDescription_RESID = 60045
|
58
|
+
CmdDrop1_TooltipDescription_RESID = 60046
|
59
|
+
CmdDrop1_SmallImages_RESID = 60047
|
60
|
+
CmdDrop1_SmallImages_120__RESID = 60048
|
61
|
+
CmdDrop1_LargeImages_RESID = 60049
|
62
|
+
CmdDrop1_LargeImages_120__RESID = 60050
|
63
|
+
CmdSplit1 = 12
|
64
|
+
CmdSplit1_LabelTitle_RESID = 60051
|
65
|
+
CmdSplit1_LabelDescription_RESID = 60052
|
66
|
+
CmdSplit1_TooltipDescription_RESID = 60053
|
67
|
+
CmdSplit1_SmallImages_RESID = 60054
|
68
|
+
CmdSplit1_SmallImages_120__RESID = 60055
|
69
|
+
CmdSplit1_LargeImages_RESID = 60056
|
70
|
+
CmdSplit1_LargeImages_120__RESID = 60057
|
71
|
+
CmdToggle1 = 13
|
72
|
+
CmdToggle1_LabelTitle_RESID = 60058
|
73
|
+
CmdToggle1_LabelDescription_RESID = 60059
|
74
|
+
CmdToggle1_TooltipDescription_RESID = 60060
|
75
|
+
CmdToggle1_SmallImages_RESID = 60061
|
76
|
+
CmdToggle1_SmallImages_120__RESID = 60062
|
77
|
+
CmdToggle1_LargeImages_RESID = 60063
|
78
|
+
CmdToggle1_LargeImages_120__RESID = 60064
|
79
|
+
CmdCheck1 = 14
|
80
|
+
CmdCheck1_LabelTitle_RESID = 60065
|
81
|
+
CmdCheck1_LabelDescription_RESID = 60066
|
82
|
+
CmdCheck1_TooltipDescription_RESID = 60067
|
83
|
+
CmdCheck1_SmallImages_RESID = 60068
|
84
|
+
CmdCheck1_SmallImages_120__RESID = 60069
|
85
|
+
CmdCheck1_LargeImages_RESID = 60070
|
86
|
+
CmdCheck1_LargeImages_120__RESID = 60071
|
87
|
+
CmdContextMap1 = 15
|
88
|
+
InternalCmd2_LabelTitle_RESID = 60072
|
89
|
+
InternalCmd4_LabelTitle_RESID = 60073
|
90
|
+
InternalCmd6_LabelTitle_RESID = 60074
|
91
|
+
InternalCmd8_LabelTitle_RESID = 60075
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'fzeet'
|
2
|
+
|
3
|
+
include Fzeet
|
4
|
+
|
5
|
+
Application.run(View.new) { |window|
|
6
|
+
UIRibbon.new(window).
|
7
|
+
on(CmdButton1) { message 'on(CmdButton1)' }.
|
8
|
+
on(CmdSplit1) { message 'on(CmdSplit1)' }.
|
9
|
+
on(CmdToggle1) { window.ribbon[CmdCheck1].toggle(:checked) }.
|
10
|
+
on(CmdCheck1) { window.ribbon[CmdToggle1].toggle(:checked) }
|
11
|
+
|
12
|
+
window.ribbon[CmdToggle1].checked = true
|
13
|
+
|
14
|
+
window.
|
15
|
+
on(:draw, Control::Font) { |dc| dc.sms 'Right-click (or menu key) for context menu' }.
|
16
|
+
|
17
|
+
on(:contextmenu) { |args|
|
18
|
+
window.ribbon.contextualUI(CmdContextMap1, args[:x], args[:y])
|
19
|
+
}
|
20
|
+
}
|