arcadia 0.9.3 → 0.10.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 +11 -10
- data/bin/arcadia +3 -0
- data/conf/arcadia.conf +117 -75
- data/conf/arcadia.res.rb +219 -58
- data/conf/theme-dark.conf +11 -8
- data/conf/theme-dark.res.rb +81 -10
- data/ext/ae-breakpoints/ae-breakpoints.rb +1 -1
- data/ext/ae-dir-projects/ae-dir-projects.conf +2 -2
- data/ext/ae-dir-projects/ae-dir-projects.rb +84 -47
- data/ext/ae-editor/ae-editor.rb +541 -190
- data/ext/ae-editor/langs/coderay.tokens +1 -0
- data/ext/ae-editor/langs/conf.lang +5 -4
- data/ext/ae-editor/langs/java.lang +2 -1
- data/ext/ae-editor/langs/python.lang +4 -0
- data/ext/ae-editor/langs/rhtml.lang +2 -1
- data/ext/ae-editor/langs/ruby.lang +45 -0
- data/ext/ae-editor/langs/tcl.lang +80 -2
- data/ext/ae-editor/langs/text.lang +2 -0
- data/ext/ae-editor/langs/xml.lang +1 -0
- data/ext/ae-file-history/ae-file-history.conf +2 -2
- data/ext/ae-file-history/ae-file-history.rb +66 -20
- data/ext/ae-output/ae-output.conf +3 -3
- data/ext/ae-output/ae-output.rb +37 -23
- data/ext/ae-rad/ae-rad-palette.rb +3 -3
- data/ext/ae-ruby-debug/ae-ruby-debug.conf +2 -2
- data/ext/ae-ruby-debug/ae-ruby-debug.rb +38 -42
- data/ext/ae-search-in-files/ae-search-in-files.conf +2 -2
- data/ext/ae-search-in-files/ae-search-in-files.rb +20 -9
- data/ext/ae-search-in-files/ext/ack-in-files/ack-in-files.conf +2 -2
- data/ext/ae-shell/ae-shell.conf +1 -1
- data/ext/ae-shell/ae-shell.rb +57 -46
- data/ext/ae-subprocess-inspector/ae-subprocess-inspector.rb +99 -46
- data/ext/ae-subprocess-inspector/process.res +0 -0
- data/lib/a-commons.rb +13 -9
- data/lib/a-contracts.rb +24 -1
- data/lib/a-core.rb +586 -196
- data/lib/a-tkcommons.rb +155 -55
- data/lib/anigif.rb +9 -0
- data/lib/ctags.exe +0 -0
- data/tcl/anigif/anigif.tcl +199 -0
- data/tcl/anigif/pkgIndex.tcl +3 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/ArrowButton.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/BWidget.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/Button.html +36 -2
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/ButtonBox.html +9 -7
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/ComboBox.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/Dialog.html +5 -11
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/DragSite.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/DropSite.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/DynamicHelp.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/Entry.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/Label.html +32 -1
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/LabelEntry.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/LabelFrame.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/ListBox.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/MainFrame.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/MessageDlg.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/NoteBook.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/PagesManager.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/PanedWindow.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/PanelFrame.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/PasswdDlg.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/ProgressBar.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/ProgressDlg.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/ScrollView.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/ScrollableFrame.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/ScrolledWindow.html +13 -1
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/SelectColor.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/SelectFont.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/Separator.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/SpinBox.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/StatusBar.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/TitleFrame.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/Tree.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/Widget.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/contents.html +12 -1
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/index.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/navtree.html +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/BWman/options.htm +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/CHANGES.txt +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/ChangeLog +70 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/LICENSE.txt +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/README.txt +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/arrow.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/bitmap.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/button.tcl +121 -53
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/buttonbox.tcl +10 -5
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/color.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/combobox.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/demo/basic.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/demo/bwidget.xbm +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/demo/demo.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/demo/dnd.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/demo/manager.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/demo/select.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/demo/tmpldlg.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/demo/tree.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/demo/x1.xbm +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/dialog.tcl +14 -2
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/dragsite.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/dropsite.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/dynhelp.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/entry.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/font.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/bold.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/copy.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/cut.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/dragfile.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/dragicon.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/error.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/file.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/folder.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/hourglass.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/info.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/italic.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/minus.xbm +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/new.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/opcopy.xbm +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/open.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/openfold.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/oplink.xbm +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/opmove.xbm +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/overstrike.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/palette.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/passwd.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/paste.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/plus.xbm +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/print.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/question.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/redo.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/save.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/target.xbm +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/underline.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/undo.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/images/warning.gif +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/init.tcl +15 -1
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/label.tcl +76 -18
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/labelentry.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/labelframe.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/lang/da.rc +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/lang/de.rc +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/lang/en.rc +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/lang/es.rc +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/lang/fr.rc +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/lang/hu.rc +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/lang/nl.rc +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/lang/no.rc +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/lang/pl.rc +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/listbox.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/mainframe.tcl +3 -2
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/messagedlg.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/notebook.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/pagesmgr.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/panedw.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/panelframe.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/passwddlg.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/pkgIndex.tcl +2 -2
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/progressbar.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/progressdlg.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/scrollframe.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/scrollview.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/scrollw.tcl +37 -25
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/separator.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/spinbox.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/statusbar.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/tests/entry.test +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/titleframe.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/tree.tcl +17 -9
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/utils.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/widget.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/wizard.tcl +0 -0
- data/tcl/{BWidget-1.9.2 → bwidget-1.9.4}/xpm2image.tcl +0 -0
- data/tcl/fsdialog/de.msg +30 -0
- data/tcl/fsdialog/en.msg +31 -0
- data/tcl/fsdialog/fsdialog.tcl +1749 -0
- data/tcl/fsdialog/fsdlg-gif.tcl +259 -0
- data/tcl/fsdialog/fsdlg-png.tcl +265 -0
- data/tcl/fsdialog/sv.msg +32 -0
- data/tcl/fsdialog/tclIndex +6 -0
- metadata +179 -174
- data/ext/ae-editor/langs/erb.lang.bind +0 -1
- data/ext/ae-editor/langs/lang.lang.bind +0 -1
- data/ext/ae-editor/langs/pers.lang.bind +0 -1
- data/ext/ae-editor/langs/rb.lang +0 -73
- data/ext/ae-editor/langs/rbw.lang.bind +0 -1
- data/ext/ae-editor/langs/tokens.lang.bind +0 -1
data/lib/a-tkcommons.rb
CHANGED
|
@@ -264,8 +264,12 @@ end
|
|
|
264
264
|
class TkFrameAdapter < TkFrame
|
|
265
265
|
include TkMovable
|
|
266
266
|
attr_reader :frame
|
|
267
|
-
def initialize(scope_parent=nil,
|
|
268
|
-
|
|
267
|
+
def initialize(scope_parent=nil, args=nil)
|
|
268
|
+
newargs = Arcadia.style('panel')
|
|
269
|
+
if !args.nil?
|
|
270
|
+
newargs.update(args)
|
|
271
|
+
end
|
|
272
|
+
super(scope_parent, newargs)
|
|
269
273
|
@scope_parent = scope_parent
|
|
270
274
|
@movable = true
|
|
271
275
|
#ObjectSpace.define_finalizer(self, self.method(:detach_frame).to_proc)
|
|
@@ -330,10 +334,10 @@ class AGTkSplittedFrames < TkFrameAdapter
|
|
|
330
334
|
attr_reader :frame1
|
|
331
335
|
attr_reader :frame2
|
|
332
336
|
def initialize(parent=nil, frame=nil, length=10, slen=5, user_control=true, keys=nil)
|
|
333
|
-
if keys.nil?
|
|
334
|
-
keys = Hash.new
|
|
335
|
-
end
|
|
336
|
-
keys.update(Arcadia.style('panel'))
|
|
337
|
+
# if keys.nil?
|
|
338
|
+
# keys = Hash.new
|
|
339
|
+
# end
|
|
340
|
+
# keys.update(Arcadia.style('panel'))
|
|
337
341
|
super(parent, keys)
|
|
338
342
|
@parent = parent
|
|
339
343
|
@slen = slen
|
|
@@ -788,6 +792,7 @@ class TkBaseTitledFrame < TkFrame
|
|
|
788
792
|
|
|
789
793
|
@buttons = Hash.new
|
|
790
794
|
@menu_buttons = Hash.new
|
|
795
|
+
@panels = Hash.new
|
|
791
796
|
@last_for_frame = Hash.new
|
|
792
797
|
self.head_buttons
|
|
793
798
|
end
|
|
@@ -804,26 +809,34 @@ class TkBaseTitledFrame < TkFrame
|
|
|
804
809
|
__add_menu_button(_name, _image, _side, _args, @button_frame)
|
|
805
810
|
end
|
|
806
811
|
|
|
812
|
+
def add_fixed_panel(_name='default',_side= 'right', _args=nil)
|
|
813
|
+
__add_panel(_name, _side, _args, @button_frame)
|
|
814
|
+
end
|
|
815
|
+
|
|
807
816
|
def add_fixed_sep(_width=0)
|
|
808
817
|
__add_sep(_width, @button_frame)
|
|
809
818
|
end
|
|
810
819
|
|
|
811
820
|
def __add_button(_label,_proc=nil,_image=nil, _side= 'right', _frame=nil)
|
|
812
821
|
return if _frame.nil?
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
822
|
+
begin
|
|
823
|
+
last = @last_for_frame[_frame]
|
|
824
|
+
@last_for_frame[_frame] = TkButton.new(_frame, Arcadia.style('titletoolbarbutton')){
|
|
825
|
+
text _label if _label
|
|
826
|
+
image Arcadia.image_res(_image) if _image
|
|
827
|
+
font 'helvetica 8 bold'
|
|
828
|
+
padx 0
|
|
829
|
+
pady 0
|
|
830
|
+
if last
|
|
831
|
+
pack('side'=> _side,'anchor'=> 'e', 'after'=>last)
|
|
832
|
+
else
|
|
833
|
+
pack('side'=> _side,'anchor'=> 'e')
|
|
834
|
+
end
|
|
835
|
+
bind('1',_proc) if _proc
|
|
836
|
+
}
|
|
837
|
+
rescue RuntimeError => e
|
|
838
|
+
Arcadia.runtime_error(e)
|
|
839
|
+
end
|
|
827
840
|
end
|
|
828
841
|
private :__add_button
|
|
829
842
|
|
|
@@ -836,7 +849,7 @@ class TkBaseTitledFrame < TkFrame
|
|
|
836
849
|
menu TkMenu.new(mb, Arcadia.style('titlemenu'))
|
|
837
850
|
if _image
|
|
838
851
|
indicatoron false
|
|
839
|
-
image
|
|
852
|
+
image Arcadia.image_res(_image)
|
|
840
853
|
else
|
|
841
854
|
indicatoron true
|
|
842
855
|
end
|
|
@@ -851,6 +864,27 @@ class TkBaseTitledFrame < TkFrame
|
|
|
851
864
|
end
|
|
852
865
|
private :__add_menu_button
|
|
853
866
|
|
|
867
|
+
def __add_panel(_name='default', _side= 'right', _args=nil, _frame=nil)
|
|
868
|
+
return if _frame.nil?
|
|
869
|
+
args = Arcadia.style('panel').update('background'=>_frame.background, 'highlightbackground'=>_frame.background)
|
|
870
|
+
args.update(_args) if _args
|
|
871
|
+
begin
|
|
872
|
+
last = @last_for_frame[_frame]
|
|
873
|
+
@last_for_frame[_frame] = @panels[_name]= TkFrame.new(_frame, args){
|
|
874
|
+
padx 0
|
|
875
|
+
pady 0
|
|
876
|
+
if last
|
|
877
|
+
pack('side'=> _side,'anchor'=> 'e', 'after'=>last)
|
|
878
|
+
else
|
|
879
|
+
pack('side'=> _side,'anchor'=> 'e')
|
|
880
|
+
end
|
|
881
|
+
}
|
|
882
|
+
@panels[_name]
|
|
883
|
+
rescue RuntimeError => e
|
|
884
|
+
Arcadia.runtime_error(e)
|
|
885
|
+
end
|
|
886
|
+
end
|
|
887
|
+
private :__add_panel
|
|
854
888
|
|
|
855
889
|
def __add_sep(_width=0, _frame=nil)
|
|
856
890
|
return if _width <= 0 || _frame.nil?
|
|
@@ -984,13 +1018,13 @@ class TkTitledFrame < TkBaseTitledFrame
|
|
|
984
1018
|
if @state == 'normal'
|
|
985
1019
|
if p.kind_of?(AGTkSplittedFrames)
|
|
986
1020
|
p.maximize(@parent)
|
|
987
|
-
@bmaxmin.image(
|
|
1021
|
+
@bmaxmin.image(Arcadia.image_res(W_NORM_GIF))
|
|
988
1022
|
end
|
|
989
1023
|
@state = 'maximize'
|
|
990
1024
|
else
|
|
991
1025
|
if p.kind_of?(AGTkSplittedFrames)
|
|
992
1026
|
p.minimize(@parent)
|
|
993
|
-
@bmaxmin.image(
|
|
1027
|
+
@bmaxmin.image(Arcadia.image_res(W_MAX_GIF))
|
|
994
1028
|
end
|
|
995
1029
|
@state = 'normal'
|
|
996
1030
|
end
|
|
@@ -1156,8 +1190,7 @@ class TkTitledFrameAdapter < TkTitledFrame
|
|
|
1156
1190
|
|
|
1157
1191
|
def forge_transient_adapter(_name)
|
|
1158
1192
|
if @transient_frame_adapter[_name].nil?
|
|
1159
|
-
@transient_frame_adapter[_name] = TkFrameAdapter.new(Arcadia.layout.root,
|
|
1160
|
-
Arcadia.style('frame').update({'background'=> Arcadia.conf('titlelabel.background')}))
|
|
1193
|
+
@transient_frame_adapter[_name] = TkFrameAdapter.new(Arcadia.layout.root, {'background'=> Arcadia.conf('titlelabel.background')})
|
|
1161
1194
|
__attach_adapter(@transient_frame_adapter[_name])
|
|
1162
1195
|
@transient_frame_adapter[_name].raise
|
|
1163
1196
|
end
|
|
@@ -1192,6 +1225,11 @@ class TkTitledFrameAdapter < TkTitledFrame
|
|
|
1192
1225
|
__add_menu_button(_name, _image, _side, _args, @transient_frame_adapter[_sender_name])
|
|
1193
1226
|
end
|
|
1194
1227
|
|
|
1228
|
+
def add_panel(_sender_name, _name='default',_side= 'right', _args=nil)
|
|
1229
|
+
forge_transient_adapter(_sender_name)
|
|
1230
|
+
__add_panel(_name, _side, _args, @transient_frame_adapter[_sender_name])
|
|
1231
|
+
end
|
|
1232
|
+
|
|
1195
1233
|
def add_sep(_sender_name, _width=0)
|
|
1196
1234
|
forge_transient_adapter(_sender_name)
|
|
1197
1235
|
__add_sep(_width, @transient_frame_adapter[_sender_name])
|
|
@@ -1216,7 +1254,7 @@ class TkResizingTitledFrame < TkFrame
|
|
|
1216
1254
|
super(parent, *args)
|
|
1217
1255
|
@resizing_label=TkLabel.new(self, Arcadia.style('label')){
|
|
1218
1256
|
text '-'
|
|
1219
|
-
image
|
|
1257
|
+
image Arcadia.image_res(EXPAND_LIGHT_GIF)
|
|
1220
1258
|
}.pack('side'=> 'right','anchor'=> 's')
|
|
1221
1259
|
start_resizing(@resizing_label, self)
|
|
1222
1260
|
end
|
|
@@ -1239,7 +1277,7 @@ class TkFloatTitledFrame < TkBaseTitledFrame
|
|
|
1239
1277
|
|
|
1240
1278
|
@resizing_label=TkLabel.new(self, Arcadia.style('label')){
|
|
1241
1279
|
text '-'
|
|
1242
|
-
image
|
|
1280
|
+
image Arcadia.image_res(EXPAND_LIGHT_GIF)
|
|
1243
1281
|
}.pack('side'=> 'right','anchor'=> 's')
|
|
1244
1282
|
start_moving(@right_label, self)
|
|
1245
1283
|
start_moving(frame, self)
|
|
@@ -1318,9 +1356,9 @@ class TkProgressframe < TkFloatTitledFrame
|
|
|
1318
1356
|
:relief=>'flat',
|
|
1319
1357
|
:maximum=>_max).place('width' => '150','x' => 25,'y' => 30,'height' => 15)
|
|
1320
1358
|
|
|
1321
|
-
@buttons_frame = TkFrame.new(self).pack('fill'=>'x', 'side'=>'bottom')
|
|
1359
|
+
@buttons_frame = TkFrame.new(self, Arcadia.style('panel')).pack('fill'=>'x', 'side'=>'bottom')
|
|
1322
1360
|
|
|
1323
|
-
@b_cancel = TkButton.new(@buttons_frame){|_b_go|
|
|
1361
|
+
@b_cancel = TkButton.new(@buttons_frame, Arcadia.style('button')){|_b_go|
|
|
1324
1362
|
default 'disabled'
|
|
1325
1363
|
text 'Cancel'
|
|
1326
1364
|
overrelief 'raised'
|
|
@@ -1396,8 +1434,6 @@ class TkWidgetFactory
|
|
|
1396
1434
|
require 'tkextlib/tile'
|
|
1397
1435
|
if Tk::Tile::Style.theme_names.include?(Arcadia.conf('tile.theme'))
|
|
1398
1436
|
Tk::Tile::Style.theme_use(Arcadia.conf('tile.theme'))
|
|
1399
|
-
else
|
|
1400
|
-
@use_tile = false
|
|
1401
1437
|
end
|
|
1402
1438
|
rescue
|
|
1403
1439
|
@use_tile = false
|
|
@@ -1410,8 +1446,8 @@ class TkWidgetFactory
|
|
|
1410
1446
|
#TScrollbar
|
|
1411
1447
|
Tk::Tile::Style.configure("Arcadia.TScrollbar", Arcadia.style('scrollbar'))
|
|
1412
1448
|
Tk::Tile::Style.map("Arcadia.TScrollbar",
|
|
1413
|
-
:background=>[:pressed, '
|
|
1414
|
-
:arrowcolor=>[:pressed, '
|
|
1449
|
+
:background=>[:pressed, Arcadia.style('scrollbar')['activebackground'], :disabled, Arcadia.style('scrollbar')['background'], :active, Arcadia.style('scrollbar')['activebackground']],
|
|
1450
|
+
:arrowcolor=>[:pressed, Arcadia.style('scrollbar')['background'], :disabled, Arcadia.style('scrollbar')['highlightbackground'], :active, Arcadia.style('scrollbar')['background']],
|
|
1415
1451
|
:relief=>[:pressed, :sunken])
|
|
1416
1452
|
|
|
1417
1453
|
Tk::Tile::Style.layout(Tk::Tile.style('Vertical', "Arcadia.TScrollbar"),
|
|
@@ -1454,12 +1490,15 @@ class TkWidgetFactory
|
|
|
1454
1490
|
end
|
|
1455
1491
|
|
|
1456
1492
|
def scrollbar(_parent,_args=nil, &b)
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1493
|
+
begin
|
|
1494
|
+
if @use_tile
|
|
1495
|
+
return Tk::Tile::Scrollbar.new(_parent,{:style=>"Arcadia.TScrollbar"}.update(_args), &b)
|
|
1496
|
+
else
|
|
1497
|
+
return TkScrollbar.new(_parent,Arcadia.style('scrollbar').update(_args), &b)
|
|
1498
|
+
end
|
|
1499
|
+
rescue RuntimeError => e
|
|
1500
|
+
Arcadia.runtime_error(e)
|
|
1461
1501
|
end
|
|
1462
|
-
|
|
1463
1502
|
end
|
|
1464
1503
|
|
|
1465
1504
|
end
|
|
@@ -1469,14 +1508,33 @@ end
|
|
|
1469
1508
|
class TkArcadiaText < TkText
|
|
1470
1509
|
def initialize(parent=nil, keys={})
|
|
1471
1510
|
super(parent, keys)
|
|
1472
|
-
self.bind_append("<Copy>"){Arcadia.process_event(CopyTextEvent.new(self));break}
|
|
1473
|
-
self.bind_append("<Cut>"){Arcadia.process_event(CutTextEvent.new(self));break}
|
|
1474
|
-
self.bind_append("<Paste>"){Arcadia.process_event(PasteTextEvent.new(self));break}
|
|
1475
|
-
self.bind_append("<Undo>"){Arcadia.process_event(UndoTextEvent.new(self));break}
|
|
1476
|
-
self.bind_append("<Redo>"){Arcadia.process_event(RedoTextEvent.new(self));break}
|
|
1511
|
+
# self.bind_append("<Copy>"){Arcadia.process_event(CopyTextEvent.new(self));break}
|
|
1512
|
+
# self.bind_append("<Cut>"){Arcadia.process_event(CutTextEvent.new(self));break}
|
|
1513
|
+
# self.bind_append("<Paste>"){Arcadia.process_event(PasteTextEvent.new(self));break}
|
|
1514
|
+
# self.bind_append("<Undo>"){Arcadia.process_event(UndoTextEvent.new(self));break}
|
|
1515
|
+
# self.bind_append("<Redo>"){Arcadia.process_event(RedoTextEvent.new(self));break}
|
|
1477
1516
|
end
|
|
1478
1517
|
end
|
|
1479
1518
|
|
|
1519
|
+
module TkInputThrow
|
|
1520
|
+
def self.extended(_widget)
|
|
1521
|
+
_widget.__initialize_throw(_widget)
|
|
1522
|
+
end
|
|
1523
|
+
|
|
1524
|
+
def self.included(_widget)
|
|
1525
|
+
_widget.__initialize_throw(_widget)
|
|
1526
|
+
end
|
|
1527
|
+
|
|
1528
|
+
def __initialize_throw(_widget)
|
|
1529
|
+
#_widget.bind_append("Enter", proc{p "Enter on #{_widget}";Arcadia.process_event(InputEnterEvent.new(self,'receiver'=>_widget))})
|
|
1530
|
+
_widget.bind_append("<Copy>"){Arcadia.process_event(CopyTextEvent.new(_widget));break}
|
|
1531
|
+
_widget.bind_append("<Cut>"){Arcadia.process_event(CutTextEvent.new(_widget));break}
|
|
1532
|
+
_widget.bind_append("<Paste>"){Arcadia.process_event(PasteTextEvent.new(_widget));break}
|
|
1533
|
+
_widget.bind_append("<Undo>"){Arcadia.process_event(UndoTextEvent.new(_widget));break}
|
|
1534
|
+
_widget.bind_append("<Redo>"){Arcadia.process_event(RedoTextEvent.new(_widget));break}
|
|
1535
|
+
_widget.bind_append("1", proc{Arcadia.process_event(InputEnterEvent.new(self,'receiver'=>_widget))})
|
|
1536
|
+
end
|
|
1537
|
+
end
|
|
1480
1538
|
|
|
1481
1539
|
module TkAutoPostMenu
|
|
1482
1540
|
|
|
@@ -1511,6 +1569,7 @@ module TkAutoPostMenu
|
|
|
1511
1569
|
@event_posting_on = false
|
|
1512
1570
|
@m_show = Hash.new
|
|
1513
1571
|
chs.each{|ch|
|
|
1572
|
+
next if ch.kind_of?(String)
|
|
1514
1573
|
ch.menu.bind_append("Map", proc{ @m_show[ch.menu] = true })
|
|
1515
1574
|
ch.menu.bind_append("Unmap", proc{ @m_show[ch.menu] = false })
|
|
1516
1575
|
ch.bind_append("Enter", proc{|x,y,rx,ry|
|
|
@@ -1570,14 +1629,23 @@ module TkAutoPostMenu
|
|
|
1570
1629
|
@posting_on=true if @event_posting_on
|
|
1571
1630
|
if @last_post && @last_post != ch.menu
|
|
1572
1631
|
@last_post.unpost
|
|
1632
|
+
# @last_post.bind_remove("1")
|
|
1573
1633
|
@last_post = nil
|
|
1574
1634
|
end
|
|
1575
1635
|
@last_post=ch.menu #if ch.state == 'active'
|
|
1576
1636
|
ch.configure('state'=>'normal')
|
|
1577
1637
|
@last_clicked = ch.menu
|
|
1638
|
+
|
|
1639
|
+
# ch.menu.bind_append("1", proc{|mx,my,mrx,mry|
|
|
1640
|
+
# if ch.menu.index("active").nil?
|
|
1641
|
+
# ch.menu.activate(ch.menu.index("@#{mry}"))
|
|
1642
|
+
# end
|
|
1643
|
+
# }, "%X %Y %x %y")
|
|
1644
|
+
|
|
1578
1645
|
#@last_post.unpost
|
|
1579
1646
|
#@last_post.post(0,0)
|
|
1580
1647
|
#@last_post.set_focus
|
|
1648
|
+
@posting_on=true if @event_posting_on
|
|
1581
1649
|
|
|
1582
1650
|
}, "%X %Y %x %y")
|
|
1583
1651
|
|
|
@@ -1598,11 +1666,6 @@ module TkAutoPostMenu
|
|
|
1598
1666
|
}).start
|
|
1599
1667
|
})
|
|
1600
1668
|
|
|
1601
|
-
|
|
1602
|
-
_widget.bind_append("1", proc{
|
|
1603
|
-
@posting_on=true if @event_posting_on
|
|
1604
|
-
})
|
|
1605
|
-
|
|
1606
1669
|
end
|
|
1607
1670
|
end
|
|
1608
1671
|
|
|
@@ -1634,6 +1697,14 @@ module TkScrollableWidget
|
|
|
1634
1697
|
@v_scroll.destroy
|
|
1635
1698
|
end
|
|
1636
1699
|
|
|
1700
|
+
def call_after_next_show_h_scroll(_proc_to_call=nil)
|
|
1701
|
+
@h_proc = _proc_to_call
|
|
1702
|
+
end
|
|
1703
|
+
|
|
1704
|
+
def call_after_next_show_v_scroll(_proc_to_call=nil)
|
|
1705
|
+
@v_proc = _proc_to_call
|
|
1706
|
+
end
|
|
1707
|
+
|
|
1637
1708
|
def add_yscrollcommand(cmd=Proc.new)
|
|
1638
1709
|
@v_scroll_command = cmd
|
|
1639
1710
|
end
|
|
@@ -1646,7 +1717,8 @@ module TkScrollableWidget
|
|
|
1646
1717
|
begin
|
|
1647
1718
|
@v_scroll.set(first,last) #if TkWinfo.mapped?(@v_scroll)
|
|
1648
1719
|
rescue Exception => e
|
|
1649
|
-
|
|
1720
|
+
Arcadia.runtime_error(e)
|
|
1721
|
+
#p "#{e.message}"
|
|
1650
1722
|
end
|
|
1651
1723
|
elsif delta == 1 || delta == 0
|
|
1652
1724
|
hide_v_scroll
|
|
@@ -1654,6 +1726,7 @@ module TkScrollableWidget
|
|
|
1654
1726
|
@v_scroll_command.call(first,last) if !@v_scroll_command.nil?
|
|
1655
1727
|
@last_y_last = last if last.to_f < 1
|
|
1656
1728
|
end
|
|
1729
|
+
|
|
1657
1730
|
end
|
|
1658
1731
|
|
|
1659
1732
|
def add_xscrollcommand(cmd=Proc.new)
|
|
@@ -1668,7 +1741,8 @@ module TkScrollableWidget
|
|
|
1668
1741
|
begin
|
|
1669
1742
|
@h_scroll.set(first,last) #if TkWinfo.mapped?(@h_scroll)
|
|
1670
1743
|
rescue Exception => e
|
|
1671
|
-
|
|
1744
|
+
Arcadia.runtime_error(e)
|
|
1745
|
+
#p "#{e.message}"
|
|
1672
1746
|
end
|
|
1673
1747
|
elsif delta == 1 || delta == 0
|
|
1674
1748
|
hide_h_scroll
|
|
@@ -1676,6 +1750,13 @@ module TkScrollableWidget
|
|
|
1676
1750
|
@h_scroll_command.call(first,last) if !@h_scroll_command.nil?
|
|
1677
1751
|
@last_x_last = last if last.to_f < 1
|
|
1678
1752
|
end
|
|
1753
|
+
if @x_proc
|
|
1754
|
+
begin
|
|
1755
|
+
@x_proc.call
|
|
1756
|
+
ensure
|
|
1757
|
+
@x_proc=nil
|
|
1758
|
+
end
|
|
1759
|
+
end
|
|
1679
1760
|
end
|
|
1680
1761
|
|
|
1681
1762
|
def show(_x=0,_y=0,_w=nil,_h=nil,_border_mode='inside')
|
|
@@ -1702,7 +1783,8 @@ module TkScrollableWidget
|
|
|
1702
1783
|
begin
|
|
1703
1784
|
arm_scroll_binding
|
|
1704
1785
|
rescue Exception => e
|
|
1705
|
-
|
|
1786
|
+
Arcadia.runtime_error(e)
|
|
1787
|
+
#p "#{e.message}"
|
|
1706
1788
|
end
|
|
1707
1789
|
end
|
|
1708
1790
|
|
|
@@ -1742,8 +1824,16 @@ module TkScrollableWidget
|
|
|
1742
1824
|
@v_scroll.pack('side' => 'right', 'fill' => 'y')
|
|
1743
1825
|
@v_scroll_on = true
|
|
1744
1826
|
@v_scroll.raise
|
|
1827
|
+
if @v_proc
|
|
1828
|
+
begin
|
|
1829
|
+
@v_proc.call
|
|
1830
|
+
ensure
|
|
1831
|
+
@v_proc=nil
|
|
1832
|
+
end
|
|
1833
|
+
end
|
|
1745
1834
|
rescue RuntimeError => e
|
|
1746
|
-
p "RuntimeError : #{e.message}"
|
|
1835
|
+
#p "RuntimeError : #{e.message}"
|
|
1836
|
+
Arcadia.runtime_error(e)
|
|
1747
1837
|
end
|
|
1748
1838
|
end
|
|
1749
1839
|
end
|
|
@@ -1755,8 +1845,16 @@ module TkScrollableWidget
|
|
|
1755
1845
|
@h_scroll.pack('side' => 'bottom', 'fill' => 'x')
|
|
1756
1846
|
@h_scroll_on = true
|
|
1757
1847
|
@h_scroll.raise
|
|
1848
|
+
if @h_proc
|
|
1849
|
+
begin
|
|
1850
|
+
@h_proc.call
|
|
1851
|
+
ensure
|
|
1852
|
+
@h_proc=nil
|
|
1853
|
+
end
|
|
1854
|
+
end
|
|
1758
1855
|
rescue RuntimeError => e
|
|
1759
|
-
p "RuntimeError : #{e.message}"
|
|
1856
|
+
#p "RuntimeError : #{e.message}"
|
|
1857
|
+
Arcadia.runtime_error(e)
|
|
1760
1858
|
end
|
|
1761
1859
|
end
|
|
1762
1860
|
end
|
|
@@ -1768,7 +1866,8 @@ module TkScrollableWidget
|
|
|
1768
1866
|
@v_scroll.unpack
|
|
1769
1867
|
@v_scroll_on = false
|
|
1770
1868
|
rescue RuntimeError => e
|
|
1771
|
-
|
|
1869
|
+
Arcadia.runtime_error(e)
|
|
1870
|
+
#p "RuntimeError : #{e.message}"
|
|
1772
1871
|
end
|
|
1773
1872
|
|
|
1774
1873
|
end
|
|
@@ -1781,7 +1880,8 @@ module TkScrollableWidget
|
|
|
1781
1880
|
@h_scroll.unpack
|
|
1782
1881
|
@h_scroll_on = false
|
|
1783
1882
|
rescue RuntimeError => e
|
|
1784
|
-
|
|
1883
|
+
Arcadia.runtime_error(e)
|
|
1884
|
+
#p "RuntimeError : #{e.message}"
|
|
1785
1885
|
end
|
|
1786
1886
|
end
|
|
1787
1887
|
end
|
data/lib/anigif.rb
ADDED
data/lib/ctags.exe
ADDED
|
Binary file
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# AniGif Package written in pure Tcl/Tk
|
|
2
|
+
#
|
|
3
|
+
# anigif.tcl v1.3 2002-09-09 (c) 2001-2002 Ryan Casey
|
|
4
|
+
#
|
|
5
|
+
# AniGif is distributed under the same license as Tcl/Tk. As of
|
|
6
|
+
# AniGif 1.3, this license is applicable to all previous versions.
|
|
7
|
+
#
|
|
8
|
+
# ############################### USAGE #################################
|
|
9
|
+
#
|
|
10
|
+
# ::anigif::anigif FILENAME WIDGET INDEX
|
|
11
|
+
# FILENAME: appropriate path and file to use for the animated gif
|
|
12
|
+
# WIDGET: a label widget to place the animated gif into
|
|
13
|
+
# DELAY: how long to wait before loading next image (Default: 100ms)
|
|
14
|
+
# INDEX: what image to begin on (first image is 0) (Default: 0)
|
|
15
|
+
#
|
|
16
|
+
# ::anigif::stop WIDGET
|
|
17
|
+
# ::anigif::restart WIDGET INDEX
|
|
18
|
+
# INDEX: defaults to next index in loop
|
|
19
|
+
# ::anigif::destroy WIDGET
|
|
20
|
+
#
|
|
21
|
+
# NOTES:
|
|
22
|
+
# There is currently a -zoom and -subsample hack to keep transparency.
|
|
23
|
+
# Anigif does not handle interlaced gifs properly. The image will look
|
|
24
|
+
# distorted.
|
|
25
|
+
# A delay of 0 renders as fast as possible, per the GIF specification.
|
|
26
|
+
# This is currently set to 40 ms to approximate the IE default.
|
|
27
|
+
# If you experience a problem with a compressed gif, try uncompressing
|
|
28
|
+
# it. Search the web for gifsicle.
|
|
29
|
+
#
|
|
30
|
+
# ############################## HISTORY #################################
|
|
31
|
+
#
|
|
32
|
+
# 1.3: Fixed error in disposal flag handling.
|
|
33
|
+
# Added handling for non-valid comment/graphic blocks.
|
|
34
|
+
# Searches for actual loop control block. If it extists, loops.
|
|
35
|
+
# Added more comments.
|
|
36
|
+
# 1.2: Now handles single playthrough gifs or gifs with partial images
|
|
37
|
+
# Fixed bug in delay time (unsigned int was being treated as signed)
|
|
38
|
+
# 1.1: Reads default timing instead of 100 ms or user-defined.
|
|
39
|
+
# You can no longer set the delay manually.
|
|
40
|
+
# 1.0: Moved all anigif variables to the anigif namespace
|
|
41
|
+
# 0.9: Initial release
|
|
42
|
+
#
|
|
43
|
+
|
|
44
|
+
namespace eval anigif {
|
|
45
|
+
|
|
46
|
+
proc anigif2 {w list delay {idx 0}} {
|
|
47
|
+
if { ![winfo exists $w] } {
|
|
48
|
+
#Cleanup
|
|
49
|
+
#???
|
|
50
|
+
destroy $w
|
|
51
|
+
return
|
|
52
|
+
} else {
|
|
53
|
+
if { $idx >= [llength $list] } {
|
|
54
|
+
set idx 0
|
|
55
|
+
if { [set ::anigif::${w}(repeat)] == 0} {
|
|
56
|
+
# Non-repeating GIF
|
|
57
|
+
::anigif::stop $w
|
|
58
|
+
return
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
set dispflag [lindex [set ::anigif::${w}(disposal)] $idx]
|
|
62
|
+
switch "$dispflag" {
|
|
63
|
+
"000" {
|
|
64
|
+
# Do nothing
|
|
65
|
+
}
|
|
66
|
+
"001" {
|
|
67
|
+
# Do not dispose
|
|
68
|
+
}
|
|
69
|
+
"100" {
|
|
70
|
+
# Restore to background
|
|
71
|
+
[set ::anigif::${w}(curimage)] blank
|
|
72
|
+
}
|
|
73
|
+
"101" {
|
|
74
|
+
# Restore to previous - not supported
|
|
75
|
+
# As recommended, since this is not supported, it is set to blank
|
|
76
|
+
[set ::anigif::${w}(curimage)] blank
|
|
77
|
+
}
|
|
78
|
+
default { puts "no match: $dispflag" }
|
|
79
|
+
}
|
|
80
|
+
[set ::anigif::${w}(curimage)] copy [lindex $list $idx] -subsample 2 2
|
|
81
|
+
if { [lindex $delay $idx] == 0 } {
|
|
82
|
+
::anigif::stop $w
|
|
83
|
+
return
|
|
84
|
+
}
|
|
85
|
+
update
|
|
86
|
+
set ::anigif::${w}(asdf) "::anigif::anigif2 $w [list $list]"
|
|
87
|
+
set ::anigif::${w}(loop) [after [lindex $delay $idx] "[set ::anigif::${w}(asdf)] [list $delay] [expr {$idx + 1}]"]
|
|
88
|
+
set ::anigif::${w}(idx) [incr idx]
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
proc anigif {fnam w {idx 0}} {
|
|
93
|
+
set n 0
|
|
94
|
+
set images {}
|
|
95
|
+
set delay {}
|
|
96
|
+
|
|
97
|
+
set fin [open $fnam r]
|
|
98
|
+
fconfigure $fin -translation binary
|
|
99
|
+
set data [read $fin [file size $fnam]]
|
|
100
|
+
close $fin
|
|
101
|
+
|
|
102
|
+
# Find Loop Record
|
|
103
|
+
set start [string first "\x21\xFF\x0B" $data]
|
|
104
|
+
|
|
105
|
+
if {$start < 0} {
|
|
106
|
+
set repeat 0
|
|
107
|
+
} else {
|
|
108
|
+
set repeat 1
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
# Find Control Records
|
|
112
|
+
set start [string first "\x21\xF9\x04" $data]
|
|
113
|
+
while {![catch "image create photo xpic$n$w \
|
|
114
|
+
-file ${fnam} \
|
|
115
|
+
-format \{gif89 -index $n\}"]} {
|
|
116
|
+
set stop [string first "\x00" $data [expr {$start + 1}]]
|
|
117
|
+
if {$stop < $start} {
|
|
118
|
+
break
|
|
119
|
+
}
|
|
120
|
+
set record [string range $data $start $stop]
|
|
121
|
+
binary scan $record @4c1 thisdelay
|
|
122
|
+
if {[info exists thisdelay]} {
|
|
123
|
+
|
|
124
|
+
# Change to unsigned integer
|
|
125
|
+
set thisdelay [expr {$thisdelay & 0xFF}];
|
|
126
|
+
|
|
127
|
+
binary scan $record @2b3b3b1b1 -> disposalval userinput transflag
|
|
128
|
+
|
|
129
|
+
lappend images pic$n$w
|
|
130
|
+
image create photo pic$n$w
|
|
131
|
+
pic$n$w copy xpic$n$w -zoom 2 2
|
|
132
|
+
image delete xpic$n$w
|
|
133
|
+
lappend disposal $disposalval
|
|
134
|
+
|
|
135
|
+
# Convert hundreths to thousandths for after
|
|
136
|
+
set thisdelay [expr {$thisdelay * 10}]
|
|
137
|
+
|
|
138
|
+
# If 0, set to fastest (25 ms min to seem to match browser default)
|
|
139
|
+
if {$thisdelay == 0} {set thisdelay 100}
|
|
140
|
+
|
|
141
|
+
lappend delay $thisdelay
|
|
142
|
+
unset thisdelay
|
|
143
|
+
|
|
144
|
+
incr n
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if {($start >= 0) && ($stop >= 0)} {
|
|
148
|
+
set start [string first "\x21\xF9\x04" $data [expr {$stop + 1}]]
|
|
149
|
+
} else {
|
|
150
|
+
break
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
set ::anigif::${w}(repeat) $repeat
|
|
154
|
+
set ::anigif::${w}(delay) $delay
|
|
155
|
+
set ::anigif::${w}(disposal) $disposal
|
|
156
|
+
set ::anigif::${w}(curimage) [image create photo]
|
|
157
|
+
[set ::anigif::${w}(curimage)] blank
|
|
158
|
+
[set ::anigif::${w}(curimage)] copy pic0${w} -subsample 2 2
|
|
159
|
+
$w configure -image [set ::anigif::${w}(curimage)]
|
|
160
|
+
|
|
161
|
+
anigif2 $w $images $delay $idx
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
proc stop {w} {
|
|
165
|
+
catch {
|
|
166
|
+
after cancel [set ::anigif::${w}(loop)]
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
proc restart {w {idx -1}} {
|
|
171
|
+
if {$idx == -1} {
|
|
172
|
+
if { [lindex ::anigif::${w}(delay) $idx] < 0 } {
|
|
173
|
+
set idx 0
|
|
174
|
+
} else {
|
|
175
|
+
set idx [set ::anigif::${w}(idx)]
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
catch {
|
|
179
|
+
::anigif::stop $w
|
|
180
|
+
eval "[set ::anigif::${w}(asdf)] [list [set ::anigif::${w}(delay)]] $idx"
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
proc destroy {w} {
|
|
185
|
+
catch {
|
|
186
|
+
::anigif::stop $w
|
|
187
|
+
set wlength [string length $w]
|
|
188
|
+
foreach imagename [image names] {
|
|
189
|
+
if {[string equal [string range $imagename [string first "." $imagename] end] $w]} {
|
|
190
|
+
image delete $imagename
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
unset ::anigif::${w}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
package provide anigif 1.3
|