|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.ui.ControlBase
ewe.ui.Control
Control is the base class for user-interface objects. Here are some common tasks you may need to do on all Controls.
To repaint a Control call the repaintNow() method.
To enable/disable a Control use the modify() method. This method will set/clear modifier flags (listed in the ewe.ui.ControlConstants interface) for the Control.
| Field Summary | |
boolean |
_debug
|
Color |
backGround
|
protected static Object |
beforeRemoved
A temporary holding spot for data in the process of being moved. |
Color |
borderColor
The Color of the border of the Control (if a single line, non-3D border is used). |
int |
borderStyle
The border style of the Control. |
int |
borderWidth
|
protected Control |
children
The children of the container. |
int |
columns
|
int |
constraints
|
protected Object |
DoPaintMethod
|
DragContext |
dragging
|
int |
dragResolution
The minimum number of pixels that the Pen/Mouse has to move during a drag operation to be considered a drag to a new location. |
int |
dragTime
Use this to control the resolution of the pen drags - it is the minimum delay in milliseconds between processing pen drags. |
int[] |
exitKeys
|
FieldTransfer |
fieldTransfer
|
Font |
font
|
Color |
foreGround
|
protected static boolean |
haveNativePaint
|
protected int |
height
The control's height |
int |
holdDownPause
|
int |
holdTick
|
int |
hotKey
This is the "HotKey" for the control - use setHotKey() to set it. |
IImage |
image
|
protected MenuItem |
lastSelected
|
protected Vector |
listeners
|
protected int |
maxHeight
Do not set this directly - use setMaximumSize() instead. |
protected int |
maxWidth
Do not set this directly - use setMaximumSize() instead. |
MenuState |
menuState
This holds a MenuState Object used for controlling the Menu associated with the Control. |
protected int |
minHeight
Do not set this directly - use setMinimumSize() instead. |
protected int |
minWidth
Do not set this directly - use setMinimumSize() instead. |
protected int |
modifiers
Modifiers of the control. |
protected Object |
MyClass
|
String |
name
|
protected Control |
next
The control's next sibling. |
static Point |
np
|
protected Container |
parent
The parent of the control. |
int |
penStatus
|
static String |
popupSound
This is the sound that is played when a popup-menu or pull-down menu is first shown. |
static SoundClip |
popupSoundClip
|
protected int |
preferredHeight
Do not set this directly - use setPrefferedSize() instead. |
protected int |
preferredWidth
Do not set this directly - use setPrefferedSize() instead. |
protected Control |
prev
The control's previous sibling. |
String |
prompt
This is an optional string that is used as a user informative prompt for the control. |
Control |
promptControl
This is optional - if an mLabel is used as the on-screen prompt for this control, then set this value to be that control. |
int |
rows
|
protected ScrollServer |
ss
|
static int |
standardBorder
|
static int |
standardEdge
|
int |
startDragResolution
The number of pixels that the Pen/Mouse has to move before it is considered the start of a drag operation. |
TagList |
tags
|
protected Control |
tail
The tail of the children list. |
String |
text
The text associated with the control. |
Object |
toolTip
The object's tool tip which should be a String, IImage, Control or ToolTip |
protected int |
width
The control's width |
protected int |
x
The control's x location |
protected int |
y
The control's y location |
| 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 | |
Control()
|
|
| Method Summary | |
boolean |
acceptsData(Object data,
DragContext how)
This should indicate whether this control will accept the data either via a drag and drop or via a paste operation. |
void |
activate()
This does NOT enable a disabled control - but tells it to put itself in an "active" state. |
void |
addListener(EventListener list)
|
Timer |
addTimer(int millis)
Deprecated. Use ewe.sys.Vm.requestTimer(); |
boolean |
amOnTopFrame()
|
protected void |
calculateSizes()
Override this to calculate the preferred, minimum and maximum size of your control. |
protected Dimension |
calculateTextSize(int width,
int height,
Dimension dest)
|
static void |
cancelCut(Control forWho)
If a Control is in the middle of a cut operation this will cancel the operation. |
static void |
cancelHoldDown()
|
boolean |
canEdit()
|
void |
chainDataChange(Control other,
String fieldName)
This sets up the Control, such that if the "other" control generates a DataChangeEvent then this Control will also generate a DataChangeEvent. |
boolean |
change(int flagsToSet,
int flagsToClear)
This ensures that the specified flags are set or clear. |
boolean |
checkClipboardOperations(Menu m)
This is called to enable/disable the clipboard options depending on the state of the Control. |
protected boolean |
checkExitKey(KeyEvent ev)
|
boolean |
checkMenu(Menu m)
This is called before a menu is displayed. |
boolean |
checkMenuKey(KeyEvent ev,
Point where)
This checks the incoming KeyEvent to see if it should cause this Control to show a menu. |
boolean |
checkModifiers(int flagsSet,
int flagsClear)
This checks if the specified flags are set or clear. |
boolean |
checkPenTransparent(PenEvent ev)
|
Control |
clearTag(int tag)
|
String |
clipboardToString(Object what)
|
Object |
clipboardTransfer(Object clip,
boolean toClipboard,
boolean cut)
|
void |
closeMenu()
If a menu for the control is being displayed, this will close it. |
boolean |
contains(Control who)
|
boolean |
contains(int x,
int y)
Returns true if the given x and y coordinate in the parent's coordinate system is contained within this control. |
Graphics |
createGraphics()
Deprecated. Use getGraphics() instead. |
protected void |
dataAccepted(Control byWho,
Object data,
String action)
This is called either when data that was cut from this control was pasted into another control, OR when data that was dragged from this control is dropped into another control. |
protected void |
dataBeingRemoved(Object data,
DragContext dc)
This tells the control that data is being removed from it either via a cut operation or by a drag operation that is not explicitly a copy operation. |
void |
dataDraggedOff(Object data)
This is called when data that was previously dragged into the control has now been dragged off. |
void |
dataDraggedOver(Object data)
This is called when data is being dragged into the control. |
void |
dataDraggedOver(Object data,
Point p,
PenEvent ev)
This is called when data is being dragged into the control. |
boolean |
dataDroppedOn(Object data,
Point p,
DragContext dc)
This is called by a drop from a drag and drop operation. |
protected void |
dataTransferCancelled(Object data)
This gets called either when that was cut from this control was not placed into another control (either it was rejected by a paste or a subsequent copy/cut into the clipboard occured before the data was pasted) or a drag and drop was initiated but not completed. |
void |
deactivate()
This does NOT disable a control - but tells it to put itself in a "non-active" state. |
Control |
defaultTo(int tag,
Object value)
|
void |
doAction(int how)
|
void |
doActionKey(int key)
|
void |
doBackground(Graphics g)
|
void |
doBorder(Graphics g)
|
protected boolean |
doHotKey(Control from,
KeyEvent ev)
This method checks to see if a KeyEvent should be considered the Control's hot-key. |
boolean |
doMenu(Point p)
This is a request to display a menu based on the pen being held or the mouse being right clicked on the Control. |
protected void |
dontAcceptDrop()
Should be called from the dataDraggedOver() method to indicate that the Control is willing to accept the data. |
void |
doPaint(Graphics g,
Rect r)
|
static void |
doPaintChildren(Control who,
int flags,
Graphics g,
Rect area)
|
protected static void |
doPaintChildren(Control who,
int flags,
Graphics g,
Rect area,
Rect clip)
|
void |
doPaintChildren(Graphics g,
int x,
int y,
int w,
int h)
|
protected void |
doPaintData()
Repaint the "data" part of the Control. |
protected void |
doPaintData(Graphics g)
Repaint the "data" part of the Control. |
protected boolean |
doShowMenu(Point pen)
Used to show the menu associated with the Control. |
void |
dragged(DragContext dc)
This is called during the drag operation. |
boolean |
exitEntry(int exitKey,
int modifiers)
If this returns false it means it is already in exitEntry. |
void |
fillBackground(Graphics g)
|
protected void |
formClosing()
This is called to indicate that the Form is about to close and it causes a FormClosed event to be posted. |
void |
fromClipboard()
Paste the contents of the clipboard into the control, overwriting any exisiting selected area. |
void |
fromField()
|
void |
fromField(FieldTransfer ft)
|
Iterator |
getAllDescendants(boolean backwards)
Get all the sub-controls for this Control and their sub-controls. |
Iterator |
getAllSubControls()
Get all the sub-controls for this Control and their sub-controls. |
Color |
getBackground()
|
Iterator |
getChildren()
This iterator cycles through the components which are physically added to this Control |
Iterator |
getChildrenBackwards()
|
Menu |
getClipboardMenu(Menu addTo)
This adds the standard clipboard menu to a menu to be used by this control. |
static Object |
getClipObject()
|
Image |
getControlBuffer()
|
Image |
getControlBuffer(Rect r)
|
protected Rect |
getDataRect(Rect dest)
Get the rectangle, relative to the Control, of the area considered to be the "data" part of the control. |
protected Object |
getDataToCopy()
This is called to get data from the control to put into the clipboard. |
protected boolean |
getDataToDragAndDrop(DragContext dc)
A quick way to provide DragAndDrop data. |
Rect |
getDim(Rect dest)
|
String |
getDisplayText()
By default getDisplayText() returns getText(); |
static DragContext |
getDragAndDropContext()
|
Font |
getFont()
|
FontMetrics |
getFontMetrics()
|
FontMetrics |
getFontMetrics(Font font)
Returns the font metrics for a given font. |
Color |
getForeground()
|
Frame |
getFrame()
|
Container |
getFrameOrContainer()
|
Graphics |
getGraphics()
Return a Graphics context for this control for drawing directly onto the window surface. |
IImage |
getImage()
|
MenuItem |
getLastSelected()
Find the menu item which was last selected. |
Point |
getLocation(Point dest)
|
Dimension |
getMaximumSize(Dimension dest)
|
Menu |
getMenu()
Return the Menu associated with the Control if any. |
Dimension |
getMinimumSize(Dimension dest)
|
int |
getModifiers(boolean shouldInherit)
This will get the modifiers for this control. |
Control |
getNext()
Returns the next child in the parent's list of controls. |
Control |
getNextKeyFocus(Control sourceChild,
boolean forwards)
Determine which sub-control should receive the keyboard focus. |
Container |
getParent()
Returns the control's parent container. |
char |
getPasswordCharacter()
If this Control represents the input of a password that must be kept hidden, then this method should return a password character (usually a '*'). |
Point |
getPosInFrame()
|
Point |
getPosInParent(Container parent)
|
Dimension |
getPreferredSize(Dimension dest)
|
String |
getPrompt()
|
String |
getPromptText()
This returns either the value of prompt, if it is not null and not an empty string, or the text value of promptControl, if that is not null and not an empty string. |
Rect |
getRect()
Returns a copy of the control's rectangle. |
Rect |
getRect(Rect dest)
|
ScrollServer |
getServer()
|
Dimension |
getSize(Dimension dest)
|
int[] |
getSizes(int[] values)
This gets all of the control sizes. |
Iterator |
getSubControls()
|
Object |
getTag(int tag,
Object defaultValue)
|
String |
getText()
|
Object |
getToolTip(int x,
int y)
This should return an acceptable ToolTip object. |
Window |
getWindow()
|
void |
gotFocus(int how)
|
boolean |
hasModifier(int what,
boolean shouldInherit)
Check if the control has the specified modifier flags set. |
boolean |
hasPopupFormAttached()
Returns true if a ControlPopupForm is attached to this Control. |
boolean |
hasTag(int tag)
|
void |
inheritModifiers(Control fromWho,
boolean inheritFromAll,
int what,
boolean setChildren)
Get particular modifiers flags from another control and optionally set children flags. |
boolean |
isChildOf(Container who)
|
boolean |
isModal()
This determines if the Control is being displayed in a modal frame. |
protected boolean |
isOnMe(Point p)
Checks if the Point p - which is relative to the top-left of this Control, is within the bounds of the Control. |
protected boolean |
isSomeonesHotKey(KeyEvent ev)
|
void |
lostFocus(int how)
|
void |
make(boolean reMake)
This is used to "make" the control before being displayed. |
void |
makeFrameTopMost()
|
String |
makeHot(String label)
Format the String as a true Hotkey encoded string using the hotkey associated with this control (if any). |
boolean |
menuIsActive()
Returns if the Menu associated with the Control is displayed. |
int |
modify(int flagsToSet,
int flagsToClear)
Set/Clear modifier flags for the Control. |
void |
modifyAll(int set,
int clear)
Modify this control and all child controls (and their children). |
void |
modifyAll(int set,
int clear,
boolean doThisOne)
Modify all child controls (and their children). |
void |
notifyAction()
|
void |
notifyDataChange()
Generate and dispatch a new DataChangeEvent. |
void |
notifyDataChange(DataChangeEvent dce)
Dispatch a new DataChangeEvent. |
static void |
notNative_doPaintChildren(Control who,
int flags,
Graphics g,
Rect area)
|
void |
oldButWorksDoPaintChildren(Graphics g,
int x,
int y,
int w,
int h)
|
void |
oldPaintChildren(Graphics g,
int x,
int y,
int width,
int height)
|
void |
oldPostEvent(Event event)
Deprecated. |
void |
onControlEvent(ControlEvent ev)
|
void |
onEvent(Event ev)
|
void |
onKeyEvent(KeyEvent ev)
|
void |
onLabelPenEvent(PenEvent ev)
|
void |
onPaint(Graphics gr)
Deprecated. Use doPaint() instead. |
void |
onPenEvent(PenEvent ev)
Called to handle an incoming PenEvent. |
void |
paintBackground(Graphics g)
|
void |
paintChildren(Graphics gr,
int x,
int y,
int w,
int h)
|
void |
penClicked(Point p)
Called if the Pen or Mouse button is quickly pressed and released. |
void |
penDoubleClicked(Point p)
Called if the Pen or Mouse button is double clicked on the Control. |
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. |
static void |
popupBeep()
This is called when a popup-menu or pull-down menu is first shown. |
protected void |
popupMenuClosed(Menu m)
This gets closed after the popup menu for the Control has closed. |
void |
popupMenuEvent(MenuEvent ev)
This is called when the popup menu associated with the control generates an event. |
void |
popupMenuEvent(Object selectedItem)
This is called when the user selects an item from the popup menu. |
void |
postEvent(Event ev)
|
Dimension |
recalculatePreferredSize(Dimension dest)
|
void |
redisplay()
Do not use this to repaint a control - use repaintNow() instead. |
void |
refresh(IImage image,
int options)
The default version of this method simpy repaints the control - however for controls which may display multiple images a better refresh scheme would be needed. |
void |
removeListener(EventListener list)
|
boolean |
removeTimer(Timer timer)
Deprecated. Use ewe.sys.Vm.requestTimer() and ewe.sys.Vm.cancelTimer(); |
void |
repaint()
This calls a repaintNow() using a CallBack - it does not repaint immediately. |
void |
repaintDataNow()
Repaint the "data" part of the Control now. |
void |
repaintNow()
Repaint the Control now. |
void |
repaintNow(boolean yes)
Repaint the Control now if the "yes" parameter is true. |
void |
repaintNow(Graphics gr,
Rect where)
Repaint a section of the Control now. |
boolean |
requestPaint()
Call this if you are going to be painting all or a portion of the control at an arbitrary time. |
void |
requestResizeTo(int width,
int height)
This requests that the size be changed to the following dimensions but the control is free to ignore it or to change to a different value. |
void |
resetRect()
|
void |
resizeTo(int width,
int height)
This will change the width and height values. |
void |
restore(int oldValue,
int mask)
Restore the modifier flags to their previous value. |
void |
scrollAndRepaint(int sx,
int sy,
int sw,
int sh,
int destX,
int destY)
This is called to update a Control on-screen after it has been scrolled. |
void |
sendToListeners(Event ev)
|
int |
set(int flag,
boolean status)
Switch on or off a modifier depending on the status parameter. |
Control |
setBorder(int style,
int width)
This sets both the border style and width of the Control |
Control |
setCell(int val)
|
static void |
setClipObject(Object obj)
|
Control |
setControl(int val)
|
void |
setCursor(int cursor)
Set the cursor for the control. |
Control |
setFixedSize(int width,
int height)
|
Control |
setFont(Font f)
Set the Font for the control. |
Control |
setHotKey(int modifiers,
char key)
Set the hot-key for this Control. |
Control |
setHotKey(int modifiers,
int key)
Set the hot-key for this Control. |
void |
setLocation(int x,
int y)
|
Control |
setMaximumSize(int width,
int height)
|
void |
setMenu(Menu menu)
Associate a context sensitive menu with the Control. |
Control |
setMinimumSize(int width,
int height)
|
Control |
setPreferredSize(int width,
int height)
|
void |
setPromptControl(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 |
setRect(int x,
int y,
int width,
int height)
|
void |
setRect(Rect r)
|
void |
setServer(ScrollServer server)
|
Control |
setTag(int tag,
Object value)
|
Control |
setTags(TagList tl)
|
void |
setText(String what)
|
Control |
setTextSize(int width,
int height)
|
Control |
setToolTip(Object tip)
Set the tooltip of the object. |
void |
show(Rect where)
|
void |
shown()
|
void |
standardOnKeyEvent(KeyEvent ev)
This is the standard Control onKeyEvent() - call this only after you have checked for other keys that your control definitely wants to trap. |
protected boolean |
startDragAndDrop(Object data,
boolean isMultiple,
boolean isCopy)
Called by a Control from within the startDragging() method to indicate that a DragAndDrop operation should begin. |
protected boolean |
startDragAndDrop(Object data,
int dragCursor,
boolean isCopy)
Called by a Control from within the startDragging() method to indicate that a DragAndDrop operation should begin. |
void |
startDragging(DragContext dc)
This is called to indicate the start of a pen/mouse drag operation. |
void |
stopDragging(DragContext dc)
Called when the pen was released during a drag operation. |
boolean |
takeData(Object data,
DragContext how)
This tells the Control to take the data which has either come from a clipboard operation or from a DragAndDrop. |
void |
takeFocus(int how)
|
protected void |
takeFromClipboard(Object clip,
String action)
This calls takeData(data,null) and then calls dataAccepted(this,data,action) on the clipOwner. |
protected boolean |
takePromptControl(Control prompt)
|
protected boolean |
testDim(Dimension dest,
int w,
int h)
|
void |
ticked(int id,
int elapsed)
|
void |
toClipboard(boolean cut)
Copy the selected contents of the control to clipboard. |
void |
toField()
|
void |
toField(FieldTransfer ft)
|
String |
toString()
Return a String representation of this object. |
static Object |
toTextData(Object data)
This converts an object into either a String or an array of Strings. |
void |
transferPenPress(Control toChild)
This is used to transfer a pen press to a Control that is contained within this child control tree of this Control. |
void |
transferPenPress(Control toWho,
int dx,
int dy)
This is used to transfer a pen press to another Control. |
protected boolean |
tryDragAndDrop(DragContext dc)
Call this from startDragging() if you want to try to do a drag and drop. |
boolean |
tryNext(boolean forwards)
|
boolean |
tryStartMenu(Point pen)
This attempts to display a Menu for the Control if one exists AND is not already displayed. |
void |
updateData()
This tells the control to consider its current data to be unchanged. |
protected void |
willAcceptDrop()
Should be called from the dataDraggedOver() method to indicate that the Control is not willing to accept the data. |
boolean |
willShowFrame(PenEvent ev)
This is used to indicate that the control is going to show a pop-up Frame of some sort (e.g. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode |
| Field Detail |
protected int x
protected int y
protected int width
protected int height
protected Container parent
protected Control next
protected Control prev
protected Control children
protected Control tail
protected int modifiers
protected Object DoPaintMethod
protected Object MyClass
public int hotKey
public int borderStyle
public Color borderColor
public int penStatus
public int borderWidth
public String name
public String prompt
public Control promptControl
public boolean _debug
public Object toolTip
protected int preferredWidth
protected int preferredHeight
protected int minWidth
protected int minHeight
protected int maxWidth
protected int maxHeight
public Color backGround
public Color foreGround
public Font font
public IImage image
protected static boolean haveNativePaint
protected Vector listeners
public static final Point np
public int holdDownPause
public int holdTick
public DragContext dragging
public int[] exitKeys
public int dragResolution
public int startDragResolution
public MenuState menuState
public int dragTime
protected static Object beforeRemoved
public String text
public int rows
public int columns
public int constraints
public TagList tags
public static String popupSound
public static SoundClip popupSoundClip
protected MenuItem lastSelected
protected ScrollServer ss
public FieldTransfer fieldTransfer
public static int standardEdge
public static int standardBorder
| Constructor Detail |
public Control()
| Method Detail |
public Timer addTimer(int millis)
public boolean removeTimer(Timer timer)
public FontMetrics getFontMetrics(Font font)
public Rect getRect()
public Container getParent()
public Control getNext()
public boolean contains(int x,
int y)
public void repaint()
public Graphics createGraphics()
public void oldPostEvent(Event event)
Eventpublic void setPromptControl(Control prompt)
prompt - the Control acting as the prompt (usually an mLabel).protected boolean takePromptControl(Control prompt)
public String toString()
Object
toString in class Objectpublic Iterator getChildren()
public Iterator getChildrenBackwards()
public Iterator getAllDescendants(boolean backwards)
public Iterator getAllSubControls()
public Iterator getSubControls()
public void activate()
If you want to re-enable a disabled control do modify(0,Control.Disabled)
public void deactivate()
If you want to disable a control do modify(Control.Disabled,0)
public final int set(int flag,
boolean status)
flag - The flags to set on or off.status - if true the flags will be set on, if false they will be set off.
public int modify(int flagsToSet,
int flagsToClear)
int old = myControl.modify(flagsSet,flagsClear);
//do some processing...
myControl.restore(old,flagsSet|flagsClear);
flagsToSet - The flags to set.flagsToClear - The flags to clear.
public void restore(int oldValue,
int mask)
int old = myControl.modify(flagsSet,flagsClear);
//do some processing...
myControl.restore(old,flagsSet|flagsClear);
oldValue - the value returned by modify().mask - the paramters flagsToSet OR'ed with flagsToClear as used in the modify() method.
public boolean checkModifiers(int flagsSet,
int flagsClear)
flagsSet - Flags to check for being set.flagsClear - Flags to check for being clear.
public boolean change(int flagsToSet,
int flagsToClear)
public boolean hasModifier(int what,
boolean shouldInherit)
what - The modifier flags to check for.shouldInherit - if this is true then all parents of the control will also be checked.
public int getModifiers(boolean shouldInherit)
public final void inheritModifiers(Control fromWho,
boolean inheritFromAll,
int what,
boolean setChildren)
fromWho - The control to get from.inheritFromAll - if this is true then also check the ancestors of the control for the flags.what - the flags to get (or'ed together).setChildren - if this is true then modify my children.
public void modifyAll(int set,
int clear)
set - The flags to set.clear - The flags to clear.
public void modifyAll(int set,
int clear,
boolean doThisOne)
set - The flags to set.clear - The flags to clear.doThisOne - if this is true then this control will also be modified.public Control setToolTip(Object tip)
tip - the tip which should be a String, IImage, Control or ToolTip
public Object getToolTip(int x,
int y)
x - The x location of the mouse in this control.y - The y location of the mouse in this control.
public final Dimension recalculatePreferredSize(Dimension dest)
protected boolean testDim(Dimension dest,
int w,
int h)
public Control setFixedSize(int width,
int height)
public Control setPreferredSize(int width,
int height)
public Control setTextSize(int width,
int height)
public Control setMinimumSize(int width,
int height)
public Control setMaximumSize(int width,
int height)
public int[] getSizes(int[] values)
public Dimension getPreferredSize(Dimension dest)
public Dimension getMinimumSize(Dimension dest)
public Dimension getMaximumSize(Dimension dest)
protected void calculateSizes()
protected Dimension calculateTextSize(int width,
int height,
Dimension dest)
public void make(boolean reMake)
reMake - if this is true then you should do a full re-make.
public void resizeTo(int width,
int height)
public void redisplay()
public void requestResizeTo(int width,
int height)
public Rect getRect(Rect dest)
public void setRect(Rect r)
public void setRect(int x,
int y,
int width,
int height)
public Rect getDim(Rect dest)
public Dimension getSize(Dimension dest)
public Point getLocation(Point dest)
public void setLocation(int x,
int y)
protected Rect getDataRect(Rect dest)
dest - The destination rectangle.
protected final void doPaintData()
protected void doPaintData(Graphics g)
g - The Graphics object to paint to.public void repaintDataNow()
public void repaintNow()
public void repaintNow(boolean yes)
public void repaintNow(Graphics gr,
Rect where)
gr - The Graphics to paint to. If this is null a new Graphics will be created.where - The rectangle within the Control to paint. If this is null the entire Control will be painted.public void onPaint(Graphics gr)
gr - The graphics to paint to.public void doBackground(Graphics g)
public Image getControlBuffer(Rect r)
throws SystemResourceException
SystemResourceExceptionpublic Image getControlBuffer()
public void doPaint(Graphics g,
Rect r)
public void paintBackground(Graphics g)
public IImage getImage()
public Font getFont()
public Color getBackground()
public Color getForeground()
public void doBorder(Graphics g)
public void oldButWorksDoPaintChildren(Graphics g,
int x,
int y,
int w,
int h)
public void doPaintChildren(Graphics g,
int x,
int y,
int w,
int h)
public static void doPaintChildren(Control who,
int flags,
Graphics g,
Rect area)
public static void notNative_doPaintChildren(Control who,
int flags,
Graphics g,
Rect area)
protected static void doPaintChildren(Control who,
int flags,
Graphics g,
Rect area,
Rect clip)
public void oldPaintChildren(Graphics g,
int x,
int y,
int width,
int height)
public void paintChildren(Graphics gr,
int x,
int y,
int w,
int h)
public void addListener(EventListener list)
public void removeListener(EventListener list)
public void sendToListeners(Event ev)
public void postEvent(Event ev)
public boolean contains(Control who)
public void onControlEvent(ControlEvent ev)
public void onEvent(Event ev)
onEvent in interface EventListenerpublic static void cancelHoldDown()
public static DragContext getDragAndDropContext()
public void ticked(int id,
int elapsed)
ticked in interface TimerProcpublic void gotFocus(int how)
public void lostFocus(int how)
public final boolean isChildOf(Container who)
public boolean tryNext(boolean forwards)
public final String makeHot(String label)
label - The label to be displayed.
public final boolean exitEntry(int exitKey,
int modifiers)
protected final boolean checkExitKey(KeyEvent ev)
protected boolean isSomeonesHotKey(KeyEvent ev)
public boolean checkMenuKey(KeyEvent ev,
Point where)
public void standardOnKeyEvent(KeyEvent ev)
public void onKeyEvent(KeyEvent ev)
public final Control setBorder(int style,
int width)
style - The border style. One or more of the BDR_XXX or EDGE_XXX constants ORed together.width - The distance between the edge of the Control and the data within it.
public final Control setHotKey(int modifiers,
char key)
modifiers - One or more of the IKeys.SHIFT, IKeys.CONTROL and IKeys.ONLY ORed together.key - The character for the hot-key.
public final Control setHotKey(int modifiers,
int key)
modifiers - One or more of the IKeys.SHIFT, IKeys.CONTROL and IKeys.ONLY ORed together.key - The KeyEvent key code for the hot-key.
protected boolean doHotKey(Control from,
KeyEvent ev)
from - The Control (parent or sibling) that is passing the event to this Control.ev - The KeyEvent representing the key press.
public void doActionKey(int key)
public void doAction(int how)
public boolean checkPenTransparent(PenEvent ev)
public void notifyAction()
public final void notifyDataChange()
public void notifyDataChange(DataChangeEvent dce)
dce - The specific DataChangeEvent to send.public void updateData()
public boolean menuIsActive()
public void closeMenu()
public void setMenu(Menu menu)
You can set a Menu for most Controls including Buttons.
menu - The Menu to set for the Control. This can be null.public Menu getMenu()
public boolean tryStartMenu(Point pen)
By default it will call doShowMenu(pen) if the menu is not already active.
pen - The point where the pen/mouse was pressed - or null if you are requesting the control to show
its menu at no particular point.
protected boolean doShowMenu(Point pen)
pen - The point where the pen was pressed.
public final void transferPenPress(Control toChild)
toChild - The child control to pass the pen press to.
public final void transferPenPress(Control toWho,
int dx,
int dy)
toWho - The Control to send it to.dx - The change in the x co-ordinate for the event.dy - The change in the y co-ordinate for the event.public boolean willShowFrame(PenEvent ev)
public void onPenEvent(PenEvent ev)
ev - The incoming PenEvent.protected boolean isOnMe(Point p)
p - The point to check.
protected void dataAccepted(Control byWho,
Object data,
String action)
byWho - The Control that accepted the data.data - The data being transferred.action - This is either "copy" or "move" indicating if the data
is meant to be copied to the other control or moved to the other Control.protected void dataTransferCancelled(Object data)
data - The data that was being transferred. If it is null it indicates
that this Control was a destination for a Drag and Drop operation, but the
operation was cancelled by the user.
protected void dataBeingRemoved(Object data,
DragContext dc)
protected boolean startDragAndDrop(Object data,
int dragCursor,
boolean isCopy)
data - The data to drag.dragCursor - The cursor code for the special cursor to use. This should
be one of the ewe.sys.Vm.XXX_CURSOR constants OR a value returned by ewe.sys.Vm.createCursor().isCopy - true if the operation is to be considered a copy operation. false if it is to be
considered a move operation.
protected boolean startDragAndDrop(Object data,
boolean isMultiple,
boolean isCopy)
data - The data to drag.isMultiple - should be true if the data should be considered as multiple data. This
will affect the cursor that is used.isCopy - true if the operation is to be considered a copy operation. false if it is to be
considered a move operation. This will affect the cursor that is used.
public void penPressed(Point p)
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.
p - The point on the Control where the pen was pressed.public void penHeld(Point p)
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);
p - The point on the Control where the pen was held.public void penRightReleased(Point p)
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);
p - The point on the Control where the pen was released.public void penReleased(Point p)
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.
p - The point on the Control where the pen was released.public void penClicked(Point p)
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.
By default this method simply calls the penReleased() method.
p - The point on the Control where the pen was clicked.public void penDoubleClicked(Point p)
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.
By default this method simply calls the penClicked() method.
p - The point on the Control where the pen was double-clicked.public boolean doMenu(Point p)
p - The point where the pen was pressed or held.
public boolean dataDroppedOn(Object data,
Point p,
DragContext dc)
public void dataDraggedOff(Object data)
data - the data being dragged.
public void dataDraggedOver(Object data,
Point p,
PenEvent ev)
By default this method calls dataDraggedOver(Object data) - which itself by default calls acceptsData() to determine whether to call willAcceptDrop() or dontAcceptDrop().
data - The data being dragged.p - The current location of the pen/mouse.ev - The PenEvent that prompted this call.public void dataDraggedOver(Object data)
By default this method calls acceptsData() to determine whether to call willAcceptDrop() or dontAcceptDrop().
data - The data being dragged.
public boolean acceptsData(Object data,
DragContext how)
data - The data to be transferred.how - if the transfer is via DragAndDrop this will be a DragContext object,
otherwise it will be null to indicate a clipboard operation.
public boolean takeData(Object data,
DragContext how)
data - The data to accept.how - if the transfer is via DragAndDrop this will be a DragContext object,
otherwise it will be null to indicate a clipboard operation.
protected void dontAcceptDrop()
protected void willAcceptDrop()
protected boolean getDataToDragAndDrop(DragContext dc)
To setup the DragContext you should set the dataToDrag, isMultiple and isCopy and (optionally) the dragCursor value.
dc - the DragContext to setup for the drag and drop operation.
protected boolean tryDragAndDrop(DragContext dc)
dc - the DragContext to setup for the drag and drop operation.
public void startDragging(DragContext dc)
dc - A DragContext indicating information about the dragging.public void stopDragging(DragContext dc)
dc - The DragContext for the dragging operation.public void dragged(DragContext dc)
dc - The DragContext for the dragging operation.public void fillBackground(Graphics g)
public Graphics getGraphics()
public Point getPosInParent(Container parent)
public void makeFrameTopMost()
public void resetRect()
public void setText(String what)
public String getText()
public String getDisplayText()
public String getPrompt()
public void show(Rect where)
public void shown()
protected void formClosing()
public final boolean isModal()
public Frame getFrame()
public Window getWindow()
public Container getFrameOrContainer()
public boolean amOnTopFrame()
public Point getPosInFrame()
public FontMetrics getFontMetrics()
public void onLabelPenEvent(PenEvent ev)
public Control setControl(int val)
public Control setCell(int val)
public Control setTag(int tag,
Object value)
public Object getTag(int tag,
Object defaultValue)
public Control clearTag(int tag)
public Control setTags(TagList tl)
public Control defaultTo(int tag,
Object value)
public boolean hasTag(int tag)
public Control getNextKeyFocus(Control sourceChild,
boolean forwards)
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.
public static void setClipObject(Object obj)
public static Object getClipObject()
public Menu getClipboardMenu(Menu addTo)
addTo - The menu under construction or null for a new menu.
public boolean canEdit()
public boolean checkMenu(Menu m)
public boolean checkClipboardOperations(Menu m)
m - The Menu which contains the clipboard operations.
protected Object getDataToCopy()
protected void takeFromClipboard(Object clip,
String action)
public static final Object toTextData(Object data)
public Object clipboardTransfer(Object clip,
boolean toClipboard,
boolean cut)
public void toClipboard(boolean cut)
public void fromClipboard()
protected void popupMenuClosed(Menu m)
public void popupMenuEvent(MenuEvent ev)
ev - The event.public void popupMenuEvent(Object selectedItem)
selectedItem - The item selected.public String clipboardToString(Object what)
public static void cancelCut(Control forWho)
public static void popupBeep()
public void setCursor(int cursor)
cursor - Should be one of the ewe.sys.Vm.XXXX_CURSOR constants
or a value returned from ewe.sys.Vm.createCursor().public MenuItem getLastSelected()
public void setServer(ScrollServer server)
public ScrollServer getServer()
public void takeFocus(int how)
public void fromField(FieldTransfer ft)
public void toField(FieldTransfer ft)
public final void fromField()
public final void toField()
public final void chainDataChange(Control other,
String fieldName)
other - The Control to listen for DataChangeEvents.fieldName - An optional name to give the chained control.
public void scrollAndRepaint(int sx,
int sy,
int sw,
int sh,
int destX,
int destY)
If data can be moved directly on screen, then this will be done and only the newly exposed portion will be updated via a repaintNow() operation. If no moving is possible at all - or if the SIP may be covering the control then no scrolling will be done.
sx - The source x co-ordinate.sy - The source y co-ordinate.sw - The source width.sh - The source height.destX - The destination x co-ordinate.destY - The destination y co-ordinate.public String getPromptText()
public Control setFont(Font f)
f - the Font to set.
public boolean requestPaint()
This method simply calls: Gui.requestPaint(this);
public void refresh(IImage image,
int options)
refresh in interface ImageRefresherimage - the image to refresh.options -
public char getPasswordCharacter()
public boolean hasPopupFormAttached()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||