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.



825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
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
# File 'lib/a-core.rb', line 825

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)
  }
  @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' => 175,'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' => 146,'height' => 19)
  }
  @progress  = TkVariable.new
  reset
  _width = 340
  _height = 210
  #_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.



824
825
826
# File 'lib/a-core.rb', line 824

def progress
  @progress
end

Instance Method Details

#labelStep(_txt) ⇒ Object



927
928
929
930
# File 'lib/a-core.rb', line 927

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

#last_step(_txt = nil) ⇒ Object



932
933
934
935
# File 'lib/a-core.rb', line 932

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

#next_step(_txt = nil) ⇒ Object



922
923
924
925
# File 'lib/a-core.rb', line 922

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

#resetObject



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

def reset
  @progress.value = -1
end

#set_progress(_max = 10) ⇒ Object



907
908
909
910
911
912
913
914
915
916
# File 'lib/a-core.rb', line 907

def set_progress(_max=10)
  @max = _max
  Tk::BWidget::ProgressBar.new(self, :width=>150, :height=>10,
  :background=>'black',
  :foreground=>'yellow',
  :variable=>@progress,
  :borderwidth=>0,
  :relief=>'flat',
  :maximum=>_max).place('width' => '150','x' => 145,'y' => 95,'height' => 15)
end

#set_sysinfo(_info) ⇒ Object



903
904
905
# File 'lib/a-core.rb', line 903

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