Class: Fox::FXDial

Inherits:
FXFrame show all
Defined in:
rdoc-sources/FXDial.rb

Overview

The Dial widget is a valuator widget which is able to provide a cyclic value range when the DIAL_CYCLIC is passed, or a simple linear value range. While being turned, the dial sends a SEL_CHANGED message to its target; at the end of the interaction, a SEL_COMMAND message is sent. The message data represents the current value (an integer). The options DIAL_VERTICAL and DIAL_HORIZONTAL control the orientation of the dial. An optional notch can be used to indicate the zero-position of the dial; display of the notch is controlled by the DIAL_HAS_NOTCH option.

Events

The following messages are sent by FXDial 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_CHANGED

sent when the dial’s value changes; the message data is the new value (an integer).

SEL_COMMAND

sent when the user stops changing the dial’s value and releases the mouse button; the message data is the new value (an integer).

Dial style options

DIAL_VERTICAL

Vertically oriented

DIAL_HORIZONTAL

Horizontal oriented

DIAL_CYCLIC

Value wraps around

DIAL_HAS_NOTCH

Dial has a Center Notch

DIAL_NORMAL

same a DIAL_VERTICAL

Instance Attribute Summary collapse

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

#height, #visual, #width

Attributes inherited from FXId

#app, #userData, #xid

Instance Method Summary collapse

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

#connect

Methods inherited from FXDrawable

#resize

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 = DIAL_NORMAL, x = 0, y = 0, width = 0, height = 0, padLeft = DEFAULT_PAD, padRight = DEFAULT_PAD, padTop = DEFAULT_PAD, padBottom = DEFAULT_PAD) ⇒ FXDial

Construct a dial widget

Parameters:

p

parent widget for this dial Fox::FXComposite

target

message target object for this dial Fox::FXObject

selector

message identifier [Integer]

opts
x
y
width
height
padLeft
padRight
padTop
padBottom


90
91
# File 'rdoc-sources/FXDial.rb', line 90

def initialize(p, target=nil, selector=0, opts=DIAL_NORMAL, x=0, y=0, width=0, height=0, padLeft=DEFAULT_PAD, padRight=DEFAULT_PAD, padTop=DEFAULT_PAD, padBottom=DEFAULT_PAD) # :yields: theDial
end

Instance Attribute Details

#dialStyleObject

Current dial style [Integer]



61
62
63
# File 'rdoc-sources/FXDial.rb', line 61

def dialStyle
  @dialStyle
end

#helpTextObject

Status line help text for this dial [String]



67
68
69
# File 'rdoc-sources/FXDial.rb', line 67

def helpText
  @helpText
end

#notchColorObject

Center notch color Fox::FXColor



64
65
66
# File 'rdoc-sources/FXDial.rb', line 64

def notchColor
  @notchColor
end

#notchOffsetObject

The notch offset is the position of the center notch; the value should be tenths of degrees in the range [-3600,3600]. [Integer]



58
59
60
# File 'rdoc-sources/FXDial.rb', line 58

def notchOffset
  @notchOffset
end

#notchSpacingObject

The spacing for the small notches; this should be set in tenths of degrees in the range [1,3600], and the value should be a divisor of 3600, so as to make the notches come out evenly. [Integer]



52
53
54
# File 'rdoc-sources/FXDial.rb', line 52

def notchSpacing
  @notchSpacing
end

#rangeObject

Dial range [Range]



37
38
39
# File 'rdoc-sources/FXDial.rb', line 37

def range
  @range
end

#revolutionIncrementObject

The revolution increment is the amount of change in the position for revolution of the dial; the dial may go through multiple revolutions to go through its whole range. By default it takes one 360 degree turn of the dial to go from the lower to the upper range. [Integer]



45
46
47
# File 'rdoc-sources/FXDial.rb', line 45

def revolutionIncrement
  @revolutionIncrement
end

#tipTextObject

Tool tip message for this dial



70
71
72
# File 'rdoc-sources/FXDial.rb', line 70

def tipText
  @tipText
end

#valueObject

Dial value [Integer]



34
35
36
# File 'rdoc-sources/FXDial.rb', line 34

def value
  @value
end

Instance Method Details

#setRange(range, notify = false) ⇒ Object

Set the dial’s range. If notify is true, and the range modification causes the dial’s value to change, a SEL_COMMAND message is sent to the dial’s message target after the value is changed.



104
# File 'rdoc-sources/FXDial.rb', line 104

def setRange(range, notify=false); end

#setValue(value, notify = false) ⇒ Object

Set the dial value. If notify is true, a SEL_COMMAND message is sent to the dial’s message target after the value is changed.



97
# File 'rdoc-sources/FXDial.rb', line 97

def setValue(value, notify=false); end