- Timestamp:
- 07/27/06 03:40:19 (18 years ago)
- Location:
- trunk/hiptop/pester
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hiptop/pester/locale/en_US/Pester.rsrc
r290 r293 50 50 shortcut = deleteKey 51 51 event = EVENT_DISCARD_ALARM 52 53 divider 54 55 menuItem 56 id = ID_ABOUT_ITEM 57 title = "About" 58 event = EVENT_ABOUT 52 59 endMenu 53 60 screen ID_ALARM_LIST_SCREEN … … 91 98 event = EVENT_VALIDATE 92 99 eventData = 3600 100 menuItem 101 title = "day(s)" 102 event = EVENT_VALIDATE 103 eventData = 86400 93 104 endMenu 94 105 … … 282 293 "Wake up" 283 294 endStringArray 295 296 data compress ID_ABOUT_TEXT 257 "about.txt" 297 string ID_SUPPORT_EMAIL "pester@sabi.net" 298 299 dialog ID_ABOUT_DIALOG 300 title = "About Pester" 301 doneEvent = EVENT_ABOUT_DONE 302 doneIsDefault 303 widthPct = 100 304 heightPct = 100 305 306 staticTextBox 307 id = ID_ABOUT_TEXT_BOX 308 className = "danger.ui.LinkTextBox" 309 alignWithParentTop = 0 310 alignWithParentLeft = 3 311 fillToRight = 3 312 fillToBottom = 0 313 initialFocus 314 doesNotHaveBorder 315 316 scrollBar 317 id = ID_ABOUT_TEXT_SCROLLBAR 318 alignWithParentTop = 0 319 alignWithParentRight = 0 320 fillToBottom = 0 321 floating 322 endDialog -
trunk/hiptop/pester/net/sabi/pester/AlarmListWindow.java
r246 r293 2 2 3 3 import danger.app.Application; 4 import danger.app.Event; 5 import danger.app.Resource; 6 import danger.text.span.SpanUtils; 7 import danger.text.span.SpannableString; 8 import danger.ui.DialogWindow; 9 import danger.ui.LinkTextBox; 4 10 import danger.ui.ScreenWindow; 5 11 import danger.ui.Menu; 6 12 import danger.ui.MenuItem; 13 import danger.ui.Scrollbar; 14 import danger.util.TextBuffer; 7 15 8 16 public class AlarmListWindow extends ScreenWindow … … 36 44 actionMenu.getItemWithID(ID_DISCARD_ITEM).setEnabled(haveFocusedItem); 37 45 } 46 47 public boolean receiveEvent(Event e) { 48 switch (e.type) { 49 case EVENT_ABOUT: 50 DialogWindow window = sPester.getDialog(ID_ABOUT_DIALOG, this); 51 LinkTextBox textBox = 52 (LinkTextBox)window.getDescendantWithID(ID_ABOUT_TEXT_BOX); 53 Resource aboutText = sPester.getResource(257, ID_ABOUT_TEXT); 54 int aboutSize = aboutText.getSize(); 55 byte b[] = new byte[aboutSize]; 56 aboutText.getBytes(b, 0, aboutSize); 57 String supportEmail = sPester.getString(ID_SUPPORT_EMAIL); 58 TextBuffer textBuffer = 59 new TextBuffer(aboutSize + supportEmail.length()); 60 textBuffer.insert(new String(b)); 61 SpannableString urlString = new SpannableString(supportEmail); 62 SpanUtils.addURL(urlString, 0, urlString.length(), 63 "mailto:" + supportEmail); 64 textBuffer.insert(urlString); 65 textBuffer.insert("."); 66 textBox.setText(textBuffer); 67 Scrollbar scrollbar = 68 (Scrollbar)window.getDescendantWithID(ID_ABOUT_TEXT_SCROLLBAR); 69 textBox.attachScrollbar(scrollbar); 70 window.show(); 71 return true; 72 } 73 return super.receiveEvent(e); 74 } 38 75 }
Note:
See TracChangeset
for help on using the changeset viewer.