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, #inc_value, #pulse, #refreshState, #setValue, #set_range

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):



267
268
269
270
# File 'lib/rUtilAnts/GUI.rb', line 267

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



276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
# File 'lib/rUtilAnts/GUI.rb', line 276

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



298
299
300
301
302
# File 'lib/rUtilAnts/GUI.rb', line 298

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