Class: Fox::FXColorWell

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

Overview

A Color Well is a widget which controls color settings. Colors may be dragged and dropped from one color well to another. A double-click inside a color well will bring up the standard color dialog panel to edit the color well's color. Colors may be also pasted by name using middle-mouse click into/out of color wells from/to other selection-capable applications; for example, you can highlight the word `red' and paste it into a color well.

Events

The following messages are sent from FXColorWell to its target:

SEL_COMMAND

sent when a new color is applied; the message data is the color value.

SEL_CHANGED

sent when the color changes; the message data is the color value.

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_CLICKED

sent when the color well is single-clicked; the message data is the color value.

SEL_DOUBLECLICKED

sent when the color well is double-clicked; the message data is the color value.

Color Well Styles

COLORWELL_OPAQUEONLY

Colors must be opaque

COLORWELL_SOURCEONLY

This color well is never a target

COLORWELL_NORMAL

Same as JUSTIFY_NORMAL

Message identifiers

ID_COLORDIALOG

x

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(parent, color = 0, target = nil, selector = 0, opts = COLORWELL_NORMAL, x = 0, y = 0, width = 0, height = 0, padLeft = DEFAULT_PAD, padRight = DEFAULT_PAD, padTop = DEFAULT_PAD, padBottom = DEFAULT_PAD) ⇒ FXColorWell

Construct color well with initial color.


51
52
# File 'rdoc-sources/FXColorWell.rb', line 51

def initialize(parent, color=0, target=nil, selector=0, opts=COLORWELL_NORMAL, x=0, y=0, width=0, height=0, padLeft=DEFAULT_PAD, padRight=DEFAULT_PAD, padTop=DEFAULT_PAD, padBottom=DEFAULT_PAD) # :yields: theColorWell
end

Instance Attribute Details

#helpTextObject

Status line help text [String]


42
43
44
# File 'rdoc-sources/FXColorWell.rb', line 42

def helpText
  @helpText
end

#opaqueOnly=(value) ⇒ Object (writeonly)

Only opaque colors allowed [Boolean]


48
49
50
# File 'rdoc-sources/FXColorWell.rb', line 48

def opaqueOnly=(value)
  @opaqueOnly = value
end

#rgbaObject

The color Fox::FXColor


39
40
41
# File 'rdoc-sources/FXColorWell.rb', line 39

def rgba
  @rgba
end

#tipTextObject

Tool tip message [String]


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

def tipText
  @tipText
end

Instance Method Details

#getRGBAObject

Return the color for this color well.


60
# File 'rdoc-sources/FXColorWell.rb', line 60

def getRGBA; end

#opaqueOnly?Boolean

Return true if only opaque colors allowed


63
# File 'rdoc-sources/FXColorWell.rb', line 63

def opaqueOnly?() ; end

#setRGBA(clr, notify = false) ⇒ Object

Set the color for this color well to clr. If notify is true, a SEL_COMMAND message is sent to the color well's message target after the color is changed.


57
# File 'rdoc-sources/FXColorWell.rb', line 57

def setRGBA(clr, notify=false); end