Sha256: a1a9720b8a91bd198a513d601c66fdc99aa2f13b0f545a20f02f6dc5d52a1c6d

Contents?: true

Size: 1.43 KB

Versions: 13

Compression:

Stored size: 1.43 KB

Contents


class FXWarningBox < FXDialogBox
  def initialize(parent, text)
      super( parent, "Warning", DECOR_ALL, 0, 0, 400, 130)
      # Frame
      s = FXVerticalFrame.new(self,
			      LAYOUT_SIDE_TOP|LAYOUT_FILL_X)

      f = FXHorizontalFrame.new(s, LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y)

      font = FXFont.new(app, "Helvetica", 30)
      oops = FXLabel.new(f, "!", nil, 0, LAYOUT_SIDE_LEFT|LAYOUT_FILL_X|
			 LAYOUT_CENTER_Y)
      oops.frameStyle = FRAME_RAISED|FRAME_THICK
      oops.baseColor = 'dark grey'
      oops.textColor = 'red'
      oops.padLeft = oops.padRight = 15
      oops.shadowColor = 'black'
      oops.borderColor = 'white'
      oops.font = font

      t = FXText.new(f)
      t.text = text
      t.visibleRows = 4
      t.visibleColumns = 80
      t.backColor = f.backColor
      t.disable

      # Separator
      FXHorizontalSeparator.new(s,
				LAYOUT_SIDE_TOP|LAYOUT_FILL_X|SEPARATOR_GROOVE)

      # Bottom buttons
      buttons = FXHorizontalFrame.new(s,
				      LAYOUT_SIDE_BOTTOM|FRAME_NONE|
				      LAYOUT_FILL_X|PACK_UNIFORM_WIDTH)
      # Accept
      yes = FXButton.new(buttons, "&Yes", nil, self, FXDialogBox::ID_ACCEPT,
			 FRAME_RAISED|FRAME_THICK|LAYOUT_FILL_X|
			 LAYOUT_RIGHT|LAYOUT_CENTER_Y)

      # Cancel
      no = FXButton.new(buttons, "&No", nil, self, FXDialogBox::ID_CANCEL,
			FRAME_RAISED|FRAME_THICK|LAYOUT_FILL_X|
			LAYOUT_RIGHT|LAYOUT_CENTER_Y)
      no.setDefault
      no.setFocus
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ifmapper-1.2.1 lib/IFMapper/FXWarningBox.rb
ifmapper-1.2.0 lib/IFMapper/FXWarningBox.rb
ifmapper-1.1.6 lib/IFMapper/FXWarningBox.rb
ifmapper-1.1.5 lib/IFMapper/FXWarningBox.rb
ifmapper-1.1.4 lib/IFMapper/FXWarningBox.rb
ifmapper-1.1.3 lib/IFMapper/FXWarningBox.rb
ifmapper-1.1.2 lib/IFMapper/FXWarningBox.rb
ifmapper-1.1.1 lib/IFMapper/FXWarningBox.rb
ifmapper-1.1.0 lib/IFMapper/FXWarningBox.rb
ifmapper-1.0.9 lib/IFMapper/FXWarningBox.rb
ifmapper-1.0.8 lib/IFMapper/FXWarningBox.rb
ifmapper-1.0.7 lib/IFMapper/FXWarningBox.rb
ifmapper-1.0.6 lib/IFMapper/FXWarningBox.rb