Class FaceDialog1p
In: dialogs.rb
Parent: FXDialogBox

Methods

Attributes

csys  [RW]  For 1 point referenced face
meshx  [RW]  unused attr_accessor :r0, :r1, :r2, :r3
meshy  [RW]  unused attr_accessor :r0, :r1, :r2, :r3
okButton  [RW] 
plane  [RW] 
planesel  [RW] 
ref  [RW]  For 1 point referenced face
refLabel  [RW] 
refattr  [RW] 
reftext  [RW] 
reftext  [RW]  For 1 point referenced face
selection  [RW]  For 1 point referenced face
xlength  [RW] 
ylength  [RW] 

Public Class methods

[Source]

# File dialogs.rb, line 575
    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)
       frame6 = 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)
       @xlength.setTipText("Input the desired length in the x direction\nIf you choose the yz-plane it will be the y direction")
       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(matrix2, "x mesh lines (2 or more):", nil, LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
       @meshx = FXTextField.new(matrix2, 8, nil, 0,
         JUSTIFY_RIGHT|FRAME_SUNKEN|FRAME_THICK|LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
       FXLabel.new(matrix2, "y mesh lines (2 or more):", nil, LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
       @meshy = FXTextField.new(matrix2, 8, nil, 0,
         JUSTIFY_RIGHT|FRAME_SUNKEN|FRAME_THICK|LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)



   @planesel = FXDataTarget.new(0)
   gp = FXGroupBox.new(frame4, "Create in plane",
           LAYOUT_SIDE_TOP|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 0)
   FXRadioButton.new(gp, "xy\tChoose which plane you want to use\txy-plane", @planesel, FXDataTarget::ID_OPTION+0,
           ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP)
   FXRadioButton.new(gp, "xz\t\txz-plane", @planesel, FXDataTarget::ID_OPTION+1,
           ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP)
   FXRadioButton.new(gp, "yz\t\tyz-plane", @planesel, FXDataTarget::ID_OPTION+2,
           JUSTIFY_LEFT|JUSTIFY_TOP|ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP)

   @planesel.handle(self, MKUINT(FXDataTarget::ID_OPTION+0, SEL_COMMAND), nil)
   @planesel.connect(SEL_COMMAND, method(:onPlaneChange))



       # ref info
       FXLabel.new(frame2, "Reference: ", nil, LAYOUT_SIDE_BOTTOM|LAYOUT_CENTER_Y)
       @reftext = FXLabel.new(frame5, "csys0,p0", nil, LAYOUT_SIDE_BOTTOM|LAYOUT_CENTER_Y)
       #buttons
       @okButton = FXButton.new(frame6, "  OK  ", nil, self, FXDialogBox::ID_ACCEPT,
         FRAME_RAISED|FRAME_THICK|LAYOUT_SIDE_RIGHT|LAYOUT_RIGHT|LAYOUT_CENTER_Y)
       FXButton.new(frame6, "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"
       # @refattr.text = "0"
       @meshx.text = "5"
       @meshy.text = "5"
       @plane = "xy"
    end

Public Instance methods

to get plane attribute right: xy, xz and yz

[Source]

# File dialogs.rb, line 638
   def onPlaneChange(sender, sel, ptr)
      case sender.to_s
         when "0"
            @plane = "xy"
         when "1"
            @plane = "xz"
         when "2"
            @plane = "yz"
      end
   end

[Source]

# File dialogs.rb, line 648
   def setdefault
       # default values in text fields
       @xlength.text = $defaults['facexlength'].to_s
       @ylength.text = $defaults['faceylength'].to_s
       # @refattr.text = defaults['facerefattr'].to_s
       @meshx.text = $defaults['facemeshx'].to_s
       @meshy.text = $defaults['facemeshy'].to_s
       # this default is hard coded. But it is pretty obvious that it should be xy-plane
       @planesel.handle(self, MKUINT(FXDataTarget::ID_OPTION+0, SEL_COMMAND), nil)
       @plane = "xy"
   end

[Validate]