|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--waba.ui.Control | +--waba.ui.PushButtonGroup
group of pushbuttons in just one control. created by guich from the original WExtras class Pushbutton of Stefan Kellner.
Field Summary | |
protected boolean |
actLikeButton
|
protected boolean |
actLikeCheck
|
protected boolean |
atLastOne
|
static byte |
BUTTON
the button will be selected and de-selected immediatly, acting like an real button |
static byte |
CHECK
one click in the button will select it and another click will de-select it. perhaps, only one button can be clicked at a time |
protected int |
cols
|
protected int |
gap
|
int |
id
not used. can be useful if you have a group of PushButtonGroup and want to know easily which group was pressed. |
protected int |
insideGap
|
int |
maxWidth
|
protected java.lang.String[] |
names
|
static byte |
NORMAL
normal: only one selected at a time |
protected int |
rows
|
protected int |
selectedIndex
|
protected int[] |
widths
|
Fields inherited from class waba.ui.Control |
BOTTOM,
CENTER,
controlCount,
enabled,
FILL,
fm,
font,
height,
LEFT,
name,
next,
parent,
PREFERRED,
prev,
RIGHT,
TOP,
width,
x,
y |
Constructor Summary | |
PushButtonGroup(java.lang.String[] names,
boolean atLastOne,
int selected,
int gap,
int insideGap,
int rows,
boolean allSameWidth,
byte type)
create the buttons. |
Method Summary | |
protected void |
drawComponent(Graphics g)
|
int |
getPreferredHeight()
returns the preffered height of this control. added by guich |
int |
getPreferredWidth()
returns the preffered width of this control. added by guich |
int |
getSelected()
returns the index of the selected button |
void |
onBoundsChanged()
called after an setRect. added by guich |
void |
onEvent(Event event)
Called to process key, pen, control and other posted events. |
void |
onEvent(int type,
int x,
int y)
|
void |
onPaint(Graphics g)
Called to draw the control. |
void |
setSelected(int ind)
sets the selected button index |
Methods inherited from class waba.ui.Control |
addTimer,
contains,
createGraphics,
getAbsoluteRect,
getFontMetrics,
getNext,
getParent,
getRect,
isEnabled,
isVisible,
onWindowPaintFinished,
postEvent,
removeTimer,
repaint,
repaintNow,
setEnabled,
setFont,
setRect,
setRect,
setVisible |
Methods inherited from class java.lang.Object |
hashCode,
toString |
Field Detail |
public static final byte NORMAL
public static final byte BUTTON
public static final byte CHECK
protected java.lang.String[] names
protected int[] widths
protected int selectedIndex
protected int gap
protected int insideGap
protected int rows
protected int cols
protected boolean atLastOne
protected boolean actLikeButton
protected boolean actLikeCheck
public int id
public int maxWidth
Constructor Detail |
public PushButtonGroup(java.lang.String[] names, boolean atLastOne, int selected, int gap, int insideGap, int rows, boolean allSameWidth, byte type)
names
- captions of the buttonsatLastOne
- if true, at least one button must be selectedselected
- default index to appear selected, or -1 if nonegap
- space between the buttons, -1 glue them.insideGap
- space between the text and the button border. the ideal is 6.rows
- if > 1, creates an button matrixallSameWidth
- if true, all the buttons will have the width if the most large one.type
- can be NORMAL, BUTTON or CHECKMethod Detail |
public void onBoundsChanged()
public int getSelected()
public int getPreferredWidth()
public int getPreferredHeight()
public void onPaint(Graphics g)
g
- the graphics object for drawingGraphics
protected void drawComponent(Graphics g)
public void setSelected(int ind)
public void onEvent(int type, int x, int y)
public void onEvent(Event event)
event
- the event to processEvent
,
KeyEvent
,
PenEvent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |