Class: Fox::FXDockBar

Inherits:
FXPacker show all
Defined in:
rdoc-sources/FXDockBar.rb,
lib/fox16/core.rb

Overview

A dock bar widget can be docked inside a dock site widget, or floated around freely. Users can move, undock, and dock the dock bar widget by means of a handle such as a tool bar grip. When docking, the dock bar sends a SEL_DOCKED message to its target; when undocking, it sends a SEL_FLOATED message. In either case the dock site involved is passed as the message data.

Events

The following messages are sent by FXDockBar to its target:

SEL_DOCKED

sent when the dock bar is docked; the message data is a reference to the new dock site (an FXDockSite instance).

SEL_FLOATED

sent when the dock bar is undocked; the message data is a reference to the previous dock site.

Dock Bar Options

ALLOW_NOWHERE

Don’t allow docking anywhere

ALLOW_TOP

Docking at the top only

ALLOW_BOTTOM

Docking at the bottom only

ALLOW_LEFT

Docking at the left only

ALLOW_RIGHT

Docking at the right only

ALLOW_HORIZONTAL

Docking at the top and bottom

ALLOW_VERTICAL

Docking at the left and right

ALLOW_EVERYWHERE

Docking can be everywhere

Direct Known Subclasses

FXToolBar

Instance Attribute Summary collapse

Attributes inherited from FXPacker

#baseColor, #borderColor, #borderWidth, #frameStyle, #hSpacing, #hiliteColor, #packingHints, #padBottom, #padLeft, #padRight, #padTop, #shadowColor, #vSpacing

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 FXComposite

#maxChildHeight, #maxChildWidth

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, opts = LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X, x = 0, y = 0, width = 0, height = 0, padLeft = 3, padRight = 3, padTop = 2, padBottom = 2, hSpacing = DEFAULT_SPACING, vSpacing = DEFAULT_SPACING) ⇒ FXDockBar

Construct a non-floatable dock bar. The dock bar can not be undocked.

Parameters:

p

the parent window for this dock bar Fox::FXComposite

opts

dock bar options [Integer]

x

initial x-position [Integer]

y

initial y-position [Integer]

width

initial width [Integer]

height

initial height [Integer]

padLeft

internal padding on the left side, in pixels [Integer]

padRight

internal padding on the right side, in pixels [Integer]

padTop

internal padding on the top side, in pixels [Integer]

padBottom

internal padding on the bottom side, in pixels [Integer]

hSpacing

horizontal spacing between widgets, in pixels [Integer]

vSpacing

vertical spacing between widgets, in pixels [Integer]



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

def initialize(p, q, opts=LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X, x=0, y=0, width=0, height=0, padLeft=3, padRight=3, padTop=2, padBottom=2, hSpacing=DEFAULT_SPACING, vSpacing=DEFAULT_SPACING) # :yields: theDockBar
end

Instance Attribute Details

#dockingSideObject

Docking side, one of LAYOUT_SIDE_LEFT, LAYOUT_SIDE_RIGHT, LAYOUT_SIDE_TOP or LAYOUT_SIDE_BOTTOM [Integer]



31
32
33
# File 'rdoc-sources/FXDockBar.rb', line 31

def dockingSide
  @dockingSide
end

Instance Method Details

#allowedSide?(side) ⇒ Boolean

Return true if docking is allowed on the specified side, where side is one of the ALLOW constants listed above.

Returns:

  • (Boolean)


103
104
105
# File 'lib/fox16/core.rb', line 103

def allowedSide?(side)
  (allowedSides & side) != 0
end

#allowedSidesObject

Return set of sides where docking is allowed



148
# File 'rdoc-sources/FXDockBar.rb', line 148

def allowedSides(); end

#allowedSides=(allowed) ⇒ Object

Change set of sides (a combination of ALLOW_TOP, ALLOW_LEFT, etc.), where docking is allowed. The default is to allow docking on all sides.



143
# File 'rdoc-sources/FXDockBar.rb', line 143

def allowedSides=(allowed); end

#allowSide(side) ⇒ Object

Allow docking on the specified side, where side is one of the ALLOW constants listed above.



90
91
92
# File 'lib/fox16/core.rb', line 90

def allowSide(side)
  self.allowedSides = self.allowedSides | side
end

#disallowSide(side) ⇒ Object

Disallow docking on the specified side, where side is one of the ALLOW constants listed above.



96
97
98
# File 'lib/fox16/core.rb', line 96

def disallowSide(side)
  self.allowedSides = self.allowedSides & ~side
end

#dock(docksite, local_x, local_y, notify) ⇒ Object

Dock the bar against the given side, near the given position relative to the toolbar dock’s origin.



124
# File 'rdoc-sources/FXDockBar.rb', line 124

def dock(docksite, before=nil, notify=false); end

#docked?Boolean

Return true if docked

Returns:

  • (Boolean)


84
# File 'rdoc-sources/FXDockBar.rb', line 84

def docked? ; end

#dryDockObject

Return parent when docked.



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

def dryDock; end

#dryDock=(dry) ⇒ Object

Set parent when docked. If it was docked, reparent under the new docking window.



95
# File 'rdoc-sources/FXDockBar.rb', line 95

def dryDock=(dry); end

#findDockAtSide(side = LAYOUT_SIDE_TOP) ⇒ Object

Search for dock against given side of main window.



112
# File 'rdoc-sources/FXDockBar.rb', line 112

def findDockAtSide(side=LAYOUT_SIDE_TOP); end

#findDockNear(root_x, root_y) ⇒ Object

Search for dock close to coordinates (root_x, root_y).



117
# File 'rdoc-sources/FXDockBar.rb', line 117

def findDockNear(root_x, root_y); end

#insideDock?(docksite, barx, bary) ⇒ Boolean

Return true if the dock bar would dock or undock if at locaton (barx, bary).

Returns:

  • (Boolean)


89
# File 'rdoc-sources/FXDockBar.rb', line 89

def insideDock?(docksite, barx, bary); end

#undock(root_x, root_y, notify = false) ⇒ Object

Undock or float the bar. The initial position of the wet dock is a few pixels below and to the right of the original docked position.



137
# File 'rdoc-sources/FXDockBar.rb', line 137

def undock(root_x, root_y, notify=false); end

#wetDockObject

Return parent when floating.



107
# File 'rdoc-sources/FXDockBar.rb', line 107

def wetDock; end

#wetDock=(wet) ⇒ Object

Set parent when floating. If it was undocked, then reparent under the new floating window.



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

def wetDock=(wet); end