Class: ArcadiaAboutSplash

Inherits:
TkToplevel
  • Object
show all
Defined in:
lib/a-core.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeArcadiaAboutSplash

Returns a new instance of ArcadiaAboutSplash.



841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
# File 'lib/a-core.rb', line 841

def initialize
  #_bgcolor = '#B83333'
  _bgcolor = '#000000'
  super()
  relief 'groove'
  #relief 'flat'
  background  _bgcolor
  highlightbackground  _bgcolor
  highlightthickness  1
  borderwidth 2
  withdraw 
  overrideredirect(true)
  
  @tkLabel3 = TkLabel.new(self){
    image  TkPhotoImage.new('format'=>'GIF','data' =>A_LOGO_GIF)
    background  _bgcolor
    place('x'=> 20,'y' => 20)
  }
  @tkLabel1 = TkLabel.new(self){
    text  'Arcadia'
    background  _bgcolor
    foreground  '#ffffff'
    font Arcadia.conf('splash.title.font')
    justify  'left'
    place('width' => '190','x' => 110,'y' => 10,'height' => 25)
  }
  @tkLabelRuby = TkLabel.new(self){
    image TkPhotoImage.new('data' =>RUBY_DOCUMENT_GIF)
    background  _bgcolor
    place('x'=> 150,'y' => 40)
  }
  @tkLabel2 = TkLabel.new(self){
    text  'Ruby ide'
    background  _bgcolor
    foreground  '#ffffff'
    font Arcadia.instance['conf']['splash.subtitle.font']
    justify  'left'
    place('width' => '90','x' => 170,'y' => 40,'height' => 19)
  }
  @tkLabelVersion = TkLabel.new(self){
    text  'version: '+$arcadia['applicationParams'].version
    background  _bgcolor
    foreground  '#ffffff'
    font Arcadia.instance['conf']['splash.version.font']
    justify  'left'
    place('width' => '120','x' => 150,'y' => 65,'height' => 19)
  }
  @tkLabel21 = TkLabel.new(self){
    text  'by Antonio Galeone - 2004/2009'
    background  _bgcolor
    foreground  '#ffffff'
    font Arcadia.instance['conf']['splash.credits.font']
    justify  'left'
    place('width' => '210','x' => 100,'y' => 95,'height' => 19)
  }
  @tkLabelStep = TkLabel.new(self){
    text  ''
    background  _bgcolor
    foreground  'yellow'
    font Arcadia.instance['conf']['splash.banner.font']
    justify  'left'
    anchor  'w'
    place('width'=>-5,'relwidth' => 1,'x' => 5,'y' => 160,'height' => 19)
  }
  @progress  = TkVariable.new
  reset
  _width = 340
  _height = 200
  #_width = 0;_height = 0
  _x = TkWinfo.screenwidth(self)/2 -  _width / 2
  _y = TkWinfo.screenheight(self)/2 -  _height / 2
  geometry = _width.to_s+'x'+_height.to_s+'+'+_x.to_s+'+'+_y.to_s
  Tk.tk_call('wm', 'geometry', self, geometry )
  bind("Double-Button-1", proc{self.destroy})
  info = "Ruby version = #{RUBY_VERSION} - TclTk version = #{Arcadia.instance.tcltk_info.level}"
  set_sysinfo(info)
end

Instance Attribute Details

#progressObject (readonly)

Returns the value of attribute progress.



840
841
842
# File 'lib/a-core.rb', line 840

def progress
  @progress
end

Instance Method Details

#labelStep(_txt) ⇒ Object



944
945
946
947
# File 'lib/a-core.rb', line 944

def labelStep(_txt)
  @tkLabelStep.text = _txt
  Tk.update
end

#last_step(_txt = nil) ⇒ Object



949
950
951
952
# File 'lib/a-core.rb', line 949

def last_step(_txt = nil)
  @progress.numeric = @max
  labelStep(_txt) if _txt
end

#next_step(_txt = nil) ⇒ Object



939
940
941
942
# File 'lib/a-core.rb', line 939

def next_step(_txt = nil)
  @progress.numeric += 1
  labelStep(_txt) if _txt
end

#resetObject



935
936
937
# File 'lib/a-core.rb', line 935

def reset
  @progress.value = -1
end

#set_progress(_max = 10) ⇒ Object



923
924
925
926
927
928
929
930
931
932
933
# File 'lib/a-core.rb', line 923

def set_progress(_max=10)
  @max = _max
  Tk::BWidget::ProgressBar.new(self, :width=>150, :height=>10,
  :background=>'black',
  :troughcolor=>'black',
  :foreground=>'#a11934',
  :variable=>@progress,
  :borderwidth=>0,
  :relief=>'flat',
  :maximum=>_max).place('relwidth' => '1','y' => 146,'height' => 2)
end

#set_sysinfo(_info) ⇒ Object



919
920
921
# File 'lib/a-core.rb', line 919

def set_sysinfo(_info)
  @tkLabelStep.text(_info)
end