ewe.ui
Class mCheckBox

java.lang.Object
  extended byewe.ui.ControlBase
      extended byewe.ui.Control
          extended byewe.ui.ButtonControl
              extended byewe.ui.mCheckBox
All Implemented Interfaces:
Booleanable, CellConstants, ControlConstants, EventListener, ImageRefresher, TimerProc, UIConstants
Direct Known Subclasses:
ButtonCheckBox

public class mCheckBox
extends ButtonControl
implements Booleanable


Field Summary
 int boxWidth
          This width of the box - this is initialized to defaultBoxWidth.
static int defaultBoxWidth
          This is the default width of the box.
static boolean defaultUseCross
          If this is true a checkbox will draw an 'x' instead of a tick.
 CheckBoxGroup group
           
 boolean useCross
          If this is true the checkbox will draw an 'x' instead of a tick.
 
Fields inherited from class ewe.ui.ButtonControl
actionOnPress, alignment, anchor, arrowDirection, flatInside, imageAnchor, inPress, pressState, shouldRepeat, state
 
Fields inherited from class ewe.ui.Control
_debug, backGround, beforeRemoved, borderColor, borderStyle, borderWidth, children, columns, constraints, DoPaintMethod, dragging, dragResolution, dragTime, exitKeys, fieldTransfer, font, foreGround, haveNativePaint, height, holdDownPause, holdTick, hotKey, image, lastSelected, listeners, maxHeight, maxWidth, menuState, minHeight, minWidth, modifiers, MyClass, name, next, np, parent, penStatus, popupSound, popupSoundClip, preferredHeight, preferredWidth, prev, prompt, promptControl, rows, ss, standardBorder, standardEdge, startDragResolution, tags, tail, text, toolTip, width, x, y
 
Fields inherited from class ewe.ui.ControlBase
clipItems, clipObject, clipOwner, curPoint, currentPenEvent, debugControl, debugFlag, DidHoldDown, doubleBuffer, doubleClickTime, firstPress, globalDrawFlat, globalEditable, globalEnabled, globalPalmStyle, globalSmallControls, GotPenDown, PenIsOn, pressPoint, TAG_LAST_USER_DATA, TAG_USER_DATA, TAKE_FIRST_PRESS, unnamed, useNativeTextInput
 
Fields inherited from interface ewe.ui.UIConstants
BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, 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
 
Fields inherited from interface ewe.ui.CellConstants
BORDER, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, FIXEDSIZE, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST
 
Fields inherited from interface ewe.ui.ControlConstants
All, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, Disabled, DisablePopupMenu, DisplayOnly, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpKeyEvents, SendUpPenEvents, ShowSIP, ShrinkToNothing, SmallControl, SpecialBackground, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown
 
Fields inherited from interface ewe.fx.ImageRefresher
KEEP_VISIBLE
 
Constructor Summary
mCheckBox()
           
mCheckBox(String txt)
           
 
Method Summary
protected  void calculateSizes()
          Override this to calculate the preferred, minimum and maximum size of your control.
 void doAction(int how)
           
 void doPaint(Graphics g, Rect area)
           
 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)
           
 boolean isExclusive()
           
 void lostFocus(int how)
           
 void notifyAction()
           
 void penPressed(Point p)
          Called when the Pen or Mouse button is pressed on the control.
 mCheckBox setGroup(CheckBoxGroup cbg)
           
 void setState(boolean to)
           
 void setText(String text)
           
 void ticked(int id, int elapsed)
           
 
Methods inherited from class ewe.ui.ButtonControl
activate, deactivate, doPenHeld, doPenPress, dragged, fullAction, fullAction, penHeld, penReleased, penRightReleased, startDragging, startDropMenu, stopDragging
 
Methods inherited from class ewe.ui.Control
acceptsData, addListener, addTimer, amOnTopFrame, calculateTextSize, cancelCut, cancelHoldDown, canEdit, chainDataChange, change, checkClipboardOperations, checkExitKey, checkMenu, checkMenuKey, checkModifiers, checkPenTransparent, clearTag, clipboardToString, clipboardTransfer, closeMenu, contains, contains, createGraphics, dataAccepted, dataBeingRemoved, dataDraggedOff, dataDraggedOver, dataDraggedOver, dataDroppedOn, dataTransferCancelled, defaultTo, doActionKey, doBackground, doBorder, doHotKey, doMenu, dontAcceptDrop, doPaintChildren, doPaintChildren, doPaintChildren, doPaintData, doShowMenu, exitEntry, fillBackground, formClosing, fromClipboard, fromField, fromField, getAllDescendants, getAllSubControls, getBackground, getChildren, getChildrenBackwards, getClipboardMenu, getClipObject, getControlBuffer, getControlBuffer, getDataRect, getDataToCopy, getDataToDragAndDrop, getDim, getDisplayText, getDragAndDropContext, getFont, getFontMetrics, getFontMetrics, getForeground, getFrame, getFrameOrContainer, getGraphics, getImage, getLastSelected, getLocation, getMaximumSize, getMenu, getMinimumSize, getModifiers, getNext, getNextKeyFocus, getParent, getPasswordCharacter, getPosInFrame, getPosInParent, getPreferredSize, getPrompt, getPromptText, getRect, getRect, getServer, getSize, getSizes, getSubControls, getTag, getText, getToolTip, getWindow, hasModifier, hasPopupFormAttached, hasTag, inheritModifiers, isChildOf, isModal, isOnMe, isSomeonesHotKey, make, makeFrameTopMost, makeHot, menuIsActive, modify, modifyAll, modifyAll, notifyDataChange, notifyDataChange, notNative_doPaintChildren, oldButWorksDoPaintChildren, oldPaintChildren, oldPostEvent, onControlEvent, onEvent, onKeyEvent, onLabelPenEvent, onPaint, onPenEvent, paintBackground, paintChildren, penClicked, penDoubleClicked, popupBeep, popupMenuClosed, popupMenuEvent, popupMenuEvent, postEvent, recalculatePreferredSize, redisplay, refresh, removeListener, removeTimer, repaint, repaintDataNow, repaintNow, repaintNow, repaintNow, requestPaint, requestResizeTo, resetRect, resizeTo, restore, scrollAndRepaint, sendToListeners, set, setBorder, setCell, setClipObject, setControl, setCursor, setFixedSize, setFont, setHotKey, setHotKey, setLocation, setMaximumSize, setMenu, setMinimumSize, setPreferredSize, setPromptControl, setRect, setRect, setServer, setTag, setTags, setTextSize, setToolTip, show, shown, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, takeData, takeFocus, takeFromClipboard, takePromptControl, testDim, toClipboard, toField, toField, toString, toTextData, transferPenPress, transferPenPress, tryDragAndDrop, tryNext, tryStartMenu, updateData, willAcceptDrop, willShowFrame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode
 

Field Detail

group

public CheckBoxGroup group

defaultBoxWidth

public static int defaultBoxWidth
This is the default width of the box. By default it is 15.


defaultUseCross

public static boolean defaultUseCross
If this is true a checkbox will draw an 'x' instead of a tick.


boxWidth

public int boxWidth
This width of the box - this is initialized to defaultBoxWidth.


useCross

public boolean useCross
If this is true the checkbox will draw an 'x' instead of a tick. It is initialized to defaultUseCross;

Constructor Detail

mCheckBox

public mCheckBox()

mCheckBox

public mCheckBox(String txt)
Method Detail

gotFocus

public void gotFocus(int how)
Overrides:
gotFocus in class ButtonControl

lostFocus

public void lostFocus(int how)
Overrides:
lostFocus in class ButtonControl

penPressed

public void penPressed(Point p)
Description copied from class: Control
Called when the Pen or Mouse button is pressed on the control. This is called by the onPenEvent(PenEvent ev) method.

Within this method you can use the Control.currentPenEvent 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.

Overrides:
penPressed in class ButtonControl

ticked

public void ticked(int id,
                   int elapsed)
Specified by:
ticked in interface TimerProc
Overrides:
ticked in class Control

calculateSizes

protected void calculateSizes()
Description copied from class: Control
Override this to calculate the preferred, minimum and maximum size of your control. This is only called once unless the modifier flag AlwaysRecalculateSizes is true. During the calculation you will set the variables preferredWidth, preferredHeight, etc. directly.

Overrides:
calculateSizes in class Control

isExclusive

public boolean isExclusive()

doPaint

public void doPaint(Graphics g,
                    Rect area)
Overrides:
doPaint in class Control

doPaintData

protected void doPaintData(Graphics g)
Description copied from class: Control
Repaint the "data" part of the Control. This is only used for Controls with the HasData modifier. These are controls that distinguish between their data (e.g. contained text) and non-data (e.g. border) on-screen display.

Overrides:
doPaintData in class Control
Parameters:
g - The Graphics object to paint to.

doPaintSquare

public void doPaintSquare(Graphics g)

doPaintCircle

public void doPaintCircle(Graphics g)

doPaintDiamond

public void doPaintDiamond(Graphics g)

getState

public boolean getState()
Specified by:
getState in interface Booleanable

setState

public void setState(boolean to)
Specified by:
setState in interface Booleanable

doAction

public void doAction(int how)
Overrides:
doAction in class ButtonControl

setGroup

public mCheckBox setGroup(CheckBoxGroup cbg)

setText

public void setText(String text)
Overrides:
setText in class Control

notifyAction

public void notifyAction()
Overrides:
notifyAction in class Control