*/
private MnemonicString mnemonic;
+ /**
+ * Get the mnemonic string for this button.
+ *
+ * @return mnemonic string
+ */
+ public final MnemonicString getMnemonic() {
+ return mnemonic;
+ }
+
/**
* Remember mouse state.
*/
shadowColor.setForeColor(Color.BLACK);
shadowColor.setBold(false);
- if (!getEnabled()) {
+ if (!isEnabled()) {
buttonColor = getTheme().getColor("tbutton.disabled");
menuMnemonicColor = getTheme().getColor("tbutton.disabled");
- } else if (getAbsoluteActive()) {
+ } else if (isAbsoluteActive()) {
buttonColor = getTheme().getColor("tbutton.active");
menuMnemonicColor = getTheme().getColor("tbutton.mnemonic.highlighted");
} else {
if (inButtonPress) {
getScreen().putCharXY(1, 0, ' ', buttonColor);
- getScreen().putStrXY(2, 0, mnemonic.getRawLabel(), buttonColor);
+ getScreen().putStringXY(2, 0, mnemonic.getRawLabel(), buttonColor);
getScreen().putCharXY(getWidth() - 1, 0, ' ', buttonColor);
} else {
getScreen().putCharXY(0, 0, ' ', buttonColor);
- getScreen().putStrXY(1, 0, mnemonic.getRawLabel(), buttonColor);
+ getScreen().putStringXY(1, 0, mnemonic.getRawLabel(), buttonColor);
getScreen().putCharXY(getWidth() - 2, 0, ' ', buttonColor);
getScreen().putCharXY(getWidth() - 1, 0,
public void onMouseDown(final TMouseEvent mouse) {
this.mouse = mouse;
- if ((mouseOnButton()) && (mouse.getMouse1())) {
+ if ((mouseOnButton()) && (mouse.isMouse1())) {
// Begin button press
inButtonPress = true;
}
public void onMouseUp(final TMouseEvent mouse) {
this.mouse = mouse;
- if (inButtonPress && mouse.getMouse1()) {
+ if (inButtonPress && mouse.isMouse1()) {
inButtonPress = false;
// Dispatch the event
if (action != null) {