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.



1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
# File 'lib/a-core.rb', line 1138

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'
    anchor 'w'
    place('width' => '210','x' => 100,'y' => 95,'height' => 25)
  }

  @tkLabelCredits = TkLabel.new(self){
    text  'Contributors: Roger D. Pack'
    background  _bgcolor
    foreground  '#ffffff'
    font Arcadia.instance['conf']['splash.credits.font']
    justify  'left'
    anchor 'w'
    place('width' => '210','x' => 100,'y' => 115,'height' => 25)
  }

  @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' => 45)
  }
  @progress  = TkVariable.new
  reset
  _width = 380
  _height = 240
  #_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("ButtonPress-1", proc{self.destroy})
  bind("Double-Button-1", proc{self.destroy})
  info = TkApplication.sys_info
  set_sysinfo(info)
end

Instance Attribute Details

#progressObject (readonly)

Returns the value of attribute progress.



1137
1138
1139
# File 'lib/a-core.rb', line 1137

def progress
  @progress
end

Instance Method Details

#labelStep(_txt) ⇒ Object



1254
1255
1256
1257
# File 'lib/a-core.rb', line 1254

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

#last_step(_txt = nil) ⇒ Object



1259
1260
1261
1262
# File 'lib/a-core.rb', line 1259

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

#next_step(_txt = nil) ⇒ Object



1249
1250
1251
1252
# File 'lib/a-core.rb', line 1249

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

#resetObject



1245
1246
1247
# File 'lib/a-core.rb', line 1245

def reset
  @progress.value = -1
end

#set_progress(_max = 10) ⇒ Object



1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
# File 'lib/a-core.rb', line 1233

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



1229
1230
1231
# File 'lib/a-core.rb', line 1229

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