Changes between Version 1 and Version 2 of pjwin_idea


Ignore:
Timestamp:
Apr 26, 2009 11:07:48 PM (11 years ago)
Author:
bennylp
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • pjwin_idea

    v1 v2  
    1717The 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. 
    1818 
    19 Sample interactions: 
     19=== Sample interactions === 
    2020 
    2121 1. Describe the window using XUL-like syntax (the code below is all over the place but hopefully you get the idea): 
     
    2626            title="Hello world"> 
    2727      <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> 
    2932    </window>"; 
    3033    }}} 
     
    3942 1. Do some code in the event handler: 
    4043    {{{ 
    41 void event_handler(window *wnd, const pj_str_t *element, event *event) 
     44void event_handler(window *wnd, event *event) 
    4245{ 
    43    if (pj_strcmp2(element, "btn_quit")==0) 
     46   if (event->type==COMMAND && pj_strcmp2(&event->element, "quit")==0) 
    4447      end_dialog(wnd); 
     48   else if (event->type==COMMAND && pj_strcmp2(&event->element, "about")==0) 
     49      msgbox("hello world"); 
    4550} 
    4651    }}} 
    4752 1. And that's it! 
     53 
     54=== Screenshots === 
     55 
     56TBD. 
     57 
     58Basically, 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. 
    4859 
    4960