*
* @return if true, this widget will receive events
*/
- public final boolean getActive() {
+ public final boolean isActive() {
return active;
}
*
* @return if true, this widget can be tabbed to or receive events
*/
- public final boolean getEnabled() {
+ public final boolean isEnabled() {
return enabled;
}
/**
* If true, this widget has a cursor.
*/
- private boolean hasCursor = false;
+ private boolean cursorVisible = false;
/**
* Set visible cursor flag.
*
- * @param hasCursor if true, this widget has a cursor
+ * @param cursorVisible if true, this widget has a cursor
*/
- public final void setHasCursor(final boolean hasCursor) {
- this.hasCursor = hasCursor;
+ public final void setCursorVisible(final boolean cursorVisible) {
+ this.cursorVisible = cursorVisible;
}
/**
*
* @return if true, this widget has a visible cursor
*/
- public final boolean visibleCursor() {
- return hasCursor;
+ public final boolean isCursorVisible() {
+ return cursorVisible;
}
/**
* @return true if this widget is active and all of its parents are
* active.
*/
- public final boolean getAbsoluteActive() {
+ public final boolean isAbsoluteActive() {
if (parent == this) {
return active;
}
- return (active && parent.getAbsoluteActive());
+ return (active && parent.isAbsoluteActive());
}
/**
* @return absolute screen column number for the cursor's X position
*/
public final int getCursorAbsoluteX() {
- assert (hasCursor);
+ assert (cursorVisible);
return getAbsoluteX() + cursorX;
}
* @return absolute screen row number for the cursor's Y position
*/
public final int getCursorAbsoluteY() {
- assert (hasCursor);
+ assert (cursorVisible);
return getAbsoluteY() + cursorY;
}
for (TWidget widget: children) {
if (widget instanceof TButton) {
TButton button = (TButton) widget;
- if (button.getEnabled()
- && !keypress.getKey().getIsKey()
- && keypress.getKey().getAlt()
- && !keypress.getKey().getCtrl()
+ if (button.isEnabled()
+ && !keypress.getKey().isFnKey()
+ && keypress.getKey().isAlt()
+ && !keypress.getKey().isCtrl()
&& (Character.toLowerCase(button.getMnemonic().getShortcut())
- == Character.toLowerCase(keypress.getKey().getCh()))
+ == Character.toLowerCase(keypress.getKey().getChar()))
) {
widget.handleEvent(new TKeypressEvent(kbEnter));