Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 3, 2005, 12:13:38 PM (19 years ago)
Author:
bensch
Message:

orxonox/branches/updater: code-standartisation updated in all files.

  1. member → this→member
  2. function (bla) → function(bla)
  3. other small fixes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/updater/src/gui/orxonox_gui_keys.cc

    r3288 r3315  
    2929   \brief Creates an Keyboard-Frame
    3030*/
    31 OrxonoxGuiKeys::OrxonoxGuiKeys ()
    32 {
    33   keysFrame = new Frame ("Keyboard-Options:");
     31OrxonoxGuiKeys::OrxonoxGuiKeys(void)
     32{
     33  this->keysFrame = new Frame("Keyboard-Options:");
    3434  //  keysFrame->setGroupName("Keyboard");
    35   keysBox = new Box ('h');
    36   player1 = new Player("player1");
    37   player2 = new Player("player2");
    38 
    39   keysBox->fill(player1->getOpenButton());
    40   keysBox->fill(player2->getOpenButton());
    41 
    42   keysFrame->fill (keysBox);
     35  this->keysBox = new Box('h');
     36  this->player1 = new Player("player1");
     37  this->player2 = new Player("player2");
     38
     39  this->keysBox->fill(this->player1->getOpenButton());
     40  this->keysBox->fill(this->player2->getOpenButton());
     41
     42  this->keysFrame->fill(this->keysBox);
    4343}
    4444
     
    4747   \return Returns the Audio-frame
    4848*/
    49 Widget* OrxonoxGuiKeys::getWidget ()
    50 {
    51   return keysFrame;
     49Widget* OrxonoxGuiKeys::getWidget(void)
     50{
     51  return this->keysFrame;
    5252}
    5353
     
    6060Player::Player(char* player)
    6161{
    62   char windowName[100] = "Keyboard settings of ";
    63   strcat (windowName, player);
    64   pKeyWindow = new Window(windowName);
    65   pKeyFrame = new Frame (windowName);
    66    pKeysBox = new Box('v');
    67    pKeysBox->setGroupName (player);
    68     pKeysBox->fill(addKey(UP, "up"));
    69     pKeysBox->fill(addKey(DOWN, "down"));
    70     pKeysBox->fill(addKey(LEFT, "left"));
    71     pKeysBox->fill(addKey(RIGHT, "right"));
    72     pKeysBox->fill(addKey(SHOOT, "shoot"));
    73    
     62  char* windowName = new char[strlen(player)+25];
     63  strcpy(windowName, "Keyboard settings of ");
     64  strcat(windowName, player);
     65  this->pKeyWindow = new Window(windowName);
     66  this->pKeyFrame = new Frame(windowName);
     67   this->pKeysBox = new Box('v');
     68   this->pKeysBox->setGroupName(player);
     69    this->pKeysBox->fill(addKey(UP, "up"));
     70    this->pKeysBox->fill(addKey(DOWN, "down"));
     71    this->pKeysBox->fill(addKey(LEFT, "left"));
     72    this->pKeysBox->fill(addKey(RIGHT, "right"));
     73    this->pKeysBox->fill(addKey(SHOOT, "shoot"));
     74    delete windowName;
    7475    closeButton = new Button("close");
    7576#ifdef HAVE_GTK2
    76     closeButton->connectSignal("button_press_event", pKeyWindow, Window::windowClose);
    77 #endif /* HAVE_GTK2 */
    78 
    79     pKeysBox->fill(closeButton);
    80     pKeyFrame->fill(pKeysBox);
    81    pKeyWindow->fill(pKeyFrame);
    82    Window::addWindow(pKeyWindow);
    83 #ifdef HAVE_GTK2
    84    pKeyWindow->connectSignal("destroy", pKeyWindow, Window::windowClose);
    85    pKeyWindow->connectSignal("delete_event", pKeyWindow, Window::windowClose);
    86 #endif /* HAVE_GTK2 */
    87 
    88   openButton = new Button (player);
    89 #ifdef HAVE_GTK2
    90   openButton->connectSignal("button_press_event", pKeyWindow, Window::windowOpen);
    91 #endif /* HAVE_GTK2 */
    92 
    93   inputWindow = new Window("inputWindow");
    94 
    95   inputButton = new Button ("test");
    96   inputWindow->fill (inputButton);
    97 #ifdef HAVE_GTK2
    98   inputWindow->connectSignal("destroy",  Widget::doNothingSignal);
    99   inputWindow->connectSignal("delete_event", Widget::doNothingSignal);
     77    this->closeButton->connectSignal("button_press_event", this->pKeyWindow, Window::windowClose);
     78#endif /* HAVE_GTK2 */
     79
     80    this->pKeysBox->fill(this->closeButton);
     81    this->pKeyFrame->fill(this->pKeysBox);
     82   this->pKeyWindow->fill(this->pKeyFrame);
     83   Window::addWindow(this->pKeyWindow);
     84#ifdef HAVE_GTK2
     85   this->pKeyWindow->connectSignal("destroy", this->pKeyWindow, Window::windowClose);
     86   this->pKeyWindow->connectSignal("delete_event", this->pKeyWindow, Window::windowClose);
     87#endif /* HAVE_GTK2 */
     88
     89  this->openButton = new Button(player);
     90#ifdef HAVE_GTK2
     91  this->openButton->connectSignal("button_press_event", this->pKeyWindow, Window::windowOpen);
     92#endif /* HAVE_GTK2 */
     93
     94  this->inputWindow = new Window("inputWindow");
     95
     96  this->inputButton = new Button("test");
     97  this->inputWindow->fill(inputButton);
     98#ifdef HAVE_GTK2
     99  this->inputWindow->connectSignal("destroy",  Widget::doNothingSignal);
     100  this->inputWindow->connectSignal("delete_event", Widget::doNothingSignal);
    100101#endif /* HAVE_GTK2 */
    101102
     
    108109   \returns A widget that has the Key-Box
    109110*/
    110 Widget* Player::addKey (KEYS key, char* name)
    111 {
    112   inputKey[key] = new InputKey;
    113   inputKey[key]->pKeyBox = new Box();
    114   inputKey[key]->pKeyButton = new Button(name);
    115   inputKey[key]->pKeyOLabel = new OptionLabel (name, name);
    116   inputKey[key]->pKeyOLabel->saveability();
     111Widget* Player::addKey(KEYS key, char* name)
     112{
     113  this->inputKey[key] = new InputKey;
     114  this->inputKey[key]->pKeyBox = new Box();
     115  this->inputKey[key]->pKeyButton = new Button(name);
     116  this->inputKey[key]->pKeyOLabel = new OptionLabel(name, name);
     117  this->inputKey[key]->pKeyOLabel->saveability();
    117118
    118119#ifdef HAVE_GTK2
    119120  //inputKey[key]->pKeyButton->connectSignal("key_press_event", inputKey[key]->pKeyButton, key_cb);
    120   inputKey[key]->pKeyButton->connectSignal("button_press_event", inputKey[key], inputWindowEvent);
    121 #endif /* HAVE_GTK2 */
    122   inputKey[key]->pKeyBox->fill(inputKey[key]->pKeyButton);
    123   inputKey[key]->pKeyBox->fill(inputKey[key]->pKeyOLabel);
    124   return inputKey[key]->pKeyBox;
     121  this->inputKey[key]->pKeyButton->connectSignal("button_press_event", this->inputKey[key], inputWindowEvent);
     122#endif /* HAVE_GTK2 */
     123  this->inputKey[key]->pKeyBox->fill(this->inputKey[key]->pKeyButton);
     124  this->inputKey[key]->pKeyBox->fill(this->inputKey[key]->pKeyOLabel);
     125  return this->inputKey[key]->pKeyBox;
    125126}
    126127
     
    128129   \returns the OpenButton of a Player
    129130*/
    130 Button* Player::getOpenButton()
    131 {
    132   return openButton;
    133 }
    134 
    135 /**
    136    \brief sets a new Key (only output)
     131Button* Player::getOpenButton(void)
     132{
     133  return this->openButton;
     134}
     135
     136/**
     137   \brief sets a new Key(only output)
    137138   \param key the new Key.
    138139*/
     
    163164gint Player::key_cb(GtkWidget* w, GdkEventKey* event, void* inputKey)
    164165{
    165   InputKey* inputkey = (InputKey*) inputKey;
     166  InputKey* inputkey =(InputKey*) inputKey;
    166167  char title [20];
    167168
     
    256257      char* tmp;
    257258      sprintf(tmp, "%c", event->keyval);
    258       printf ("other key %s \n", tmp);
     259      printf("other key %s \n", tmp);
    259260      strcpy(title, tmp);
    260261      break;
    261262    }
    262263
    263   inputkey->pKeyOLabel->setValue (title);
     264  inputkey->pKeyOLabel->setValue(title);
    264265  inputButton->disconnectSignal(keySignal);
    265266  inputWindow->close();
Note: See TracChangeset for help on using the changeset viewer.