G4P (GUI for Processing) 4.3.11
A set of GUI controls for your Processing sketch.
|
Classes | |
class | Z_Order |
Public Member Functions | |
void | addControl (GAbstractControl c) |
void | addControl (GAbstractControl c, float x, float y) |
void | addControl (GAbstractControl c, float x, float y, float angle) |
void | addControls (GAbstractControl... controls) |
void | addEventHandler (Object obj, String methodName) |
void | dispose () |
void | draw () |
void | forceBufferUpdate () |
GAbstractControl (PApplet theApplet) | |
GAbstractControl (PApplet theApplet, float p0, float p1) | |
GAbstractControl (PApplet theApplet, float p0, float p1, float p2, float p3) | |
int | getAlpha () |
int | getCursorOver () |
float | getCX () |
float | getCY () |
float | getHeight () |
int | getLocalColorScheme () |
PApplet | getPApplet () |
GAbstractControl | getParent () |
float | getRotation () |
PGraphics | getSnapshot () |
GToolTip | getTip () |
float | getWidth () |
float | getX () |
float | getY () |
boolean | hasFocus () |
boolean | isDragging () |
boolean | isEnabled () |
boolean | isOpaque () |
boolean | isVisible () |
void | keyEvent (KeyEvent e) |
void | mouseEvent (MouseEvent event) |
void | moveTo (float px, float py) |
void | moveTo (float px, float py, GControlMode mode) |
void | post () |
void | pre () |
void | removeTip () |
boolean | saveSnapshot () |
boolean | saveSnapshot (String filename) |
void | setAlpha (int alpha) |
void | setAlpha (int alpha, boolean includeChildren) |
void | setCursorOver (int cursorOver) |
void | setEnabled (boolean enable) |
void | setFocus (boolean focus) |
void | setLocalColor (int colorNo, int color) |
void | setLocalColorScheme (int cs) |
void | setLocalColorScheme (int cs, boolean includeChildren) |
void | setOpaque (boolean opaque) |
void | setRotation (float angle) |
void | setRotation (float angle, GControlMode mode) |
void | setTip (GToolTip tt, float offset, float angle) |
void | setTip (GToolTip tt, GAlign ax, GAlign ay, float gap) |
void | setTip (String text, float offset, float angle) |
void | setTip (String text, GAlign ax, GAlign ay, float gap) |
void | setTipDisplayTime (long msecs) |
void | setTipEnabled (boolean enable) |
void | setTipHorz (boolean level) |
void | setTipPos (float radius, float ang) |
void | setTipPos (GAlign ax, GAlign ay, float gap) |
void | setTipText (String text) |
void | setVisible (boolean visible) |
String | toString () |
Public Attributes | |
String | tag = "" |
int | tagNo |
Public Attributes inherited from g4p_controls.GConstants | |
int | ALPHA_BLOCK = 128 |
int | ALPHA_PICK = 48 |
TextAttribute | BACKGROUND = TextAttribute.BACKGROUND |
int | BLUE_SCHEME = 6 |
int | BOLD = Font.BOLD |
int | CANCEL = JOptionPane.CANCEL_OPTION |
int | CLOSE_WINDOW = 0x00000f02 |
int | CLOSED = JOptionPane.CLOSED_OPTION |
int | CTRL_ANGULAR = 0x00000501 |
int | CTRL_HORIZONTAL = 0x00000502 |
int | CTRL_VERTICAL = 0x00000503 |
int | CYAN_SCHEME = 5 |
int | DECIMAL = 1 |
char | END = java.awt.event.KeyEvent.VK_END |
int | ERROR_MESSAGE = JOptionPane.ERROR_MESSAGE |
int | EXIT_APP = 0x00000f01 |
int | EXPONENT = 2 |
TextAttribute | FAMILY = TextAttribute.FAMILY |
TextAttribute | FOREGROUND = TextAttribute.FOREGROUND |
int | FORWARD = 1 |
int | GOLD_SCHEME = 7 |
int | GREEN_SCHEME = 1 |
int | HIDE_WINDOW = 0x00000f04 |
char | HOME = java.awt.event.KeyEvent.VK_HOME |
int | INFO_MESSAGE = JOptionPane.INFORMATION_MESSAGE |
int | INTEGER = 0 |
int | ITALIC = Font.ITALIC |
int | KEEP_OPEN = 0x00000f03 |
int | NO = JOptionPane.NO_OPTION |
int | OK = JOptionPane.OK_OPTION |
int | OK_CANCEL = JOptionPane.OK_CANCEL_OPTION |
int | ORANGE_SCHEME = 4 |
int | ORIENT_LEFT = -1 |
int | ORIENT_RIGHT = 1 |
int | ORIENT_TRACK = 0 |
int | PLAIN = Font.PLAIN |
int | PLAIN_MESSAGE = JOptionPane.PLAIN_MESSAGE |
TextAttribute | POSTURE = TextAttribute.POSTURE |
Float | POSTURE_OBLIQUE = new Float(0.20f) |
Float | POSTURE_REGULAR = new Float(0.0f) |
int | PURPLE_SCHEME = 3 |
int | QUERY_MESSAGE = JOptionPane.QUESTION_MESSAGE |
int | RED_SCHEME = 0 |
int | REVERSE = -1 |
int | SCHEME_10 = 10 |
int | SCHEME_11 = 11 |
int | SCHEME_12 = 12 |
int | SCHEME_13 = 13 |
int | SCHEME_14 = 14 |
int | SCHEME_15 = 15 |
int | SCHEME_8 = 8 |
int | SCHEME_9 = 9 |
int | SCROLLBARS_AUTOHIDE = 0x1000 |
int | SCROLLBARS_BOTH = 0x0003 |
int | SCROLLBARS_HORIZONTAL_ONLY = 0x0002 |
int | SCROLLBARS_NONE = 0x0000 |
int | SCROLLBARS_VERTICAL_ONLY = 0x0001 |
TextAttribute | SIZE = TextAttribute.SIZE |
TextAttribute | STRIKETHROUGH = TextAttribute.STRIKETHROUGH |
Boolean | STRIKETHROUGH_OFF = new Boolean(false) |
Boolean | STRIKETHROUGH_ON = new Boolean(true) |
TextAttribute | SUPERSCRIPT = TextAttribute.SUPERSCRIPT |
Integer | SUPERSCRIPT_OFF = new Integer(0) |
Integer | SUPERSCRIPT_SUB = new Integer(-1) |
Integer | SUPERSCRIPT_SUPER = new Integer(1) |
int | UNDEFINED = Integer.MAX_VALUE |
TextAttribute | UNDERLINE = TextAttribute.UNDERLINE |
int | UNDERLINE_OFF = Integer.valueOf(-1) |
int | UNDERLINE_ON = TextAttribute.UNDERLINE_ON |
int | USER_COL_SCHEME = 0x00010102 |
int | WARN_MESSAGE = JOptionPane.WARNING_MESSAGE |
TextAttribute | WEIGHT = TextAttribute.WEIGHT |
Float | WEIGHT_BOLD = new Float(2.0f) |
Float | WEIGHT_DEMIBOLD = new Float(1.75f) |
Float | WEIGHT_DEMILIGHT = new Float(0.875f) |
Float | WEIGHT_EXTRA_LIGHT = new Float(0.5f) |
Float | WEIGHT_EXTRABOLD = new Float(2.5f) |
Float | WEIGHT_HEAVY = new Float(2.25f) |
Float | WEIGHT_LIGHT = new Float(0.75f) |
Float | WEIGHT_MEDIUM = new Float(1.5f) |
Float | WEIGHT_REGULAR = new Float(1.0f) |
Float | WEIGHT_SEMIBOLD = new Float(1.25f) |
Float | WEIGHT_ULTRABOLD = new Float(2.75f) |
TextAttribute | WIDTH = TextAttribute.WIDTH |
Float | WIDTH_CONDENSED = new Float(0.75f) |
Float | WIDTH_EXTENDED = new Float(1.5f) |
Float | WIDTH_REGULAR = new Float(1.0f) |
Float | WIDTH_SEMI_CONDENSED = new Float(0.875f) |
Float | WIDTH_SEMI_EXTENDED = new Float(1.25f) |
int | X4 = 1 |
int | X8 = 2 |
int | YELLOW_SCHEME = 2 |
int | YES = JOptionPane.YES_OPTION |
int | YES_NO = JOptionPane.YES_NO_OPTION |
int | YES_NO_CANCEL = JOptionPane.YES_NO_CANCEL_OPTION |
Protected Member Functions | |
void | addControlImpl (GAbstractControl c, float x, float y, float angle) |
void | addToParent (GAbstractControl p) |
void | calcTransformedOrigin (float px, float py) |
boolean | controlSupportsToolTips () |
void | createEventHandler (Object handlerObj, String methodName, Class[] param_classes, String[] param_names) |
void | drawChildren () |
void | fireEvent (Object... objects) |
int | focusObjectZ () |
PGraphics | getBuffer () |
int | getCurrHotSpot () |
AffineTransform | getTransform (AffineTransform aff) |
void | hideTip () |
boolean | isAvailable () |
boolean | isDisplayable (int ascii) |
boolean | isSuitableForGroupControl (GAbstractControl control) |
void | loseFocus (GAbstractControl grabber) |
void | makeBuffer () |
void | manageToolTip () |
void | resize (int w, int h) |
void | resize (int w, int h, GControlMode mode) |
void | setAvailable (boolean avail) |
void | setZ (int parentZ) |
void | showTip () |
void | takeFocus () |
void | updateBuffer () |
int | whichHotSpot (float px, float py) |
Protected Attributes | |
boolean | allowChildren = true |
boolean | allowToolTips = true |
int | alphaLevel = G4P.globalAlpha |
boolean | available = true |
PGraphicsJava2D | buffer = null |
boolean | bufferInvalid = true |
LinkedList< GAbstractControl > | children = null |
int | currSpot = -1 |
int | cursorOver = HAND |
float | cx |
float | cy |
boolean | dragging = false |
boolean | enabled = true |
Method | eventHandlerMethod = null |
String | eventHandlerMethodName |
Object | eventHandlerObject = null |
float | halfHeight |
float | halfWidth |
float | height |
HotSpot[] | hotspots = null |
int | lastSpot = -1 |
int | localColorScheme = G4P.globalColorScheme |
boolean | opaque = false |
float | ox |
float | oy |
Color[] | palette = null |
GAbstractControl | parent = null |
int | registeredMethods = 0 |
float | rotAngle |
double[] | temp = new double[2] |
GToolTip | tip = null |
boolean | visible = true |
float | width |
PApplet | winApp |
float | x |
float | y |
int | z = Z_STICKY |
Static Protected Attributes | |
static GAbstractControl | controlToTakeFocus = null |
static GAbstractControl | cursorIsOver |
static float | epsilon = 0.001f |
static GAbstractControl | focusIsWith = null |
Abstract base class for all GUI controls.
g4p_controls.GAbstractControl.GAbstractControl | ( | PApplet | theApplet | ) |
Base constructor for ALL control ctors that do not have a visible UI but require access to a PApplet object.
As of V3.5 the only class using this constructor is GGroup
theApplet | the main sketch or GWindow control for this control |
g4p_controls.GAbstractControl.GAbstractControl | ( | PApplet | theApplet, |
float | p0, | ||
float | p1 | ||
) |
Base constructor for ALL control ctors that have a visible UI but whose width and height are determined elsewhere e.g. the size of an image. It will set the position of the control based on controlMode.
theApplet | the main sketch or GWindow control for this control |
p0 | x position based on control mode |
p1 | y position based on control mode |
g4p_controls.GAbstractControl.GAbstractControl | ( | PApplet | theApplet, |
float | p0, | ||
float | p1, | ||
float | p2, | ||
float | p3 | ||
) |
Base constructor for ALL control ctors that have a visible UI. It will set the position and size of the control based on controlMode.
theApplet | the main sketch or GWindow control for this control |
p0 | x position based on control mode |
p1 | y position based on control mode |
p2 | x position or width based on control mode |
p3 | y position or height based on control mode |
void g4p_controls.GAbstractControl.addControl | ( | GAbstractControl | c | ) |
Add a control at the position and rotation specified in the control.
c | the control to add |
Reimplemented in g4p_controls.GControlPalette, and g4p_controls.GGroup.
void g4p_controls.GAbstractControl.addControl | ( | GAbstractControl | c, |
float | x, | ||
float | y | ||
) |
Add a control at the given position with zero rotation angle.
c | the control to add. |
x | the leftmost or centre position depending on controlMode |
y | the topmost or centre position depending on controlMode |
Reimplemented in g4p_controls.GControlPalette.
void g4p_controls.GAbstractControl.addControl | ( | GAbstractControl | c, |
float | x, | ||
float | y, | ||
float | angle | ||
) |
This will set the rotation of the control to angle overwriting any previous rotation set. Then it calculates the centre position so that the original top left corner of the control will be the position indicated by x,y with respect to the top left corner of parent.
The added control will have its position calculated relative to the centre of the parent control.
All overloaded methods call this one.
c | the control to add. |
x | the leftmost or centre position depending on controlMode |
y | the topmost or centre position depending on controlMode |
angle | the rotation angle (replaces any the angle specified in control) |
Reimplemented in g4p_controls.GControlPalette, and g4p_controls.GPanel.
|
protected |
All addControl(...) methods must call this one.
Checks to see if this control allows children and creates the child list if needed.
c | the control to add. |
x | the leftmost or centre position depending on controlMode |
y | the topmost or centre position depending on controlMode |
angle | the rotation angle (replaces any the angle specified in control) |
void g4p_controls.GAbstractControl.addControls | ( | GAbstractControl... | controls | ) |
Add several control at the position and rotation specified in each control.
controls | comma separated list of controls |
Reimplemented in g4p_controls.GControlPalette, and g4p_controls.GGroup.
void g4p_controls.GAbstractControl.addEventHandler | ( | Object | obj, |
String | methodName | ||
) |
Attempt to create the default event handler for the control class. The default event handler is a method that returns void and has a single parameter of the same type as the control class generating the event and a method name specific for that class.
obj | the object to handle the event |
methodName | the method to execute in the object handler class |
|
protected |
Changes that need to be made to child when added. Override where needed e.g. GPanel
p | the parent |
Reimplemented in g4p_controls.GPanel.
|
protected |
This method takes a position px, py and calculates the equivalent position [ox,oy] as if no transformations have taken place and the origin is the top-left corner of the control.
px | |
py |
|
protected |
Return true if this class / control supports tool tips otherwise false and output error message.
|
protected |
Attempt to create the default event handler for the control class. The default event handler is a method that returns void and has a single parameter of the same type as the control class generating the event and a method name specific for that class.
handlerObj | the object to handle the event |
methodName | the method to execute in the object handler class |
param_classes | the parameter classes. |
param_names | that names of the parameters (used for error messages only) |
void g4p_controls.GAbstractControl.dispose | ( | ) |
This will remove all references to this control from G4P after the next frame has been rendered.
The user is responsible for nullifying all references to this control in their sketch code.
Once this method is called the control cannot be reused but resources used by the control remain until ALL references to the control are set to null.
For example if you want to dispose of a button called
btnDoThis
then to remove the button use the statements
btnDoThis.dispose();
btnDoThis = null;
Reimplemented in g4p_controls.GEditableTextControl.
void g4p_controls.GAbstractControl.draw | ( | ) |
Reimplemented in g4p_controls.GAbstractView, g4p_controls.GControlPalette, and g4p_controls.GPanel.
|
protected |
Introduced in V4.3.9 along with tool tips
|
protected |
Attempt to fire an event for this control.
The method called must have a single parameter which is the object firing the event. If the method to be called is to have different parameters then it should be overridden in the child class The method
|
protected |
Get the Z order value for the object with focus.
If there is no object with focus or the focus is with a control on another window then return -1 which will allow this control to take focus.
void g4p_controls.GAbstractControl.forceBufferUpdate | ( | ) |
This is for emergency use only!!!!
In this version of the library a visual controls is drawn to off-screen buffer and then drawn to the screen by copying the buffer. This means that the computationally expensive routines needed to draw the control (especially text controls) are only done when a change has been noted. This means that single changes need not trigger a full redraw to buffer.
It does mean that an error in the library code could result in the buffer not being updated after changes. If this happens then in draw() call this method on the affected control, and report it as an issue here
Thanks
Reimplemented in g4p_controls.GTextBase.
int g4p_controls.GAbstractControl.getAlpha | ( | ) |
Returns the current transparency level
0 = fully transparent
255 = opaque
int g4p_controls.GAbstractControl.getCursorOver | ( | ) |
Get the shape type when the cursor is over a control
float g4p_controls.GAbstractControl.getCX | ( | ) |
Get the centre x position of the control centre.
Changed 3.4.10
float g4p_controls.GAbstractControl.getCY | ( | ) |
Get the centre y position of the control centre.
Changed 3.4.10
float g4p_controls.GAbstractControl.getHeight | ( | ) |
int g4p_controls.GAbstractControl.getLocalColorScheme | ( | ) |
Get the local color scheme ID number. If it returns a value <0 then it is using a control specific palette.
PApplet g4p_controls.GAbstractControl.getPApplet | ( | ) |
GAbstractControl g4p_controls.GAbstractControl.getParent | ( | ) |
Get the parent control. If null then this is a top-level control
float g4p_controls.GAbstractControl.getRotation | ( | ) |
PGraphics g4p_controls.GAbstractControl.getSnapshot | ( | ) |
This method should be used sparingly since it is heavy on resources.
Reimplemented in g4p_controls.GAbstractView, g4p_controls.GDropList, g4p_controls.GPassword, g4p_controls.GSpinner, g4p_controls.GTextArea, and g4p_controls.GTextField.
GToolTip g4p_controls.GAbstractControl.getTip | ( | ) |
Gets a reference to the tool tip so the user can access methods not available through its control.
|
protected |
Get an affine transformation that is the compound of all transformations including parents
aff |
float g4p_controls.GAbstractControl.getWidth | ( | ) |
float g4p_controls.GAbstractControl.getX | ( | ) |
Get the top-left x position of the control.
Changed 3.4.10
float g4p_controls.GAbstractControl.getY | ( | ) |
Get the top-left y position of the control.
Changed 3.4.10
boolean g4p_controls.GAbstractControl.hasFocus | ( | ) |
Does this control have focus
|
protected |
Hide the tool tip. Called when mouse exits control or display time exceeded.
|
protected |
Is this control available?
|
protected |
Support UTF8 encoding
ascii | UTF8 code |
boolean g4p_controls.GAbstractControl.isEnabled | ( | ) |
Is this control enabled
boolean g4p_controls.GAbstractControl.isOpaque | ( | ) |
Find out if the control is opaque
|
protected |
If the control responds to key or mouse input or has a visual representation this it can be part of a group controller.
control | the G4P control we are interested in |
boolean g4p_controls.GAbstractControl.isVisible | ( | ) |
|
protected |
For most controls there is nothing to do when they loose focus. Override this method in classes that need to do something when they loose focus eg TextField
Reimplemented in g4p_controls.GDropList, g4p_controls.GEditableTextControl, g4p_controls.GPanel, g4p_controls.GPassword, and g4p_controls.GSpinner.
|
protected |
Make a 2D off-screen buffer for this control.
|
protected |
Used internally at runtime to show/hide the tool tip. V4.3.9
void g4p_controls.GAbstractControl.mouseEvent | ( | MouseEvent | event | ) |
void g4p_controls.GAbstractControl.moveTo | ( | float | px, |
float | py | ||
) |
Move the control to the given position based on the mode.
The position is not constrained to the screen area.
The current control mode determines whether we move the corner or the center of the control to px,py
px | the horizontal position to move to |
py | the vertical position to move to |
Reimplemented in g4p_controls.GViewPeasyCam.
void g4p_controls.GAbstractControl.moveTo | ( | float | px, |
float | py, | ||
GControlMode | mode | ||
) |
Move the control to the given position based on the mode.
Unlike when dragged the position is not constrained to the screen area.
The mode determines whether we move the corner or the center of the control to px,py
px | the horizontal position to move to |
py | the vertical position to move to |
mode | the control mode |
Reimplemented in g4p_controls.GViewPeasyCam.
void g4p_controls.GAbstractControl.pre | ( | ) |
Reimplemented in g4p_controls.GValueControl, and g4p_controls.GValueControl2D.
void g4p_controls.GAbstractControl.removeTip | ( | ) |
Removes the existing tool tip for this control.
|
protected |
Used internally to enforce minimum size constraints using current global control mode.
This updates x, y, cx, cy, width and height so the original and resized control have the same centre position.
w | |
h |
|
protected |
Used internally to enforce minimum size constraints using user defined control mode.
This updates x, y, cx, cy, width and height so the original and resized control have the same centre position.
w | the new width |
h | the new height |
boolean g4p_controls.GAbstractControl.saveSnapshot | ( | ) |
Save a snapshot of the control using class name and sketch runtime as the filename
boolean g4p_controls.GAbstractControl.saveSnapshot | ( | String | filename | ) |
Save a snapshot of the control using the specified filename.
filename | the name of the file to save for the image |
Reimplemented in g4p_controls.GAbstractView.
void g4p_controls.GAbstractControl.setAlpha | ( | int | alpha | ) |
Set the transparency of the control and make it unavailable to mouse and keyboard events if below the threshold. Child controls are ignored?
alpha | value in the range 0 (transparent) to 255 (opaque) |
Reimplemented in g4p_controls.GGroup, and g4p_controls.GViewPeasyCam.
void g4p_controls.GAbstractControl.setAlpha | ( | int | alpha, |
boolean | includeChildren | ||
) |
Set the transparency of the control and make it unavailable to mouse and keyboard events if below the threshold. Child controls are ignored?
If required include the children and their children.
alpha | value in the range 0 (transparent) to 255 (opaque) |
includeChildren | if do do the same for all descendants |
Reimplemented in g4p_controls.GGroup, and g4p_controls.GViewPeasyCam.
|
protected |
The availability flag is used by the library code to determine whether a control should be considered for drawing and mouse/key input.
It permits an internal control that does not affect the visible and enabled state of the control, which are set by the programmer.
If a control and its children are made unavailable it will still be drawn but it not respond to user input.
avail |
void g4p_controls.GAbstractControl.setCursorOver | ( | int | cursorOver | ) |
Set the shape type to use when the cursor is over a control
cursorOver | the shape type to use |
void g4p_controls.GAbstractControl.setEnabled | ( | boolean | enable | ) |
Enable or disable the ability of the control to generate mouse events.
GTextField - it also controls key press events
GPanel - controls whether the panel can be moved/collapsed/expanded
enable | true to enable else false |
Reimplemented in g4p_controls.GButton, g4p_controls.GGroup, g4p_controls.GImageButton, g4p_controls.GSlider, and g4p_controls.GViewPeasyCam.
void g4p_controls.GAbstractControl.setFocus | ( | boolean | focus | ) |
Determines whether this control is to have focus or not
focus | true if the control is to have focus else false. |
Reimplemented in g4p_controls.GEditableTextControl, and g4p_controls.GPassword.
void g4p_controls.GAbstractControl.setLocalColor | ( | int | colorNo, |
int | color | ||
) |
Change a specific colour within the scheme.
Most controls used a shared colour palette but calling this method will create a new palette specific for this control.
colorNo | the colour index value (0-15 inlc) |
color | ARGB color value |
void g4p_controls.GAbstractControl.setLocalColorScheme | ( | int | cs | ) |
Set the local colour scheme for this control. Children are ignored.
cs | the colour scheme to use (0-15 incl.) |
Reimplemented in g4p_controls.GGroup, g4p_controls.GDropList, g4p_controls.GEditableTextControl, and g4p_controls.GPassword.
void g4p_controls.GAbstractControl.setLocalColorScheme | ( | int | cs, |
boolean | includeChildren | ||
) |
Set the local colour scheme for this control. If required include the children and their children.
cs | the colour scheme to use (0-15 incl.) |
includeChildren | if do do the same for all descendants |
void g4p_controls.GAbstractControl.setOpaque | ( | boolean | opaque | ) |
Determines whether to show the back colour or not. Only applies to some controls
opaque | true = opaque, flase = transparent |
Reimplemented in g4p_controls.GPanel.
void g4p_controls.GAbstractControl.setRotation | ( | float | angle | ) |
Set the rotation to apply when displaying this control. The center of rotation is determined by the control_mode attribute.
angle | clockwise angle in radians |
Reimplemented in g4p_controls.GViewPeasyCam.
void g4p_controls.GAbstractControl.setRotation | ( | float | angle, |
GControlMode | mode | ||
) |
Set the rotation to apply when displaying this control. The center of rotation is determined by the mode parameter parameter.
angle | clockwise angle in radians |
mode | PApplet.CORNER / CORNERS / CENTER |
Reimplemented in g4p_controls.GToolTip, and g4p_controls.GViewPeasyCam.
void g4p_controls.GAbstractControl.setTip | ( | GToolTip | tt, |
float | offset, | ||
float | angle | ||
) |
Only use this method if you are creating custom tool tips.
Replaces the current tool tip (if any) with a new tool tip for this control. Do not use this method to simply change the tip text, in that situation use the setToolTipText(String) method.
tt | the custom tool tip |
offset | distance between control and tool tip centres |
angle | the angle (radians) made by the line joining the control centre the tool tip centre |
Only use this method if you are creating custom tool tips.
Replaces the current tool tip (if any) with a new tool tip for this control. Do not use this method to simply change the tip text, in that situation use the setTipText(String) method.
tt | the custom tool tip |
ax | horizontal alignment with its control (LEFT, CENTER, RIGHT) |
ay | vertical position relative with its control (NORTH, SOUTH) |
gap | the gap between the tool tip and its control in pixels |
void g4p_controls.GAbstractControl.setTip | ( | String | text, |
float | offset, | ||
float | angle | ||
) |
Replaces the current tool tip (if any) with a new tool tip for this control. Do not use this method to simply change the tip text, in that situation use the setToolTipText(String) method.
text | the text to display |
offset | distance between control and tool tip centres |
angle | the angle (radians) made by the line joining the control centre the tool tip centre |
Replaces the current tool tip (if any) with a new tool tip for this control. Do not use this method to simply change the tip text, in that situation use the setTipText(String) method.
text | the text to display |
ax | horizontal alignment with its control (LEFT, CENTER, RIGHT) |
ay | vertical position relative with its control (NORTH, SOUTH) |
gap | the gap between the tool tip and its control in pixels |
void g4p_controls.GAbstractControl.setTipDisplayTime | ( | long | msecs | ) |
Set the maximum length of time to show the tool tip
msecs |
void g4p_controls.GAbstractControl.setTipEnabled | ( | boolean | enable | ) |
If this control has a tool tip set its enabled state.
enable | true to show tips, false to hide tips |
void g4p_controls.GAbstractControl.setTipHorz | ( | boolean | level | ) |
By default the tool tip is always aligned along the X axis. To have the tool tip rotate with the control pass false.
level | false to rotate with the control else false to keep horizontal |
void g4p_controls.GAbstractControl.setTipPos | ( | float | radius, |
float | ang | ||
) |
Implementation method to set a tool tip based on polar position (offset and angle)
Implementation method to set a tool tip based on alignment with control
void g4p_controls.GAbstractControl.setTipText | ( | String | text | ) |
If this control has a tool tip change the text it displays.
text | the text to display |
void g4p_controls.GAbstractControl.setVisible | ( | boolean | visible | ) |
visible | the visibility to set |
Reimplemented in g4p_controls.GGroup.
|
protected |
Recursive function to set the priority of a control. This is used to determine who gets focus when controls overlap on the screen e.g. when a droplist expands it might cover a button.
It is used where controls have childen e.g. GDropList and GPaneln It is used when a child control is added.
control | |
parentZ |
|
protected |
Show the tool tip. Called when mouse enters control.
|
protected |
Give the focus to this control but only after allowing the current control with focus to release it gracefully.
Always cancel the keyFocusIsWith irrespective of the control type. If the control needs to retain keyFocus then override this method in that class e.g. GCombo
Reimplemented in g4p_controls.GEditableTextControl, and g4p_controls.GPassword.
|
protected |
Reimplemented in g4p_controls.GPassword, g4p_controls.GSpinner, g4p_controls.GTextArea, and g4p_controls.GTextField.
|
protected |
Stop when we are over a hotspot.
Hotspots should be listed in order of importance.
px | |
py |
|
protected |
The centre of the control
|
protected |
Half sizes reduces programming complexity later
|
protected |
Reimplemented in g4p_controls.GAbstractView.
|
protected |
Whether to show background or not
|
protected |
Link to the parent panel (if null then it is on main window)
|
protected |
The angle to control is rotated (radians)
String g4p_controls.GAbstractControl.tag = "" |
Simple tag that can be used by the user
int g4p_controls.GAbstractControl.tagNo |
Allows user to specify a number for this control
|
protected |
Introduced V3 to speed up AffineTransform operations
|
protected |
Width and height of control in pixels for drawing background (changed form int data type in V3
Reimplemented in g4p_controls.GAbstractView.
|
protected |
Top left position of control in pixels (relative to parent or absolute if parent is null) (changed form int data type in V3
Reimplemented in g4p_controls.GAbstractView.
|
protected |
Reimplemented in g4p_controls.GAbstractView.