Class FaceDialog1f
In: dialogs.rb
Parent: FXDialogBox

Methods

Attributes

adjust  [RW]  checkbox for adjust, enabled by default
adjustButton  [RW]  checkbox for adjust, enabled by default
adjustTarget  [RW]  checkbox for adjust, enabled by default
csys  [RW]  unused attr_accessor :r0, :r1, :r2, :r3
okButton  [RW]  unused attr_accessor :r0, :r1, :r2, :r3
ref  [RW]  unused attr_accessor :r0, :r1, :r2, :r3
refLabel  [RW]  unused attr_accessor :r0, :r1, :r2, :r3
refattr  [RW]  checkbox for adjust, enabled by default
reftext  [RW] 
selection  [RW]  For face referenced face
xlength  [RW] 
xpos  [RW] 
ylength  [RW] 
ypos  [RW] 

Public Class methods

[Source]

# File dialogs.rb, line 754
    def initialize(owner,title)
       super(owner, title)
       # Set up its contents
       frame1=FXVerticalFrame.new(self, LAYOUT_FILL_X|LAYOUT_FILL_Y)
       frame2 = FXHorizontalFrame.new(frame1, LAYOUT_FILL_X)
       matrix1 = FXMatrix.new(frame1, 2,
         MATRIX_BY_COLUMNS|LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y) 
       frame3 = FXHorizontalFrame.new(frame1, LAYOUT_FILL_X)
       matrix2 = FXMatrix.new(frame1, 2,
         MATRIX_BY_COLUMNS|LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y) 
       frame4 = FXHorizontalFrame.new(frame1, LAYOUT_FILL_X)
       frame5 = FXHorizontalFrame.new(frame1, LAYOUT_FILL_X)
       # label
       FXLabel.new(frame2, "Face attributes:", nil, LAYOUT_SIDE_BOTTOM|LAYOUT_CENTER_Y)
       FXLabel.new(matrix1, "x length:                ", nil, LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
       @xlength = FXTextField.new(matrix1, 8, nil, 0,
         JUSTIFY_RIGHT|FRAME_SUNKEN|FRAME_THICK|LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
       FXLabel.new(matrix1, "y length:                ", nil, LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
       @ylength = FXTextField.new(matrix1, 8, nil, 0,
         JUSTIFY_RIGHT|FRAME_SUNKEN|FRAME_THICK|LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
       FXLabel.new(frame3, "Face center position", nil, LAYOUT_SIDE_BOTTOM|LAYOUT_CENTER_Y)
       FXLabel.new(matrix2, "x position:", nil, LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
       @xpos = FXTextField.new(matrix2, 8, nil, 0,
         JUSTIFY_RIGHT|FRAME_SUNKEN|FRAME_THICK|LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
       FXLabel.new(matrix2, "y position:", nil, LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
       @ypos = FXTextField.new(matrix2, 8, nil, 0,
         JUSTIFY_RIGHT|FRAME_SUNKEN|FRAME_THICK|LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
       FXLabel.new(matrix2, "Reference point (0 to 3):", nil, LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
       @refattr = FXTextField.new(matrix2, 8, nil, 0,
         JUSTIFY_RIGHT|FRAME_SUNKEN|FRAME_THICK|LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
       # adjust check box
       @adjustTarget = FXDataTarget.new(true)
       @adjustButton = FXCheckButton.new(matrix2, "Adjust position", @adjustTarget, FXDataTarget::ID_VALUE, CHECKBUTTON_NORMAL)
       @adjustTarget.connect(SEL_COMMAND, method(:onAdjustChange))

       # ref info
       FXLabel.new(frame4, "Reference: ", nil, LAYOUT_SIDE_BOTTOM|LAYOUT_CENTER_Y)
       @reftext = FXLabel.new(frame4, "f0", nil, LAYOUT_SIDE_BOTTOM|LAYOUT_CENTER_Y)
       #buttons
       @okButton = FXButton.new(frame5, "  OK  ", nil, self, FXDialogBox::ID_ACCEPT,
         FRAME_RAISED|FRAME_THICK|LAYOUT_SIDE_RIGHT|LAYOUT_RIGHT|LAYOUT_CENTER_Y)
       FXButton.new(frame5, "Cancel", nil, self, FXDialogBox::ID_CANCEL,
         FRAME_RAISED|FRAME_THICK|LAYOUT_SIDE_RIGHT|LAYOUT_RIGHT|LAYOUT_CENTER_Y)
       # default values in text fields
       @xlength.text = "10"
       @ylength.text = "10"
       @xpos.text = "5.0"
       @ypos.text = "5.0"
       @refattr.text = "0"
       @adjust = 1
    end

Public Instance methods

[Source]

# File dialogs.rb, line 805
    def onAdjustChange(sender, sel, ptr)
       if sender.value
          @adjust = 1
       else
          @adjust = 0
       end
    end

[Source]

# File dialogs.rb, line 812
   def setAdjust(adjust)
      if adjust == 1
         @adjustCheck
      end
   end

[Source]

# File dialogs.rb, line 820
   def setdefault
       # default values in text fields
       @xlength.text = $defaults['facefacexlength'].to_s
       @ylength.text = $defaults['facefaceylength'].to_s
       @xpos.text = $defaults['facefacexpos'].to_s
       @ypos.text = $defaults['facefaceypos'].to_s
       @refattr.text = $defaults['facefacerefattr'].to_s
       @adjustTarget.value = true
       updateCheck
   end

[Source]

# File dialogs.rb, line 817
   def updateCheck
      @adjustTarget.handle(self, MKUINT(FXDataTarget::ID_VALUE, SEL_COMMAND), nil)
   end

[Validate]