Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5020 in orxonox.OLD for orxonox/trunk/src/lib/gui


Ignore:
Timestamp:
Aug 14, 2005, 11:44:49 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: IniParser: added the ability to write to files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/gui/gui_keys.cc

    r4836 r5020  
    1 /* 
     1/*
    22   orxonox - the future of 3D-vertical-scrollers
    33
     
    1616   You should have received a copy of the GNU General Public License
    1717   along with this program; if not, write to the Free Software Foundation,
    18    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
     18   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    1919
    2020
     
    3838  {
    3939    Box* keysBox0;          //!< The Frame that holds the keyOptions.
    40    
     40
    4141    //  keysFrame->setGroupName("Keyboard");
    4242    keysBox0 = new Box('v');
     
    4747      keysBox1 = new Box('h');
    4848      {
    49         PlayerKeys* player1;       //!< The first Player's keys.
    50         PlayerKeys* player2;       //!< The seconds Player's keys.
    51        
    52         player1 = new PlayerKeys(CONFIG_SECTION_PLAYER "1");
    53         player2 = new PlayerKeys(CONFIG_SECTION_PLAYER "2");
    54        
    55         keysBox1->fill(player1->getOpenButton());
    56         keysBox1->fill(player2->getOpenButton());
     49        PlayerKeys* player1;       //!< The first Player's keys.
     50        PlayerKeys* player2;       //!< The seconds Player's keys.
     51
     52        player1 = new PlayerKeys(CONFIG_SECTION_PLAYER "1");
     53        player2 = new PlayerKeys(CONFIG_SECTION_PLAYER "2");
     54
     55        keysBox1->fill(player1->getOpenButton());
     56        keysBox1->fill(player2->getOpenButton());
    5757      }
    5858      keysBox0->fill(keysBox1);
     
    6363    keysFrame->fill(keysBox0);
    6464  }
    65  
     65
    6666  // setting up the Input Windows that receives keystrokes.
    6767  this->inputWindow = new Window("inputWindow");
     
    7272#endif /* HAVE_GTK2 */
    7373  this->inputWindow->fill(inputButton);
    74  
     74
    7575  this->setMainWidget(keysFrame);
    7676}
     
    112112      pKeysBox = new Box('v');
    113113      {
    114         Button* closeButton;    //!< The CloseButton for this key-settings.
    115 
    116         pKeysBox->setGroupName(player);
    117         pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_UP, "UP"));
    118         pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_DOWN, "DOWN"));
    119         pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_LEFT, "LEFT"));
    120         pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_RIGHT, "RIGHT"));
    121         pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_FIRE, "SPACE"));
    122         pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_NEXT_WEAPON, "m"));
    123         pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_PREV_WEAPON, "n"));
    124         closeButton = new Button("close");
    125 #ifdef HAVE_GTK2
    126         closeButton->connectSignal("button_press_event", pKeyWindow, Window::windowClose);
    127 #endif /* HAVE_GTK2 */
    128 
    129         pKeysBox->fill(closeButton);
     114        Button* closeButton;    //!< The CloseButton for this key-settings.
     115
     116        pKeysBox->setGroupName(player);
     117        pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_UP, "UP"));
     118        pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_DOWN, "DOWN"));
     119        pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_LEFT, "LEFT"));
     120        pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_RIGHT, "RIGHT"));
     121        pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_FIRE, "SPACE"));
     122        pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_NEXT_WEAPON, "m"));
     123        pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_PREV_WEAPON, "n"));
     124        closeButton = new Button("close");
     125#ifdef HAVE_GTK2
     126        closeButton->connectSignal("button_press_event", pKeyWindow, Window::windowClose);
     127#endif /* HAVE_GTK2 */
     128
     129        pKeysBox->fill(closeButton);
    130130      }
    131131      pKeyFrame->fill(pKeysBox);
     
    139139  pKeyWindow->connectSignal("delete_event", pKeyWindow, Window::windowClose);
    140140#endif /* HAVE_GTK2 */
    141  
     141
    142142  this->openButton = new Button(player);
    143143#ifdef HAVE_GTK2
     
    174174      keysBox = new Box('v');
    175175      {
    176         Button* closeButton;    //!< The CloseButton for this key-settings.
    177 
    178         keysBox->setGroupName(CONFIG_SECTION_MISC_KEYS);
    179         keysBox->fill(addKey(CONFIG_NAME_QUIT , "ESCAPE"));
    180         keysBox->fill(addKey(CONFIG_NAME_PAUSE, "PAUSE"));
    181         keysBox->fill(addKey(CONFIG_NAME_NEXT_WORLD, "x"));
    182         keysBox->fill(addKey(CONFIG_NAME_PREV_WORLD, "z"));
    183         keysBox->fill(addKey(CONFIG_NAME_VIEW0, "1"));
    184         keysBox->fill(addKey(CONFIG_NAME_VIEW1, "2"));
    185         keysBox->fill(addKey(CONFIG_NAME_VIEW2, "3"));
    186         keysBox->fill(addKey(CONFIG_NAME_VIEW3, "4"));
    187         keysBox->fill(addKey(CONFIG_NAME_VIEW4, "5"));
    188         keysBox->fill(addKey(CONFIG_NAME_VIEW5, "6"));
    189 
    190         closeButton = new Button("close");
    191 #ifdef HAVE_GTK2
    192         closeButton->connectSignal("button_press_event", keyWindow, Window::windowClose);
    193 #endif /* HAVE_GTK2 */
    194 
    195         keysBox->fill(closeButton);
     176        Button* closeButton;    //!< The CloseButton for this key-settings.
     177
     178        keysBox->setGroupName(CONFIG_SECTION_MISC_KEYS);
     179        keysBox->fill(addKey(CONFIG_NAME_QUIT , "ESCAPE"));
     180        keysBox->fill(addKey(CONFIG_NAME_PAUSE, "PAUSE"));
     181        keysBox->fill(addKey(CONFIG_NAME_NEXT_WORLD, "x"));
     182        keysBox->fill(addKey(CONFIG_NAME_PREV_WORLD, "z"));
     183        keysBox->fill(addKey(CONFIG_NAME_VIEW0, "1"));
     184        keysBox->fill(addKey(CONFIG_NAME_VIEW1, "2"));
     185        keysBox->fill(addKey(CONFIG_NAME_VIEW2, "3"));
     186        keysBox->fill(addKey(CONFIG_NAME_VIEW3, "4"));
     187        keysBox->fill(addKey(CONFIG_NAME_VIEW4, "5"));
     188        keysBox->fill(addKey(CONFIG_NAME_VIEW5, "6"));
     189
     190        closeButton = new Button("close");
     191#ifdef HAVE_GTK2
     192        closeButton->connectSignal("button_press_event", keyWindow, Window::windowClose);
     193#endif /* HAVE_GTK2 */
     194
     195        keysBox->fill(closeButton);
    196196      }
    197197      keyFrame->fill(keysBox);
     
    204204  keyWindow->connectSignal("delete_event", keyWindow, Window::windowClose);
    205205#endif /* HAVE_GTK2 */
    206  
     206
    207207  this->openButton = new Button("misc");
    208208#ifdef HAVE_GTK2
     
    254254  GuiKeys::inputWindow->open();
    255255}
    256  
     256
    257257/**
    258258 *  Function which gets keystrokes
     
    281281      strcpy(title, "RIGHT");
    282282      break;
    283      
     283
    284284    case GDK_space:
    285285      strcpy(title, "SPACE");
    286286      break;
    287      
     287
    288288    case GDK_Return:
    289289      strcpy(title, "RETURN");
    290290      break;
    291      
     291
    292292      // Special Keys //
    293293    case GDK_BackSpace:
     
    361361      strcpy(title, "INSERT");
    362362      break;
    363      
     363
    364364    case GDK_Escape:
    365365      strcpy(title, "ESCAPE");
     
    423423      strcpy(title, "F12");
    424424      break;
    425      
    426      
     425
     426
    427427    default:
    428428      char* tmp;
Note: See TracChangeset for help on using the changeset viewer.