arcadia 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README +126 -123
- data/arcadia.rb +770 -756
- data/base/a-contracts.rb +130 -93
- data/base/a-ext.rb +280 -280
- data/base/a-libs.rb +5 -11
- data/base/a-utils.rb +235 -44
- data/conf/arcadia.conf +20 -16
- data/conf/arcadia.init.rb +0 -0
- data/conf/arcadia.res.rb +74 -0
- data/ext/ae-complete-code/ae-complete-code.conf +0 -0
- data/ext/ae-complete-code/ae-complete-code.rb +80 -79
- data/ext/ae-debug/ae-debug.conf +0 -0
- data/ext/ae-debug/ae-debug.rb +2 -6
- data/ext/ae-debug/debug1.57.rb +0 -0
- data/ext/ae-doc-code/ae-doc-code.conf +15 -0
- data/ext/ae-doc-code/ae-doc-code.rb +289 -0
- data/ext/ae-editor/ae-editor.conf +17 -8
- data/ext/ae-editor/ae-editor.rb +738 -396
- data/ext/ae-event-log/ae-event-log.conf +0 -0
- data/ext/ae-event-log/ae-event-log.rb +0 -0
- data/ext/ae-file-history/ae-file-history.conf +2 -2
- data/ext/ae-file-history/ae-file-history.rb +286 -290
- data/ext/ae-inspector/ae-inspector.conf +0 -0
- data/ext/ae-inspector/ae-inspector.rb +0 -0
- data/ext/ae-output-event/ae-output-event.conf +2 -2
- data/ext/ae-output/ae-output.conf +2 -2
- data/ext/ae-output/ae-output.rb +173 -178
- data/ext/ae-palette/ae-palette.conf +0 -0
- data/ext/ae-palette/ae-palette.rb +0 -0
- data/ext/ae-shell/ae-shell.conf +0 -0
- data/ext/ae-shell/ae-shell.rb +54 -54
- data/lib/tk/al-tk.rb +3076 -3082
- data/lib/tk/al-tk.res.rb +0 -0
- data/lib/tk/al-tkarcadia.rb +0 -0
- data/lib/tk/al-tkcustom.rb +0 -0
- data/lib/tkext/al-bwidget.rb +0 -0
- data/lib/tkext/al-iwidgets.rb +0 -0
- data/lib/tkext/al-tile.rb +0 -0
- data/lib/tkext/al-tktable.rb +0 -0
- data/tcl/BWidget-1.8.0/BWman/ArrowButton.html +276 -0
- data/tcl/BWidget-1.8.0/BWman/BWidget.html +228 -0
- data/tcl/BWidget-1.8.0/BWman/Button.html +273 -0
- data/tcl/BWidget-1.8.0/BWman/ButtonBox.html +264 -0
- data/tcl/BWidget-1.8.0/BWman/ComboBox.html +402 -0
- data/tcl/BWidget-1.8.0/BWman/Dialog.html +314 -0
- data/tcl/BWidget-1.8.0/BWman/DragSite.html +139 -0
- data/tcl/BWidget-1.8.0/BWman/DropSite.html +254 -0
- data/tcl/BWidget-1.8.0/BWman/DynamicHelp.html +248 -0
- data/tcl/BWidget-1.8.0/BWman/Entry.html +341 -0
- data/tcl/BWidget-1.8.0/BWman/Label.html +331 -0
- data/tcl/BWidget-1.8.0/BWman/LabelEntry.html +194 -0
- data/tcl/BWidget-1.8.0/BWman/LabelFrame.html +144 -0
- data/tcl/BWidget-1.8.0/BWman/ListBox.html +678 -0
- data/tcl/BWidget-1.8.0/BWman/MainFrame.html +283 -0
- data/tcl/BWidget-1.8.0/BWman/MessageDlg.html +218 -0
- data/tcl/BWidget-1.8.0/BWman/NoteBook.html +374 -0
- data/tcl/BWidget-1.8.0/BWman/PagesManager.html +180 -0
- data/tcl/BWidget-1.8.0/BWman/PanedWindow.html +142 -0
- data/tcl/BWidget-1.8.0/BWman/PanelFrame.html +153 -0
- data/tcl/BWidget-1.8.0/BWman/PasswdDlg.html +214 -0
- data/tcl/BWidget-1.8.0/BWman/ProgressBar.html +152 -0
- data/tcl/BWidget-1.8.0/BWman/ProgressDlg.html +145 -0
- data/tcl/BWidget-1.8.0/BWman/ScrollView.html +130 -0
- data/tcl/BWidget-1.8.0/BWman/ScrollableFrame.html +191 -0
- data/tcl/BWidget-1.8.0/BWman/ScrolledWindow.html +116 -0
- data/tcl/BWidget-1.8.0/BWman/SelectColor.html +164 -0
- data/tcl/BWidget-1.8.0/BWman/SelectFont.html +152 -0
- data/tcl/BWidget-1.8.0/BWman/Separator.html +77 -0
- data/tcl/BWidget-1.8.0/BWman/SpinBox.html +250 -0
- data/tcl/BWidget-1.8.0/BWman/StatusBar.html +147 -0
- data/tcl/BWidget-1.8.0/BWman/TitleFrame.html +107 -0
- data/tcl/BWidget-1.8.0/BWman/Tree.html +947 -0
- data/tcl/BWidget-1.8.0/BWman/Widget.html +502 -0
- data/tcl/BWidget-1.8.0/BWman/contents.html +84 -0
- data/tcl/BWidget-1.8.0/BWman/index.html +7 -0
- data/tcl/BWidget-1.8.0/BWman/navtree.html +41 -0
- data/tcl/BWidget-1.8.0/BWman/options.htm +458 -0
- data/tcl/BWidget-1.8.0/CHANGES.txt +266 -0
- data/tcl/BWidget-1.8.0/ChangeLog +1641 -0
- data/tcl/BWidget-1.8.0/LICENSE.txt +41 -0
- data/tcl/BWidget-1.8.0/README.txt +127 -0
- data/tcl/BWidget-1.8.0/arrow.tcl +551 -0
- data/tcl/BWidget-1.8.0/bitmap.tcl +94 -0
- data/tcl/BWidget-1.8.0/button.tcl +324 -0
- data/tcl/BWidget-1.8.0/buttonbox.tcl +403 -0
- data/tcl/BWidget-1.8.0/color.tcl +493 -0
- data/tcl/BWidget-1.8.0/combobox.tcl +809 -0
- data/tcl/BWidget-1.8.0/demo/basic.tcl +199 -0
- data/tcl/BWidget-1.8.0/demo/bwidget.xbm +46 -0
- data/tcl/BWidget-1.8.0/demo/demo.tcl +212 -0
- data/tcl/BWidget-1.8.0/demo/dnd.tcl +42 -0
- data/tcl/BWidget-1.8.0/demo/manager.tcl +141 -0
- data/tcl/BWidget-1.8.0/demo/select.tcl +59 -0
- data/tcl/BWidget-1.8.0/demo/tmpldlg.tcl +214 -0
- data/tcl/BWidget-1.8.0/demo/tree.tcl +260 -0
- data/tcl/BWidget-1.8.0/demo/x1.xbm +2258 -0
- data/tcl/BWidget-1.8.0/dialog.tcl +345 -0
- data/tcl/BWidget-1.8.0/dragsite.tcl +197 -0
- data/tcl/BWidget-1.8.0/dropsite.tcl +455 -0
- data/tcl/BWidget-1.8.0/dynhelp.tcl +625 -0
- data/tcl/BWidget-1.8.0/entry.tcl +469 -0
- data/tcl/BWidget-1.8.0/font.tcl +566 -0
- data/tcl/BWidget-1.8.0/images/bold.gif +0 -0
- data/tcl/BWidget-1.8.0/images/copy.gif +0 -0
- data/tcl/BWidget-1.8.0/images/cut.gif +0 -0
- data/tcl/BWidget-1.8.0/images/dragfile.gif +0 -0
- data/tcl/BWidget-1.8.0/images/dragicon.gif +0 -0
- data/tcl/BWidget-1.8.0/images/error.gif +0 -0
- data/tcl/BWidget-1.8.0/images/file.gif +0 -0
- data/tcl/BWidget-1.8.0/images/folder.gif +0 -0
- data/tcl/BWidget-1.8.0/images/hourglass.gif +0 -0
- data/tcl/BWidget-1.8.0/images/info.gif +0 -0
- data/tcl/BWidget-1.8.0/images/italic.gif +0 -0
- data/tcl/BWidget-1.8.0/images/minus.xbm +5 -0
- data/tcl/BWidget-1.8.0/images/new.gif +0 -0
- data/tcl/BWidget-1.8.0/images/opcopy.xbm +5 -0
- data/tcl/BWidget-1.8.0/images/open.gif +0 -0
- data/tcl/BWidget-1.8.0/images/openfold.gif +0 -0
- data/tcl/BWidget-1.8.0/images/oplink.xbm +5 -0
- data/tcl/BWidget-1.8.0/images/opmove.xbm +5 -0
- data/tcl/BWidget-1.8.0/images/overstrike.gif +0 -0
- data/tcl/BWidget-1.8.0/images/palette.gif +0 -0
- data/tcl/BWidget-1.8.0/images/passwd.gif +0 -0
- data/tcl/BWidget-1.8.0/images/paste.gif +0 -0
- data/tcl/BWidget-1.8.0/images/plus.xbm +5 -0
- data/tcl/BWidget-1.8.0/images/print.gif +0 -0
- data/tcl/BWidget-1.8.0/images/question.gif +0 -0
- data/tcl/BWidget-1.8.0/images/redo.gif +0 -0
- data/tcl/BWidget-1.8.0/images/save.gif +0 -0
- data/tcl/BWidget-1.8.0/images/target.xbm +9 -0
- data/tcl/BWidget-1.8.0/images/underline.gif +0 -0
- data/tcl/BWidget-1.8.0/images/undo.gif +0 -0
- data/tcl/BWidget-1.8.0/images/warning.gif +0 -0
- data/tcl/BWidget-1.8.0/init.tcl +40 -0
- data/tcl/BWidget-1.8.0/label.tcl +271 -0
- data/tcl/BWidget-1.8.0/labelentry.tcl +100 -0
- data/tcl/BWidget-1.8.0/labelframe.tcl +160 -0
- data/tcl/BWidget-1.8.0/lang/da.rc +52 -0
- data/tcl/BWidget-1.8.0/lang/de.rc +52 -0
- data/tcl/BWidget-1.8.0/lang/en.rc +52 -0
- data/tcl/BWidget-1.8.0/lang/es.rc +53 -0
- data/tcl/BWidget-1.8.0/lang/fr.rc +52 -0
- data/tcl/BWidget-1.8.0/listbox.tcl +1638 -0
- data/tcl/BWidget-1.8.0/mainframe.tcl +711 -0
- data/tcl/BWidget-1.8.0/messagedlg.tcl +128 -0
- data/tcl/BWidget-1.8.0/notebook.tcl +1164 -0
- data/tcl/BWidget-1.8.0/pagesmgr.tcl +294 -0
- data/tcl/BWidget-1.8.0/panedw.tcl +381 -0
- data/tcl/BWidget-1.8.0/panelframe.tcl +246 -0
- data/tcl/BWidget-1.8.0/passwddlg.tcl +178 -0
- data/tcl/BWidget-1.8.0/pkgIndex.tcl +47 -0
- data/tcl/BWidget-1.8.0/progressbar.tcl +208 -0
- data/tcl/BWidget-1.8.0/progressdlg.tcl +87 -0
- data/tcl/BWidget-1.8.0/scrollframe.tcl +226 -0
- data/tcl/BWidget-1.8.0/scrollview.tcl +254 -0
- data/tcl/BWidget-1.8.0/scrollw.tcl +280 -0
- data/tcl/BWidget-1.8.0/separator.tcl +75 -0
- data/tcl/BWidget-1.8.0/spinbox.tcl +331 -0
- data/tcl/BWidget-1.8.0/statusbar.tcl +422 -0
- data/tcl/BWidget-1.8.0/tests/entry.test +173 -0
- data/tcl/BWidget-1.8.0/titleframe.tcl +170 -0
- data/tcl/BWidget-1.8.0/tree.tcl +2228 -0
- data/tcl/BWidget-1.8.0/utils.tcl +645 -0
- data/tcl/BWidget-1.8.0/widget.tcl +1576 -0
- data/tcl/BWidget-1.8.0/wizard.tcl +1028 -0
- data/tcl/BWidget-1.8.0/xpm2image.tcl +115 -0
- metadata +141 -5
data/README
CHANGED
@@ -1,123 +1,126 @@
|
|
1
|
-
Arcadia Ruby Ide
|
2
|
-
version 0.1.
|
3
|
-
|
4
|
-
by Antonio Galeone
|
5
|
-
on
|
6
|
-
|
7
|
-
"Thank you for consider this project"
|
8
|
-
|
9
|
-
About
|
10
|
-
=====
|
11
|
-
Arcadia is a Integrated Development Environment (IDE) for Ruby language
|
12
|
-
written in Ruby using the classic tcl/tk GUI toolkit.
|
13
|
-
|
14
|
-
Some of Arcadia ruby ide project features include:
|
15
|
-
-Editor with source browsing
|
16
|
-
-
|
17
|
-
-
|
18
|
-
-
|
19
|
-
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
-[
|
25
|
-
-[
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
Editor
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
Ctrl-
|
55
|
-
Ctrl-
|
56
|
-
Ctrl-
|
57
|
-
Ctrl-
|
58
|
-
Ctrl-
|
59
|
-
Ctrl-
|
60
|
-
Ctrl-
|
61
|
-
Ctrl-shift-
|
62
|
-
Ctrl-shift-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
The
|
79
|
-
|
80
|
-
|
81
|
-
created
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
<
|
88
|
-
It is
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
<
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
1
|
+
Arcadia Ruby Ide
|
2
|
+
version 0.1.2
|
3
|
+
|
4
|
+
by Antonio Galeone
|
5
|
+
on May 8, 2007
|
6
|
+
|
7
|
+
"Thank you for consider this project"
|
8
|
+
|
9
|
+
About
|
10
|
+
=====
|
11
|
+
Arcadia is a Integrated Development Environment (IDE) for Ruby language
|
12
|
+
written in Ruby using the classic tcl/tk GUI toolkit.
|
13
|
+
|
14
|
+
Some of Arcadia ruby ide project features include:
|
15
|
+
-Editor with source browsing, syntax highlighting, code completion
|
16
|
+
-Contextual ruby documentation
|
17
|
+
-Supporting RAD gui building
|
18
|
+
-Generation of widget-wrapper-independent ruby code
|
19
|
+
-Working on any platform where ruby and tcl-tk work.
|
20
|
+
-Highly extensibility architecture.
|
21
|
+
|
22
|
+
This release
|
23
|
+
============
|
24
|
+
-[fixed] Bugs fixed and general restyling
|
25
|
+
-[new] Added integration with ri--Ruby (F1) for display contextual ruby documentation
|
26
|
+
-[new] Enhanced find/replace dialog
|
27
|
+
|
28
|
+
Short User guide
|
29
|
+
================
|
30
|
+
I hope that you perceive Arcadia gui enough user frindly.
|
31
|
+
As you can see the application is splitted in vertical
|
32
|
+
and horizontal resizing frames. Clicking on vertical splitter
|
33
|
+
appear two button for left or right one shot frame close.
|
34
|
+
The horizontal splitter has two little button for the same reason
|
35
|
+
(perhaps i will conform them to the vertical style).
|
36
|
+
Every frame has a title and a button to expand or resizing it.
|
37
|
+
In this beta release there are very essential feature:
|
38
|
+
|
39
|
+
< Toolbar >
|
40
|
+
The toolbar button are in order:
|
41
|
+
-new, open, save
|
42
|
+
(relatively to editor extension)
|
43
|
+
-run current, run last
|
44
|
+
(for execute the raised file in the editor or the last file executed)
|
45
|
+
-debug current, debug last, stop debug
|
46
|
+
(for the debug extension that is in very unstable state)
|
47
|
+
-quit (to exit from arcadia)
|
48
|
+
|
49
|
+
< Editor >
|
50
|
+
Editor use the notebook metaphor. Same command are on the popup menu
|
51
|
+
that is raised on "Button-3" click event fundamentalally for closing the tab
|
52
|
+
under the mouse pointer.
|
53
|
+
These are same editor short-cut:
|
54
|
+
Ctrl-c => copy selected text
|
55
|
+
Ctrl-v => paste copied text
|
56
|
+
Ctrl-x => cut selected text
|
57
|
+
Ctrl-z => undo
|
58
|
+
Ctrl-f => copy the selected text on input combobox of find dialog and moves focus
|
59
|
+
Ctrl-s => save
|
60
|
+
Ctrl-space => completion code
|
61
|
+
Ctrl-shift-i => indent the selected block
|
62
|
+
Ctrl-shift-u => unindent the selected block
|
63
|
+
Ctrl-shift-c => comment/uncomment the selected code block
|
64
|
+
F5 => execute the file
|
65
|
+
F3 => find/ find next
|
66
|
+
F1 => contextual ruby documentation (called from editor or from code completion item, if
|
67
|
+
no corrispondation is founded a doc tree is build in left side)
|
68
|
+
|
69
|
+
Double-Click on line number set or unset a debug breckpoint
|
70
|
+
|
71
|
+
< File history >
|
72
|
+
The last used files are organizing in tree so you can reopen them or there
|
73
|
+
directory by clicking on the tree node.
|
74
|
+
|
75
|
+
< Palette >
|
76
|
+
It contain the wrapper components for the tk gui building.
|
77
|
+
It is in very unstabled and incomplete state.
|
78
|
+
The first component is a TkTopLevel wrapper, when you click on it a new form is created and a
|
79
|
+
Object inspector appears.
|
80
|
+
The other components must be first selected and then created by clicking on container widget.
|
81
|
+
The so created widgets has a popup menu for deleting them or in the toplevel case to switch
|
82
|
+
to a code view.
|
83
|
+
On the palette there are also two button, one for deselect and other for copy from the selected
|
84
|
+
created widget. The copy action copy also the code into the clipboard, so you can copy the
|
85
|
+
code rapresenting the gui into the embedded editor or into external editor.
|
86
|
+
|
87
|
+
< Object Inspector >
|
88
|
+
It is for modify the widget property at runtime
|
89
|
+
|
90
|
+
< Debug >
|
91
|
+
It is created when a debug session init.
|
92
|
+
The debug button are: Step Next, Step Into, Step Over, Resume.
|
93
|
+
The debug frame show the local, instance and global variables for each
|
94
|
+
step. (you must have patience!)
|
95
|
+
|
96
|
+
<Configuration>
|
97
|
+
Same Arcadia properties are locally configurabled by editing the file arcadia.conf
|
98
|
+
under ~/.arcadia directory. The format of property definition are:
|
99
|
+
<OPERATING SYSTEM IDENTIFY::>PROPERTY_NAME=PROPERTY_VALUE
|
100
|
+
|
101
|
+
|
102
|
+
Requirement
|
103
|
+
===========
|
104
|
+
I include into distribution also the BWidget lib (under tcl directory) so
|
105
|
+
are require realy only the standard tcl tk lib (tested on tcl tk 8.4).
|
106
|
+
I have tested arcadia with ruby 1.8.4, 1.8.5, 1.8.6 on FreeBsd6, Vector linux and windows 2000/XP os. If you
|
107
|
+
will test arcadia on other operating system sends me an e-mail.
|
108
|
+
|
109
|
+
Developers information
|
110
|
+
=====================
|
111
|
+
Soon i will write samething about the arcadia software architecture (when it is more stable)
|
112
|
+
in order to allow extensions writing and collaborations.
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
License
|
117
|
+
=======
|
118
|
+
Arcadia is released under the Ruby License
|
119
|
+
|
120
|
+
Contacts
|
121
|
+
========
|
122
|
+
For questions:
|
123
|
+
antonio-galeone@rubyforge.org
|
124
|
+
For bugs, support request, feature request https://rubyforge.org/projects/arcadia:
|
125
|
+
|
126
|
+
Bye
|
data/arcadia.rb
CHANGED
@@ -1,756 +1,770 @@
|
|
1
|
-
#
|
2
|
-
# arcadia.rb - Arcadia Ruby ide
|
3
|
-
# by Antonio Galeone <antonio-galeone@rubyforge.org>
|
4
|
-
#
|
5
|
-
|
6
|
-
Dir.chdir(File.dirname(__FILE__))
|
7
|
-
if FileTest.exist?('conf/arcadia.init.rb')
|
8
|
-
require 'conf/arcadia.init'
|
9
|
-
end
|
10
|
-
require "conf/arcadia.res"
|
11
|
-
require 'tkextlib/bwidget'
|
12
|
-
require "base/a-utils"
|
13
|
-
require "base/a-ext"
|
14
|
-
require "base/a-contracts"
|
15
|
-
require "observer"
|
16
|
-
|
17
|
-
class Arcadia < TkApplication
|
18
|
-
include Observable
|
19
|
-
attr_reader :layout
|
20
|
-
attr_reader :libs
|
21
|
-
#attr_reader :main_contract
|
22
|
-
def initialize
|
23
|
-
super(
|
24
|
-
ApplicationParams.new(
|
25
|
-
'arcadia',
|
26
|
-
'0.1.
|
27
|
-
'conf/arcadia.conf',
|
28
|
-
'conf/arcadia.pers'
|
29
|
-
)
|
30
|
-
)
|
31
|
-
self.load_local_config(false)
|
32
|
-
ObjectSpace.define_finalizer($arcadia, self.class.method(:finalize).to_proc)
|
33
|
-
publish('action.on_exit', proc{do_exit})
|
34
|
-
_title = "Arcadia Ruby ide :: [Platform = "+RUBY_PLATFORM+'] [Ruby version = ' + RUBY_VERSION+']'
|
35
|
-
@root = TkRoot.new{
|
36
|
-
title _title
|
37
|
-
withdraw
|
38
|
-
protocol( "WM_DELETE_WINDOW", $arcadia['action.on_exit'])
|
39
|
-
}
|
40
|
-
@on_event = Hash.new
|
41
|
-
@main_menu = TkMenubar.new.pack('fill'=>'x')
|
42
|
-
@mf_root = Tk::BWidget::MainFrame.new(@root){
|
43
|
-
menu @main_menu
|
44
|
-
}.pack(
|
45
|
-
'anchor'=> 'center',
|
46
|
-
'fill'=> 'both',
|
47
|
-
'expand'=> 1
|
48
|
-
)
|
49
|
-
|
50
|
-
#.place('x'=>0,'y'=>0,'relwidth'=>1,'relheight'=>1)
|
51
|
-
@mf_root.show_statusbar('none')
|
52
|
-
@toolbar = @mf_root.add_toolbar
|
53
|
-
@
|
54
|
-
@
|
55
|
-
@splash.
|
56
|
-
@splash.
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
prepare
|
61
|
-
|
62
|
-
|
63
|
-
(TkWinfo.
|
64
|
-
@root.
|
65
|
-
@root.
|
66
|
-
@root.
|
67
|
-
@root.
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
@splash.next_step
|
305
|
-
self.
|
306
|
-
|
307
|
-
@
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
@splash.next_step
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
publish('action.
|
323
|
-
publish('action.
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
publish('
|
329
|
-
proc{
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
#
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
menu
|
381
|
-
menu
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
['
|
394
|
-
['
|
395
|
-
['
|
396
|
-
|
397
|
-
|
398
|
-
['
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
end
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
@
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
@
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
@
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
@
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
p['
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
@panels[_domain_name]['
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
1
|
+
#
|
2
|
+
# arcadia.rb - Arcadia Ruby ide
|
3
|
+
# by Antonio Galeone <antonio-galeone@rubyforge.org>
|
4
|
+
#
|
5
|
+
|
6
|
+
Dir.chdir(File.dirname(__FILE__))
|
7
|
+
if FileTest.exist?('conf/arcadia.init.rb')
|
8
|
+
require 'conf/arcadia.init'
|
9
|
+
end
|
10
|
+
require "conf/arcadia.res"
|
11
|
+
require 'tkextlib/bwidget'
|
12
|
+
require "base/a-utils"
|
13
|
+
require "base/a-ext"
|
14
|
+
require "base/a-contracts"
|
15
|
+
require "observer"
|
16
|
+
|
17
|
+
class Arcadia < TkApplication
|
18
|
+
include Observable
|
19
|
+
attr_reader :layout
|
20
|
+
attr_reader :libs
|
21
|
+
#attr_reader :main_contract
|
22
|
+
def initialize
|
23
|
+
super(
|
24
|
+
ApplicationParams.new(
|
25
|
+
'arcadia',
|
26
|
+
'0.1.2',
|
27
|
+
'conf/arcadia.conf',
|
28
|
+
'conf/arcadia.pers'
|
29
|
+
)
|
30
|
+
)
|
31
|
+
self.load_local_config(false)
|
32
|
+
ObjectSpace.define_finalizer($arcadia, self.class.method(:finalize).to_proc)
|
33
|
+
publish('action.on_exit', proc{do_exit})
|
34
|
+
_title = "Arcadia Ruby ide :: [Platform = "+RUBY_PLATFORM+'] [Ruby version = ' + RUBY_VERSION+']'
|
35
|
+
@root = TkRoot.new{
|
36
|
+
title _title
|
37
|
+
withdraw
|
38
|
+
protocol( "WM_DELETE_WINDOW", $arcadia['action.on_exit'])
|
39
|
+
}
|
40
|
+
@on_event = Hash.new
|
41
|
+
@main_menu = TkMenubar.new.pack('fill'=>'x')
|
42
|
+
@mf_root = Tk::BWidget::MainFrame.new(@root){
|
43
|
+
menu @main_menu
|
44
|
+
}.pack(
|
45
|
+
'anchor'=> 'center',
|
46
|
+
'fill'=> 'both',
|
47
|
+
'expand'=> 1
|
48
|
+
)
|
49
|
+
|
50
|
+
#.place('x'=>0,'y'=>0,'relwidth'=>1,'relheight'=>1)
|
51
|
+
@mf_root.show_statusbar('none')
|
52
|
+
@toolbar = @mf_root.add_toolbar
|
53
|
+
@is_toolbar_show=self['conf']['toolbar_show']=='yes'
|
54
|
+
@mf_root.show_toolbar(0,@is_toolbar_show)
|
55
|
+
@splash = ArcadiaAboutSplash.new('... initialize')
|
56
|
+
@splash.set_progress(50)
|
57
|
+
@splash.deiconify
|
58
|
+
Tk.update
|
59
|
+
sleep(1)
|
60
|
+
@splash.next_step('..prepare')
|
61
|
+
prepare
|
62
|
+
@splash.last_step('..load finish')
|
63
|
+
geometry = (TkWinfo.screenwidth(@root)-4).to_s+'x'+
|
64
|
+
(TkWinfo.screenheight(@root)-20).to_s+'+0+0'
|
65
|
+
@root.deiconify
|
66
|
+
@root.raise
|
67
|
+
@root.focus(true)
|
68
|
+
@root.geometry(geometry)
|
69
|
+
Tk.update_idletasks
|
70
|
+
sleep(1)
|
71
|
+
@splash.destroy
|
72
|
+
if @first_run
|
73
|
+
EditorContract.instance.open_file(self, 'file'=>'README')
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def show_hide_toolbar
|
78
|
+
if @is_toolbar_show
|
79
|
+
@mf_root.show_toolbar(0,false)
|
80
|
+
@is_toolbar_show = false
|
81
|
+
else
|
82
|
+
@mf_root.show_toolbar(0,true)
|
83
|
+
Tk.update
|
84
|
+
@is_toolbar_show = true
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|
88
|
+
|
89
|
+
|
90
|
+
def Arcadia.finalize(id)
|
91
|
+
puts "\nArcadia #{id} dying at #{Time.new}"
|
92
|
+
end
|
93
|
+
|
94
|
+
def load_libs
|
95
|
+
@libs = ArcadiaLibs.new(self)
|
96
|
+
libs = self['conf']['libraries'].split(',')
|
97
|
+
libs.each{|lib|
|
98
|
+
if lib
|
99
|
+
@splash.next_step('... loading library '+lib)
|
100
|
+
begin
|
101
|
+
require self['conf']['libraries.'+lib+'.source']
|
102
|
+
@libs.add_lib(
|
103
|
+
ArcadiaLibs::ArcadiaLibParams.new(
|
104
|
+
self['conf']['libraries.'+lib+'.name'],
|
105
|
+
self['conf']['libraries.'+lib+'.source'],
|
106
|
+
self['conf']['libraries.'+lib+'.require'],
|
107
|
+
eval(self['conf']['libraries.'+lib+'.collection.class']))
|
108
|
+
)
|
109
|
+
rescue Exception
|
110
|
+
msg = "Loading lib "+'"'+lib+'"'+" ("+$!.class.to_s+") "+" : "+$! + " at : "+$@.to_s
|
111
|
+
if Tk.messageBox('icon' => 'error', 'type' => 'okcancel',
|
112
|
+
'title' => '(Arcadia) Libs', 'parent' => @root,
|
113
|
+
'message' => msg) == 'cancel'
|
114
|
+
raise
|
115
|
+
exit
|
116
|
+
else
|
117
|
+
Tk.update
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
}
|
122
|
+
end
|
123
|
+
|
124
|
+
def load_toolbar_buttons
|
125
|
+
suf = 'toolbar_buttons'
|
126
|
+
@buttons = Hash.new
|
127
|
+
toolbar_buttons = self['conf'][suf].split(',')
|
128
|
+
toolbar_buttons.each{|groups|
|
129
|
+
if groups
|
130
|
+
suf1 = suf+'.'+groups
|
131
|
+
@splash.next_step('... loading '+suf1)
|
132
|
+
begin
|
133
|
+
buttons = self['conf'][suf1].split(',')
|
134
|
+
buttons.each{|button|
|
135
|
+
suf2 = suf1+'.'+button
|
136
|
+
name = self['conf'][suf2+'.name']
|
137
|
+
text = self['conf'][suf2+'.text']
|
138
|
+
image = self['conf'][suf2+'.image']
|
139
|
+
font = self['conf'][suf2+'.font']
|
140
|
+
background = self['conf'][suf2+'.background']
|
141
|
+
foreground = self['conf'][suf2+'.foreground']
|
142
|
+
hint = self['conf'][suf2+'.hint']
|
143
|
+
action = self['conf'][suf2+'.action']
|
144
|
+
actions = action.split('->') if action
|
145
|
+
if actions && actions.length>1
|
146
|
+
_command = proc{
|
147
|
+
action_obj = $arcadia[actions[0]]
|
148
|
+
1.upto(actions.length-2) do |x|
|
149
|
+
action_obj = action_obj.send(actions[x])
|
150
|
+
end
|
151
|
+
action_obj.send(actions[actions.length-1])
|
152
|
+
}
|
153
|
+
elsif action
|
154
|
+
_command = proc{$arcadia[action].call}
|
155
|
+
end
|
156
|
+
@buttons[name] = Tk::BWidget::Button.new(@toolbar){
|
157
|
+
image TkPhotoImage.new('data' => eval(image)) if image
|
158
|
+
borderwidth 1
|
159
|
+
font font if font
|
160
|
+
background background if background
|
161
|
+
foreground foreground if foreground
|
162
|
+
command _command if action
|
163
|
+
relief 'flat'
|
164
|
+
helptext hint if hint
|
165
|
+
text text if text
|
166
|
+
pack('side' =>'left', :padx=>2, :pady=>2)
|
167
|
+
}
|
168
|
+
}
|
169
|
+
rescue Exception
|
170
|
+
msg = 'Loading '+groups+'" -> '+buttons.to_s+ '" (' + $!.class.to_s + ") : " + $!.to_s + " at : "+$@.to_s
|
171
|
+
if Tk.messageBox('icon' => 'error', 'type' => 'okcancel',
|
172
|
+
'title' => '(Arcadia) Toolbar', 'parent' => @root,
|
173
|
+
'message' => msg) == 'cancel'
|
174
|
+
raise
|
175
|
+
exit
|
176
|
+
else
|
177
|
+
Tk.update
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
181
|
+
Tk::BWidget::Separator.new(@toolbar, :orient=>'vertical').pack('side' =>'left', :padx=>2, :pady=>2, :fill=>'y',:anchor=> 'w')
|
182
|
+
}
|
183
|
+
end
|
184
|
+
|
185
|
+
def ext_active?(_name)
|
186
|
+
return (self['conf'][_name+'.active'] != nil && self['conf'][_name+'.active']=='yes')||
|
187
|
+
(self['conf'][_name+'.active'] == nil)
|
188
|
+
end
|
189
|
+
|
190
|
+
def load_exts_conf
|
191
|
+
@exts = Array.new
|
192
|
+
dirs = Array.new
|
193
|
+
files = Dir['ext/*'].concat(Dir[ENV["HOME"]+'/.arcadia/ext/*'])
|
194
|
+
files.each{|f|
|
195
|
+
dirs << f if File.stat(f).directory? && FileTest.exist?(f+'/'+File.basename(f)+'.conf')
|
196
|
+
}
|
197
|
+
dirs.each{|ext_dir|
|
198
|
+
conf_hash = self.config_file2hash(ext_dir+'/'+File.basename(ext_dir)+'.conf')
|
199
|
+
conf_hash2 = Hash.new
|
200
|
+
name = conf_hash['name']
|
201
|
+
conf_hash.each{|key, value|
|
202
|
+
var_plat = key.split(':')
|
203
|
+
if var_plat.length > 1
|
204
|
+
new_key = var_plat[0] + ':' + name + '.' + var_plat[1]
|
205
|
+
else
|
206
|
+
new_key = name+'.'+key
|
207
|
+
end
|
208
|
+
conf_hash2[new_key]= value
|
209
|
+
}
|
210
|
+
@exts << name
|
211
|
+
self['conf'].update(conf_hash2)
|
212
|
+
}
|
213
|
+
end
|
214
|
+
|
215
|
+
def load_exts
|
216
|
+
|
217
|
+
# create extensions
|
218
|
+
@exts.each{|extension|
|
219
|
+
if extension && ext_active?(extension)
|
220
|
+
@splash.next_step('... creating '+extension)
|
221
|
+
ext_create(extension)
|
222
|
+
end
|
223
|
+
}
|
224
|
+
|
225
|
+
# before_build extensions
|
226
|
+
@exts.each{|extension|
|
227
|
+
if extension && ext_active?(extension)
|
228
|
+
@splash.next_step('... before building '+extension)
|
229
|
+
ext_method(extension, :before_build)
|
230
|
+
MainContract.instance.extension_before_build(self, 'obj'=>self[extension])
|
231
|
+
end
|
232
|
+
}
|
233
|
+
|
234
|
+
# build extensions
|
235
|
+
@exts.each{|extension|
|
236
|
+
if extension && ext_active?(extension)
|
237
|
+
@splash.next_step('... building '+extension)
|
238
|
+
ext_method(extension, :build)
|
239
|
+
MainContract.instance.extension_build(self, 'obj'=>self[extension])
|
240
|
+
end
|
241
|
+
}
|
242
|
+
|
243
|
+
# after build extensions
|
244
|
+
@exts.each{|extension|
|
245
|
+
if extension && ext_active?(extension)
|
246
|
+
@splash.next_step('... after building '+extension)
|
247
|
+
ext_method(extension, :after_build)
|
248
|
+
MainContract.instance.extension_after_build(self, 'obj'=>self[extension])
|
249
|
+
end
|
250
|
+
}
|
251
|
+
|
252
|
+
end
|
253
|
+
|
254
|
+
def ext_create(_extension)
|
255
|
+
begin
|
256
|
+
source = self['conf'][_extension+'.require']
|
257
|
+
class_name = self['conf'][_extension+'.class']
|
258
|
+
if source.strip.length > 0
|
259
|
+
#p source
|
260
|
+
eval('require ' + "'" + source + "'")
|
261
|
+
end
|
262
|
+
if class_name.strip.length > 0
|
263
|
+
publish(_extension, eval(class_name).new(self, _extension))
|
264
|
+
end
|
265
|
+
rescue Exception
|
266
|
+
raise
|
267
|
+
msg = "Loading "+'"'+extension+'"'+" ("+$!.class.to_s+") "+" : "+$! + " at : "+$@.to_s
|
268
|
+
ans = Tk.messageBox('icon' => 'error', 'type' => 'abortretryignore',
|
269
|
+
'title' => '(Arcadia) Extensions', 'parent' => @root,
|
270
|
+
'message' => msg)
|
271
|
+
if ans == 'abort'
|
272
|
+
raise
|
273
|
+
exit
|
274
|
+
elsif ans == 'retry'
|
275
|
+
retry
|
276
|
+
else
|
277
|
+
Tk.update
|
278
|
+
end
|
279
|
+
end
|
280
|
+
end
|
281
|
+
|
282
|
+
def ext_method(_extension, _method)
|
283
|
+
begin
|
284
|
+
self[_extension].send(_method)
|
285
|
+
rescue Exception
|
286
|
+
msg = _method.to_s+' "'+_extension.to_s+'"'+" ("+$!.class.to_s+") "+" : "+$! + "\n at : "+$@.to_s
|
287
|
+
ans = Tk.messageBox('icon' => 'warning', 'type' => 'abortretryignore',
|
288
|
+
'title' => '(Arcadia) Extensions', 'parent' => @root,
|
289
|
+
'message' => msg)
|
290
|
+
if ans == 'abort'
|
291
|
+
raise
|
292
|
+
exit
|
293
|
+
elsif ans == 'retry'
|
294
|
+
retry
|
295
|
+
else
|
296
|
+
Tk.update
|
297
|
+
end
|
298
|
+
end
|
299
|
+
end
|
300
|
+
|
301
|
+
|
302
|
+
def prepare
|
303
|
+
super
|
304
|
+
@splash.next_step('...initialize')
|
305
|
+
@layout = ArcadiaLayout.new(self, @mf_root.get_frame)
|
306
|
+
|
307
|
+
@layout.add_cols(0,0,225)
|
308
|
+
@layout.add_rows(0,0,180)
|
309
|
+
# @layout.add_rows(0,1,500)
|
310
|
+
@layout.add_rows_perc(0,1,70)
|
311
|
+
|
312
|
+
|
313
|
+
@layout.add_headers
|
314
|
+
@splash.next_step
|
315
|
+
self.load_libs
|
316
|
+
@splash.next_step
|
317
|
+
@splash.next_step('... load extensions')
|
318
|
+
self.load_exts_conf
|
319
|
+
self.load_local_config
|
320
|
+
self.load_exts
|
321
|
+
publish('buffers.code.in_memory',Hash.new)
|
322
|
+
publish('action.load_code_from_buffers', proc{TkBuffersChoise.new})
|
323
|
+
publish('output.action.run_last', proc{$arcadia['output'].run_last})
|
324
|
+
publish('main.action.open_file', proc{self['editor'].open_file(Tk.getOpenFile)})
|
325
|
+
@splash.next_step('... load obj controller')
|
326
|
+
@splash.next_step('... load editor')
|
327
|
+
publish('main.action.new_file',proc{$arcadia['editor'].open_buffer()})
|
328
|
+
publish('main.action.edit_cut',proc{$arcadia['editor'].raised.text.text_cut()})
|
329
|
+
publish('main.action.edit_copy',proc{$arcadia['editor'].raised.text.text_copy()})
|
330
|
+
publish('main.action.edit_paste',proc{$arcadia['editor'].raised.text.text_paste()})
|
331
|
+
@splash.next_step('... load actions')
|
332
|
+
publish('action.test.keys', proc{KetTest.new})
|
333
|
+
publish('action.get.font', proc{Tk::BWidget::SelectFont::Dialog.new.create})
|
334
|
+
@splash.next_step
|
335
|
+
publish('action.show_about', proc{ArcadiaAboutSplash.new.deiconify})
|
336
|
+
# publish('main.menu', @main_menu)
|
337
|
+
publish('main.menu', AMainMenu.new(@main_menu))
|
338
|
+
@splash.next_step
|
339
|
+
publish('objic.action.raise_active_obj',
|
340
|
+
proc{
|
341
|
+
InspectorContract.instance.raise_active_toplevel(self)
|
342
|
+
}
|
343
|
+
)
|
344
|
+
load_toolbar_buttons
|
345
|
+
end
|
346
|
+
|
347
|
+
def do_exit
|
348
|
+
q1 = (Tk.messageBox('icon' => 'question', 'type' => 'yesno',
|
349
|
+
'title' => '(Arcadia) Exit', 'parent' => @root,
|
350
|
+
'message' => "Do you want exit?")=='yes')
|
351
|
+
if q1 && can_exit?
|
352
|
+
do_finalize
|
353
|
+
@root.destroy
|
354
|
+
end
|
355
|
+
end
|
356
|
+
|
357
|
+
def can_exit?
|
358
|
+
_can_exit = true
|
359
|
+
@exts.each{|extension|
|
360
|
+
if ext_active?(extension) && !self[extension].can_exit_query
|
361
|
+
_can_exit = false
|
362
|
+
break
|
363
|
+
end
|
364
|
+
}
|
365
|
+
return _can_exit
|
366
|
+
end
|
367
|
+
|
368
|
+
def do_finalize
|
369
|
+
@exts.each{|extension|
|
370
|
+
self[extension].finalize if ext_active?(extension)
|
371
|
+
}
|
372
|
+
self.write_persist
|
373
|
+
end
|
374
|
+
end
|
375
|
+
|
376
|
+
|
377
|
+
class AMainMenu < TkMenubar
|
378
|
+
|
379
|
+
def initialize(menu)
|
380
|
+
# create main menu
|
381
|
+
@menu = menu
|
382
|
+
build
|
383
|
+
menu.foreground('grey40')
|
384
|
+
menu.activeforeground('red')
|
385
|
+
menu.relief('groove')
|
386
|
+
menu.borderwidth(0)
|
387
|
+
menu.font($arcadia['conf']['main.mainmenu.font'])
|
388
|
+
end
|
389
|
+
|
390
|
+
def build
|
391
|
+
menu_spec_file = [
|
392
|
+
['File', 0],
|
393
|
+
['Open', $arcadia['main.action.open_file'], 0],
|
394
|
+
['New', $arcadia['main.action.new_file'], 0],
|
395
|
+
['Save', proc{EditorContract.instance.save_file_raised(self)},0],
|
396
|
+
['Save as ...', proc{EditorContract.instance.save_as_file_raised(self)},0],
|
397
|
+
'---',
|
398
|
+
['Quit', $arcadia['action.on_exit'], 0]]
|
399
|
+
menu_spec_edit = [['Edit', 0],
|
400
|
+
['Cut', $arcadia['main.action.edit_cut'], 2],
|
401
|
+
['Copy', $arcadia['main.action.edit_copy'], 0],
|
402
|
+
['Paste', $arcadia['main.action.edit_paste'], 0]]
|
403
|
+
menu_spec_search = [['Search', 0],
|
404
|
+
['Find ...', proc{EditorContract.instance.show_search_dialog(self)}, 2],
|
405
|
+
['Go to line ...', proc{EditorContract.instance.show_goto_line_dialog(self)}, 2]]
|
406
|
+
menu_spec_view = [['View', 0],['Show/Hide Toolbar', proc{$arcadia.show_hide_toolbar}, 2]]
|
407
|
+
menu_spec_tools = [['Utils', 0],
|
408
|
+
['Keys-test', $arcadia['action.test.keys'], 2],
|
409
|
+
['Load code from buffer', $arcadia['action.load_code_from_buffers'], 2]
|
410
|
+
]
|
411
|
+
menu_spec_help = [['Help', 0],
|
412
|
+
['About', $arcadia['action.show_about'], 2],]
|
413
|
+
@menu.add_menu(menu_spec_file)
|
414
|
+
@menu.add_menu(menu_spec_edit)
|
415
|
+
@menu.add_menu(menu_spec_search)
|
416
|
+
@menu.add_menu(menu_spec_view)
|
417
|
+
@menu.add_menu(menu_spec_tools)
|
418
|
+
@menu.add_menu(menu_spec_help)
|
419
|
+
end
|
420
|
+
|
421
|
+
end
|
422
|
+
|
423
|
+
|
424
|
+
class ArcadiaAboutSplash < TkToplevel
|
425
|
+
attr :progress
|
426
|
+
|
427
|
+
def initialize(_txt=nil)
|
428
|
+
#_bgcolor = '#B83333'
|
429
|
+
_bgcolor = '#000000'
|
430
|
+
super()
|
431
|
+
relief 'flat'
|
432
|
+
background _bgcolor
|
433
|
+
highlightbackground _bgcolor
|
434
|
+
highlightthickness 6
|
435
|
+
borderwidth 1
|
436
|
+
withdraw
|
437
|
+
overrideredirect(true)
|
438
|
+
|
439
|
+
@tkLabel3 = TkLabel.new(self){
|
440
|
+
image TkPhotoImage.new('format'=>'GIF','data' =>A_LOGO_GIF)
|
441
|
+
background _bgcolor
|
442
|
+
place('x'=> 20,'y' => 20)
|
443
|
+
}
|
444
|
+
@tkLabel1 = TkLabel.new(self){
|
445
|
+
text 'Arcadia'
|
446
|
+
background _bgcolor
|
447
|
+
foreground '#ffffff'
|
448
|
+
font Arcadia.instance['conf']['splash.title.font']
|
449
|
+
justify 'left'
|
450
|
+
place('width' => '190','x' => 120,'y' => 10,'height' => 25)
|
451
|
+
}
|
452
|
+
@tkLabelRuby = TkLabel.new(self){
|
453
|
+
image TkPhotoImage.new('data' =>RUBY_DOCUMENT_GIF)
|
454
|
+
background _bgcolor
|
455
|
+
place('x'=> 150,'y' => 40)
|
456
|
+
}
|
457
|
+
@tkLabel2 = TkLabel.new(self){
|
458
|
+
text 'Ruby ide'
|
459
|
+
background _bgcolor
|
460
|
+
foreground '#ffffff'
|
461
|
+
font Arcadia.instance['conf']['splash.subtitle.font']
|
462
|
+
justify 'left'
|
463
|
+
place('width' => '90','x' => 170,'y' => 40,'height' => 19)
|
464
|
+
}
|
465
|
+
@tkLabelVersion = TkLabel.new(self){
|
466
|
+
text 'version: '+$arcadia['applicationParams'].version
|
467
|
+
background _bgcolor
|
468
|
+
foreground '#ffffff'
|
469
|
+
font Arcadia.instance['conf']['splash.version.font']
|
470
|
+
justify 'left'
|
471
|
+
place('width' => '100','x' => 150,'y' => 60,'height' => 19)
|
472
|
+
}
|
473
|
+
@tkLabelStep = TkLabel.new(self){
|
474
|
+
text _txt
|
475
|
+
background _bgcolor
|
476
|
+
foreground 'yellow'
|
477
|
+
font Arcadia.instance['conf']['splash.banner.font']
|
478
|
+
justify 'left'
|
479
|
+
anchor 'w'
|
480
|
+
place('width'=>-5,'relwidth' => 1,'x' => 5,'y' => 175,'height' => 19)
|
481
|
+
}
|
482
|
+
@tkLabel21 = TkLabel.new(self){
|
483
|
+
text 'by Antonio Galeone - 2007'
|
484
|
+
background _bgcolor
|
485
|
+
foreground '#ffffff'
|
486
|
+
font Arcadia.instance['conf']['splash.credits.font']
|
487
|
+
justify 'left'
|
488
|
+
place('width' => '190','x' => 130,'y' => 146,'height' => 19)
|
489
|
+
}
|
490
|
+
@progress = TkVariable.new
|
491
|
+
reset
|
492
|
+
_width = 340
|
493
|
+
_height = 210
|
494
|
+
#_width = 0;_height = 0
|
495
|
+
_x = TkWinfo.screenwidth(self)/2 - _width / 2
|
496
|
+
_y = TkWinfo.screenheight(self)/2 - _height / 2
|
497
|
+
geometry = _width.to_s+'x'+_height.to_s+'+'+_x.to_s+'+'+_y.to_s
|
498
|
+
Tk.tk_call('wm', 'geometry', self, geometry )
|
499
|
+
bind("Double-Button-1", proc{self.destroy})
|
500
|
+
end
|
501
|
+
|
502
|
+
def set_progress(_max=10)
|
503
|
+
@max = _max
|
504
|
+
Tk::BWidget::ProgressBar.new(self, :width=>150, :height=>10,
|
505
|
+
:background=>'black',
|
506
|
+
:foreground=>'yellow',
|
507
|
+
:variable=>@progress,
|
508
|
+
:borderwidth=>0,
|
509
|
+
:relief=>'flat',
|
510
|
+
:maximum=>_max).place('width' => '150','x' => 145,'y' => 95,'height' => 15)
|
511
|
+
end
|
512
|
+
|
513
|
+
def reset
|
514
|
+
@progress.value = -1
|
515
|
+
end
|
516
|
+
|
517
|
+
def next_step(_txt = nil)
|
518
|
+
@progress.numeric += 1
|
519
|
+
labelStep(_txt) if _txt
|
520
|
+
end
|
521
|
+
|
522
|
+
def labelStep(_txt)
|
523
|
+
@tkLabelStep.text = _txt
|
524
|
+
Tk.update
|
525
|
+
end
|
526
|
+
|
527
|
+
def last_step(_txt = nil)
|
528
|
+
@progress.numeric = @max
|
529
|
+
labelStep(_txt) if _txt
|
530
|
+
end
|
531
|
+
|
532
|
+
end
|
533
|
+
|
534
|
+
class TkBuffersChoiseView < TkToplevel
|
535
|
+
|
536
|
+
def initialize
|
537
|
+
super
|
538
|
+
Tk.tk_call('wm', 'title', self, '...hello' )
|
539
|
+
Tk.tk_call('wm', 'geometry', self, '150x217+339+198' )
|
540
|
+
@lb = TkListbox.new(self){
|
541
|
+
background '#fedbd7'
|
542
|
+
relief 'groove'
|
543
|
+
place('relwidth' => '1','relx' => 0,'x' => '0','y' => '0','relheight' => '1','rely' => 0,'height' => '0','bordermode' => 'inside','width' => '0')
|
544
|
+
}
|
545
|
+
end
|
546
|
+
|
547
|
+
end
|
548
|
+
|
549
|
+
class TkBuffersChoise < TkBuffersChoiseView
|
550
|
+
|
551
|
+
def initialize
|
552
|
+
super
|
553
|
+
@lb.value= $arcadia['buffers.code.in_memory'].keys
|
554
|
+
@lb.bind("Double-ButtonPress-1",proc{
|
555
|
+
_sel = @lb.get('active')
|
556
|
+
Revparsel.new($arcadia['buffers.code.in_memory'][_sel])
|
557
|
+
@lb.delete('active')
|
558
|
+
$arcadia['buffers.code.in_memory'].delete(_sel)
|
559
|
+
destroy
|
560
|
+
})
|
561
|
+
raise
|
562
|
+
end
|
563
|
+
|
564
|
+
end
|
565
|
+
|
566
|
+
class ArcadiaLayout
|
567
|
+
include Observable
|
568
|
+
ArcadiaPanelInfo = Struct.new( "ArcadiaPanelInfo",
|
569
|
+
:name,
|
570
|
+
:title,
|
571
|
+
:frame
|
572
|
+
)
|
573
|
+
|
574
|
+
def initialize(_arcadia, _frame, _autotab=true)
|
575
|
+
@arcadia = _arcadia
|
576
|
+
@frames = Array.new
|
577
|
+
@frames[0] = Array.new
|
578
|
+
@frames[0][0] = _frame
|
579
|
+
@domains = Array.new
|
580
|
+
@domains[0] = Array.new
|
581
|
+
@domains[0][0] = '_domain_root_'
|
582
|
+
@panels = Hash.new
|
583
|
+
@panels['_domain_root_']= Hash.new
|
584
|
+
@panels['_domain_root_']['root']= _frame
|
585
|
+
@panels['_domain_root_']['sons'] = Hash.new
|
586
|
+
@autotab = _autotab
|
587
|
+
@headed = false
|
588
|
+
ArcadiaContractListener.new(self, MainContract, :do_main_event)
|
589
|
+
end
|
590
|
+
def root
|
591
|
+
@panels['_domain_root_']['root']
|
592
|
+
end
|
593
|
+
def do_main_event(_event)
|
594
|
+
case _event.signature
|
595
|
+
when MainContract::RAISE_EXTENSION
|
596
|
+
p = @panels[_event.context.domain]
|
597
|
+
if p && p['notebook'] != nil && _event.channel == '0'
|
598
|
+
p['notebook'].raise(_event.context.extension)
|
599
|
+
end
|
600
|
+
end
|
601
|
+
end
|
602
|
+
|
603
|
+
def _prepare_rows(_row,_col, _height, _perc=false, _top_name=nil, _bottom_name=nil)
|
604
|
+
if (@frames[_row][_col] != nil)
|
605
|
+
_h = AGTkOSplittedFrames.new(@frames[_row][_col],_height, _perc)
|
606
|
+
if @frames[_row + 1] == nil
|
607
|
+
@frames[_row + 1] = Array.new
|
608
|
+
@domains[_row + 1] = Array.new
|
609
|
+
end
|
610
|
+
@frames[_row][_col] = _h.top_frame
|
611
|
+
@frames[_row + 1][_col] = _h.bottom_frame
|
612
|
+
|
613
|
+
_top_name = _row.to_s+'.'+_col.to_s if _top_name == nil
|
614
|
+
@panels[_top_name] = Hash.new
|
615
|
+
@panels[_top_name]['root'] = @frames[_row][_col]
|
616
|
+
@panels[_top_name]['sons'] = Hash.new
|
617
|
+
@domains[_row][_col] = _top_name
|
618
|
+
|
619
|
+
_bottom_name = (_row+1).to_s+'.'+_col.to_s if _bottom_name == nil
|
620
|
+
@panels[_bottom_name] = Hash.new
|
621
|
+
@panels[_bottom_name]['root'] = @frames[_row + 1][_col]
|
622
|
+
@panels[_bottom_name]['sons'] = Hash.new
|
623
|
+
@domains[_row + 1][_col] = _bottom_name
|
624
|
+
end
|
625
|
+
end
|
626
|
+
private :_prepare_rows
|
627
|
+
|
628
|
+
def add_rows(_row,_col, _height, _top_name=nil, _bottom_name=nil)
|
629
|
+
_prepare_rows(_row,_col, _height, false, _top_name, _bottom_name)
|
630
|
+
end
|
631
|
+
|
632
|
+
def add_rows_perc(_row,_col, _height, _top_name=nil, _bottom_name=nil)
|
633
|
+
_prepare_rows(_row,_col, _height, true, _top_name, _bottom_name)
|
634
|
+
end
|
635
|
+
|
636
|
+
|
637
|
+
def add_cols(_row,_col, _width, _left_name=nil, _right_name=nil)
|
638
|
+
if (@frames[_row][_col] != nil)
|
639
|
+
_w = AGTkVSplittedFrames.new(@frames[_row][_col],_width)
|
640
|
+
@frames[_row][_col] = _w.left_frame
|
641
|
+
@frames[_row][_col + 1] = _w.right_frame
|
642
|
+
|
643
|
+
_left_name = _row.to_s+'.'+_col.to_s if _left_name == nil
|
644
|
+
@panels[_left_name] = Hash.new
|
645
|
+
@panels[_left_name]['root'] = @frames[_row][_col]
|
646
|
+
@panels[_left_name]['sons'] = Hash.new
|
647
|
+
@domains[_row][_col] = _left_name
|
648
|
+
|
649
|
+
_right_name = _row.to_s+'.'+(_col+1).to_s if _right_name == nil
|
650
|
+
@panels[_right_name] = Hash.new
|
651
|
+
@panels[_right_name]['root'] = @frames[_row][_col + 1]
|
652
|
+
@panels[_right_name]['sons'] = Hash.new
|
653
|
+
@domains[_row][_col + 1] = _right_name
|
654
|
+
end
|
655
|
+
end
|
656
|
+
|
657
|
+
def add_headers
|
658
|
+
@domains.each{|row|
|
659
|
+
row.each{|domain|
|
660
|
+
@panels[domain]['root']= TkTitledFrame.new(@panels[domain]['root'], '...').place('x'=>0, 'y'=>0,'relheight'=>1, 'relwidth'=>1) if @panels[domain]
|
661
|
+
}
|
662
|
+
}
|
663
|
+
@headed = true
|
664
|
+
end
|
665
|
+
|
666
|
+
def headed?
|
667
|
+
@headed
|
668
|
+
end
|
669
|
+
|
670
|
+
def autotab?
|
671
|
+
@autotab
|
672
|
+
end
|
673
|
+
|
674
|
+
def registed?(_domain_name, _name)
|
675
|
+
@panels[_domain_name]['sons'][_name] != nil
|
676
|
+
end
|
677
|
+
|
678
|
+
def register_panel(_domain_name, _name, _title)
|
679
|
+
p = @panels[_domain_name]
|
680
|
+
if p!=nil
|
681
|
+
num = p['sons'].length
|
682
|
+
if @headed
|
683
|
+
p['root'].title(_title)
|
684
|
+
root_frame = p['root'].frame
|
685
|
+
else
|
686
|
+
root_frame = p['root']
|
687
|
+
end
|
688
|
+
if (num == 0 && @autotab)
|
689
|
+
api = ArcadiaPanelInfo.new(_name,_title,nil)
|
690
|
+
api.frame = TkFrame.new(root_frame).place('x'=>0, 'y'=>0, 'relwidth'=>1, 'relheight'=>1)
|
691
|
+
p['sons'][_name] = api
|
692
|
+
return api.frame
|
693
|
+
else
|
694
|
+
if num == 1 && @autotab && p['notebook'] == nil
|
695
|
+
p['notebook'] = Tk::BWidget::NoteBook.new(root_frame){
|
696
|
+
tabbevelsize 0
|
697
|
+
internalborderwidth 0
|
698
|
+
pack('fill'=>'both', :padx=>0, :pady=>0, :expand => 'yes')
|
699
|
+
}
|
700
|
+
api = p['sons'].values[0]
|
701
|
+
api_tab_frame = p['notebook'].insert('end',
|
702
|
+
api.name,
|
703
|
+
'text'=>api.title,
|
704
|
+
'raisecmd'=>proc{
|
705
|
+
p['root'].title(api.title)
|
706
|
+
p['root'].top_text('')
|
707
|
+
changed
|
708
|
+
notify_observers('RAISE', api.name)
|
709
|
+
}
|
710
|
+
)
|
711
|
+
api.frame.place('in'=>api_tab_frame, 'x'=>0, 'y'=>0, 'relwidth'=>1, 'relheight'=>1)
|
712
|
+
api.frame.raise
|
713
|
+
elsif (num==0 && !@autotab)
|
714
|
+
p['notebook'] = Tk::BWidget::NoteBook.new(root_frame){
|
715
|
+
tabbevelsize 0
|
716
|
+
internalborderwidth 0
|
717
|
+
pack('fill'=>'both', :padx=>0, :pady=>0, :expand => 'yes')
|
718
|
+
}
|
719
|
+
end
|
720
|
+
_panel = p['notebook'].insert('end',_name ,
|
721
|
+
'text'=>_title,
|
722
|
+
#'background'=>_tab_bg,
|
723
|
+
'raisecmd'=>proc{
|
724
|
+
p['root'].title(_title)
|
725
|
+
changed
|
726
|
+
notify_observers('RAISE', _name)
|
727
|
+
}
|
728
|
+
)
|
729
|
+
|
730
|
+
# if _tab_bg
|
731
|
+
# _panel = p['notebook'].insert('end',_name , 'text'=>_title, 'background'=>_tab_bg)
|
732
|
+
# else
|
733
|
+
# _panel = p['notebook'].insert('end',_name , 'text'=>_title)
|
734
|
+
# end
|
735
|
+
p['sons'][_name] = ArcadiaPanelInfo.new(_name,_title,_panel)
|
736
|
+
p['notebook'].raise(_name)
|
737
|
+
return _panel
|
738
|
+
end
|
739
|
+
end
|
740
|
+
end
|
741
|
+
|
742
|
+
def unregister_panel(_domain_name, _name)
|
743
|
+
@panels[_domain_name]['sons'].delete(_name)
|
744
|
+
@panels[_domain_name]['notebook'].delete(_name)
|
745
|
+
new_raise_key = @panels[_domain_name]['sons'].keys[@panels[_domain_name]['sons'].length-1]
|
746
|
+
@panels[_domain_name]['notebook'].raise(new_raise_key)
|
747
|
+
end
|
748
|
+
|
749
|
+
def raise_panel(_domain_name, _name)
|
750
|
+
@panels[_domain_name]['notebook'].raise(_name) if @panels[_domain_name] && @panels[_domain_name]['notebook']
|
751
|
+
end
|
752
|
+
|
753
|
+
def [](_row, _col)
|
754
|
+
@frames[_row][_col]
|
755
|
+
end
|
756
|
+
|
757
|
+
def frame(_domain_name, _name)
|
758
|
+
@panels[_domain_name]['sons'][_name].frame
|
759
|
+
end
|
760
|
+
|
761
|
+
def domain(_domain_name)
|
762
|
+
@panels[_domain_name]
|
763
|
+
end
|
764
|
+
|
765
|
+
def domain_root_frame(_domain_name)
|
766
|
+
@panels[_domain_name]['root'].frame
|
767
|
+
end
|
768
|
+
end
|
769
|
+
|
770
|
+
Arcadia.new.run
|