/* -*-mode: C; fill-column: 78; c-basic-offset: 4; -*- */ /* * Copyright 2005 by Eric House (fixin@peak.org). (based on sample * app helloworldbasic "Copyright (c) 2002, Nokia. All rights * reserved.") * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ NAME XWRD #include #include #include "xwords.hrh" // --------------------------------------------------------- // // Define the resource file signature // This resource should be empty. // // --------------------------------------------------------- // RESOURCE RSS_SIGNATURE { } // --------------------------------------------------------- // // Default Document Name // // --------------------------------------------------------- // RESOURCE TBUF r_default_document_name { buf=""; } // --------------------------------------------------------- // // Define default menu, hotkeys and CBA keys. // // --------------------------------------------------------- // RESOURCE EIK_APP_INFO { menubar = r_xwords_menubar; cba = r_xwords_cba; hotkeys = r_xwords_hotkeys; } // --------------------------------------------------------- // // r_xwords_hotkeys // // --------------------------------------------------------- // RESOURCE HOTKEYS r_xwords_hotkeys { control = { HOTKEY { command = EEikCmdExit; key = 'e'; } }; } // --------------------------------------------------------- // // r_xwords_cba // // --------------------------------------------------------- // RESOURCE CBA r_xwords_cba { buttons= { CBA_BUTTON { id=XW_JUGGLE_COMMAND; txt="Juggle"; }, CBA_BUTTON { id=XW_NEXTHINT_COMMAND; txt="Next Hint"; }, CBA_BUTTON { id=XW_HIDETRAY_COMMAND; txt="Hide tray"; }, CBA_BUTTON { id=XW_DONE_COMMAND; txt="Done"; } }; } // --------------------------------------------------------- // // r_xwords_menubar // // --------------------------------------------------------- // RESOURCE MENU_BAR r_xwords_menubar { titles = { MENU_TITLE {menu_pane = r_xwords_file_menu; txt = "File";} ,MENU_TITLE {menu_pane = r_xwords_game_menu; txt = "Game";} ,MENU_TITLE {menu_pane = r_xwords_move_menu; txt = "Move";} }; } // --------------------------------------------------------- // // r_xwords_file_menu // Menu for "Options" // // --------------------------------------------------------- // RESOURCE MENU_PANE r_xwords_file_menu { items = { MENU_ITEM {command = XW_NEWGAME_COMMAND; txt = "New game";} ,MENU_ITEM {command = XW_SAVEDGAMES_COMMAND; txt = "Saved games";} ,MENU_ITEM {command = XW_PREFS_COMMAND; txt = "Preferences";} ,MENU_ITEM {command = XW_ABOUT_COMMAND; txt = "About";} ,MENU_ITEM {command = EEikCmdExit; txt = "Exit";} }; } RESOURCE MENU_PANE r_xwords_game_menu { items = { MENU_ITEM {command = XW_VALUES_COMMAND; txt = "Tile values";} ,MENU_ITEM {command = XW_REMAIN_COMMAND; txt = "Remaining tiles";} ,MENU_ITEM {command = XW_CURINFO_COMMAND; txt = "Game info";} ,MENU_ITEM {command = XW_HISTORY_COMMAND; txt = "History";} ,MENU_ITEM {command = XW_FINALSCORES_COMMAND; txt = "Final scores";} ,MENU_ITEM {command = XW_FLIP_COMMAND; txt = "Flip board"; } ,MENU_ITEM {command = XW_TOGGLEVALS_COMMAND; txt = "Toggle values"; } }; } RESOURCE MENU_PANE r_xwords_move_menu { items = { MENU_ITEM {command = XW_HINT_COMMAND; txt = "Hint";} /* #ifdef XWFEATURE_SEARCHLIMIT */ /* ,MENU_ITEM {command = XW_LIMHINT_COMMAND; txt = "Limited hint";} */ /* #endif */ ,MENU_ITEM {command = XW_NEXTHINT_COMMAND; txt = "Next hint";} ,MENU_ITEM {command = XW_UNDOCUR_COMMAND; txt = "Undo current";} ,MENU_ITEM {command = XW_UNDOLAST_COMMAND; txt = "Undo last";} ,MENU_ITEM {command = XW_DONE_COMMAND; txt = "Done";} /* ,MENU_ITEM {command = XW_JUGGLE_COMMAND; txt = "Juggle";} */ ,MENU_ITEM {command = XW_TRADE_COMMAND; txt = "Trade";} /* ,MENU_ITEM {command = XW_HIDETRAY_COMMAND; txt = "[Un]hide tray";} */ }; } /* Apparently you have to use a resource type large enough to hold the string. There are TBUF16, TBUF32, TBUF40, TBUF48,TBUF64, 128 and 256. Why a system that can generate constants from the resource IDs can't match resource types to strings is beyond me. */ RESOURCE TBUF32 r_no_peek_alert { buf="No peeking at the robot's tiles."; } RESOURCE TBUF40 r_tiles_in_line_alert { buf ="All tiles played must be in a line."; } RESOURCE TBUF64 r_no_empties_sep_alert { buf ="Empty squares cannot separate pieces played."; } RESOURCE TBUF64 r_two_tiles_first_move_alert { buf = "Must play two or more pieces on the first move."; } RESOURCE TBUF128 r_placed_must_contact_alert { buf = "New tiles must contact others already in place (or the middle square on the first move)."; } RESOURCE TBUF32 r_too_few_to_trade_alert { buf = "Too few tiles left to trade."; } RESOURCE TBUF64 r_not_your_turn_alert { buf = "You can't do that; it's not your turn!"; } RESOURCE TBUF40 r_remove_first_alert { buf = "Remove played tiles before trading."; } RESOURCE TBUF64 r_nothing_to_undo_alert { buf = "Nothing to undo. (Initial tile picking cannot be undone.)"; } RESOURCE TBUF64 r_confirm_end_game { buf = "Are you sure you want to end the game now?"; } RESOURCE TBUF64 r_alert_no_dicts { buf = "Crosswords requires at least one dictionary."; } RESOURCE TBUF32 r_alert_feature_pending { buf = "Feature not yet implemented."; } #define XW_EFLAGS EEikEdwinNoAutoSelection | EEikEdwinReadOnly | EEikEdwinResizable // EEikEdwinDisplayOnly | RESOURCE DIALOG r_xwords_confirmation_query { title = "Query"; #if ! defined SERIES_60 buttons = R_EIK_BUTTONS_NO_YES; #endif flags = EEikDialogFlagWait | EEikDialogFlagNotifyEsc; items = { DLG_LINE { control = EDWIN { flags = XW_EFLAGS; width = 50; lines = 4; }; type = EEikCtEdwin; id = EAskContents; } }; } RESOURCE DIALOG r_xwords_info_only { title = "Info"; #if ! defined SERIES_60 buttons = R_EIK_BUTTONS_CONTINUE; #endif flags = EEikDialogFlagWait | EEikDialogFlagNotifyEsc; items = { DLG_LINE { control = EDWIN { flags = XW_EFLAGS; width = 50; lines = 4; }; type = EEikCtEdwin; id = EAskContents; } }; } #ifndef XWFEATURE_STANDALONE_ONLY RESOURCE ARRAY r_conn_roles { items = { LBUF { txt = "Standalone"; } ,LBUF { txt = "Host"; } ,LBUF { txt = "Guest"; } }; } RESOURCE ARRAY r_conn_types { items = { LBUF { txt = "Bluetooth"; } ,LBUF { txt = "IR"; } ,LBUF { txt = "Cellular internet"; } }; } RESOURCE ARRAY r_xwords_newgame_page_conn { items = { DLG_LINE { prompt = "Role"; type = EEikCtChoiceList; control = CHOICELIST { array_id = r_conn_roles; }; id = EConnectionRole; // itemflags = }, DLG_LINE { prompt = "Connect via"; type = EEikCtChoiceList; control = CHOICELIST { array_id = r_conn_types; }; id = EConnectionType; // itemflags = } }; } #endif RESOURCE ARRAY r_four_nums { items = { LBUF { txt = "1"; } ,LBUF { txt = "2"; } ,LBUF { txt = "3"; } ,LBUF { txt = "4"; } }; } RESOURCE ARRAY r_xwords_newgame_page_players { items = { DLG_LINE { prompt = "Number of players"; type = EEikCtChoiceList; control = CHOICELIST { array_id = r_four_nums; }; id = ENPlayersList; }, DLG_LINE { prompt = "Show player"; type = EEikCtChoiceList; control = CHOICELIST { maxdisplaychar = 2; }; id = ENPlayersWhichList; }, DLG_LINE { prompt = "Location"; type = EEikCtChoiceList; control = CHOICELIST { array_id = r_location_choices; }; id = EPlayerLocationChoice; } ,DLG_LINE { prompt = "Name"; control = EDWIN { width = 20; maxlength = 32; }; type = EEikCtEdwin; id = EPlayerName; } ,DLG_LINE { prompt = "Species"; type = EEikCtChoiceList; control = CHOICELIST { array_id = r_player_species; }; id = EPlayerSpeciesChoice; } ,DLG_LINE { type = EEikCtSecretEd; prompt = "Password"; id = EDecryptPassword; control = SECRETED { num_letters = 5; }; } }; } RESOURCE ARRAY r_player_species { items = { LBUF { txt = "Human"; } ,LBUF { txt = "Robot"; } }; } RESOURCE ARRAY r_location_choices { items = { LBUF { txt = "Local"; } ,LBUF { txt = "Remote"; } ,LBUF { txt = "Dead"; } }; } /* This flag goes on editors in pages on series 60 */ /* avkon_flags = EAknEditorFlagNoEditIndicators; \ */ #ifdef SERIES_60 RESOURCE DLG_BUTTONS r_dict_browse_button { buttons = { DLG_BUTTON { id = EDictBrowseButton; button = CMBUT { txt = "Browse"; }; hotkey = "B"; } }; } #endif RESOURCE ARRAY r_xwords_newgame_page_dict { items = { DLG_LINE { prompt = "Game dictionary"; type = EEikCtChoiceList; control = CHOICELIST { flags = EEikChlistArrayOwnedExternally; }; id = ESelDictChoice; } #ifdef SERIES_60 ,DLG_LINE { buttons = r_dict_browse_button; } #endif }; } RESOURCE ARRAY r_xwords_newgame_pages { items = { #ifndef XWFEATURE_STANDALONE_ONLY PAGE{ text="Connection"; id=EPage1; lines=r_xwords_newgame_page_conn;} , #endif PAGE{ text="Players"; id=EPage2; lines=r_xwords_newgame_page_players;} ,PAGE{ text="Dictionary"; id=EPage3; lines=r_xwords_newgame_page_dict;} }; } RESOURCE DIALOG r_xwords_newgame_dlg { title = "Game setup"; /* This doesn't work in series 60. How do I differentiate? Sep .rss files? */ buttons = R_EIK_BUTTONS_CANCEL_OK; flags = EEikDialogFlagWait | EEikDialogFlagNotifyEsc; pages = r_xwords_newgame_pages; } RESOURCE DIALOG r_xwords_blank_picker { title = "Tile picker"; buttons = R_EIK_BUTTONS_CONTINUE; flags = EEikDialogFlagWait | EEikDialogFlagNotifyEsc; items = { DLG_LINE { prompt = "Choose one"; type = EEikCtChoiceList; control = CHOICELIST { flags = EEikChlistArrayOwnedExternally; }; id = ESelBlankChoice; } }; } RESOURCE DLG_BUTTONS r_savedgames_buttons { buttons = { DLG_BUTTON { id = XW_SGAMES_OPEN_COMMAND; buttontype = EEikCtCommandButton; flags = EEikLabeledButtonIsDefault; button = CMBUT { txt = "Open"; }; }, DLG_BUTTON { id = XW_SGAMES_RENAME_COMMAND; buttontype = EEikCtCommandButton; button = CMBUT { txt = "Rename"; }; }, DLG_BUTTON { id = XW_SGAMES_DELETE_COMMAND; buttontype = EEikCtCommandButton; button = CMBUT { txt = "Delete"; }; }, DLG_BUTTON { id = EEikBidCancel; buttontype = EEikCtCommandButton; button = CMBUT { txt = "Cancel"; }; } }; } RESOURCE DIALOG r_xwords_savedgames_dlg { title = "Saved games"; buttons = r_savedgames_buttons; flags = EEikDialogFlagWait | EEikDialogFlagNotifyEsc; items = { DLG_LINE { prompt = "Open:"; id = ESelGameChoice; #if 0 type = EEikCtChoiceList; control = CHOICELIST { flags = EEikChlistArrayOwnedExternally; }; #else type = EEikCtListBox; control = LISTBOX { flags = EEikListBoxMultipleSelection; width = 20; }; #endif } }; }