Ignore:
Timestamp:
07/08/06 19:28:37 (18 years ago)
Author:
Nicholas Riley
Message:

Final initial control set for edit dialog.

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

Legend:

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

    r237 r239  
    1313    // persisted
    1414    private String mMessage;
    15     private boolean mUsesPeriod;
     15    private int mType;
    1616    private long mPeriod;
    1717    private Date mDate;
     
    3131    }
    3232    public boolean getUsesPeriod() {
    33         return mUsesPeriod;
     33        return mType != TYPE_DATE;
    3434    }
    3535    public Date getDate() {
     
    4040        mMessage = message;
    4141    }
    42     public void setPeriod(long period) {
    43         mUsesPeriod = true;
     42    public void setPeriod(long period, boolean repeating) {
     43        mType = repeating ? TYPE_PERIODIC_REPEATING : TYPE_PERIODIC;
    4444        mPeriod = period;
    4545    }
    4646    public void setDate(Date date) {
    47         mUsesPeriod = false;
     47        mType = TYPE_DATE;
    4848        mDate = date;
    4949    }
     
    5858            dataStream.writeLong(mPeriod);
    5959            dataStream.writeInt(mDate.getUnixTimeGMT());
    60             dataStream.writeBoolean(mUsesPeriod);
     60            dataStream.writeInt(mType);
    6161            dataStream.flush();
    6262            return byteStream.toByteArray();
     
    7878            mMessage = dataStream.readUTF();
    7979            mPeriod = dataStream.readLong();
    80             mUsesPeriod = dataStream.readBoolean();
     80            mType = dataStream.readInt();
    8181        } catch (Exception e) {
    8282            // XXX do something
     
    9696    }
    9797
     98    public static final int TYPE_PERIODIC = 0;
     99    public static final int TYPE_PERIODIC_REPEATING = 1;
     100    public static final int TYPE_DATE = 2;
     101
    98102    public static final int STATUS_INVALID = 0;
    99103    public static final int STATUS_EDITING = 1;
  • trunk/hiptop/pester/net/sabi/pester/AlarmListView.java

    r238 r239  
    66import danger.ui.Button;
    77import danger.ui.DialogWindow;
     8import danger.ui.RadioButton;
    89import danger.ui.Rect;
    910import danger.ui.TypeAheadTextField;
     
    2324    private TypeAheadTextField sMessageField;
    2425    private Button sDiscardAlarmButton;
     26    private RadioButton sInButton, sAtButton;
    2527
    2628    private static Alarm sFocusedAlarm, sEditingAlarm;
     
    3840        sMessageField = (TypeAheadTextField)sEditWindow.getDescendantWithID(ID_MESSAGE_FIELD);
    3941        sEditWindow.disableBottomRightButtonOnEmptyField(sMessageField);
     42        sInButton = (RadioButton)sEditWindow.getDescendantWithID(ID_IN_BUTTON);
     43        sAtButton = (RadioButton)sEditWindow.getDescendantWithID(ID_AT_BUTTON);
    4044        sDiscardAlarmButton = (Button)sEditWindow.getDescendantWithID(ID_DISCARD_ALARM_BUTTON);
    4145
     
    8791            sAlarmList.removeItem(sFocusedAlarm);
    8892            return true;
     93        case EVENT_IN:
     94            sAtButton.setValue(0);
     95            return true;
     96        case EVENT_AT:
     97            sInButton.setValue(0);
     98            return true;
    8999        }
    90100        return super.receiveEvent(e);
Note: See TracChangeset for help on using the changeset viewer.