Class CsysDialog0p
In: dialogs.rb
Parent: FXDialogBox

Methods

new   setdefault  

Attributes

csystype  [RW] 
okButton  [RW]  attr_accessor :pop, :normaloption, :cyloption, :sphericaloption, :gp_datatarget unused attr_accessor :r0, :r1, :r2, :r3
refattr  [RW] 
selection  [RW]  For 0 point referenced csys
size  [RW] 
xpos  [RW] 
xrot  [RW] 
ypos  [RW] 
yrot  [RW] 
zpos  [RW] 
zrot  [RW] 

Public Class methods

[Source]

# File dialogs.rb, line 117
   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, "Coordinate system attributes:", nil, LAYOUT_SIDE_BOTTOM|LAYOUT_CENTER_Y)

      FXLabel.new(matrix1, "x position:                ", nil, LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
      @xpos = FXTextField.new(matrix1, 8, nil, 0,
        JUSTIFY_RIGHT|FRAME_SUNKEN|FRAME_THICK|LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)

      FXLabel.new(matrix1, "y position:                ", nil, LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
      @ypos = FXTextField.new(matrix1, 8, nil, 0,
        JUSTIFY_RIGHT|FRAME_SUNKEN|FRAME_THICK|LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
        
      FXLabel.new(matrix1, "z position:                ", nil, LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
      @zpos = FXTextField.new(matrix1, 8, nil, 0,
        JUSTIFY_RIGHT|FRAME_SUNKEN|FRAME_THICK|LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)

      FXLabel.new(frame3, "Rotation (along each axis):", nil, LAYOUT_SIDE_BOTTOM|LAYOUT_CENTER_Y)
      FXLabel.new(matrix2, "x rotation:", nil, LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
      @xrot = FXTextField.new(matrix2, 8, nil, 0,
        JUSTIFY_RIGHT|FRAME_SUNKEN|FRAME_THICK|LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
      FXLabel.new(matrix2, "y rotation:", nil, LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
      @yrot = FXTextField.new(matrix2, 8, nil, 0,
        JUSTIFY_RIGHT|FRAME_SUNKEN|FRAME_THICK|LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
      FXLabel.new(matrix2, "z rotation:", nil, LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
      @zrot = FXTextField.new(matrix2, 8, nil, 0,
        JUSTIFY_RIGHT|FRAME_SUNKEN|FRAME_THICK|LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
??
      FXLabel.new(matrix2, "Coordinate system size:", nil, LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)
      @size = FXTextField.new(matrix2, 8, nil, 0,
        JUSTIFY_RIGHT|FRAME_SUNKEN|FRAME_THICK|LAYOUT_SIDE_LEFT|LAYOUT_CENTER_Y)

   @csystype = FXDataTarget.new(0)
   gp = FXGroupBox.new(frame4, "Coordinate system type",
           LAYOUT_SIDE_TOP|FRAME_GROOVE|LAYOUT_FILL_X, 0, 0, 0, 0)
   FXRadioButton.new(gp, "Normal (cartesian)\tChoose coordinate system type\tCartesian coordinate system", @csystype, FXDataTarget::ID_OPTION+0,
           ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP)
   FXRadioButton.new(gp, "Cylindrical\t\tCylindrical coordinate system", @csystype, FXDataTarget::ID_OPTION+1,
           ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP)
   FXRadioButton.new(gp, "Spherical\t\tSpherical coordinate system", @csystype, FXDataTarget::ID_OPTION+2,
           JUSTIFY_LEFT|JUSTIFY_TOP|ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP)

   @csystype.handle(self, MKUINT(FXDataTarget::ID_OPTION+1, SEL_COMMAND), nil)
      
      FXLabel.new(frame5, "Reference: csys0", 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
      @xpos.text = "0"
      @ypos.text = "0"
      @zpos.text = "0"
      @xrot.text = "0.0"
      @yrot.text = "0.0"
      @zrot.text = "0.0"
      @size.text = "10.0"
      @csystype.handle(self, MKUINT(FXDataTarget::ID_OPTION+1, SEL_COMMAND), nil)
      # @refattr.text = "0"
   end

Public Instance methods

[Source]

# File dialogs.rb, line 215
   def setdefault
       # default values in text fields
       @xpos.text = $defaults['csysxpos'].to_s
       @ypos.text = $defaults['csysypos'].to_s
       @zpos.text = $defaults['csyszpos'].to_s
       @xrot.text = $defaults['csysxrot'].to_s
       @yrot.text = $defaults['csysyrot'].to_s
       @zrot.text = $defaults['csyszrot'].to_s
       @size.text = $defaults['csyssize'].to_s
       case $defaults['csystype']
          when "normal"
             csysint = 0
          when "cyl"
             csysint = 1
          when "spherical"
             csysint = 2
       end
       @csystype.handle(self, MKUINT(FXDataTarget::ID_OPTION+csysint, SEL_COMMAND), nil)
   end

[Validate]