Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7343 in orxonox.OLD for trunk/src/lib/shell/shell_input.cc


Ignore:
Timestamp:
Apr 19, 2006, 4:26:27 AM (19 years ago)
Author:
bensch
Message:

oroxnox/trunk: ShellInput and ShellCompletion more c++-like

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/shell/shell_input.cc

    r7342 r7343  
    4141 * this also generates a ShellCompletion automatically.
    4242*/
    43 ShellInput::ShellInput () : Text ("")
     43ShellInput::ShellInput ()
     44  : Text ("")
    4445{
    4546  this->pressedKey = SDLK_FIRST;
     
    6667  evh->unsubscribe(ES_SHELL, SDLK_PAGEDOWN);
    6768
    68   this->completion = new ShellCompletion(this);
    69 }
    70 
    71 /**
    72  * standard deconstructor
    73 */
     69}
     70
     71/**
     72 * @brief standard deconstructor
     73 */
    7474ShellInput::~ShellInput ()
    7575{
    76   // delete what has to be deleted here
    77   delete this->completion;
    78 
    79   while (!this->history.empty())
    80   {
    81     this->history.pop_front();
    82   }
    83 }
    84 
    85 /**
    86  * sets the Repeate-delay and rate
     76}
     77
     78/**
     79 * @brief sets the Repeate-delay and rate
    8780 * @param repeatDelay the Delay it takes, to repeate a key
    8881 * @param repeatRate the rate to repeate a pressed key
     
    9588
    9689/**
    97  * deletes the InputLine
     90 * @brief deletes the InputLine
    9891 */
    9992void ShellInput::flush()
     
    10497
    10598/**
    106  * sets the entire text of the InputLine to text
     99 * @brief sets the entire text of the InputLine to text
    107100 * @param text the new Text to set as InputLine
    108101 */
     
    115108
    116109/**
    117  * adds one character to the inputLine
     110 * @brief adds one character to the inputLine
    118111 * @param character the character to add to the inputLine
    119112 */
     
    131124
    132125/**
    133  * adds multiple Characters to thr inputLine
     126 * @brief adds multiple Characters to thr inputLine
    134127 * @param characters a \\0 terminated char-array to add to the InputLine
    135128 */
     
    147140
    148141/**
    149  * removes characterCount characters from the InputLine
     142 * @brief removes characterCount characters from the InputLine
    150143 * @param characterCount the count of Characters to remove from the input Line
    151144 */
     
    165158
    166159/**
    167  * executes the command stored in the inputLine
     160 * @brief executes the command stored in the inputLine
    168161 * @return true if the command was commited successfully, false otherwise
    169162 */
     
    198191
    199192/**
    200  * moves one entry up in the history.
     193 * @brief moves one entry up in the history.
    201194 */
    202195void ShellInput::historyMoveUp()
     
    223216
    224217/**
    225  * moves one entry down in the history
     218 * @brief moves one entry down in the history
    226219 */
    227220void ShellInput::historyMoveDown()
     
    244237
    245238/**
    246  * prints out some nice help about the Shell
     239 * @brief prints out some nice help about the Shell
    247240 */
    248241void ShellInput::help(const std::string& className, const std::string& functionName)
     
    267260
    268261/**
    269  * ticks the ShellInput
     262 * @brief ticks the ShellInput
    270263 * @param dt the time passed since the last update
    271264 */
     
    298291
    299292/**
    300  * listens for some event
     293 * @brief listens for some event
    301294 * @param event the Event happened
    302295 */
     
    323316    }
    324317    else if (event.type == SDLK_TAB)
    325       this->completion->autoComplete();
     318    {
     319      this->completion.autoComplete(this->inputLine);
     320      this->setText(this->inputLine);
     321    }
    326322    else if (event.type == SDLK_BACKSPACE)
    327323    {
Note: See TracChangeset for help on using the changeset viewer.