Class: Fox::FXGradientBar

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

Overview

The FXGradientBar is a control that is used to edit color gradient, such as used in texture mapping and shape filling.

Events

The following messages are sent by FXGradientBar to its target:

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 anything about a segment changes; the message data is an integer indicating the segment number

SEL_SELECTED

sent when one or more segments are selected.

SEL_DESELECTED

sent when one or more segments are deselected.

Gradient bar orientation

GRADIENTBAR_HORIZONTAL

Gradient bar shown horizontally

GRADIENTBAR_VERTICAL

Gradient bar shown vertically

GRADIENTBAR_NO_CONTROLS

No controls shown

GRADIENTBAR_CONTROLS_TOP

Controls on top

GRADIENTBAR_CONTROLS_BOTTOM

Controls on bottom

GRADIENTBAR_CONTROLS_LEFT

Controls on left

GRADIENTBAR_CONTROLS_RIGHT

Controls on right

Blend modes

GRADIENT_BLEND_LINEAR

Linear blend

GRADIENT_BLEND_POWER

Power law blend

GRADIENT_BLEND_SINE

Sine blend

GRADIENT_BLEND_INCREASING

Quadratic increasing blend

GRADIENT_BLEND_DECREASING

Quadratic decreasing blend

Message identifiers

ID_LOWER_COLOR

write me

ID_UPPER_COLOR

write me

ID_BLEND_LINEAR

write me

ID_BLEND_POWER

write me

ID_BLEND_SINE

write me

ID_BLEND_INCREASING

write me

ID_BLEND_DECREASING

write me

ID_RECENTER

write me

ID_SPLIT

write me

ID_MERGE

write me

ID_UNIFORM

write me

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

Return an initialized FXGradientBar instance.



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

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

Instance Attribute Details

#barStyleObject

Gradient bar style, some combination of GRADIENTBAR_HORIZONTAL, GRADIENTBAR_VERTICAL, GRADIENTBAR_NO_CONTROLS, GRADIENTBAR_CONTROLS_TOP, GRADIENTBAR_CONTROLS_BOTTOM, GRADIENTBAR_CONTROLS_LEFT and GRADIENTBAR_CONTROLS_RIGHT.



83
84
85
# File 'rdoc-sources/FXGradientBar.rb', line 83

def barStyle
  @barStyle
end

#helpTextObject

Status line help text [String]



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

def helpText
  @helpText
end

#selectColorObject

Selection color Fox::FXColor



86
87
88
# File 'rdoc-sources/FXGradientBar.rb', line 86

def selectColor
  @selectColor
end

#tipTextObject

Tool tip text [String]



92
93
94
# File 'rdoc-sources/FXGradientBar.rb', line 92

def tipText
  @tipText
end

Instance Method Details

#anchorSegmentObject

Return the index of the anchor segment, or -1 if there is no anchor segment.



152
# File 'rdoc-sources/FXGradientBar.rb', line 152

def anchorSegment(); end

#anchorSegment=(seg) ⇒ Object

Change anchor segment to seg. Use a seg value of -1 to indicate that there is no anchor segment. Raises IndexError if seg is out of bounds.



147
# File 'rdoc-sources/FXGradientBar.rb', line 147

def anchorSegment=(seg); end

#blendSegments(sglo, sghi, blend = GRADIENT_BLEND_LINEAR, notify = false) ⇒ Object

Set the blend mode for segments sglo through sghi to blend, where blend is one of GRADIENT_BLEND_LINEAR, GRADIENT_BLEND_POWER, GRADIENT_BLEND_SINE, GRADIENT_BLEND_INCREASING or GRADIENT_BLEND_DECREASING. If notify is true, a SEL_CHANGED message is sent to the gradient bar’s message target after this change is completed.



299
# File 'rdoc-sources/FXGradientBar.rb', line 299

def blendSegments(sglo, sghi, blend=GRADIENT_BLEND_LINEAR, notify=false); end

#deselectSegments(notify) ⇒ Object

Deselect all segments, and return true if there was a previously selected range. If notify is true, a SEL_DESELECTED message is sent to the gradient bar’s message target after the current selection is deselected.



170
# File 'rdoc-sources/FXGradientBar.rb', line 170

def deselectSegments(notify); end

#getCurrentSegmentObject

Return the index of the current segment, or -1 if there is no current segment.



140
# File 'rdoc-sources/FXGradientBar.rb', line 140

def getCurrentSegment(); end

#getGrip(seg, x, y) ⇒ Object

Return the grip in segment seg which is closest to location (x, y), one of GRIP_LOWER, GRIP_SEG_LOWER, GRIP_MIDDLE, GRIP_SEG_UPPER, GRIP_UPPER or GRIP_NONE.



111
# File 'rdoc-sources/FXGradientBar.rb', line 111

def getGrip(seg, x, y); end

#getSegment(x, y) ⇒ Object

Return the zero-based index of the segment containing location (x, y). Returns -1 if no matching segment was found.



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

def getSegment(x, y); end

#getSegmentBlend(seg) ⇒ Object

Return the blend mode of segment seg, one of GRADIENT_BLEND_LINEAR, GRADIENT_BLEND_POWER, GRADIENT_BLEND_SINE, GRADIENT_BLEND_INCREASING or GRADIENT_BLEND_DECREASING. Raises IndexError if seg is out of bounds.



268
# File 'rdoc-sources/FXGradientBar.rb', line 268

def getSegmentBlend(seg); end

#getSegmentLower(seg) ⇒ Object

Return lower value of segment seg. Raises IndexError if seg is out of bounds.



241
# File 'rdoc-sources/FXGradientBar.rb', line 241

def getSegmentLower(seg); end

#getSegmentLowerColor(seg) ⇒ Object

Return lower color of the segment with index seg. Raises IndexError if seg is out of bounds.



198
# File 'rdoc-sources/FXGradientBar.rb', line 198

def getSegmentLowerColor(seg); end

#getSegmentMiddle(seg) ⇒ Object

Return middle value of segment seg. Raises IndexError if seg is out of bounds.



247
# File 'rdoc-sources/FXGradientBar.rb', line 247

def getSegmentMiddle(seg); end

#getSegmentUpper(seg) ⇒ Object

Return upper value of segment seg. Raises IndexError if seg is out of bounds.



253
# File 'rdoc-sources/FXGradientBar.rb', line 253

def getSegmentUpper(seg); end

#getSegmentUpperColor(seg) ⇒ Object

Return upper color of the segment with index seg. Raises IndexError if seg is out of bounds.



204
# File 'rdoc-sources/FXGradientBar.rb', line 204

def getSegmentUpperColor(seg); end

#gradient(nramp) ⇒ Object

Return a gradient ramp of size nramp based on the settings for this gradient bar. The return value is an array of color values corresponding to this gradient bar.



260
# File 'rdoc-sources/FXGradientBar.rb', line 260

def gradient(nramp); end

#gradientsObject

Return a reference to the array of gradient segments (an array of FXGradient instances).



126
# File 'rdoc-sources/FXGradientBar.rb', line 126

def gradients(); end

#gradients=(segments) ⇒ Object

Replace the current gradient segments with segments, an array of FXGradient instances.



120
# File 'rdoc-sources/FXGradientBar.rb', line 120

def gradients=(segments); end

#mergeSegments(sglo, sghi, notify = false) ⇒ Object

Merge segments. If notify is true, a SEL_CHANGED message is sent to the gradient bar’s message target after this change is completed.



282
# File 'rdoc-sources/FXGradientBar.rb', line 282

def mergeSegments(sglo, sghi, notify=false); end

#moveSegmentLower(seg, val, notify = false) ⇒ Object

Move lower point of segment seg to val. If notify is true, a SEL_CHANGED message is sent to the gradient bar’s message target after the segment’s lower value is changed. Raises IndexError if seg is out of bounds.



212
# File 'rdoc-sources/FXGradientBar.rb', line 212

def moveSegmentLower(seg, val, notify=false); end

#moveSegmentMiddle(seg, val, notify = false) ⇒ Object

Move middle point of segment seg to val. If notify is true, a SEL_CHANGED message is sent to the gradient bar’s message target after the segment’s middle value is changed. Raises IndexError if seg is out of bounds.



220
# File 'rdoc-sources/FXGradientBar.rb', line 220

def moveSegmentMiddle(seg, val, notify=false); end

#moveSegments(sglo, sghi, val, notify = false) ⇒ Object

Move segments sglo to sghi to new position val. If notify is true, a SEL_CHANGED message is sent to the gradient bar’s message target after the segments’ values are changed.



235
# File 'rdoc-sources/FXGradientBar.rb', line 235

def moveSegments(sglo, sghi, val, notify=false); end

#moveSegmentUpper(seg, val, notify = false) ⇒ Object

Move upper point of segment seg to val. If notify is true, a SEL_CHANGED message is sent to the gradient bar’s message target after the segment’s upper value is changed. Raises IndexError if seg is out of bounds.



228
# File 'rdoc-sources/FXGradientBar.rb', line 228

def moveSegmentUpper(seg, val, notify=false); end

#numSegmentsObject

Return the number of segments



114
# File 'rdoc-sources/FXGradientBar.rb', line 114

def numSegments(); end

#segmentSelected?(seg) ⇒ Boolean

Return true if the specified segment is selected. Raises IndexError if seg is out of bounds.

Returns:

  • (Boolean)


176
# File 'rdoc-sources/FXGradientBar.rb', line 176

def segmentSelected?(seg); end

#selectSegments(fm, to, notify = false) ⇒ Object

Select segment(s) fm through to and return true if the selected range is different than it was. If notify is true, a SEL_SELECTED message is sent to the gradient bar’s message target after the current segment is changed. Raises ArgumentError if fm is greater than to, and IndexError if either fm or to is out of bounds.



162
# File 'rdoc-sources/FXGradientBar.rb', line 162

def selectSegments(fm, to, notify=false); end

#setCurrentSegment(index, notify = false) ⇒ Object

Change current segment to index. Use an index of -1 to indicate that there is no current segment. If notify is true, a SEL_CHANGED message is sent to the gradient bar’s message target after the current segment is changed. Raises IndexError if index is out of bounds.



135
# File 'rdoc-sources/FXGradientBar.rb', line 135

def setCurrentSegment(index, notify=false); end

#setSegmentLowerColor(seg, clr, notify = false) ⇒ Object

Set lower color of the segment with index seg. If notify is true, a SEL_CHANGED message is sent to the gradient bar’s message target after the segment’s lower color is changed. Raises IndexError if seg is out of bounds.



184
# File 'rdoc-sources/FXGradientBar.rb', line 184

def setSegmentLowerColor(seg, clr, notify=false); end

#setSegmentUpperColor(seg, clr, notify = false) ⇒ Object

Set upper color of the segment with index seg. If notify is true, a SEL_CHANGED message is sent to the gradient bar’s message target after the segment’s upper color is changed. Raises IndexError if seg is out of bounds.



192
# File 'rdoc-sources/FXGradientBar.rb', line 192

def setSegmentUpperColor(seg, clr, notify=false); end

#splitSegments(sglo, sghi, notify = false) ⇒ Object

Split segment at the midpoint If notify is true, a SEL_CHANGED message is sent to the gradient bar’s message target after this change is completed.



275
# File 'rdoc-sources/FXGradientBar.rb', line 275

def splitSegments(sglo, sghi, notify=false); end

#uniformSegments(sglo, sghi, notify = false) ⇒ Object

Make segments uniformly distributed. If notify is true, a SEL_CHANGED message is sent to the gradient bar’s message target after this change is completed.



289
# File 'rdoc-sources/FXGradientBar.rb', line 289

def uniformSegments(sglo, sghi, notify=false); end