Changeset 291 for trunk/hiptop


Ignore:
Timestamp:
07/26/06 03:46:12 (18 years ago)
Author:
Nicholas Riley
Message:

Forward alphabetic chars in period to units popup.

Location:
trunk/hiptop/pester/net/sabi/pester
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/hiptop/pester/net/sabi/pester/AlarmSetDialog.java

    r288 r291  
    1515import danger.ui.Layout;
    1616import danger.ui.MenuItem;
    17 import danger.ui.NumberEditor;
    1817import danger.ui.Pen;
    1918import danger.ui.PopupMenu;
     
    3130    private TypeAheadTextField mMessageField;
    3231    private RadioButton mInButton, mAtButton;
    33     private NumberEditor mPeriodField;
     32    private EventfulNumberEditor mPeriodField;
    3433    private PopupMenu mPeriodUnitsPopup;
    35     // XXX don't allow <5 second repeating alarms
    3634    private CheckBox mRepeatCheckBox;
    3735    private DateTimeEditor mTimeEditor, mDateEditor;
     
    5957        mInButton = (RadioButton)getDescendantWithID(ID_IN_BUTTON);
    6058        mAtButton = (RadioButton)getDescendantWithID(ID_AT_BUTTON);
    61         mPeriodField = (NumberEditor)getDescendantWithID(ID_PERIOD_FIELD);
     59        mPeriodField =
     60            (EventfulNumberEditor)getDescendantWithID(ID_PERIOD_FIELD);
    6261        mPeriodUnitsPopup =
    6362            (PopupMenu)getDescendantWithID(ID_PERIOD_UNITS_POPUP);
     
    7473        mMessageField.setNumCharsNeededForCompletion(0);
    7574        mInButton.setValue(1);
     75        mPeriodField.mAlphaView = mPeriodUnitsPopup;
    7676        mDateEditor.limitToDangerEpoch();
    7777        mAlertPicker.setGroupFilter(ToneClass.FOREGROUND | ToneClass.CUSTOM);
  • trunk/hiptop/pester/net/sabi/pester/EventfulNumberEditor.java

    r253 r291  
    33import danger.app.Event;
    44import danger.ui.NumberEditor;
     5import danger.ui.View;
    56import danger.util.DEBUG;
    67
    78public class EventfulNumberEditor extends NumberEditor {
     9    public View mAlphaView;
     10   
     11    public boolean eventKeyDown(char c, Event event) {
     12        if (Character.isLetter(c))
     13            return mAlphaView.eventKeyDown(c, event);
     14        return super.eventKeyDown(c, event);
     15    }
    816
    917    // Note: because NumberEditor temporarily holds invalid values to
Note: See TracChangeset for help on using the changeset viewer.