S60UIExample.rss
上传用户:laixiong
上传日期:2007-03-11
资源大小:2994k
文件大小:16k
源码类别:

Symbian

开发平台:

C/C++

  1. // Copyright (c) 2006 Nokia Corporation.
  2. //  RESOURCE IDENTIFIER
  3. NAME S60U    // 4 letter ID
  4. //  INCLUDES
  5. #include <eikon.rh>
  6. #include <avkon.rh>
  7. #include <avkon.rsg>
  8. #include <appinfo.rh>
  9. #include "S60UIExample.hrh"
  10. #include "S60UIExample.rls"
  11. #include <S60UIExample.mbg>  // for the weapon icons
  12. //  RESOURCE DEFINITIONS
  13. // -----------------------------------------------------------------------------
  14. //
  15. //    Define the resource file signature
  16. //    This resource should be empty.
  17. //
  18. // -----------------------------------------------------------------------------
  19. //
  20. RESOURCE RSS_SIGNATURE
  21.     {
  22.     }
  23. // -----------------------------------------------------------------------------
  24. //
  25. //    Default Document Name
  26. //
  27. // -----------------------------------------------------------------------------
  28. //
  29. RESOURCE TBUF r_default_document_name
  30.     {
  31.     buf="HEWB";
  32.     }
  33. // -----------------------------------------------------------------------------
  34. //
  35. //    Define default menu and CBA key.
  36. //
  37. // -----------------------------------------------------------------------------
  38. //
  39. RESOURCE EIK_APP_INFO
  40.     {
  41.     }
  42. // -----------------------------------------------------------------------------
  43. //
  44. //    r_s60uiexample_initialview
  45. //    Define initial view 
  46. //
  47. // -----------------------------------------------------------------------------
  48. //
  49. RESOURCE AVKON_VIEW r_s60uiexample_initialview
  50.     {
  51.     menubar = r_s60uiexample_initialmenubar;
  52.     cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
  53.     }
  54. // -----------------------------------------------------------------------------
  55. //
  56. //   r_s60uiexample_initialmenubar
  57. //   Menu title definition
  58. //
  59. // -----------------------------------------------------------------------------
  60. //
  61. RESOURCE MENU_BAR r_s60uiexample_initialmenubar
  62.     {
  63.     titles =
  64.         {
  65.         MENU_TITLE
  66.             {
  67.             menu_pane = r_s60uiexample_initialmenu;
  68.             }
  69.         };
  70.     }
  71. // -----------------------------------------------------------------------------
  72. //
  73. //   r_s60uiexample_initialmenu
  74. //   Menu for "Options"
  75. //
  76. // -----------------------------------------------------------------------------
  77. //
  78. RESOURCE MENU_PANE r_s60uiexample_initialmenu
  79.     {
  80.     items =
  81.         {
  82.         MENU_ITEM
  83.             {
  84.             command = ES60UIExampleStartGame;
  85.             txt = qtn_startgame;
  86.             },
  87.         MENU_ITEM
  88.             {
  89.             command = ES60UIExampleContinueGame;
  90.             txt = qtn_continuegame;
  91.             },
  92.         MENU_ITEM
  93.             {
  94.             command = ES60UIExampleRegister;
  95.             txt = qtn_register;
  96.             },
  97.         MENU_ITEM
  98.             {
  99.             command = ES60UIExampleSettings;
  100.             txt = qtn_settings;
  101.             },  
  102.         MENU_ITEM
  103.             {
  104.             command = ES60UIExampleHighscores;
  105.             txt = qtn_highscores;
  106.             },
  107.         MENU_ITEM
  108.             {
  109.             command = EAknSoftkeyExit;
  110.             txt = qtn_exit;
  111.             }
  112.         };
  113.     }
  114. // -----------------------------------------------------------------------------
  115. //
  116. //    r_s60uiexample_playview
  117. //    Define play view 
  118. //
  119. // -----------------------------------------------------------------------------
  120. //
  121. RESOURCE AVKON_VIEW r_s60uiexample_playview
  122.     {
  123.     menubar = r_s60uiexample_playmenubar;
  124.     cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
  125.     }
  126. // -----------------------------------------------------------------------------
  127. //
  128. //   r_S60UIExample_playmenubar
  129. //   Menu title definition
  130. //
  131. // -----------------------------------------------------------------------------
  132. //
  133. RESOURCE MENU_BAR r_s60uiexample_playmenubar
  134.     {
  135.         titles =
  136.         {
  137.             MENU_TITLE
  138.             {
  139.             menu_pane = r_s60uiexample_playmenu;
  140.             }
  141.         };
  142.     }
  143. // -----------------------------------------------------------------------------
  144. //
  145. //   r_s60uiexample_playmenu
  146. //   Menu for "Options"
  147. //
  148. // -----------------------------------------------------------------------------
  149. //
  150. RESOURCE MENU_PANE r_s60uiexample_playmenu
  151.     {
  152.     items =
  153.         {
  154.             MENU_ITEM
  155.             {
  156.                 command = ES60UIExampleStopGame;
  157.                 txt = qtn_endgame;
  158.             },
  159.             MENU_ITEM
  160.             {
  161.                 command = ES60UIExampleContinueGame;
  162.                 txt = qtn_continuegame;
  163.             },
  164.             MENU_ITEM
  165.             {
  166.                 command = ES60UIExampleStartGame;
  167.                 txt = qtn_restartgame;
  168.             },
  169.             MENU_ITEM
  170.             {
  171.                 command = ES60UIExamplePauseGame;
  172.                 txt = qtn_pausegame;
  173.             },
  174.             MENU_ITEM
  175.             {
  176.                 command = ES60UIExampleWeapon;
  177.                 txt = qtn_selectweapon;
  178.             },
  179.             MENU_ITEM
  180.             {
  181.                 command = EAknSoftkeyExit;
  182.                 txt = qtn_exit;
  183.             }
  184.         };
  185.     }
  186.     
  187.     
  188. RESOURCE DIALOG r_s60uiexample_enter_score_query
  189.     {
  190.     flags = EGeneralQueryFlags;
  191.     buttons = R_AVKON_SOFTKEYS_YES_NO;
  192.     items = 
  193.         { 
  194.             DLG_LINE 
  195.             {
  196.                 type = EAknCtQuery;
  197.                 id = EGeneralQuery;
  198.                 control = AVKON_CONFIRMATION_QUERY 
  199.                 {
  200.                     layout =  EConfirmationQueryLayout;
  201.                     label = qtn_enter_score_query_label;
  202.                 };
  203.             }
  204.         };
  205.     }
  206. RESOURCE DIALOG r_s60uiexample_confirmation_query
  207.     {
  208.     flags = EGeneralQueryFlags;
  209.     buttons = R_AVKON_SOFTKEYS_YES_NO;
  210.     items = 
  211.         { 
  212.             DLG_LINE 
  213.             {
  214.                 type = EAknCtQuery;
  215.                 id = EGeneralQuery;
  216.                 control = AVKON_CONFIRMATION_QUERY 
  217.                 {
  218.                     layout =  EConfirmationQueryLayout;
  219.                     label = qtn_confirmation_query_label;
  220.                 };
  221.             }
  222.         };
  223.     }
  224. //-----------------------------------------------------------------------------
  225. //
  226. //    r_s60uiexample_name_query
  227. //    Resource of Data Query.
  228. //
  229. //-----------------------------------------------------------------------------
  230. //
  231. RESOURCE DIALOG r_s60uiexample_name_query
  232.     {
  233.     flags = EGeneralQueryFlags;
  234.     buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
  235.     items =
  236.         {
  237.         DLG_LINE
  238.             {
  239.             type = EAknCtQuery;
  240.             id = EGeneralQuery;
  241.             control = AVKON_DATA_QUERY
  242.                 {
  243.                 layout = EDataLayout;
  244.                 label = qtn_name_query_label;
  245.                 control = EDWIN
  246.                     {
  247.                     flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
  248.                     width = 23;
  249.                     maxlength = 18;
  250.                     max_view_height_in_lines = 2; 
  251.                     };
  252.                 };
  253.             }
  254.         };
  255.     }
  256. //-----------------------------------------------------------------------------
  257. //
  258. //    r_s60uiexample_list_query
  259. //    Resources of Weapon Selection Query.
  260. //
  261. //-----------------------------------------------------------------------------
  262. //
  263. RESOURCE AVKON_LIST_QUERY r_s60uiexample_list_query
  264.     {
  265.     flags = EGeneralQueryFlags;
  266.     softkeys = R_AVKON_SOFTKEYS_OK_CANCEL;
  267.     items =
  268.         {
  269.         AVKON_LIST_QUERY_DLG_LINE
  270.             {
  271.             control = AVKON_LIST_QUERY_CONTROL
  272.                 {
  273.                 listtype = EAknCtSingleGraphicPopupMenuListBox;
  274.                 listbox = AVKON_LIST_QUERY_LIST
  275.                     {
  276.                     array_id = r_s60uiexample_list_query_item;
  277.                     };
  278.                 heading = qtn_list_query_heading;
  279.                 };
  280.             }
  281.         };
  282.     }
  283.     
  284.     
  285. RESOURCE ARRAY r_s60uiexample_list_query_item
  286.     {
  287.     items =
  288.         {
  289.         LBUF
  290.             {
  291.             txt = qtn_list_query_item_gun;
  292.             }, 
  293.         LBUF
  294.             {
  295.             txt = qtn_list_query_item_dagger;
  296.             },
  297.         LBUF
  298.             {
  299.             txt = qtn_list_query_item_candlestick;
  300.             }
  301.         };
  302.     }
  303. RESOURCE AKN_ICON_ARRAY r_s60uiexample_weapon_icons
  304.     {
  305.     bmpfile = "\resource\apps\S60UIExample.mif";
  306.     icons =
  307.         {
  308.         AKN_ICON
  309.             {
  310.             iconId = EMbmS60uiexampleGun;
  311.             maskId = EMbmS60uiexampleGun_mask;
  312.             },
  313.         AKN_ICON
  314.             {
  315.             iconId = EMbmS60uiexampleDagger;
  316.             maskId = EMbmS60uiexampleDagger_mask;
  317.             },
  318.         AKN_ICON
  319.             {
  320.             iconId = EMbmS60uiexampleCandlestick;
  321.             maskId = EMbmS60uiexampleCandlestick_mask;
  322.             }
  323.         };
  324.     }
  325. //-----------------------------------------------------------------------------
  326. //
  327. //    r_s60uiexample_form_dialog
  328. //    Resources for Register Form.
  329. //
  330. //-----------------------------------------------------------------------------
  331. //
  332. RESOURCE DIALOG r_s60uiex_form_dialog
  333.     {
  334.     flags = EEikDialogFlagNoDrag | EEikDialogFlagFillAppClientRect | EEikDialogFlagNoTitleBar | EEikDialogFlagNoBorder | EEikDialogFlagCbaButtons; 
  335.     // Defined in avkon.hrh (search CBA LABELS) 
  336.     // Labels the left softkey as Options and the right softkey as 
  337.     // Back 
  338.     buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK; 
  339.     form = r_s60uiex_form; 
  340.     }
  341. RESOURCE FORM r_s60uiex_form 
  342.     { 
  343.     flags = EEikFormUseDoubleSpacedFormat; 
  344.     items = 
  345.         { 
  346.         DLG_LINE 
  347.             { 
  348.             type = EEikCtEdwin; 
  349.             prompt = qtn_s60uiex_form_name; 
  350.             id = ES60UIExCtrlIdName; 
  351.             itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys; 
  352.             control = EDWIN
  353.                 { 
  354.                 flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable; 
  355.                 width = 1; 
  356.                 lines = 2; 
  357.                 maxlength = 30; 
  358.                 base_line_delta = 21; 
  359.                 }; 
  360.             }, 
  361.         DLG_LINE
  362.             {
  363.             type = EEikCtDateEditor;
  364.             id = ES60UIExCtrlIdBirthDate;
  365.             prompt = qtn_s60uiex_form_dob;
  366.             control = DATE_EDITOR
  367.                 {
  368.                 minDate = DATE
  369.                     {
  370.                     year = 1900;
  371.                     };
  372.                 maxDate = DATE
  373.                     {
  374.                     year = 2100;
  375.                     };
  376.                 };
  377.             },
  378.         DLG_LINE
  379.     { 
  380.     type = EEikCtEdwin;
  381.     prompt = "Mobile Number";
  382.     id = ES60UIExCtrlIdMobile;
  383.     itemflags = EEikDlgItemTakesEnterKey |
  384.                 EEikDlgItemOfferAllHotKeys |
  385.                 EEikDlgItemSeparatorBefore;
  386.     control = EDWIN
  387.         {
  388.         flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
  389.         allowed_input_modes = EAknEditorNumericInputMode;
  390.         default_input_mode = EAknEditorNumericInputMode;
  391.         width = 1; 
  392.         lines = 2; 
  393.         maxlength = 15; 
  394.         base_line_delta = 21; 
  395.         };
  396.     }
  397.         }; 
  398.     }
  399. // -----------------------------------------------------------------------------
  400. //
  401. // String Resources .
  402. //
  403. // -----------------------------------------------------------------------------
  404. //
  405. RESOURCE TBUF32 r_s60uiexample_title_text
  406.     { 
  407.     buf = qtn_s60uiexample_title_text; 
  408.     }
  409. RESOURCE TBUF32 r_s60uiexample_highscore_title_text
  410.     { 
  411.     buf = qtn_high_score_title_text; 
  412.     }
  413. RESOURCE TBUF32 r_s60uiexample_resetting_text
  414.     { 
  415.     buf = qtn_resetting_text; 
  416.     }
  417. // -----------------------------------------------------------------------------
  418. //
  419. // Resources HighScore View.
  420. //
  421. // -----------------------------------------------------------------------------
  422. //
  423. RESOURCE AVKON_VIEW r_s60uiexample_highscore_view
  424.     {
  425.     cba = R_AVKON_SOFTKEYS_OK_CANCEL;
  426.     }
  427. // -----------------------------------------------------------------------------
  428. //
  429. // Resources Settings List.
  430. //
  431. // -----------------------------------------------------------------------------
  432. //
  433. RESOURCE AVKON_VIEW r_s60uiexample_settings_view
  434.     {
  435.     menubar = r_s60uiexample_settingsmenubar;
  436.     cba = R_AVKON_SOFTKEYS_OPTIONS_BACK;
  437.     }
  438. // -----------------------------------------------------------------------------
  439. //
  440. //   r_s60uiexample_settingsmenubar
  441. //   Menu title definition
  442. //
  443. // -----------------------------------------------------------------------------
  444. //
  445. RESOURCE MENU_BAR r_s60uiexample_settingsmenubar
  446.     {
  447.     titles =
  448.         {
  449.         MENU_TITLE
  450.             {
  451.             menu_pane = r_s60uiexample_settingsmenu;
  452.             }
  453.         };
  454.     }
  455.     
  456. // -----------------------------------------------------------------------------
  457. //
  458. //   r_s60uiexample_settingsmenu
  459. //   Menu for "Options"
  460. //
  461. // -----------------------------------------------------------------------------
  462. //
  463. RESOURCE MENU_PANE r_s60uiexample_settingsmenu
  464.     {
  465.     items =
  466.         {
  467.         MENU_ITEM
  468.             {
  469.             command = ES60UIExampleChange;
  470.             txt = qtn_change;
  471.             },
  472.         MENU_ITEM
  473.             {
  474.             command = EAknSoftkeyExit;
  475.             txt = qtn_exit;
  476.             }
  477.         };
  478.     }
  479. RESOURCE AVKON_SETTING_ITEM_LIST r_s60uiexample_setting_list
  480.     {
  481.     flags = EAknSettingItemNumberedStyle;
  482.     title = qtn_setting_list_title;
  483.     items =
  484.         {
  485.         AVKON_SETTING_ITEM
  486.             {
  487.             identifier = ESpeedSettingItem;
  488.             name = qtn_setting_list_item_speed;
  489.             setting_page_resource = r_s60uiexample_speed_setting_page;
  490.             },
  491.         AVKON_SETTING_ITEM
  492.             {
  493.             identifier = EBacktrackingSettingItem;
  494.             setting_page_resource = r_s60uiexample_backtracking_setting_page;
  495.             associated_resource = r_s60uiexample_backtracking_texts;
  496.             name = qtn_setting_list_item_backtracking;
  497.             }
  498.         };
  499.     }
  500.     
  501.     
  502. RESOURCE AVKON_SETTING_PAGE r_s60uiexample_speed_setting_page
  503.     {
  504.     type = EAknCtSlider;
  505.     editor_resource_id = r_s60uiexample_slider;
  506.     label = qtn_setting_list_item_speed;
  507.     }    
  508.     
  509. RESOURCE SLIDER r_s60uiexample_slider
  510.     {
  511.     layout = EAknSettingsItemSliderLayout;
  512.     minvalue = 0;
  513.     maxvalue = 10;
  514.     step = 2;
  515.     valuetype = EAknSliderValueBareFigure;
  516.     minlabel = qtn_slider_minlabel;
  517.     maxlabel = qtn_slider_maxlabel;
  518.     }    
  519.     
  520. RESOURCE AVKON_SETTING_PAGE r_s60uiexample_backtracking_setting_page
  521.     {
  522.     type = EAknCtPopupSettingList;
  523.     label = qtn_setting_list_item_backtracking;
  524.     }    
  525.     
  526. RESOURCE AVKON_POPUP_SETTING_TEXTS r_s60uiexample_backtracking_texts
  527.     {
  528.     flags = 0;
  529.     setting_texts_resource = r_s60uiexample_on_off_texts;
  530.     }
  531. RESOURCE ARRAY r_s60uiexample_on_off_texts
  532.     {
  533.     items =
  534.         {
  535.         AVKON_ENUMERATED_TEXT { value=0; text = qtn_on; },
  536.     AVKON_ENUMERATED_TEXT { value=1; text = qtn_off; }
  537.         };
  538.     }
  539. // ---------------------------------------------------------------------------- 
  540. //
  541. // r_localisable_app_info
  542. //
  543. // ---------------------------------------------------------------------------- 
  544. //
  545. RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info
  546.     {
  547.     short_caption = qtn_short_caption_string;
  548.     caption_and_icon = 
  549.     CAPTION_AND_ICON_INFO
  550.         {
  551.         caption = qtn_caption_string;
  552.         number_of_icons = 1;
  553.     icon_file = "\resource\apps\S60UIExample_icon.mif";
  554.     };
  555.     }
  556. // End of File