arcadia 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +28 -22
- data/bin/arcadia +3 -3
- data/conf/arcadia.conf +87 -36
- data/conf/arcadia.res.rb +143 -5
- data/conf/theme-dark.conf +94 -0
- data/conf/theme-dark.res.rb +218 -0
- data/ext/ae-breakpoints/ae-breakpoints.rb +1 -0
- data/ext/ae-dir-projects/ae-dir-projects.rb +37 -9
- data/ext/ae-editor/ae-editor.conf +10 -9
- data/ext/ae-editor/ae-editor.rb +306 -127
- data/ext/ae-editor/langs/pers.lang.bind +1 -0
- data/ext/ae-editor/langs/rb.lang +6 -6
- data/ext/ae-editor/langs/tcl.lang +3 -0
- data/ext/ae-file-history/ae-file-history.rb +4 -11
- data/ext/ae-output/ae-output.rb +57 -38
- data/ext/ae-rad/ae-rad-inspector.rb +1 -1
- data/ext/ae-rad/ae-rad-palette.rb +2 -2
- data/ext/ae-rad/ae-rad.rb +7 -7
- data/ext/ae-rad/lib/tk/al-tk.rb +3 -3
- data/ext/ae-rad/lib/tk/al-tkcustom.rb +2 -2
- data/ext/ae-ruby-debug/ae-ruby-debug.conf +20 -1
- data/ext/ae-ruby-debug/ae-ruby-debug.rb +69 -65
- data/ext/ae-search-in-files/ae-search-in-files.rb +2 -17
- data/ext/ae-shell/ae-shell.conf +7 -6
- data/ext/ae-shell/ae-shell.rb +211 -32
- data/ext/ae-subprocess-inspector/ae-subprocess-inspector.conf +11 -0
- data/ext/ae-subprocess-inspector/ae-subprocess-inspector.rb +109 -0
- data/lib/a-commons.rb +74 -16
- data/lib/a-contracts.rb +18 -1
- data/lib/a-core.rb +410 -77
- data/lib/a-tkcommons.rb +338 -138
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/ArrowButton.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/BWidget.html +2 -2
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/Button.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/ButtonBox.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/ComboBox.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/Dialog.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/DragSite.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/DropSite.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/DynamicHelp.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/Entry.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/Label.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/LabelEntry.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/LabelFrame.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/ListBox.html +1 -4
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/MainFrame.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/MessageDlg.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/NoteBook.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/PagesManager.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/PanedWindow.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/PanelFrame.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/PasswdDlg.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/ProgressBar.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/ProgressDlg.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/ScrollView.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/ScrollableFrame.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/ScrolledWindow.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/SelectColor.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/SelectFont.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/Separator.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/SpinBox.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/StatusBar.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/TitleFrame.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/Tree.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/Widget.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/contents.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/index.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/navtree.html +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/options.htm +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/CHANGES.txt +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/ChangeLog +70 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/LICENSE.txt +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/README.txt +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/arrow.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/bitmap.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/button.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/buttonbox.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/color.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/combobox.tcl +4 -4
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/demo/basic.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/demo/bwidget.xbm +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/demo/demo.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/demo/dnd.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/demo/manager.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/demo/select.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/demo/tmpldlg.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/demo/tree.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/demo/x1.xbm +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/dialog.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/dragsite.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/dropsite.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/dynhelp.tcl +25 -18
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/entry.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/font.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/bold.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/copy.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/cut.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/dragfile.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/dragicon.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/error.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/file.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/folder.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/hourglass.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/info.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/italic.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/minus.xbm +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/new.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/opcopy.xbm +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/open.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/openfold.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/oplink.xbm +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/opmove.xbm +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/overstrike.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/palette.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/passwd.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/paste.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/plus.xbm +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/print.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/question.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/redo.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/save.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/target.xbm +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/underline.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/undo.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/warning.gif +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/init.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/label.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/labelentry.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/labelframe.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/lang/da.rc +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/lang/de.rc +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/lang/en.rc +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/lang/es.rc +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/lang/fr.rc +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/lang/hu.rc +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/lang/nl.rc +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/lang/no.rc +0 -0
- data/tcl/BWidget-1.9.2/lang/pl.rc +104 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/listbox.tcl +68 -35
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/mainframe.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/messagedlg.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/notebook.tcl +2 -2
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/pagesmgr.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/panedw.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/panelframe.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/passwddlg.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/pkgIndex.tcl +2 -2
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/progressbar.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/progressdlg.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/scrollframe.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/scrollview.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/scrollw.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/separator.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/spinbox.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/statusbar.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/tests/entry.test +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/titleframe.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/tree.tcl +6 -1
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/utils.tcl +27 -7
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/widget.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/wizard.tcl +0 -0
- data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/xpm2image.tcl +0 -0
- metadata +162 -153
data/lib/a-tkcommons.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# by Antonio Galeone <antonio-galeone@rubyforge.org>
|
|
4
4
|
#
|
|
5
5
|
|
|
6
|
-
require "lib/a-commons"
|
|
6
|
+
require "#{Dir.pwd}/lib/a-commons"
|
|
7
7
|
require "tk/menu"
|
|
8
8
|
|
|
9
9
|
class BWidgetTreePatched < Tk::BWidget::Tree
|
|
@@ -532,7 +532,8 @@ class AGTkVSplittedFrames < AGTkSplittedFrames
|
|
|
532
532
|
end
|
|
533
533
|
@right_frame_obj.width = - _w - @slen
|
|
534
534
|
@right_frame_obj.amove(_w + @slen,0)
|
|
535
|
-
@right_frame_obj.obj.
|
|
535
|
+
@right_frame_obj.obj.place_forget if @state=='left'
|
|
536
|
+
#.unplace if @state=='left'
|
|
536
537
|
@splitter_frame_obj.amove(_w,0)
|
|
537
538
|
@left_frame_obj.width = _w
|
|
538
539
|
@left_frame_obj.go(_w,0)
|
|
@@ -811,6 +812,7 @@ class TkBaseTitledFrame < TkFrame
|
|
|
811
812
|
if _image
|
|
812
813
|
image TkPhotoImage.new('dat' => _image)
|
|
813
814
|
end
|
|
815
|
+
padx 0
|
|
814
816
|
pack('side'=> _side,'anchor'=> 'e')
|
|
815
817
|
}
|
|
816
818
|
@menu_buttons[_name]
|
|
@@ -1107,6 +1109,14 @@ class TkFloatTitledFrame < TkBaseTitledFrame
|
|
|
1107
1109
|
start_moving(frame, self)
|
|
1108
1110
|
start_resizing(@resizing_label, self)
|
|
1109
1111
|
@grabbed = false
|
|
1112
|
+
# frame.bind_append('KeyPress'){|e|
|
|
1113
|
+
# p e.keysym
|
|
1114
|
+
# case e.keysym
|
|
1115
|
+
# when 'Escape'
|
|
1116
|
+
# p "WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW"
|
|
1117
|
+
# hide
|
|
1118
|
+
# end
|
|
1119
|
+
# }
|
|
1110
1120
|
end
|
|
1111
1121
|
|
|
1112
1122
|
def title(_text)
|
|
@@ -1238,97 +1248,89 @@ class TclTkInfo
|
|
|
1238
1248
|
end
|
|
1239
1249
|
end
|
|
1240
1250
|
|
|
1251
|
+
#require 'tkextlib/tile'
|
|
1252
|
+
#Tk.tk_call "eval","ttk::setTheme clam"
|
|
1253
|
+
#Tk::Tile::Style.theme_use('clam')
|
|
1241
1254
|
|
|
1242
|
-
class
|
|
1243
|
-
def initialize
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
@h_scroll = TkScrollbar.new(parent,{
|
|
1259
|
-
'orient'=>'horizontal'}.update(Arcadia.style('scrollbar'))
|
|
1260
|
-
)
|
|
1261
|
-
@h_scroll.command(proc{|*args|
|
|
1262
|
-
self.xview *args
|
|
1263
|
-
})
|
|
1264
|
-
self.xscrollcommand(proc{|first,last|
|
|
1265
|
-
self.do_xscrollcommand(first,last)
|
|
1266
|
-
})
|
|
1267
|
-
end
|
|
1268
|
-
def add_yscrollcommand(cmd=Proc.new)
|
|
1269
|
-
@v_scroll_command = cmd
|
|
1270
|
-
end
|
|
1271
|
-
def do_yscrollcommand(first,last)
|
|
1272
|
-
#p "do_yscrollcommand first=#{first} last=#{last}"
|
|
1273
|
-
@v_scroll.set(first,last)
|
|
1274
|
-
@v_scroll_command.call(first,last) if !@v_scroll_command.nil?
|
|
1275
|
-
end
|
|
1276
|
-
def add_xscrollcommand(cmd=Proc.new)
|
|
1277
|
-
@h_scroll_command = cmd
|
|
1278
|
-
end
|
|
1279
|
-
def do_xscrollcommand(first,last)
|
|
1280
|
-
#p "do_xscrollcommand first=#{first} last=#{last}"
|
|
1281
|
-
@h_scroll.set(first,last)
|
|
1282
|
-
@h_scroll_command.call(first,last) if !@h_scroll_command.nil?
|
|
1255
|
+
class TkWidgetFactory
|
|
1256
|
+
def initialize
|
|
1257
|
+
if Arcadia.conf('tile.theme')
|
|
1258
|
+
@use_tile = true
|
|
1259
|
+
begin
|
|
1260
|
+
require 'tkextlib/tile'
|
|
1261
|
+
if Tk::Tile::Style.theme_names.include?(Arcadia.conf('tile.theme'))
|
|
1262
|
+
Tk::Tile::Style.theme_use(Arcadia.conf('tile.theme'))
|
|
1263
|
+
else
|
|
1264
|
+
@use_tile = false
|
|
1265
|
+
end
|
|
1266
|
+
rescue
|
|
1267
|
+
@use_tile = false
|
|
1268
|
+
end
|
|
1269
|
+
initialize_tile_widgets if @use_tile
|
|
1270
|
+
end
|
|
1283
1271
|
end
|
|
1284
1272
|
|
|
1285
|
-
def
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1273
|
+
def initialize_tile_widgets
|
|
1274
|
+
#TScrollbar
|
|
1275
|
+
Tk::Tile::Style.configure("Arcadia.TScrollbar", Arcadia.style('scrollbar'))
|
|
1276
|
+
Tk::Tile::Style.map("Arcadia.TScrollbar",
|
|
1277
|
+
:background=>[:pressed, '#694418', :disabled, '#333333', :active, Arcadia.style('scrollbar')['activebackground']],
|
|
1278
|
+
:arrowcolor=>[:pressed, '#FEF7CB', :disabled, Arcadia.style('scrollbar')['background'], :active, Arcadia.style('scrollbar')['activebackground']],
|
|
1279
|
+
:relief=>[:pressed, :sunken])
|
|
1280
|
+
|
|
1281
|
+
Tk::Tile::Style.layout(Tk::Tile.style('Vertical', "Arcadia.TScrollbar"),
|
|
1282
|
+
["Scrollbar.trough",{:sticky=>"nsew", :children=>[
|
|
1283
|
+
"Scrollbar.uparrow",{:side=>:top, :sticky=>"we"},
|
|
1284
|
+
"Scrollbar.downarrow", {:side=>:bottom, :sticky=>"we"},
|
|
1285
|
+
"Scrollbar.thumb", {:sticky=>"nswe",:side=>:top, :border =>1, :expand=>true}]}])
|
|
1286
|
+
|
|
1287
|
+
Tk::Tile::Style.layout(Tk::Tile.style('Horizontal', "Arcadia.TScrollbar"),
|
|
1288
|
+
['Scrollbar.trough', {:children=>[
|
|
1289
|
+
'Scrollbar.leftarrow', {:side=>:left},
|
|
1290
|
+
'Scrollbar.rightarrow', {:side=>:right},
|
|
1291
|
+
'Scrollbar.thumb', {:side=>:left, :expand=>true}]}])
|
|
1292
|
+
|
|
1293
|
+
#TFrame
|
|
1294
|
+
#Tk::Tile::Style.configure(Tk::Tile::TFrame, Arcadia.style('panel'))
|
|
1295
|
+
|
|
1296
|
+
#TPaned
|
|
1297
|
+
#Tk::Tile::Style.configure(Tk::Tile::TPaned, Arcadia.style('panel'))
|
|
1298
|
+
|
|
1299
|
+
#TEntry
|
|
1300
|
+
#Tk::Tile::Style.configure(Tk::Tile::TEntry, Arcadia.style('edit'))
|
|
1301
|
+
|
|
1302
|
+
#TCombobox
|
|
1303
|
+
#Tk::Tile::Style.configure(Tk::Tile::TCombobox, Arcadia.style('combobox'))
|
|
1304
1304
|
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
@v_scroll.pack('side' => 'right', 'fill' => 'y')
|
|
1308
|
-
@v_scroll_on = true
|
|
1309
|
-
end
|
|
1305
|
+
#TLabel
|
|
1306
|
+
#Tk::Tile::Style.configure(Tk::Tile::TLabel, Arcadia.style('label'))
|
|
1310
1307
|
|
|
1311
|
-
def show_h_scroll
|
|
1312
|
-
self.place('height' => -@scroll_width-@y)
|
|
1313
|
-
@h_scroll.pack('side' => 'bottom', 'fill' => 'x')
|
|
1314
|
-
@h_scroll_on = true
|
|
1315
|
-
end
|
|
1316
1308
|
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
@v_scroll.unpack
|
|
1320
|
-
@v_scroll_on = false
|
|
1321
|
-
end
|
|
1309
|
+
#Treeview
|
|
1310
|
+
#Tk::Tile::Style.configure(Tk::Tile::Treeview, Arcadia.style('treepanel'))
|
|
1322
1311
|
|
|
1323
|
-
def hide_h_scroll
|
|
1324
|
-
self.place('height' => 0)
|
|
1325
|
-
@h_scroll.unpack
|
|
1326
|
-
@h_scroll_on = false
|
|
1327
|
-
end
|
|
1328
1312
|
|
|
1313
|
+
#TMenubutton
|
|
1314
|
+
#Tk::Tile::Style.configure(Tk::Tile::TMenubutton, Arcadia.style('menu'))
|
|
1315
|
+
|
|
1316
|
+
#TButton
|
|
1317
|
+
#Tk::Tile::Style.configure(Tk::Tile::TButton, Arcadia.style('button'))
|
|
1318
|
+
end
|
|
1319
|
+
|
|
1320
|
+
def scrollbar(_parent,_args=nil, &b)
|
|
1321
|
+
if @use_tile
|
|
1322
|
+
return Tk::Tile::Scrollbar.new(_parent,{:style=>"Arcadia.TScrollbar"}.update(_args), &b)
|
|
1323
|
+
else
|
|
1324
|
+
return TkScrollbar.new(_parent,Arcadia.style('scrollbar').update(_args), &b)
|
|
1325
|
+
end
|
|
1326
|
+
|
|
1327
|
+
end
|
|
1328
|
+
|
|
1329
1329
|
end
|
|
1330
1330
|
|
|
1331
|
-
|
|
1331
|
+
|
|
1332
|
+
|
|
1333
|
+
class TkArcadiaText < TkText
|
|
1332
1334
|
def initialize(parent=nil, keys={})
|
|
1333
1335
|
super(parent, keys)
|
|
1334
1336
|
self.bind_append("<Copy>"){Arcadia.process_event(CopyTextEvent.new(self));break}
|
|
@@ -1339,32 +1341,156 @@ class TkArcadiaText < TkScrollText
|
|
|
1339
1341
|
end
|
|
1340
1342
|
end
|
|
1341
1343
|
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1344
|
+
|
|
1345
|
+
module TkAutoPostMenu
|
|
1346
|
+
|
|
1347
|
+
def self.extended(_widget)
|
|
1348
|
+
_widget.__initialize_posting(_widget)
|
|
1349
|
+
end
|
|
1350
|
+
|
|
1351
|
+
def self.included(_widget)
|
|
1352
|
+
_widget.__initialize_posting(_widget)
|
|
1353
|
+
end
|
|
1354
|
+
|
|
1355
|
+
def event_posting_on
|
|
1356
|
+
@event_posting_on = true
|
|
1357
|
+
@posting_on = false
|
|
1358
|
+
end
|
|
1359
|
+
|
|
1360
|
+
def event_posting_off
|
|
1361
|
+
@event_posting_on = false
|
|
1362
|
+
@posting_on = true
|
|
1363
|
+
end
|
|
1364
|
+
|
|
1365
|
+
|
|
1366
|
+
def __initialize_posting(_widget=self)
|
|
1367
|
+
# parent = TkWinfo.parent(_widget)
|
|
1368
|
+
# parent.bind_append("Enter", proc{p "Enter parent"})
|
|
1369
|
+
# parent.bind_append("Leave", proc{p "Leave parent"})
|
|
1370
|
+
|
|
1371
|
+
chs = TkWinfo.children(_widget)
|
|
1372
|
+
hh = 22
|
|
1373
|
+
@last_post = nil
|
|
1374
|
+
@posting_on = true
|
|
1375
|
+
@event_posting_on = false
|
|
1376
|
+
@m_show = Hash.new
|
|
1377
|
+
chs.each{|ch|
|
|
1378
|
+
ch.menu.bind_append("Map", proc{ @m_show[ch.menu] = true })
|
|
1379
|
+
ch.menu.bind_append("Unmap", proc{ @m_show[ch.menu] = false })
|
|
1380
|
+
ch.bind_append("Enter", proc{|x,y,rx,ry|
|
|
1381
|
+
if @posting_on
|
|
1382
|
+
if @last_post && @last_post != ch.menu
|
|
1383
|
+
@last_post.unpost
|
|
1384
|
+
@last_post=nil
|
|
1385
|
+
end
|
|
1386
|
+
if @last_clicked && @last_clicked != ch.menu
|
|
1387
|
+
@last_clicked.unpost
|
|
1388
|
+
@last_clicked = nil
|
|
1389
|
+
end
|
|
1390
|
+
|
|
1391
|
+
ch.menu.post(x-rx,y-ry+hh)
|
|
1392
|
+
|
|
1393
|
+
#just_posted = TkWinfo.containing(x, y+hh)
|
|
1394
|
+
|
|
1395
|
+
chmenus = TkWinfo.children(ch)
|
|
1396
|
+
@last_menu_posted = chmenus[0]
|
|
1397
|
+
@last_menu_posted.set_focus
|
|
1398
|
+
@last_menu_posted.bind("Enter", proc{
|
|
1399
|
+
@last_menu_posted.bind("Leave", proc{
|
|
1400
|
+
if @posting_on
|
|
1401
|
+
@last_post.unpost if @last_post
|
|
1402
|
+
@last_post = nil
|
|
1403
|
+
@last_menu_posted.bind("Enter", proc{})
|
|
1404
|
+
@last_menu_posted.bind("Leave", proc{})
|
|
1405
|
+
end
|
|
1406
|
+
})
|
|
1407
|
+
})
|
|
1408
|
+
#@last_post = just_posted
|
|
1409
|
+
end
|
|
1410
|
+
|
|
1411
|
+
#@last_post=ch.menu
|
|
1412
|
+
}, "%X %Y %x %y")
|
|
1413
|
+
ch.bind_append("Leave", proc{
|
|
1414
|
+
ch.configure("state"=>:normal, "relief"=>:flat)
|
|
1415
|
+
if @posting_on
|
|
1416
|
+
if @last_post
|
|
1417
|
+
_x = TkWinfo.x(@last_post)
|
|
1418
|
+
_y = TkWinfo.y(@last_post)
|
|
1419
|
+
ch.event_generate("KeyPress", :keysym=>"Escape") #if Tk.focus.kind_of?(TkMenu) && Tk.focus != ch.menu
|
|
1420
|
+
@last_post.post(_x,_y) if @last_clicked && @last_clicked == ch.menu
|
|
1421
|
+
end
|
|
1422
|
+
if @last_post!=ch.menu
|
|
1423
|
+
@last_post=ch.menu
|
|
1424
|
+
else
|
|
1425
|
+
@last_post=nil
|
|
1426
|
+
end
|
|
1427
|
+
if !Tk.focus.kind_of?(TkMenu)
|
|
1428
|
+
@last_post.unpost if @last_post
|
|
1429
|
+
@last_post=nil
|
|
1430
|
+
end
|
|
1431
|
+
end
|
|
1432
|
+
})
|
|
1433
|
+
ch.bind_append("1", proc{|x,y,rx,ry|
|
|
1434
|
+
@posting_on=true if @event_posting_on
|
|
1435
|
+
if @last_post && @last_post != ch.menu
|
|
1436
|
+
@last_post.unpost
|
|
1437
|
+
@last_post = nil
|
|
1438
|
+
end
|
|
1439
|
+
@last_post=ch.menu #if ch.state == 'active'
|
|
1440
|
+
ch.configure('state'=>'normal')
|
|
1441
|
+
@last_clicked = ch.menu
|
|
1442
|
+
#@last_post.unpost
|
|
1443
|
+
#@last_post.post(0,0)
|
|
1444
|
+
#@last_post.set_focus
|
|
1445
|
+
|
|
1446
|
+
}, "%X %Y %x %y")
|
|
1447
|
+
|
|
1448
|
+
}
|
|
1449
|
+
_widget.bind_append("Leave", proc{
|
|
1450
|
+
if @posting_on && Tk.focus != @last_menu_posted
|
|
1451
|
+
@last_post.unpost if @last_post
|
|
1452
|
+
@last_post=nil
|
|
1453
|
+
@posting_on = false if @event_posting_on
|
|
1454
|
+
end
|
|
1455
|
+
TkAfter.new(1000,1, proc{
|
|
1456
|
+
one_post = false
|
|
1457
|
+
@m_show.each{|m,v|
|
|
1458
|
+
one_post = v
|
|
1459
|
+
break if v
|
|
1460
|
+
}
|
|
1461
|
+
@posting_on = one_post if @event_posting_on
|
|
1462
|
+
}).start
|
|
1463
|
+
})
|
|
1464
|
+
|
|
1465
|
+
|
|
1466
|
+
_widget.bind_append("1", proc{
|
|
1467
|
+
@posting_on=true if @event_posting_on
|
|
1468
|
+
})
|
|
1469
|
+
|
|
1470
|
+
end
|
|
1471
|
+
end
|
|
1472
|
+
|
|
1473
|
+
#
|
|
1474
|
+
module TkScrollableWidget
|
|
1475
|
+
|
|
1476
|
+
def self.extended(_widget)
|
|
1477
|
+
_widget.__initialize_scrolling(_widget)
|
|
1478
|
+
end
|
|
1479
|
+
|
|
1480
|
+
def self.included(_widget)
|
|
1481
|
+
_widget.__initialize_scrolling(_widget)
|
|
1482
|
+
end
|
|
1483
|
+
|
|
1484
|
+
def __initialize_scrolling(_widget=self)
|
|
1485
|
+
@widget = _widget
|
|
1345
1486
|
@parent = TkWinfo.parent(@widget)
|
|
1346
|
-
@scroll_width =
|
|
1487
|
+
@scroll_width = Arcadia.style('scrollbar')['width'].to_i
|
|
1488
|
+
@x=0
|
|
1489
|
+
@y=0
|
|
1347
1490
|
@v_scroll_on = false
|
|
1348
1491
|
@h_scroll_on = false
|
|
1349
|
-
@v_scroll =
|
|
1350
|
-
|
|
1351
|
-
)
|
|
1352
|
-
@v_scroll.command(proc{|*args|
|
|
1353
|
-
@widget.yview *args
|
|
1354
|
-
})
|
|
1355
|
-
@widget.yscrollcommand(proc{|first,last|
|
|
1356
|
-
do_yscrollcommand(first,last)
|
|
1357
|
-
})
|
|
1358
|
-
|
|
1359
|
-
@h_scroll = TkScrollbar.new(@parent,{
|
|
1360
|
-
'orient'=>'horizontal'}.update(Arcadia.style('scrollbar'))
|
|
1361
|
-
)
|
|
1362
|
-
@h_scroll.command(proc{|*args|
|
|
1363
|
-
@widget.xview *args
|
|
1364
|
-
})
|
|
1365
|
-
@widget.xscrollcommand(proc{|first,last|
|
|
1366
|
-
do_xscrollcommand(first,last)
|
|
1367
|
-
})
|
|
1492
|
+
@v_scroll = Arcadia.wf.scrollbar(@parent,{'orient'=>'vertical'})
|
|
1493
|
+
@h_scroll = Arcadia.wf.scrollbar(@parent,{'orient'=>'horizontal'})
|
|
1368
1494
|
end
|
|
1369
1495
|
|
|
1370
1496
|
def destroy
|
|
@@ -1377,8 +1503,21 @@ class TkScrollWidget
|
|
|
1377
1503
|
end
|
|
1378
1504
|
|
|
1379
1505
|
def do_yscrollcommand(first,last)
|
|
1380
|
-
|
|
1381
|
-
|
|
1506
|
+
if first != nil && last != nil
|
|
1507
|
+
delta = last.to_f - first.to_f
|
|
1508
|
+
if delta < 1 && delta > 0 && last != @last_y_last
|
|
1509
|
+
show_v_scroll
|
|
1510
|
+
begin
|
|
1511
|
+
@v_scroll.set(first,last) #if TkWinfo.mapped?(@v_scroll)
|
|
1512
|
+
rescue Exception => e
|
|
1513
|
+
p "#{e.message}"
|
|
1514
|
+
end
|
|
1515
|
+
elsif delta == 1 || delta == 0
|
|
1516
|
+
hide_v_scroll
|
|
1517
|
+
end
|
|
1518
|
+
@v_scroll_command.call(first,last) if !@v_scroll_command.nil?
|
|
1519
|
+
@last_y_last = last if last.to_f < 1
|
|
1520
|
+
end
|
|
1382
1521
|
end
|
|
1383
1522
|
|
|
1384
1523
|
def add_xscrollcommand(cmd=Proc.new)
|
|
@@ -1386,8 +1525,21 @@ class TkScrollWidget
|
|
|
1386
1525
|
end
|
|
1387
1526
|
|
|
1388
1527
|
def do_xscrollcommand(first,last)
|
|
1389
|
-
|
|
1390
|
-
|
|
1528
|
+
if first != nil && last != nil
|
|
1529
|
+
delta = last.to_f - first.to_f
|
|
1530
|
+
if delta < 1 && delta > 0 && last != @last_x_last
|
|
1531
|
+
show_h_scroll
|
|
1532
|
+
begin
|
|
1533
|
+
@h_scroll.set(first,last) #if TkWinfo.mapped?(@h_scroll)
|
|
1534
|
+
rescue Exception => e
|
|
1535
|
+
p "#{e.message}"
|
|
1536
|
+
end
|
|
1537
|
+
elsif delta == 1 || delta == 0
|
|
1538
|
+
hide_h_scroll
|
|
1539
|
+
end
|
|
1540
|
+
@h_scroll_command.call(first,last) if !@h_scroll_command.nil?
|
|
1541
|
+
@last_x_last = last if last.to_f < 1
|
|
1542
|
+
end
|
|
1391
1543
|
end
|
|
1392
1544
|
|
|
1393
1545
|
def show(_x=0,_y=0,_border_mode='outside')
|
|
@@ -1401,56 +1553,107 @@ class TkScrollWidget
|
|
|
1401
1553
|
'relheight'=>1,
|
|
1402
1554
|
'relwidth'=>1,
|
|
1403
1555
|
'bordermode'=>_border_mode
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1556
|
+
)
|
|
1557
|
+
if @v_scroll_on
|
|
1558
|
+
show_v_scroll(true)
|
|
1559
|
+
end
|
|
1560
|
+
if @h_scroll_on
|
|
1561
|
+
show_h_scroll(true)
|
|
1562
|
+
end
|
|
1563
|
+
begin
|
|
1564
|
+
arm_scroll_binding
|
|
1565
|
+
rescue Exception => e
|
|
1566
|
+
p "#{e.message}"
|
|
1567
|
+
end
|
|
1411
1568
|
end
|
|
1412
1569
|
|
|
1413
1570
|
def hide
|
|
1571
|
+
disarm_scroll_binding
|
|
1414
1572
|
@widget.unplace
|
|
1415
1573
|
@v_scroll.unpack
|
|
1416
1574
|
@h_scroll.unpack
|
|
1417
1575
|
end
|
|
1418
1576
|
|
|
1419
|
-
def
|
|
1420
|
-
@widget.
|
|
1421
|
-
|
|
1422
|
-
|
|
1577
|
+
def arm_scroll_binding
|
|
1578
|
+
@widget.yscrollcommand(proc{|first,last|
|
|
1579
|
+
do_yscrollcommand(first,last)
|
|
1580
|
+
})
|
|
1581
|
+
@v_scroll.command(proc{|*args|
|
|
1582
|
+
@widget.yview *args
|
|
1583
|
+
})
|
|
1584
|
+
@widget.xscrollcommand(proc{|first,last|
|
|
1585
|
+
do_xscrollcommand(first,last)
|
|
1586
|
+
})
|
|
1587
|
+
@h_scroll.command(proc{|*args|
|
|
1588
|
+
@widget.xview *args
|
|
1589
|
+
})
|
|
1590
|
+
end
|
|
1591
|
+
|
|
1592
|
+
def disarm_scroll_binding
|
|
1593
|
+
@widget.yscrollcommand(proc{})
|
|
1594
|
+
@widget.xscrollcommand(proc{})
|
|
1595
|
+
@v_scroll.command(proc{})
|
|
1596
|
+
@h_scroll.command(proc{})
|
|
1597
|
+
end
|
|
1598
|
+
|
|
1599
|
+
def show_v_scroll(_force=false)
|
|
1600
|
+
if _force || !@v_scroll_on
|
|
1601
|
+
begin
|
|
1602
|
+
@widget.place('width' => -@scroll_width-@x)
|
|
1603
|
+
@v_scroll.pack('side' => 'right', 'fill' => 'y')
|
|
1604
|
+
@v_scroll_on = true
|
|
1605
|
+
rescue RuntimeError => e
|
|
1606
|
+
p "RuntimeError : #{e.message}"
|
|
1607
|
+
end
|
|
1608
|
+
end
|
|
1423
1609
|
end
|
|
1424
1610
|
|
|
1425
|
-
def show_h_scroll
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1611
|
+
def show_h_scroll(_force=false)
|
|
1612
|
+
if _force || !@h_scroll_on
|
|
1613
|
+
begin
|
|
1614
|
+
@widget.place('height' => -@scroll_width-@y)
|
|
1615
|
+
@h_scroll.pack('side' => 'bottom', 'fill' => 'x')
|
|
1616
|
+
@h_scroll_on = true
|
|
1617
|
+
rescue RuntimeError => e
|
|
1618
|
+
p "RuntimeError : #{e.message}"
|
|
1619
|
+
end
|
|
1620
|
+
end
|
|
1429
1621
|
end
|
|
1430
1622
|
|
|
1431
1623
|
def hide_v_scroll
|
|
1432
|
-
@
|
|
1433
|
-
|
|
1434
|
-
|
|
1624
|
+
if @v_scroll_on
|
|
1625
|
+
begin
|
|
1626
|
+
@widget.place('width' => 0)
|
|
1627
|
+
@v_scroll.unpack
|
|
1628
|
+
@v_scroll_on = false
|
|
1629
|
+
rescue RuntimeError => e
|
|
1630
|
+
p "RuntimeError : #{e.message}"
|
|
1631
|
+
end
|
|
1632
|
+
|
|
1633
|
+
end
|
|
1435
1634
|
end
|
|
1436
1635
|
|
|
1437
1636
|
def hide_h_scroll
|
|
1438
|
-
@
|
|
1439
|
-
|
|
1440
|
-
|
|
1637
|
+
if @h_scroll_on
|
|
1638
|
+
begin
|
|
1639
|
+
@widget.place('height' => 0)
|
|
1640
|
+
@h_scroll.unpack
|
|
1641
|
+
@h_scroll_on = false
|
|
1642
|
+
rescue RuntimeError => e
|
|
1643
|
+
p "RuntimeError : #{e.message}"
|
|
1644
|
+
end
|
|
1645
|
+
end
|
|
1441
1646
|
end
|
|
1442
1647
|
|
|
1443
1648
|
end
|
|
1444
1649
|
|
|
1650
|
+
|
|
1445
1651
|
class KeyTest < TkFloatTitledFrame
|
|
1446
1652
|
attr_reader :ttest
|
|
1447
1653
|
def initialize(_parent=nil)
|
|
1448
1654
|
_parent = Arcadia.instance.layout.root if _parent.nil?
|
|
1449
1655
|
super(_parent)
|
|
1450
1656
|
|
|
1451
|
-
#Tk.tk_call('wm', 'title', self, '...hello' )
|
|
1452
|
-
#Tk.tk_call('wm', 'geometry', self, '638x117+200+257' )
|
|
1453
|
-
|
|
1454
1657
|
@ttest = TkText.new(self.frame){
|
|
1455
1658
|
background '#FFF454'
|
|
1456
1659
|
#place('relwidth' => '1','relx' => 0,'x' => '0','y' => '0','relheight' => '1','rely' => 0,'height' => '0','bordermode' => 'inside','width' => '0')
|
|
@@ -1458,10 +1661,7 @@ class KeyTest < TkFloatTitledFrame
|
|
|
1458
1661
|
@ttest.insert('end'," "+e.keysym+" ")
|
|
1459
1662
|
break
|
|
1460
1663
|
}
|
|
1461
|
-
|
|
1462
|
-
_wrapper.show
|
|
1463
|
-
_wrapper.show_v_scroll
|
|
1464
|
-
_wrapper.show_h_scroll
|
|
1664
|
+
@ttest.extend(TkScrollableWidget).show
|
|
1465
1665
|
place('x'=>100,'y'=>100,'height'=> 220,'width'=> 500)
|
|
1466
1666
|
end
|
|
1467
1667
|
end
|