public class Container extends Control
Modifier and Type | Field and Description |
---|---|
boolean |
closedFocus
If this is true then the keyboard focus cannot be moved outside of this Container using
the TAB or cursor keys.
|
boolean |
cycleFocus
If this is true then the keyboard focus will cycle from the first to the last control
in this container when the focus has moved to the very first or very last control.
|
boolean |
dontAutoScroll
If this is set to true, then when child Controls gain the focus the GUI
will not attempt to scroll so that the focused Control is visible.
|
boolean |
dontFocusOnChildren
If this is true then the keyboard focus cannot be moved to the Container's child controls
using the TAB or cursor keys.
|
static int |
FIND_FOR_MOUSE_PRESS |
boolean |
takeNextFocus
Normally the child of a Container would get the focus if a call to Gui.takeFocus(aContainer,ByRequest)
is called.
|
backGround, beforeRemoved, borderColor, borderStyle, borderWidth, children, columns, constraints, curFont, debugModify, debugRepaintNow, disabledBackground, dragging, dragResolution, dragTime, exitKeys, fieldTransfer, font, fontChange, fontFrom, foreGround, height, holdDownPause, holdTick, hotKey, image, lastSelected, listeners, lockPaint, maxHeight, maxWidth, menuState, minHeight, minWidth, modifiers, name, next, parent, penStatus, preferredHeight, preferredWidth, prev, prompt, promptControl, rows, ss, startDragResolution, tags, tail, text, toolTip, width, x, y
clipItems, clipObject, clipOwner, debugControl, debugFlag, doubleBuffer, doubleClickTime, doubleSizedFontHeight, firstPress, globalEditable, globalEnabled, PEN_STATUS_DID_HOLD_DOWN, PEN_STATUS_GOT_PEN_DOWN, PEN_STATUS_PEN_IS_ON, pressPoint, TAG_BOOLEAN_KEEP_BELOW_SIP, TAG_HOVER_TIME_INT, TAG_LAST_USER_DATA, TAG_USER_DATA, TAKE_FIRST_PRESS, unnamed
BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, BF_ABUT_ANY, BF_ABUT_BOTTOM, BF_ABUT_LEFT, BF_ABUT_RIGHT, BF_ABUT_TOP, BF_BOTTOM, BF_BOTTOMLEFT, BF_BOTTOMRIGHT, BF_BUTTON, BF_DIAGONAL, BF_DIAGONAL_ENDBOTTOMLEFT, BF_DIAGONAL_ENDBOTTOMRIGHT, BF_DIAGONAL_ENDTOPLEFT, BF_DIAGONAL_ENDTOPRIGHT, BF_EXACT, BF_FLAT, BF_LEFT, BF_MIDDLE, BF_MONO, BF_PALM, BF_RECT, BF_RIGHT, BF_SOFT, BF_SQUARE, BF_TOP, BF_TOPLEFT, BF_TOPRIGHT, EDGE_BUMP, EDGE_ETCHED, EDGE_RAISED, EDGE_SUNKEN
ALWAYS_STRETCHABLE, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_HIDDEN, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TAG_BACKGROUND_IMAGE, TAG_BUSY_DISPLAY, TAG_COLORS, TAG_CONTROL_PAINTER, TAG_EXPOSE_GROUP, TAG_FIXEDSIZE, TAG_GRAY_BACKGROUND, TAG_HIDE_CONTROL_OBJECT, TAG_HIDE_PARENT, TAG_INNER_TEXT_INSETS, TAG_INPUT_STACK_PARENT, TAG_INSETS, TAG_MAKE_VISIBLE, TAG_MAXIMUMSIZE, TAG_MINIMUMSIZE, TAG_PAINT_CONTROL_LIST, TAG_PREFERRED_TEXT_SIZE, TAG_PREFERRED_TEXT_SIZE_HEIGHT, TAG_PREFERRED_TEXT_SIZE_WIDTH, TAG_PREFERREDSIZE, TAG_RECT, TAG_SHADOW_INSETS, TAG_SPAN, TAG_SWIPER, TAG_TEMPORARY_ERROR, TAG_TEXT_INSETS, TAG_TEXTSIZE, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST
All, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, ContainerDontPaintChildren, Disabled, DisablePopupMenu, DisplayOnly, DontBuffer, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, ModifiersInheritedFromWindow, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpUIEvents, ShowSIP, ShrinkToNothing, SmallControl, TakeChildUIEvents, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown
KEEP_VISIBLE
Constructor and Description |
---|
Container() |
Modifier and Type | Method and Description |
---|---|
protected void |
add(Control control)
Adds a child control to this container - you should not generally use
this method.
|
void |
addDirectly(Control control)
You would generally not use this method.
|
static void |
completeAddPopupControl(Control c,
int x,
int y,
int width,
int height)
Use this to complete the startAddPopupControl() operation.
|
boolean |
containerHasFocus()
Returns true if the Container itself has the focus instead of one of its
children.
|
void |
dismantle() |
void |
dismantle(Control stopAt) |
protected boolean |
doHotKey(Control from,
KeyEvent ev)
This method checks to see if a KeyEvent should be considered the Control's hot-key.
|
void |
doPaint(Graphics g,
Rect r)
This is the main method to override when doing custom Control painting.
|
Control |
findChild(int x,
int y)
Returns the child located at the given x and y coordinates.
|
Control |
findChild(int x,
int y,
int findPurpose) |
void |
focusFirst() |
void |
focusFirst(int how) |
void |
focusOnContainer(int how)
Put the focus on the container itself rather than any of its children.
|
void |
focusOnData(int how)
Put the focus on the data within the container.
|
ControlIterator |
getChildren(ControlIterator it,
boolean backwards)
Called by the system to draw the children of the container.
|
protected Control |
getFirstFocus() |
Control |
getNextKeyFocus(Control sourceChild,
boolean forwards)
Determine which sub-control should receive the keyboard focus.
|
void |
gotFocus(int how)
If a container gets the focus via an explicit focusOnContainer() then it
will take the focus, otherwise it will call pass focus to the first
control within it that wants the focus.
|
static void |
grayOut(double alpha,
Graphics g,
int sx,
int sy,
int width,
int height) |
void |
hide(Control child,
boolean update)
Temporarily set the size of a Control to zero and relayout this container.
|
void |
lostFocus(int how)
This is called when the Control loses the focus.
|
void |
make(boolean reMake)
This is used to "make" the control before being displayed.
|
void |
relayout(boolean redisplay)
Force a recalculation of all preferredSize() and resizing/positioning of the panel.
|
void |
remove(Control control)
Removes a child control from the container.
|
void |
removeAll() |
static void |
removePopupControl(Control c)
Use this to remove a Control added via addPopupControl().
|
void |
repaintDataNow()
Repaint the "data" part of the Control now.
|
void |
reShow(int x,
int y,
int toWidth,
int toHeight)
Resize the control and force all subcontrols to be considered to be reshown and
relaid out.
|
boolean |
scrollToVisible(int x,
int y,
int width,
int height) |
void |
setHidden(Control child,
boolean isHidden,
boolean update)
Unconditionally set the hidden state of the child.
|
Dimension |
startAddPopupControl(Control c)
Use this to show a Control directly on a parent at a specific point.
|
void |
takeFocus(int how)
Set the focus on this Control.
|
protected boolean |
takePromptControl(Control prompt)
On a normal Control this will set the promptControl variable to "prompt", but
on a Container, the first child non-container will have "prompt" assigned to it.
|
void |
unhide(Control child,
boolean update)
Make visible a Control hidden by hide().
|
acceptsData, activate, addListener, amOnTopFrame, applyFontChange, baseOnPenEvent, bufferGraphics, bufferGraphics, bufferGraphics, bufferGraphics, bufferGraphics, cache, calculatedSizes, calculateSizes, calculateTextSize, calculateTextSize, calculateTextSize, cancelHoldDown, cancelPenPress, canEdit, change, changeDimension, changeTag, checkClipboardOperations, checkExitKey, checkMenu, checkMenuKey, checkModifiers, checkParentInterceptsUIEvent, checkPenTransparent, childrenPainted, clearTag, clipboardToString, clipboardTransfer, closeMenu, contains, contains, createNewMenu, dataAccepted, dataBeingRemoved, dataDraggedOff, dataDraggedOver, dataDraggedOver, dataDroppedOn, dataTransferCancelled, deactivate, defaultTo, deferInWindowThread, doAction, doActionKey, doBackground, doBorder, doMenu, dontAcceptDrop, doPaintChildren, doPaintData, doPaintData, doShowMenu, dragged, draw, draw, draw, exitEntry, fillBackground, fillBackgroundNotInFrame, findTagInParents, fontChanged, formClosing, free, fromClipboard, fromField, fromField, getAllDescendants, getAllSubControls, getAncestor, getAncestor, getAncestorProperty, getBackground, getCached, getCachedChildren, getCachedDim, getCachedDim, getCachedRect, getCachedRect, getCachedSubControls, getChildAnchor, getChildren, getChildrenBackwards, getClipboardMenu, getClipObject, getContentsInsets, getContentsInsets, getContentsRect, getDataToCopy, getDataToDragAndDrop, getDim, getDisplayText, getDragAndDropContext, getFieldTransfer, getFont, getFontMetrics, getFontMetrics, getFontMetricsForSizeCalculations, getForeground, getFrame, getFrameOrContainer, getGraphics, getGraphics, getHeight, getHideParent, getImage, getLastSelected, getLocation, getLock, getMaximumSize, getMenu, getMinimumSize, getModifiedBorderFlags, getModifiers, getNext, getPaintParameters, getParent, getParent, getParent, getParentOrListener, getPasswordCharacter, getPosInFrame, getPosInFrame, getPosInParent, getPosInParent, getPreferredSize, getPreferredSizeByParent, getPreferredTextSize, getPrompt, getPromptText, getRect, getRect, getServer, getSize, getSizes, getSubControls, getSubControls, getTag, getText, getToolTip, getWidth, getWindow, getWindowGraphics, hasModifier, hasPopupFormAttached, hasTag, hide, inheritModifiers, insetToContents, interceptChildUIEvent, isChildOf, isDirectChildOfWindow, isHidden, isModal, isOnMe, isOnMe, isOnMe, isSomeonesHotKey, makeFrameTopMost, makeHot, makeHot, makeInvisible, makeVisible, markAsTemporaryError, menuIsActive, menuStateChanged, modify, modifyAll, modifyAll, modifyFlags, mouseHover, newEventThread, notifyAction, notifyDataChange, notifyDataChange, notifyMenuItemSelected, notifyStructureChanged, onControlEvent, onEvent, onKeyEvent, onLabelPenEvent, onPenEvent, paintBackground, paintWithControlPainter, pauseEventThread, penClicked, penDoubleClicked, penHeld, penPressed, penReleased, penRightReleased, popupBeep, popupMenuClosed, popupMenuEvent, popupMenuEvent, postEvent, postInWindowThread, postUIEvent, putInside, queueKeyEvent, queuePenEvent, readLock, recalculatePreferredSize, redisplay, refresh, releaseBufferedGraphics, removed, removeListener, repaint, repaint, repaintInWindowThread, repaintInWindowThread, repaintNow, repaintNow, repaintNow, repaintNow, requestPaint, requestResizeTo, resetAllCachedProperties, resetCachedProperties, resetRect, resizeTo, restore, restoreBorderModifiers, restoreFlags, resumeEventThread, scrollAndRepaint, sendToListeners, set, setAllFonts, setBackgroundImage, setBorder, setBorderModifiers, setCell, setChildAnchor, setClipObject, setControl, setCursor, setFieldTransfer, setFixedSize, setFont, setFontChange, setFreeDragging, setHidden, setHiddenParent, setHotKey, setHotKey, setLocation, setMaximumSize, setMenu, setMinimumSize, setPreferredSize, setPreferredTextSize, setPreferredTextSize, setPromptControl, setRect, setRect, setScaledBackgroundImage, setServer, setShadow, setSwiping, setTag, setTags, setText, setTextSize, setTiledBackgroundImage, setToolTip, showHoldDownIndicator, shown, simulateClickOn, simulateKeyPresses, simulateKeyType, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, startDragging, stopDragging, takeData, takeFromClipboard, testInWindowThread, ticked, tipIsDisplayed, toClipboard, toField, toField, toIDString, toString, toTextData, transferPenPress, transferPenPress, tryDragAndDrop, tryGetGraphics, tryNext, tryStartMenu, unhide, unlock, updateData, updateDCDuringDD, updateFrom, updateTo, verifyWantDrag, verifyWantHoldDown, waitEventThread, willAcceptDrop, willShowFrame, windowHasFloatingControls, writeLock
doubleSizeIt, getGuiTextHeight, isDoubleSized, isDoubleSizedFont, loadImage, tryLoadImage
public boolean dontAutoScroll
public static final int FIND_FOR_MOUSE_PRESS
public boolean dontFocusOnChildren
public boolean closedFocus
public boolean cycleFocus
public boolean takeNextFocus
public Dimension startAddPopupControl(Control c)
c
- the Control to show in this Container.preferredLocation
- a non-null Point indicating the location for the Control to be displayed.
A negative value for y or x, indicates that the co-ordinate represents where the center of the
displayed control should be.alternateLocation
- an optional alternate x and y locations (which are independent) to adjust
the location if the preferredLocation x or y places the control out of bounds of the container.public static void completeAddPopupControl(Control c, int x, int y, int width, int height)
c
- the Control to add.x
- the x location in the parent to place the Control.y
- the y location in the parent to place the Control.width
- the width to set the Control.height
- the height to set the Control.public static void removePopupControl(Control c)
c
- the Control added.public void addDirectly(Control control)
control
- protected void add(Control control)
public void hide(Control child, boolean update)
child
- the child to hide.update
- set true to relayout and repaint this control, false otherwise.
If you do not update the Control now you must do relayout(true) later to do an update.public void unhide(Control child, boolean update)
child
- the child to hide.update
- set true to relayout and repaint this control, false otherwise.
If you do not update the Control now you must do relayout(true) later to do an update.public void setHidden(Control child, boolean isHidden, boolean update)
child
- the child to make hidden or unhidden.isHidden
- true for it to be hidden, false for it to be unhidden.update
- set true to relayout and repaint this control, false otherwise.
If you do not update the Control now you must do relayout(true) later to do an update.public void relayout(boolean redisplay)
redisplay
- set true to repaint the Container.public void reShow(int x, int y, int toWidth, int toHeight)
x
- the new or same x location.y
- the new or same y location.toWidth
- the new or same width.toHeight
- the new or same height.public void remove(Control control)
public Control findChild(int x, int y, int findPurpose)
public Control findChild(int x, int y)
public void make(boolean reMake)
public ControlIterator getChildren(ControlIterator it, boolean backwards)
getChildren
in class Control
it
- an optional destination ControlIterator.backwards
- true to iterate through the children in the reverse order
in which they were added.public void repaintDataNow()
Control
repaintDataNow
in class Control
public void removeAll()
public void dismantle(Control stopAt)
public final void dismantle()
protected boolean doHotKey(Control from, KeyEvent ev)
Control
public Control getNextKeyFocus(Control sourceChild, boolean forwards)
getNextKeyFocus
in class Control
sourceChild
- the child control from which the call came from, or null if the call
came from the parent of this control, or this control itself.forwards
- true if the user wants to go to the next control, false if the user wants
to go to the previous one.protected Control getFirstFocus()
protected boolean takePromptControl(Control prompt)
takePromptControl
in class Control
prompt
- the Control acting as the prompt (usually an mLabel).public boolean containerHasFocus()
public void focusOnContainer(int how)
how
- one of the Control.ByXXX values (e.g. ByRequest)public void focusOnData(int how)
how
- one of the Control.ByXXX values (e.g. ByRequest)public void gotFocus(int how)
public void lostFocus(int how)
Control
public void focusFirst()
public void focusFirst(int how)
public void takeFocus(int how)
Control
public boolean scrollToVisible(int x, int y, int width, int height)
public void doPaint(Graphics g, Rect r)
Control
public static void grayOut(double alpha, Graphics g, int sx, int sy, int width, int height)