Class: Fox::FXRadioButton
Overview
A radio button is a tri-state button. Normally, it is either TRUE
or FALSE
; a third state MAYBE
may be set to indicate that no selection has been made yet by the user, or that the state is ambiguous. When pressed, the radio button sets its state to TRUE
and sends a SEL_COMMAND
message to its target, with the message data set to the state of the radio button. A group of radio buttons can be made mutually exclusive by linking them to a common data target (i.e. an instance of FXDataTarget). Alternatively, an application can implement a common SEL_UPDATE
handler to check and uncheck radio buttons as appropriate.
Events
The following messages are sent by FXRadioButton to its target:
SEL_COMMAND
-
sent when the radio button is pressed.
SEL_KEYPRESS
-
sent when a key goes down; the message data is an FXEvent instance.
SEL_KEYRELEASE
-
sent when a key goes up; the message data is an FXEvent instance.
SEL_LEFTBUTTONPRESS
-
sent when the left mouse button goes down; the message data is an FXEvent instance.
SEL_LEFTBUTTONRELEASE
-
sent when the left mouse button goes up; the message data is an FXEvent instance.
RadioButton flags
RADIOBUTTON_AUTOGRAY
-
Automatically gray out when not updated
RADIOBUTTON_AUTOHIDE
-
Automatically hide when not updated
RADIOBUTTON_NORMAL
-
JUSTIFY_NORMAL|ICON_BEFORE_TEXT
Instance Attribute Summary collapse
-
#checkState ⇒ Object
Radio button state, one of
TRUE
,FALSE
orMAYBE
[Integer]. -
#diskColor ⇒ Object
Radio disk color FXColor.
-
#radioButtonStyle ⇒ Object
Radio button style [Integer].
-
#radioColor ⇒ Object
Radio ball color FXColor.
Attributes inherited from FXLabel
#font, #helpText, #icon, #iconPosition, #justify, #text, #textColor, #tipText
Attributes inherited from FXFrame
#baseColor, #borderColor, #borderWidth, #frameStyle, #hiliteColor, #padBottom, #padLeft, #padRight, #padTop, #shadowColor
Attributes inherited from FXWindow
#accelTable, #backColor, #defaultCursor, #dragCursor, #first, #focus, #key, #last, #layoutHints, #next, #numChildren, #owner, #parent, #prev, #root, #selector, #shell, #target, #x, #y
Attributes inherited from FXDrawable
Attributes inherited from FXId
Instance Method Summary collapse
-
#checked? ⇒ Boolean
Return
true
if this radio button is in the checked state. -
#initialize(parent, text, target = nil, selector = 0, opts = RADIOBUTTON_NORMAL, x = 0, y = 0, width = 0, height = 0, padLeft = DEFAULT_PAD, padRight = DEFAULT_PAD, padTop = DEFAULT_PAD, padBottom = DEFAULT_PAD) ⇒ FXRadioButton
constructor
Construct new radio button.
-
#maybe? ⇒ Boolean
Return
true
if this radio button is in the indeterminate, or “maybe”, state. -
#unchecked? ⇒ Boolean
Return
true
if this radio button is in the unchecked state.
Methods inherited from FXLabel
Methods inherited from FXWindow
#acceptDrop, #acquireClipboard, #acquireSelection, #active?, #addHotKey, after?, #after?, before?, #before?, #beginDrag, #canFocus?, #changeFocus, #childAtIndex, #childOf?, #children, #clearDragRectangle, #clearShape, colorType, colorTypeName, commonAncestor, #composeContext, #composite?, #contains?, #containsChild?, #create, #createComposeContext, #cursorPosition, #default?, #defaultHeight, #defaultWidth, deleteType, deleteTypeName, #destroy, #destroyComposeContext, #detach, #didAccept, #disable, #doesSaveUnder?, #dragging?, #dropDisable, #dropEnable, #dropEnabled?, #dropFinished, #dropTarget?, #each_child, #each_child_recursive, #enable, #enabled?, #endDrag, #forceRefresh, #getChildAt, #getDNDData, #getHeightForWidth, #getWidthForHeight, #grab, #grabKeyboard, #grabbed?, #grabbedKeyboard?, #handleDrag, #hasClipboard?, #hasFocus?, #hasSelection?, #height, #height=, #hide, imageType, #inFocusChain?, #indexOfChild, #initial?, #inquireDNDAction, #inquireDNDTypes, #killFocus, #layout, #linkAfter, #linkBefore, #lower, #move, octetType, octetTypeName, #offeredDNDType?, #position, #raiseWindow, #recalc, #releaseClipboard, #releaseSelection, #remHotKey, #removeChild, #repaint, #reparent, #resize, #scroll, #setCursorPosition, #setDNDData, #setDefault, #setDragRectangle, #setFocus, #setInitial, #setShape, #shell?, #show, #shown?, stringType, textType, textTypeName, #tr, #translateCoordinatesFrom, #translateCoordinatesTo, #underCursor?, #ungrab, #ungrabKeyboard, #update, urilistType, urilistTypeName, utf16Type, utf16TypeName, utf8Type, utf8TypeName, #visible=, #width, #width=
Methods included from Responder2
Methods inherited from FXDrawable
Methods inherited from FXId
#create, #created?, #destroy, #detach, #runOnUiThread
Methods inherited from FXObject
#bind, #handle, #load, #save, subclasses
Constructor Details
#initialize(parent, text, target = nil, selector = 0, opts = RADIOBUTTON_NORMAL, x = 0, y = 0, width = 0, height = 0, padLeft = DEFAULT_PAD, padRight = DEFAULT_PAD, padTop = DEFAULT_PAD, padBottom = DEFAULT_PAD) ⇒ FXRadioButton
Construct new radio button
46 47 |
# File 'rdoc-sources/FXRadioButton.rb', line 46 def initialize(parent, text, target=nil, selector=0, opts=RADIOBUTTON_NORMAL, x=0, y=0, width=0, height=0, padLeft=DEFAULT_PAD, padRight=DEFAULT_PAD, padTop=DEFAULT_PAD, padBottom=DEFAULT_PAD) # :yields: theRadioButton end |
Instance Attribute Details
#checkState ⇒ Object
Radio button state, one of TRUE
, FALSE
or MAYBE
[Integer]
32 33 34 |
# File 'rdoc-sources/FXRadioButton.rb', line 32 def checkState @checkState end |
#diskColor ⇒ Object
Radio disk color Fox::FXColor
41 42 43 |
# File 'rdoc-sources/FXRadioButton.rb', line 41 def diskColor @diskColor end |
#radioButtonStyle ⇒ Object
Radio button style [Integer]
35 36 37 |
# File 'rdoc-sources/FXRadioButton.rb', line 35 def radioButtonStyle @radioButtonStyle end |
#radioColor ⇒ Object
Radio ball color Fox::FXColor
38 39 40 |
# File 'rdoc-sources/FXRadioButton.rb', line 38 def radioColor @radioColor end |
Instance Method Details
#checked? ⇒ Boolean
Return true
if this radio button is in the checked state.
52 53 54 |
# File 'rdoc-sources/FXRadioButton.rb', line 52 def checked? self.checkState == Fox::TRUE end |
#maybe? ⇒ Boolean
Return true
if this radio button is in the indeterminate, or “maybe”, state.
66 67 68 |
# File 'rdoc-sources/FXRadioButton.rb', line 66 def maybe? self.checkState == Fox::MAYBE end |
#unchecked? ⇒ Boolean
Return true
if this radio button is in the unchecked state.
59 60 61 |
# File 'rdoc-sources/FXRadioButton.rb', line 59 def unchecked? self.checkState == Fox::FALSE end |