fzeet 0.5.3 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. data/examples/Command.rbw +2 -2
  2. data/examples/Control/Button.rbw +33 -11
  3. data/examples/Control/ComboBox.rbw +30 -0
  4. data/examples/Control/ComboBoxEx.rbw +30 -0
  5. data/examples/Control/DateTimePicker.rbw +9 -0
  6. data/examples/Control/Edit.rbw +18 -0
  7. data/examples/Control/Header.rbw +9 -0
  8. data/examples/Control/ListBox.rbw +30 -0
  9. data/examples/Control/ListView.rbw +11 -0
  10. data/examples/Control/MonthCalendar.rbw +9 -0
  11. data/examples/Control/ProgressBar.rbw +22 -0
  12. data/examples/Control/PropertySheet.rbw +50 -0
  13. data/examples/Control/Static.rbw +14 -0
  14. data/examples/Control/SysLink.rbw +9 -0
  15. data/examples/Control/TreeView.rbw +28 -0
  16. data/examples/Control/UpDown.rbw +12 -0
  17. data/examples/Dialog/Dialog.rbw +9 -9
  18. data/examples/Dialog/DialogApplication.rbw +1 -1
  19. data/examples/Menu/ContextMenu.rbw +3 -1
  20. data/examples/Menu/MenuPARGB32.rbw +6 -6
  21. data/examples/Paint.rbw +9 -0
  22. data/examples/UIRibbon/ContextPopup.rbw +7 -4
  23. data/examples/UIRibbon/Control/Button.dll +0 -0
  24. data/examples/UIRibbon/Control/Button.rb +91 -0
  25. data/examples/UIRibbon/Control/Button.rbw +20 -0
  26. data/examples/UIRibbon/Control/Button.xml +247 -0
  27. data/examples/UIRibbon/Size.rbw +13 -0
  28. data/examples/res/audio-volume-muted-big.bmp +0 -0
  29. data/examples/res/audio-volume-muted-small.bmp +0 -0
  30. data/examples/res/audio-volume-muted.bmp +0 -0
  31. data/examples/res/go-down-big.bmp +0 -0
  32. data/examples/res/go-down-small.bmp +0 -0
  33. data/examples/res/go-down.bmp +0 -0
  34. data/examples/res/go-jump-big.bmp +0 -0
  35. data/examples/res/go-jump-small.bmp +0 -0
  36. data/examples/res/go-jump.bmp +0 -0
  37. data/examples/res/media-playback-pause-big.bmp +0 -0
  38. data/examples/res/media-playback-pause-small.bmp +0 -0
  39. data/examples/res/media-playback-pause.bmp +0 -0
  40. data/lib/fzeet/Application.rb +4 -2
  41. data/lib/fzeet/Common.rb +44 -2
  42. data/lib/fzeet/Control/Button.rb +17 -0
  43. data/lib/fzeet/Control/ComboBox.rb +46 -0
  44. data/lib/fzeet/Control/ComboBoxEx.rb +35 -0
  45. data/lib/fzeet/Control/Common.rb +2 -0
  46. data/lib/fzeet/Control/DateTimePicker.rb +38 -0
  47. data/lib/fzeet/Control/Edit.rb +53 -0
  48. data/lib/fzeet/Control/Header.rb +46 -0
  49. data/lib/fzeet/Control/ListBox.rb +72 -0
  50. data/lib/fzeet/Control/ListView.rb +90 -0
  51. data/lib/fzeet/Control/MonthCalendar.rb +38 -0
  52. data/lib/fzeet/Control/ProgressBar.rb +40 -0
  53. data/lib/fzeet/Control/Static.rb +34 -0
  54. data/lib/fzeet/Control/SysLink.rb +40 -0
  55. data/lib/fzeet/Control/TreeView.rb +32 -0
  56. data/lib/fzeet/Control/UpDown.rb +36 -0
  57. data/lib/fzeet/Control.rb +13 -0
  58. data/lib/fzeet/UIRibbon.rb +91 -31
  59. data/lib/fzeet/Window/Common.rb +22 -1
  60. data/lib/fzeet/Window/View.rb +15 -0
  61. data/lib/fzeet/Window/WindowMethods.rb +26 -1
  62. data/lib/fzeet/Window.rb +1 -0
  63. data/lib/fzeet/windows/comctl/Button.rb +3 -0
  64. data/lib/fzeet/windows/comctl/ComboBox.rb +12 -0
  65. data/lib/fzeet/windows/comctl/ComboBoxEx.rb +65 -0
  66. data/lib/fzeet/windows/comctl/Common.rb +52 -1
  67. data/lib/fzeet/windows/comctl/DateTimePicker.rb +54 -0
  68. data/lib/fzeet/windows/comctl/Edit.rb +20 -0
  69. data/lib/fzeet/windows/comctl/Header.rb +128 -0
  70. data/lib/fzeet/windows/comctl/ListView.rb +317 -0
  71. data/lib/fzeet/windows/comctl/MonthCalendar.rb +62 -0
  72. data/lib/fzeet/windows/comctl/ProgressBar.rb +31 -0
  73. data/lib/fzeet/windows/comctl/PropertySheet.rb +205 -0
  74. data/lib/fzeet/windows/comctl/SysLink.rb +34 -0
  75. data/lib/fzeet/windows/comctl/TreeView.rb +198 -0
  76. data/lib/fzeet/windows/comctl/UpDown.rb +43 -0
  77. data/lib/fzeet/windows/comctl.rb +12 -0
  78. data/lib/fzeet/windows/common.rb +74 -2
  79. data/lib/fzeet/windows/gdi.rb +2 -0
  80. data/lib/fzeet/windows/libc.rb +4 -0
  81. data/lib/fzeet/windows/ole.rb +0 -22
  82. data/lib/fzeet/windows/shell/Common.rb +2 -0
  83. data/lib/fzeet/windows/user/Control/Button.rb +6 -0
  84. data/lib/fzeet/windows/user/Control/ComboBox.rb +72 -0
  85. data/lib/fzeet/windows/user/Control/Common.rb +1 -1
  86. data/lib/fzeet/windows/user/Control/Edit.rb +71 -0
  87. data/lib/fzeet/windows/user/Control/ListBox.rb +78 -0
  88. data/lib/fzeet/windows/user/Control/Static.rb +49 -0
  89. data/lib/fzeet/windows/user/Control.rb +4 -0
  90. data/lib/fzeet/windows/user/Window.rb +47 -0
  91. 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, x: 10, y: 10, width: 76, height: 24)
15
+ Button.new(window, :button1, position: [10, 10, 76, 24])
16
16
 
17
17
  window.
18
18
  on(:command, :item1) {
@@ -2,18 +2,40 @@ require 'fzeet'
2
2
 
3
3
  include Fzeet
4
4
 
5
- Application.run { |window|
6
- Button.new(window, :button1, x: 10, y: 10, width: 76, height: 24) {
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, :button3, x: 10, y: 70, width: 76, height: 24, style: :splitbutton)
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[:button3].on(:dropdown) {
17
- message 'on(:notify, :button3, :dropdown)'
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,9 @@
1
+ require 'fzeet'
2
+
3
+ include Fzeet
4
+
5
+ Application.run { |window| window.dialog = true
6
+ DateTimePicker.new(window, :datetime1, position: [10, 10, 150, 24])
7
+
8
+ window[:datetime1].on(:datetimechange) { |args| message args[:st].to_local }
9
+ }
@@ -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,9 @@
1
+ require 'fzeet'
2
+
3
+ include Fzeet
4
+
5
+ Application.run { |window| window.dialog = true
6
+ Header.new(window, :header1, style: :buttons, position: [10, 10, 200, 30]).
7
+ insertItem(0, 'Item1', 100).
8
+ insertItem(1, 'Item2', 100)
9
+ }
@@ -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,9 @@
1
+ require 'fzeet'
2
+
3
+ include Fzeet
4
+
5
+ Application.run { |window| window.dialog = true
6
+ MonthCalendar.new(window, :monthcal1, position: [10, 10, 240, 170])
7
+
8
+ window[:monthcal1].on(:selchange) { |args| message args[:st1].to_local }
9
+ }
@@ -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
+ }
@@ -2,20 +2,20 @@ require 'fzeet'
2
2
 
3
3
  include Fzeet
4
4
 
5
- Application.run { |window|
6
- Button.new(window, :modeless, x: 10, y: 10, width: 76, height: 24) {
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, x: 228, y: 242, width: 76, height: 24) {
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, x: 308, y: 242, width: 76, height: 24) {
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, x: 10, y: 10, width: 76, height: 24) {
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, x: 90, y: 10, width: 76, height: 24) {
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, x: 228, y: 242, width: 76, height: 24) {
30
+ Button.new(dialog, :ok, position: [228, 242, 76, 24]) {
31
31
  dialog.end(:ok)
32
32
  }
33
33
 
34
- Button.new(dialog, :cancel, x: 308, y: 242, width: 76, height: 24) {
34
+ Button.new(dialog, :cancel, position: [308, 242, 76, 24]) {
35
35
  dialog.end(:cancel)
36
36
  }
37
37
 
38
- Button.new(dialog, :button1, x: 10, y: 10, width: 76, height: 24) {
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', x: 10, y: 10, width: 76, height: 24)
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: PARGB32.new('../res/edit-cut.bmp'),
8
- copy: PARGB32.new('../res/edit-copy.bmp'),
9
- paste: PARGB32.new('../res/edit-paste.bmp')
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.on(:destroy) { images.values.each(&:dispose) }
21
+ window.stubNotImplementedCommands
22
22
  }
@@ -0,0 +1,9 @@
1
+ require 'fzeet'
2
+
3
+ include Fzeet
4
+
5
+ Application.run(View.new) { |window|
6
+ window.on(:draw, Control::Font) { |dc|
7
+ dc.sms 'The quick brown fox jumps over the lazy dog. 1234567890'
8
+ }
9
+ }
@@ -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.on(:contextmenu) { |args|
10
- window.ribbon.contextualUI(CmdContextMap1, args[:x], args[:y])
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
  }
@@ -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
+ }