Changes between Version 1 and Version 2 of pjwin_idea
- Timestamp:
- Apr 26, 2009 11:07:48 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
pjwin_idea
v1 v2 17 17 The basic idea is to use XUL-like interface (see [http://www.mozilla.org/projects/xul/ XUL], and [https://developer.mozilla.org/en/XUL_Tutorial XUL tutorial]), but much more simplified. 18 18 19 Sample interactions: 19 === Sample interactions === 20 20 21 21 1. Describe the window using XUL-like syntax (the code below is all over the place but hopefully you get the idea): … … 26 26 title="Hello world"> 27 27 <label value="Press the button to exit"/> 28 <button id="btn_quit" value="Quit"/> 28 <cmdbar> 29 <menuitem id="about" value="About.."/> 30 <menuitem id="quit" value="Quit"/> 31 </cmdbar> 29 32 </window>"; 30 33 }}} … … 39 42 1. Do some code in the event handler: 40 43 {{{ 41 void event_handler(window *wnd, const pj_str_t *element,event *event)44 void event_handler(window *wnd, event *event) 42 45 { 43 if ( pj_strcmp2(element, "btn_quit")==0)46 if (event->type==COMMAND && pj_strcmp2(&event->element, "quit")==0) 44 47 end_dialog(wnd); 48 else if (event->type==COMMAND && pj_strcmp2(&event->element, "about")==0) 49 msgbox("hello world"); 45 50 } 46 51 }}} 47 52 1. And that's it! 53 54 === Screenshots === 55 56 TBD. 57 58 Basically, on Smartphone and S60, the command bar will be implemented as menu, while on Win32 it will be as buttons, while on PPC it may be implemented as menu or buttons. 48 59 49 60