Class: MCLimit::AdminDialog

Inherits:
Wx::Dialog
  • Object
show all
Defined in:
lib/mc-limit/admin.rb

Instance Method Summary collapse

Constructor Details

#initialize(parent, value) ⇒ AdminDialog

Returns a new instance of AdminDialog.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/mc-limit/admin.rb', line 5

def initialize(parent, value)
  super( parent, -1, 'Minecraft Limiter Administration' )

  sizer = Wx::FlexGridSizer.new( 1, 2, 0, 0 )
  label = Wx::StaticText.new( self, -1, 'Minutes of game play remaining:' )
  sizer.add( label, 0, Wx::ALL, 4 )
  @expand = Wx::SpinCtrl.new( self )
  @expand.set_range(0, 1440)
  @expand.set_value(value)
  @expand.set_selection(-1, -1)
  sizer.add( @expand, 0, Wx::ALL, 4 )

  topsizer = Wx::GridSizer.new( 2, 1, 0, 0 )
  topsizer.add( sizer, 0, Wx::ALL, 4 )
  topsizer.add( create_std_dialog_button_sizer( Wx::OK | Wx::CANCEL ), 0, Wx::ALL, 4 )
  self.set_sizer( topsizer )
  topsizer.set_size_hints( self )
  topsizer.fit( self )
  @expand.set_focus
end

Instance Method Details

#valueObject



26
27
28
# File 'lib/mc-limit/admin.rb', line 26

def value
  @expand.get_value
end