public class CheckBox extends ButtonControl implements Booleanable
Modifier and Type | Field and Description |
---|---|
int |
boxWidth
Deprecated.
the box size is now matched to the text size.
|
static int |
defaultBoxWidth
Deprecated.
the box size is now matched to the text size.
|
static boolean |
defaultUseCross
If this is true a checkbox will draw an 'x' instead of a tick.
|
boolean |
dontBlink
Set this true to disable blinking of the Checkbox when it gets the keyboard focus.
|
CheckBoxGroup |
group |
boolean |
useCross
If this is true the checkbox will draw an 'x' instead of a tick.
|
actionOnPress, alignment, anchor, arrowDirection, flatInside, imageAnchor, inPress, pressState, shouldRepeat, state
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
Modifier and Type | Method and Description |
---|---|
protected void |
calculateSizes()
Override this to calculate the preferred, minimum and maximum size of your control.
|
void |
doAction(int how)
Do the action as appropriate for this Control - but do not send an Action event.
|
void |
doPaint(Graphics g,
Rect area)
This is the main method to override when doing custom Control painting.
|
void |
doPaintCircle(Graphics g) |
protected void |
doPaintData(Graphics g)
Repaint the "data" part of the Control.
|
void |
doPaintDiamond(Graphics g) |
void |
doPaintSquare(Graphics g) |
boolean |
getState() |
void |
gotFocus(int how)
This is called when the Control gets the focus.
|
boolean |
isExclusive() |
void |
lostFocus(int how)
This is called when the Control loses the focus.
|
void |
notifyAction()
Generate and send a standard "action" event for this Control.
|
void |
onLabelPenEvent(PenEvent pe)
This is called if the Pen/Mouse is pressed on the Label associated with this Control.
|
void |
penPressed(Point p)
Called when the Pen or Mouse button is pressed on the control.
|
CheckBox |
setGroup(CheckBoxGroup cbg)
Add this CheckBox to the CheckBoxGroup and return this CheckBox.
|
void |
setState(boolean to) |
void |
setText(String text)
Set the text of the Control, automatically repainting it.
|
void |
ticked(Object id,
long elapsed) |
activate, cancelPenPress, deactivate, displayAction, doPenHeld, doPenPress, dragged, fullAction, fullAction, penHeld, penReleased, penRightReleased, startDragging, startDropMenu, stopDragging
acceptsData, addListener, amOnTopFrame, applyFontChange, baseOnPenEvent, bufferGraphics, bufferGraphics, bufferGraphics, bufferGraphics, bufferGraphics, cache, calculatedSizes, calculateTextSize, calculateTextSize, calculateTextSize, cancelHoldDown, 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, defaultTo, deferInWindowThread, doActionKey, doBackground, doBorder, doHotKey, doMenu, dontAcceptDrop, doPaintChildren, doPaintData, doShowMenu, 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, 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, getNextKeyFocus, 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, make, makeFrameTopMost, makeHot, makeHot, makeInvisible, makeVisible, markAsTemporaryError, menuIsActive, menuStateChanged, modify, modifyAll, modifyAll, modifyFlags, mouseHover, newEventThread, notifyDataChange, notifyDataChange, notifyMenuItemSelected, notifyStructureChanged, onControlEvent, onEvent, onKeyEvent, onPenEvent, paintBackground, paintWithControlPainter, pauseEventThread, penClicked, penDoubleClicked, popupBeep, popupMenuClosed, popupMenuEvent, popupMenuEvent, postEvent, postInWindowThread, postUIEvent, putInside, queueKeyEvent, queuePenEvent, readLock, recalculatePreferredSize, redisplay, refresh, releaseBufferedGraphics, removed, removeListener, repaint, repaint, repaintDataNow, 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, setTextSize, setTiledBackgroundImage, setToolTip, showHoldDownIndicator, shown, simulateClickOn, simulateKeyPresses, simulateKeyType, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, takeData, takeFocus, takeFromClipboard, takePromptControl, testInWindowThread, 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 dontBlink
public CheckBoxGroup group
public static int defaultBoxWidth
public static boolean defaultUseCross
public int boxWidth
public boolean useCross
public CheckBox()
public CheckBox(String txt)
public void onLabelPenEvent(PenEvent pe)
Control
onLabelPenEvent
in class ButtonControl
public void gotFocus(int how)
Control
gotFocus
in class ButtonControl
how
- one of the ByXXX values.public void lostFocus(int how)
Control
lostFocus
in class ButtonControl
how
- one of the ByXXX values.public void penPressed(Point p)
Control
Within this method you can use the Control.Gui.currentPenPress() value to find out more about the PenEvent that caused this - including any modifiers (e.g. SHIFT keys) or determine if the left or right mouse button was pressed.
penPressed
in class ButtonControl
p
- The point on the Control where the pen was pressed.public void ticked(Object id, long elapsed)
protected void calculateSizes()
Control
calculateSizes
in class Control
public boolean isExclusive()
public void doPaint(Graphics g, Rect area)
Control
protected void doPaintData(Graphics g)
Control
doPaintData
in class Control
g
- The Graphics object to paint to.public void doPaintSquare(Graphics g)
public void doPaintCircle(Graphics g)
public void doPaintDiamond(Graphics g)
public boolean getState()
getState
in interface Booleanable
public void setState(boolean to)
setState
in interface Booleanable
public void doAction(int how)
Control
doAction
in class ButtonControl
how
- one of the ByXXX values.public CheckBox setGroup(CheckBoxGroup cbg)
cbg
- the Group to add to.public void setText(String text)
Control
public void notifyAction()
Control
notifyAction
in class Control