Class: RUtilAnts::GUI::TextProgressDialog

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

Overview

Text 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, iText, iParameters = {}) ⇒ TextProgressDialog

Constructor

Parameters
  • iParentWindow (Wx::Window): Parent window

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

  • iText (String): The text to display

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



222
223
224
225
# File 'lib/rUtilAnts/GUI.rb', line 222

def initialize(iParentWindow, iCodeToExecute, iText, iParameters = {})
  @Text = iText
  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



231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/rUtilAnts/GUI.rb', line 231

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

  # Create components
  @STText = Wx::StaticText.new(rPanel, Wx::ID_ANY, @Text, :style => Wx::ALIGN_CENTRE)

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

  return rPanel
end

#setText(iText) ⇒ Object

Set the text

Parameters
  • iText (String): The text



249
250
251
252
253
# File 'lib/rUtilAnts/GUI.rb', line 249

def setText(iText)
  @STText.label = iText
  self.fit
  refreshState
end