Class: Fox::FXKnob
- Defined in:
- rdoc-sources/FXKnob.rb
Overview
The knob widget is a valuator widget which provides simple linear value range. While being moved, the knob sends SEL_CHANGED
messages to its target; at the end of the interaction, a final SEL_COMMAND
message is sent. The message data represents the current knob value (an integer).
Events
The following messages are sent by FXKnob to its target:
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.
SEL_MIDDLEBUTTONPRESS
-
sent when the middle mouse button goes down; the message data is an FXEvent instance.
SEL_MIDDLEBUTTONRELEASE
-
sent when the middle mouse button goes up; the message data is an FXEvent instance.
SEL_COMMAND
-
sent at the end of a knob move; the message data is the new value of the knob.
SEL_CHANGED
-
sent continuously while the knob is being moved; the message data is an integer indicating the current knob value.
Knob Control styles
KNOB_NEEDLE
-
Use a needle as indicator
KNOB_DOT
-
Use a dot as indicator
KNOB_TICKS
-
Show ticks around the knob
KNOB_INDICATOR
-
Show only the indicator (like a speedometer)
KNOB_NORMAL
-
Normal knob looks
Instance Attribute Summary collapse
-
#helpText ⇒ Object
Help text displayed on the status line [String].
-
#increment ⇒ Object
Knob auto-increment/decrement value [Integer].
-
#knobStyle ⇒ Object
Knob style [Integer].
-
#lineColor ⇒ Object
Indicator needle color FXColor.
-
#range ⇒ Object
Knob range [Range].
-
#tickDelta ⇒ Object
Delta between ticks [Integer].
-
#tipText ⇒ Object
Tooltip text value [String].
-
#value ⇒ Object
Knob value [Integer].
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
-
#getLimits ⇒ Object
Return the knob’s current limits as a two-element array.
-
#initialize(p, target = nil, selector = 0, opts = KNOB_NORMAL, x = 0, y = 0, width = 0, height = 0, padLeft = DEFAULT_PAD, padRight = DEFAULT_PAD, padTop = DEFAULT_PAD, padBottom = DEFAULT_PAD) ⇒ FXKnob
constructor
Return a new FXKnob instance.
-
#setLimits(start_angle, end_angle, notify = false) ⇒ Object
Change the knob’s movement limits (start and ending angles) Accept values in degrees from 0 (south) to 360.
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(p, target = nil, selector = 0, opts = KNOB_NORMAL, x = 0, y = 0, width = 0, height = 0, padLeft = DEFAULT_PAD, padRight = DEFAULT_PAD, padTop = DEFAULT_PAD, padBottom = DEFAULT_PAD) ⇒ FXKnob
Return a new FXKnob instance.
61 62 |
# File 'rdoc-sources/FXKnob.rb', line 61 def initialize(p, target=nil, selector=0, opts=KNOB_NORMAL, x=0, y=0, width=0, height=0, padLeft=DEFAULT_PAD, padRight=DEFAULT_PAD, padTop=DEFAULT_PAD, padBottom=DEFAULT_PAD) # :yields: theKnob end |
Instance Attribute Details
#helpText ⇒ Object
Help text displayed on the status line [String]
53 54 55 |
# File 'rdoc-sources/FXKnob.rb', line 53 def helpText @helpText end |
#increment ⇒ Object
Knob auto-increment/decrement value [Integer]
44 45 46 |
# File 'rdoc-sources/FXKnob.rb', line 44 def increment @increment end |
#knobStyle ⇒ Object
Knob style [Integer]
41 42 43 |
# File 'rdoc-sources/FXKnob.rb', line 41 def knobStyle @knobStyle end |
#lineColor ⇒ Object
Indicator needle color Fox::FXColor
50 51 52 |
# File 'rdoc-sources/FXKnob.rb', line 50 def lineColor @lineColor end |
#range ⇒ Object
Knob range [Range]
38 39 40 |
# File 'rdoc-sources/FXKnob.rb', line 38 def range @range end |
#tickDelta ⇒ Object
Delta between ticks [Integer]
47 48 49 |
# File 'rdoc-sources/FXKnob.rb', line 47 def tickDelta @tickDelta end |
#tipText ⇒ Object
Tooltip text value [String]
56 57 58 |
# File 'rdoc-sources/FXKnob.rb', line 56 def tipText @tipText end |
#value ⇒ Object
Knob value [Integer]
35 36 37 |
# File 'rdoc-sources/FXKnob.rb', line 35 def value @value end |
Instance Method Details
#getLimits ⇒ Object
Return the knob’s current limits as a two-element array.
73 |
# File 'rdoc-sources/FXKnob.rb', line 73 def getLimits(); end |
#setLimits(start_angle, end_angle, notify = false) ⇒ Object
Change the knob’s movement limits (start and ending angles) Accept values in degrees from 0 (south) to 360.
68 |
# File 'rdoc-sources/FXKnob.rb', line 68 def setLimits(start_angle, end_angle, notify=false); end |