Class: RUtilAnts::GUI::BitmapProgressDialog

Inherits:
ProgressDialog
  • Object
show all
Defined in:
lib/rUtilAnts/GUI.rb

Overview

Bitmap progress dialog

Constant Summary

Constants inherited from ProgressDialog

ProgressDialog::DEFAULT_UNDETERMINED_RANGE

Instance Attribute Summary

Attributes inherited from ProgressDialog

#Cancelled, #Determined

Instance Method Summary collapse

Methods inherited from ProgressDialog

#incRange, #incValue, #pulse, #refreshState, #setRange, #setValue

Constructor Details

#initialize(iParentWindow, iCodeToExecute, iBitmap, iParameters = {}) ⇒ BitmapProgressDialog

Constructor

Parameters:

  • iParentWindow (Wx::Window): Parent window

  • iCodeToExecute (Proc): The code to execute that will update the progression

  • iBitmap (Wx::Bitmap): The bitmap to display (can be nil)

  • iParameters (map<Symbol,Object>): Additional parameters (check RUtilAnts::GUI::ProgressDialog#initialize documentation):



272
273
274
275
# File 'lib/rUtilAnts/GUI.rb', line 272

def initialize(iParentWindow, iCodeToExecute, iBitmap, iParameters = {})
  @Bitmap = iBitmap
  super(iParentWindow, iCodeToExecute, iParameters)
end

Instance Method Details

#getTitlePanelObject

Get the panel to display as title

Return:

  • Wx::Panel: The panel to use as a title



281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# File 'lib/rUtilAnts/GUI.rb', line 281

def getTitlePanel
  rPanel = Wx::Panel.new(self)

  # Create components
  if (@Bitmap == nil)
    @SBBitmap = Wx::StaticBitmap.new(rPanel, Wx::ID_ANY, Wx::Bitmap.new)
  else
    @SBBitmap = Wx::StaticBitmap.new(rPanel, Wx::ID_ANY, @Bitmap)
  end

  # Put them into sizers
  lMainSizer = Wx::BoxSizer.new(Wx::VERTICAL)
  lMainSizer.add_item(@SBBitmap, :flag => Wx::GROW, :proportion => 1)
  rPanel.sizer = lMainSizer

  return rPanel
end

#setBitmap(iBitmap) ⇒ Object

Set the bitmap

Parameters:

  • iBitmap (Wx::Bitmap): The bitmap



303
304
305
306
307
# File 'lib/rUtilAnts/GUI.rb', line 303

def setBitmap(iBitmap)
  @SBBitmap.bitmap = iBitmap
  self.fit
  refreshState
end