Class: Watobo::Gui::EditScopeDialog

Inherits:
FXDialogBox
  • Object
show all
Includes:
Responder
Defined in:
lib/watobo/gui/edit_scope_dialog.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(owner, prefs) ⇒ EditScopeDialog

Returns a new instance of EditScopeDialog.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/watobo/gui/edit_scope_dialog.rb', line 18

def initialize(owner, prefs)
  #super(owner, "Edit Target Scope", DECOR_TITLE|DECOR_BORDER, :width => 300, :height => 425)
  super(owner, "Edit Target Scope", DECOR_ALL, :width => 350, :height => 425)
  
  @scope = Hash.new

  FXMAPFUNC(SEL_COMMAND, ID_ACCEPT, :onAccept)

  base_frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)

  #  puts "create scopeframe with scope:"
  # @project.scope
  @defineScopeFrame = DefineScopeFrame.new(base_frame, prefs)

  buttons_frame = FXHorizontalFrame.new(base_frame,
  :opts => LAYOUT_FILL_X|LAYOUT_SIDE_TOP)

  @finishButton = FXButton.new(buttons_frame, "Accept" ,  nil, nil, :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
  @finishButton.enable
  @finishButton.connect(SEL_COMMAND) do |sender, sel, item|
  #self.handle(self, FXSEL(SEL_COMMAND, ID_CANCEL), nil)
    self.handle(self, FXSEL(SEL_COMMAND, ID_ACCEPT), nil)
  end

  @cancelButton = FXButton.new(buttons_frame, "Cancel" ,
  :target => self, :selector => FXDialogBox::ID_CANCEL,
  :opts => BUTTON_NORMAL|LAYOUT_RIGHT)

end

Instance Attribute Details

#scopeObject (readonly)

Returns the value of attribute scope.



8
9
10
# File 'lib/watobo/gui/edit_scope_dialog.rb', line 8

def scope
  @scope
end

Instance Method Details

#onAccept(sender, sel, event) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/watobo/gui/edit_scope_dialog.rb', line 9

def onAccept(sender, sel, event)

  Watobo::Scope.set @defineScopeFrame.getScope()

  getApp().stopModal(self, 1)
  self.hide()
  return 1
end