Class: Fox::FXMatrix

Inherits:
FXPacker show all
Defined in:
rdoc-sources/FXMatrix.rb

Overview

The FXMatrix layout manager automatically arranges its child windows in rows and columns. If the matrix style is MATRIX_BY_ROWS, then the matrix will have the given number of rows and the number of columns grows as more child windows are added; if the matrix style is MATRIX_BY_COLUMNS, then the number of columns is fixed and the number of rows grows as more children are added. If all children in a row (column) have the LAYOUT_FILL_ROW (LAYOUT_FILL_COLUMN) hint set, then the row (column) will be stretchable as the matrix layout manager itself is resized. If more than one row (column) is stretchable, the space is apportioned to each stretchable row (column) proportionally. Within each cell of the matrix, all other layout hints are observed. For example, a child having LAYOUT_CENTER_Y and LAYOUT_FILL_X hints will be centered in the Y-direction, while being stretched in the X-direction. Empty cells can be obtained by simply placing a borderless FXFrame widget as a space-holder.

Matrix packing options

MATRIX_BY_ROWS

Fixed number of rows, add columns as needed

MATRIX_BY_COLUMNS

Fixed number of columns, adding rows as needed

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(parent, n = 1, opts = MATRIX_BY_ROWS, x = 0, y = 0, width = 0, height = 0, padLeft = DEFAULT_SPACING, padRight = DEFAULT_SPACING, padTop = DEFAULT_SPACING, padBottom = DEFAULT_SPACING, hSpacing = DEFAULT_SPACING, vSpacing = DEFAULT_SPACING) ⇒ FXMatrix

Construct a matrix layout manager with n rows or columns



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

def initialize(parent, n=1, opts=MATRIX_BY_ROWS, x=0, y=0, width=0, height=0, padLeft=DEFAULT_SPACING, padRight=DEFAULT_SPACING, padTop=DEFAULT_SPACING, padBottom=DEFAULT_SPACING, hSpacing=DEFAULT_SPACING, vSpacing=DEFAULT_SPACING) # :yields: theMatrix
end

Instance Attribute Details

#matrixStyleObject

Matrix style [Integer]



27
28
29
# File 'rdoc-sources/FXMatrix.rb', line 27

def matrixStyle
  @matrixStyle
end

#numColumnsObject

Number of columns [Integer]



33
34
35
# File 'rdoc-sources/FXMatrix.rb', line 33

def numColumns
  @numColumns
end

#numRowsObject

Number of rows [Integer]



30
31
32
# File 'rdoc-sources/FXMatrix.rb', line 30

def numRows
  @numRows
end

Instance Method Details

#childAtRowCol(row, column) ⇒ Object

Obtain the child placed at a certain row and column.



44
# File 'rdoc-sources/FXMatrix.rb', line 44

def childAtRowCol(row, column); end

#colOfChild(child) ⇒ Object

Return the column in which the given child is placed.



54
# File 'rdoc-sources/FXMatrix.rb', line 54

def colOfChild(child); end

#rowOfChild(child) ⇒ Object

Return the row in which the given child is placed.



49
# File 'rdoc-sources/FXMatrix.rb', line 49

def rowOfChild(child); end