Class: Fox::FXColorWell
- 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
-
#helpText ⇒ Object
Status line help text [String].
-
#opaqueOnly ⇒ Object
writeonly
Only opaque colors allowed [Boolean].
-
#rgba ⇒ Object
The color FXColor.
-
#tipText ⇒ Object
Tool tip message [String].
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
-
#getRGBA ⇒ Object
Return the color for this color well.
-
#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
constructor
Construct color well with initial color.
-
#opaqueOnly? ⇒ Boolean
Return
true
if only opaque colors allowed. -
#setRGBA(clr, notify = false) ⇒ Object
Set the color for this color well to clr.
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, 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
#helpText ⇒ Object
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 |
#rgba ⇒ Object
The color Fox::FXColor
39 40 41 |
# File 'rdoc-sources/FXColorWell.rb', line 39 def rgba @rgba end |
#tipText ⇒ Object
Tool tip message [String]
45 46 47 |
# File 'rdoc-sources/FXColorWell.rb', line 45 def tipText @tipText end |
Instance Method Details
#getRGBA ⇒ Object
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 |