foxguib 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +0 -0
  3. data/changelog.txt +128 -0
  4. data/doc/www/index.html +173 -0
  5. data/doc/www/upload.rb +9 -0
  6. data/examples/event_handler.rb +67 -0
  7. data/examples/event_handlers.rbin +0 -0
  8. data/examples/guib_testdialog.rb +31 -0
  9. data/examples/testdialog.rb +29 -0
  10. data/exe/foxguib +1 -0
  11. data/foxGUIb-debug.rb +37 -0
  12. data/foxGUIb.rb +88 -0
  13. data/foxGUIb_win32.rbw +1 -0
  14. data/foxguib.gemspec +26 -0
  15. data/license.txt +49 -0
  16. data/readme.txt +1 -0
  17. data/release_notes.txt +68 -0
  18. data/src/assert.rb +8 -0
  19. data/src/cfgman.rb +27 -0
  20. data/src/code-gen/code-generator.rb +171 -0
  21. data/src/code-gen/property-generators.rb +65 -0
  22. data/src/code-gen/widget-generator.rb +22 -0
  23. data/src/convert.rb +60 -0
  24. data/src/direct_widget_manipulation.rb +343 -0
  25. data/src/docman.rb +260 -0
  26. data/src/document.rb +405 -0
  27. data/src/event_categories.yaml +85 -0
  28. data/src/event_listener.rb +57 -0
  29. data/src/events.yaml +77 -0
  30. data/src/events_docu.yaml +228 -0
  31. data/src/get_events.rb +64 -0
  32. data/src/gui/ArrowButton.tga +0 -0
  33. data/src/gui/BoxMinus.tga +0 -0
  34. data/src/gui/BoxPlus.tga +0 -0
  35. data/src/gui/Button.tga +0 -0
  36. data/src/gui/CheckButton.tga +0 -0
  37. data/src/gui/ComboBox.tga +0 -0
  38. data/src/gui/Dial.tga +0 -0
  39. data/src/gui/GroupBox.tga +0 -0
  40. data/src/gui/HorizontalFrame.tga +0 -0
  41. data/src/gui/HorizontalSeparator.tga +0 -0
  42. data/src/gui/Label.tga +0 -0
  43. data/src/gui/MDIChild.tga +0 -0
  44. data/src/gui/MDIClient.tga +0 -0
  45. data/src/gui/Matrix.tga +0 -0
  46. data/src/gui/MenuCaption.tga +0 -0
  47. data/src/gui/MenuCascade.tga +0 -0
  48. data/src/gui/MenuCheck.tga +0 -0
  49. data/src/gui/MenuCommand.tga +0 -0
  50. data/src/gui/MenuPane.tga +0 -0
  51. data/src/gui/MenuRadio.tga +0 -0
  52. data/src/gui/MenuSeparator.tga +0 -0
  53. data/src/gui/MenuTitle.tga +0 -0
  54. data/src/gui/Menubar.tga +0 -0
  55. data/src/gui/Packer.tga +0 -0
  56. data/src/gui/ProgressBar.tga +0 -0
  57. data/src/gui/RadioButton.tga +0 -0
  58. data/src/gui/RadioMutex.tga +0 -0
  59. data/src/gui/ScrollWindow.tga +0 -0
  60. data/src/gui/Scrollbar.tga +0 -0
  61. data/src/gui/Shutter.tga +0 -0
  62. data/src/gui/ShutterItem.tga +0 -0
  63. data/src/gui/Slider.tga +0 -0
  64. data/src/gui/Spinner.tga +0 -0
  65. data/src/gui/Splitter.tga +0 -0
  66. data/src/gui/StatusBar.tga +0 -0
  67. data/src/gui/Statusline.tga +0 -0
  68. data/src/gui/Switcher.tga +0 -0
  69. data/src/gui/TabBar.tga +0 -0
  70. data/src/gui/TabBook.tga +0 -0
  71. data/src/gui/TabItem.tga +0 -0
  72. data/src/gui/Text.tga +0 -0
  73. data/src/gui/TextField.tga +0 -0
  74. data/src/gui/ToggleButton.tga +0 -0
  75. data/src/gui/Toolbar.tga +0 -0
  76. data/src/gui/VerticalFrame.tga +0 -0
  77. data/src/gui/VerticalSeparator.tga +0 -0
  78. data/src/gui/_guib_event_editor.rb +185 -0
  79. data/src/gui/_guib_event_editor.rbin +0 -0
  80. data/src/gui/_guib_genruby.rb +414 -0
  81. data/src/gui/_guib_genruby.rbin +0 -0
  82. data/src/gui/_guib_mainwin.rb +574 -0
  83. data/src/gui/_guib_mainwin.rbin +0 -0
  84. data/src/gui/event_editor.rb +180 -0
  85. data/src/gui/genruby.rb +155 -0
  86. data/src/gui/guib__console.rb +265 -0
  87. data/src/gui/mainwin.rb +71 -0
  88. data/src/gui/ruby_console.rb +263 -0
  89. data/src/gui/svg/Matrix.svg +87 -0
  90. data/src/gui/svg/MenuCheck.svg +135 -0
  91. data/src/gui/svg/MenuRadio.svg +130 -0
  92. data/src/gui/svg/RadioMutex.svg +119 -0
  93. data/src/gui/textview.rb +101 -0
  94. data/src/gui/textview.rbin +0 -0
  95. data/src/minitest.rb +60 -0
  96. data/src/prop-lists.rb +323 -0
  97. data/src/prop-types.rb +606 -0
  98. data/src/properties.rb +119 -0
  99. data/src/propman.rb +88 -0
  100. data/src/relink_mechanisms.rb +95 -0
  101. data/src/serialize.rb +167 -0
  102. data/src/state_machine.rb +73 -0
  103. data/src/version.rb +6 -0
  104. data/src/widget-lists.rb +118 -0
  105. data/src/widget-selector.rb +85 -0
  106. data/src/widgettree-controls.rb +183 -0
  107. data.tar.gz.sig +0 -0
  108. metadata +236 -0
  109. metadata.gz.sig +0 -0
@@ -0,0 +1,183 @@
1
+ # Copyright (c) 2004-2006 by Henon (meinrad dot recheis at gmail dot com)
2
+
3
+ require "relink_mechanisms"
4
+
5
+ module WidgettreeControls
6
+ # copy/paste clipboard
7
+ $clipboard = []
8
+
9
+ def onClick wdg
10
+ item = wdg.userData.treeitem
11
+ if item.nil?
12
+ error "this widget's item is nil", wdg.to_s
13
+ return
14
+ end
15
+ @fxtree.currentItem = item
16
+ expand_parents item
17
+ mark wdg
18
+ wdg.update_properties
19
+ # ~ @updateBrowserButtons.call item
20
+ # ~ unless $mvdestLbl.nil?
21
+ # ~ $mvdest=item
22
+ # ~ $mvdestLbl.text=item.to_s
23
+ # ~ $mvdestLbl.shell.forceRefresh
24
+ # ~ end
25
+ end
26
+
27
+ def create_dlg
28
+ @fxtree = TreeList.new(MAINWIN.Switcher, TREELIST_BROWSESELECT | TREELIST_SHOWS_LINES | TREELIST_SHOWS_BOXES)
29
+ @fxtree.backColor = STD_BACK_COLOR
30
+ @fxtree.create
31
+ @switcherIndex = MAINWIN.Switcher.numChildren - 1
32
+ @root = @fxtree.appendItem nil, "root"
33
+ @fxtree.connect(SEL_COMMAND, method(:item_click))
34
+ @wdgMenu = WidgetMenu.new(MAINWIN.topwin)
35
+ $__popup__ = @wdgMenu if $DEBUG
36
+ @wdgMenu.on_cmd_cut { |wdg|
37
+ @wdgMenu.send :cmd_copy
38
+ @wdgMenu.send :cmd_delete
39
+ }
40
+ @wdgMenu.on_cmd_copy {
41
+ # ~ puts "copy"
42
+ wdg = @w[@fxtree.currentItem.to_s]
43
+ widgetlist = []
44
+ traverse(wdg, widgetlist)
45
+ $clipboard << widgetlist
46
+ }
47
+ @wdgMenu.on_cmd_paste { |where|
48
+ # ~ puts "paste #{where}"
49
+ wdg = @w[@fxtree.currentItem.to_s]
50
+ widgetlist = $clipboard.last
51
+ load_widgettree(widgetlist, where, wdg)
52
+ }
53
+ @wdgMenu.on_cmd_jumpup {
54
+ # ~ puts "jumpup"
55
+ item = @fxtree.currentItem
56
+ relink_wdg item, "before", item.prev unless item.prev.nil? or item.prev == @root
57
+ }
58
+ @wdgMenu.on_cmd_jumpdown {
59
+ # ~ puts "jumpdown"
60
+ item = @fxtree.currentItem
61
+ relink_wdg item, "after", item.next unless item.next.nil?
62
+ }
63
+ @wdgMenu.on_cmd_delete {
64
+ # ~ puts "delete"
65
+ unmark
66
+ item = @fxtree.currentItem
67
+ wdg = @w[item.to_s]
68
+ wdg.parent.removeChild wdg
69
+ @w.delete(item.to_s)
70
+ # @marked=nil
71
+ @fxtree.removeItem(item)
72
+ # updating:
73
+ item = @fxtree.currentItem
74
+ wdg = @w[item.to_s]
75
+ wdg.update_properties
76
+ }
77
+ @wdgMenu.on_cmd_events {
78
+ EventEditor.instance.show
79
+ }
80
+ @fxtree.connect(SEL_RIGHTBUTTONPRESS) { |sender, sel, e|
81
+ item = @fxtree.getCursorItem
82
+ if item
83
+ @fxtree.currentItem = item
84
+ else
85
+ item = @fxtree.currentItem
86
+ end
87
+ # item.setFocus(false)
88
+ next if item == @root
89
+ widget = @w[item.to_s]
90
+ onClick widget
91
+ @wdgMenu.popup_over(widget, e.rootclick_x, e.rootclick_y)
92
+ # 1
93
+ }
94
+ end
95
+
96
+ class WidgetMenu
97
+ __sends__ :cmd_jumpup,
98
+ :cmd_jumpdown,
99
+ :cmd_cut,
100
+ :cmd_copy,
101
+ :cmd_paste,
102
+ :cmd_delete,
103
+ :cmd_events
104
+
105
+ def initialize parent
106
+ @popup = FXPopup.new parent
107
+ @title = FXMenuCaption.new @popup, "@popup_title"
108
+ FXMenuSeparator.new @popup
109
+ cmd "events", "Edit events ..."
110
+ cmd "---"
111
+ cmd "jumpup", "Jump up"
112
+ cmd "jumpdown", "Jump down"
113
+ cmd "---"
114
+ cmd "cut", "Cut"
115
+ cmd "copy", "Copy"
116
+ ["before", "after", "inside"].each { |where|
117
+ instance_eval %{
118
+ def self.cmd_paste_#{where}(*args)
119
+ cmd_paste "#{where}"
120
+ end
121
+ }, __FILE__, __LINE__ - 4
122
+ cmd "paste_#{where}", "Paste #{where}"
123
+ }
124
+ cmd "delete", "Delete"
125
+ cmd "---"
126
+ cmd "cancel", "Cancel"
127
+ @popup.create if $fxapp.created?
128
+ end
129
+
130
+ def popup_over widget, x, y
131
+ # paste concerns: is it possible to paste before, after or inside this widget?
132
+ ["before", "after", "inside"].each { |where|
133
+ cmd = instance_variable_get(:"@mc_paste_#{where}")
134
+ cmd.enabled = RelinkMechanisms.insert_possible?(where, widget)
135
+ cmd.enabled = false if $clipboard.nil? or $clipboard.empty?
136
+ }
137
+ @mc_jumpup.enabled = !widget.prev.nil?
138
+ @mc_jumpdown.enabled = !widget.next.nil?
139
+ [@mc_cut, @mc_delete, @mc_copy].each { |mc| mc.enabled = true }
140
+ [@mc_cut, @mc_delete, @mc_copy, @mc_jumpup, @mc_jumpdown].each { |mc|
141
+ mc.enabled = false if widget.is_a?(Fox::FXTopWindow)
142
+ }
143
+ @title.text = "[ #{widget.class} ]"
144
+ @popup.popup nil, x, y
145
+ end
146
+
147
+ private
148
+
149
+ def cmd name, text = nil
150
+ if name == "---"
151
+ MenuSeparator.new(@popup)
152
+ else
153
+ text ||= name
154
+ MenuCommand.new(@popup) { |c|
155
+ instance_variable_set :"@mc_#{name}", c
156
+ c.text = text
157
+ c.connect(SEL_COMMAND) {
158
+ m = "cmd_#{name}"
159
+ send m
160
+ }
161
+ }
162
+ end
163
+ end
164
+
165
+ def method_missing(*args)
166
+ puts "WidgetMenu#method missing: #{args.inspect}" if $DEBUG
167
+ end
168
+ end
169
+
170
+ def item_click(*args)
171
+ item = args[2]
172
+ return if item == @root
173
+ unless $mvdestLbl.nil?
174
+ $mvdest = item
175
+ $mvdestLbl.text = item.to_s
176
+ $mvdestLbl.shell.forceRefresh
177
+ end
178
+ wdg = @w[item.to_s]
179
+ mark wdg if wdg
180
+ wdg.update_properties
181
+ # ~ @updateBrowserButtons.call item
182
+ end
183
+ end # module
data.tar.gz.sig ADDED
Binary file
metadata ADDED
@@ -0,0 +1,236 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: foxguib
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Meinrad Recheis aka Henon
8
+ - Lars Kanis
9
+ autorequire:
10
+ bindir: exe
11
+ cert_chain:
12
+ - |
13
+ -----BEGIN CERTIFICATE-----
14
+ MIIDLjCCAhagAwIBAgIBDDANBgkqhkiG9w0BAQsFADA9MQ4wDAYDVQQDDAVrYW5p
15
+ czEXMBUGCgmSJomT8ixkARkWB2NvbWNhcmQxEjAQBgoJkiaJk/IsZAEZFgJkZTAe
16
+ Fw0yNDA1MDIxMTAwNDVaFw0yNTA1MDIxMTAwNDVaMD0xDjAMBgNVBAMMBWthbmlz
17
+ MRcwFQYKCZImiZPyLGQBGRYHY29tY2FyZDESMBAGCgmSJomT8ixkARkWAmRlMIIB
18
+ IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApop+rNmg35bzRugZ21VMGqI6
19
+ HGzPLO4VHYncWn/xmgPU/ZMcZdfj6MzIaZJ/czXyt4eHpBk1r8QOV3gBXnRXEjVW
20
+ 9xi+EdVOkTV2/AVFKThcbTAQGiF/bT1n2M+B1GTybRzMg6hyhOJeGPqIhLfJEpxn
21
+ lJi4+ENAVT4MpqHEAGB8yFoPC0GqiOHQsdHxQV3P3c2OZqG+yJey74QtwA2tLcLn
22
+ Q53c63+VLGsOjODl1yPn/2ejyq8qWu6ahfTxiIlSar2UbwtaQGBDFdb2CXgEufXT
23
+ L7oaPxlmj+Q2oLOfOnInd2Oxop59HoJCQPsg8f921J43NCQGA8VHK6paxIRDLQID
24
+ AQABozkwNzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUvgTdT7fe
25
+ x17ugO3IOsjEJwW7KP4wDQYJKoZIhvcNAQELBQADggEBAH+LA+CcA9vbbqtuhK4J
26
+ lG1lQwA+hCKiueQgVsepNbXyDzx6PMC8ap/bFaKSaoUWABBA/bsh3jDNXT/eVZrN
27
+ lFP8cVGrznSYIBG8D/QQmJKpvDBJgnC4Zk01HkhYlqJC4qCTn9X+/uZNHLPLbAEL
28
+ xl3P43zyL3GQb1IP9bp0xV6oxwG9FO9Rk8bYDojky/69ylowFI5aODS39v01Siu2
29
+ FsEjM9tMSNb7lQRywQ/432KXi+8AAPTm+wdGnlt3wLE9w2TTpGUBsNKk+QiytTZO
30
+ zwbjAdVlRm0pg/vpDzzFmRf1GYVckMm8hpCRt8BP0akAbNyw1snYvZBwgLqxztru
31
+ bEo=
32
+ -----END CERTIFICATE-----
33
+ date: 2024-07-02 00:00:00.000000000 Z
34
+ dependencies:
35
+ - !ruby/object:Gem::Dependency
36
+ name: fxruby
37
+ requirement: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: 1.6.0
42
+ type: :runtime
43
+ prerelease: false
44
+ version_requirements: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: 1.6.0
49
+ - !ruby/object:Gem::Dependency
50
+ name: libguib
51
+ requirement: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '1.1'
56
+ type: :runtime
57
+ prerelease: false
58
+ version_requirements: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '1.1'
63
+ - !ruby/object:Gem::Dependency
64
+ name: bundler
65
+ requirement: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '1.11'
70
+ - - "<="
71
+ - !ruby/object:Gem::Version
72
+ version: '3.0'
73
+ type: :development
74
+ prerelease: false
75
+ version_requirements: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: '1.11'
80
+ - - "<="
81
+ - !ruby/object:Gem::Version
82
+ version: '3.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '13.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '13.0'
97
+ description: GUI builder for the Fox toolkit written in Ruby.
98
+ email:
99
+ - meinrad.recheis@gmail.com
100
+ - lars@greiz-reinsdorf.de
101
+ executables:
102
+ - foxguib
103
+ extensions: []
104
+ extra_rdoc_files: []
105
+ files:
106
+ - changelog.txt
107
+ - doc/www/index.html
108
+ - doc/www/upload.rb
109
+ - examples/event_handler.rb
110
+ - examples/event_handlers.rbin
111
+ - examples/guib_testdialog.rb
112
+ - examples/testdialog.rb
113
+ - exe/foxguib
114
+ - foxGUIb-debug.rb
115
+ - foxGUIb.rb
116
+ - foxGUIb_win32.rbw
117
+ - foxguib.gemspec
118
+ - license.txt
119
+ - readme.txt
120
+ - release_notes.txt
121
+ - src/assert.rb
122
+ - src/cfgman.rb
123
+ - src/code-gen/code-generator.rb
124
+ - src/code-gen/property-generators.rb
125
+ - src/code-gen/widget-generator.rb
126
+ - src/convert.rb
127
+ - src/direct_widget_manipulation.rb
128
+ - src/docman.rb
129
+ - src/document.rb
130
+ - src/event_categories.yaml
131
+ - src/event_listener.rb
132
+ - src/events.yaml
133
+ - src/events_docu.yaml
134
+ - src/get_events.rb
135
+ - src/gui/ArrowButton.tga
136
+ - src/gui/BoxMinus.tga
137
+ - src/gui/BoxPlus.tga
138
+ - src/gui/Button.tga
139
+ - src/gui/CheckButton.tga
140
+ - src/gui/ComboBox.tga
141
+ - src/gui/Dial.tga
142
+ - src/gui/GroupBox.tga
143
+ - src/gui/HorizontalFrame.tga
144
+ - src/gui/HorizontalSeparator.tga
145
+ - src/gui/Label.tga
146
+ - src/gui/MDIChild.tga
147
+ - src/gui/MDIClient.tga
148
+ - src/gui/Matrix.tga
149
+ - src/gui/MenuCaption.tga
150
+ - src/gui/MenuCascade.tga
151
+ - src/gui/MenuCheck.tga
152
+ - src/gui/MenuCommand.tga
153
+ - src/gui/MenuPane.tga
154
+ - src/gui/MenuRadio.tga
155
+ - src/gui/MenuSeparator.tga
156
+ - src/gui/MenuTitle.tga
157
+ - src/gui/Menubar.tga
158
+ - src/gui/Packer.tga
159
+ - src/gui/ProgressBar.tga
160
+ - src/gui/RadioButton.tga
161
+ - src/gui/RadioMutex.tga
162
+ - src/gui/ScrollWindow.tga
163
+ - src/gui/Scrollbar.tga
164
+ - src/gui/Shutter.tga
165
+ - src/gui/ShutterItem.tga
166
+ - src/gui/Slider.tga
167
+ - src/gui/Spinner.tga
168
+ - src/gui/Splitter.tga
169
+ - src/gui/StatusBar.tga
170
+ - src/gui/Statusline.tga
171
+ - src/gui/Switcher.tga
172
+ - src/gui/TabBar.tga
173
+ - src/gui/TabBook.tga
174
+ - src/gui/TabItem.tga
175
+ - src/gui/Text.tga
176
+ - src/gui/TextField.tga
177
+ - src/gui/ToggleButton.tga
178
+ - src/gui/Toolbar.tga
179
+ - src/gui/VerticalFrame.tga
180
+ - src/gui/VerticalSeparator.tga
181
+ - src/gui/_guib_event_editor.rb
182
+ - src/gui/_guib_event_editor.rbin
183
+ - src/gui/_guib_genruby.rb
184
+ - src/gui/_guib_genruby.rbin
185
+ - src/gui/_guib_mainwin.rb
186
+ - src/gui/_guib_mainwin.rbin
187
+ - src/gui/event_editor.rb
188
+ - src/gui/genruby.rb
189
+ - src/gui/guib__console.rb
190
+ - src/gui/mainwin.rb
191
+ - src/gui/ruby_console.rb
192
+ - src/gui/svg/Matrix.svg
193
+ - src/gui/svg/MenuCheck.svg
194
+ - src/gui/svg/MenuRadio.svg
195
+ - src/gui/svg/RadioMutex.svg
196
+ - src/gui/textview.rb
197
+ - src/gui/textview.rbin
198
+ - src/minitest.rb
199
+ - src/prop-lists.rb
200
+ - src/prop-types.rb
201
+ - src/properties.rb
202
+ - src/propman.rb
203
+ - src/relink_mechanisms.rb
204
+ - src/serialize.rb
205
+ - src/state_machine.rb
206
+ - src/version.rb
207
+ - src/widget-lists.rb
208
+ - src/widget-selector.rb
209
+ - src/widgettree-controls.rb
210
+ homepage: https://github.com/larskanis/foxGUIb
211
+ licenses:
212
+ - Artistic License 1.0
213
+ metadata: {}
214
+ post_install_message:
215
+ rdoc_options: []
216
+ require_paths:
217
+ - src
218
+ required_ruby_version: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ">="
221
+ - !ruby/object:Gem::Version
222
+ version: '2.5'
223
+ - - "<"
224
+ - !ruby/object:Gem::Version
225
+ version: '4.0'
226
+ required_rubygems_version: !ruby/object:Gem::Requirement
227
+ requirements:
228
+ - - ">="
229
+ - !ruby/object:Gem::Version
230
+ version: '0'
231
+ requirements: []
232
+ rubygems_version: 3.5.11
233
+ signing_key:
234
+ specification_version: 4
235
+ summary: Fox GUI builder
236
+ test_files: []
metadata.gz.sig ADDED
Binary file