ewe.ui
Class ButtonControl

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

public class ButtonControl
extends Control

This is an intermediate class which is the base for mButtons and mCheckBoxes.


Field Summary
 boolean actionOnPress
           
 int alignment
           
 int anchor
           
 int arrowDirection
          This allows an optional arrow to be displayed along with the text and icon.
 boolean flatInside
           
 int imageAnchor
           
protected  boolean inPress
           
protected  boolean pressState
           
 boolean shouldRepeat
           
 boolean 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
ButtonControl()
           
 
Method Summary
 void activate()
          This does NOT enable a disabled control - but tells it to put itself in an "active" state.
 void deactivate()
          This does NOT disable a control - but tells it to put itself in a "non-active" state.
 void doAction(int how)
           
 void doPenHeld(Point p)
           
 void doPenPress(Point p)
           
 void dragged(DragContext dc)
          This is called during the drag operation.
 void fullAction(int how)
           
 void fullAction(int how, boolean repaint)
           
 void gotFocus(int how)
           
 void lostFocus(int how)
           
 void penHeld(Point p)
          Called when the Pen or Mouse button is held down on the control.
 void penPressed(Point p)
          Called when the Pen or Mouse button is pressed on the control.
 void penReleased(Point p)
          Called when the Pen or Mouse button is released on the control.
 void penRightReleased(Point p)
          Called when the right Mouse button is released on the control.
 void startDragging(DragContext dc)
          This is called to indicate the start of a pen/mouse drag operation.
 boolean startDropMenu(Point p)
           
 void stopDragging(DragContext dc)
          Called when the pen was released during a drag operation.
 
Methods inherited from class ewe.ui.Control
acceptsData, addListener, addTimer, amOnTopFrame, calculateSizes, 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, doPaint, doPaintChildren, doPaintChildren, doPaintChildren, doPaintData, 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, notifyAction, 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, setText, setTextSize, setToolTip, show, shown, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, takeData, takeFocus, takeFromClipboard, takePromptControl, testDim, ticked, 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

pressState

protected boolean pressState

inPress

protected boolean inPress

state

public boolean state

shouldRepeat

public boolean shouldRepeat

actionOnPress

public boolean actionOnPress

flatInside

public boolean flatInside

alignment

public int alignment

anchor

public int anchor

imageAnchor

public int imageAnchor

arrowDirection

public int arrowDirection
This allows an optional arrow to be displayed along with the text and icon. If it is 0, then no arrow is displayed. Otherwise it can be set to Up, Down, Left and Right.

Constructor Detail

ButtonControl

public ButtonControl()
Method Detail

gotFocus

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

lostFocus

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

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 Control
Parameters:
p - The point on the Control where the pen was pressed.

penHeld

public void penHeld(Point p)
Description copied from class: Control
Called when the Pen or Mouse button is held down on the control. This will only get called if the WantHoldDown modifier has been set for this 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.

This method is usually used to display a context sensitive menu. In fact the default code for it is:

                if (!menuIsActive()) doMenu(p);
        

Overrides:
penHeld in class Control
Parameters:
p - The point on the Control where the pen was held.

penReleased

public void penReleased(Point p)
Description copied from class: Control
Called when the Pen or Mouse button is released 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:
penReleased in class Control
Parameters:
p - The point on the Control where the pen was released.

startDragging

public void startDragging(DragContext dc)
Description copied from class: Control
This is called to indicate the start of a pen/mouse drag operation. This will only get called if the WantDrag modifier has been set for this control. Within this method you can call startDragAndDrop() or tryDragAndDrop() to begin a data DragAndDrop operation.

Overrides:
startDragging in class Control
Parameters:
dc - A DragContext indicating information about the dragging.

stopDragging

public void stopDragging(DragContext dc)
Description copied from class: Control
Called when the pen was released during a drag operation. This will only be called if a data DragAndDrop was not initiated and if the cancelled member of the DragContext was not set true during the operation.

Overrides:
stopDragging in class Control
Parameters:
dc - The DragContext for the dragging operation.

fullAction

public void fullAction(int how)

fullAction

public void fullAction(int how,
                       boolean repaint)

doAction

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

dragged

public void dragged(DragContext dc)
Description copied from class: Control
This is called during the drag operation. It is also called by default by the startDragging() method if you do not override it.

Overrides:
dragged in class Control
Parameters:
dc - The DragContext for the dragging operation.

penRightReleased

public void penRightReleased(Point p)
Description copied from class: Control
Called when the right Mouse button is released 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.

This method is usually used to display a context sensitive menu. In fact the default code for it is:

                if (!menuIsActive()) 
                        if (doMenu(p)) return;
                penReleased(p);
        

Overrides:
penRightReleased in class Control
Parameters:
p - The point on the Control where the pen was released.

doPenHeld

public void doPenHeld(Point p)

doPenPress

public void doPenPress(Point p)

startDropMenu

public boolean startDropMenu(Point p)

deactivate

public void deactivate()
Description copied from class: Control
This does NOT disable a control - but tells it to put itself in a "non-active" state. For example, a button that has is showing itself as being pressed, will show itself as not pressed when this is called.

If you want to disable a control do modify(Control.Disabled,0)

Overrides:
deactivate in class Control

activate

public void activate()
Description copied from class: Control
This does NOT enable a disabled control - but tells it to put itself in an "active" state. For example, a button in an active state looks as if the mouse/pen is being pressed down on it.

If you want to re-enable a disabled control do modify(0,Control.Disabled)

Overrides:
activate in class Control