Changeset 5181 in orxonox.OLD
- Timestamp:
- Sep 14, 2005, 12:07:06 AM (19 years ago)
- Location:
- trunk/src/lib
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/text_engine.h
r5179 r5181 113 113 void setType(TEXT_RENDER_TYPE type); 114 114 void setText(const char* text, bool isExtern = false); 115 /** @returns the String this Text displays */ 116 inline const char* getText() const { return (externText == NULL)?this->text:this->externText; }; 115 117 /** @param blending the blending intensity to set (between 0.0 and 1.0) */ 116 118 inline void setBlending(float blending) { this->blending = blending; }; -
trunk/src/lib/shell/shell.cc
r5180 r5181 61 61 62 62 this->rebuildText(); 63 this->completionList = NULL;64 63 65 64 // EVENT-Handler subscription of '`' to all States. -
trunk/src/lib/shell/shell.h
r5180 r5181 87 87 unsigned int bufferDisplaySize; //!< The Size of the Display-buffer, in lines (not in characters) 88 88 Text** bufferText; //!< A list of stored bufferTexts for the display of the buffer 89 90 // completion91 tList<const char>* completionList; //!< A list of completions, that are io.92 89 }; 93 90 -
trunk/src/lib/shell/shell_completion.cc
r5178 r5181 18 18 #include "shell_completion.h" 19 19 20 #include "shell_input.h" 21 20 22 #include "base_object.h" 21 23 #include "class_list.h" … … 33 35 ShellCompletion::ShellCompletion () 34 36 { 35 // this->setClassID(CL_PROTO_ID, "ProtoClass"); 36 37 /* If you make a new class, what is most probably the case when you write this file 38 don't forget to: 39 1. Add the new file new_class.cc to the ./src/Makefile.am 40 2. Add the class identifier to ./src/class_id.h eg. CL_NEW_CLASS 41 42 Advanced Topics: 43 - if you want to let your object be managed via the ObjectManager make sure to read 44 the object_manager.h header comments. You will use this most certanly only if you 45 make many objects of your class, like a weapon bullet. 46 */ 37 this->completionList = NULL; 47 38 } 48 39 … … 54 45 { 55 46 // delete what has to be deleted here 47 if (this->completionList) 48 { 49 delete this->completionList; 50 } 56 51 } 57 52 … … 64 59 * @todo implement it!! 65 60 */ 66 bool ShellCompletion::autoComplete( const char* inputLine)61 bool ShellCompletion::autoComplete(ShellInput* input) 67 62 { 68 63 //PRINTF(3)("AutoCompletion not implemented yet\n"); 69 64 70 char* completionLine = new char[strlen(input Line)+1];71 strcpy(completionLine, input Line);65 char* completionLine = new char[strlen(input->getText())+1]; 66 strcpy(completionLine, input->getText()); 72 67 73 68 char* commandBegin = strrchr(completionLine, ' '); -
trunk/src/lib/shell/shell_completion.h
r5178 r5181 9 9 // FORWARD DECLARATION 10 10 class BaseObject; 11 class ShellInput; 11 12 template<class T> class tList; 12 13 #ifndef NULL … … 21 22 virtual ~ShellCompletion(); 22 23 23 bool autoComplete( const char* inputLine);24 bool autoComplete(ShellInput* input); 24 25 bool classComplete(const char* classBegin); 25 26 bool objectComplete(const char* objectBegin, long classID); -
trunk/src/lib/shell/shell_input.cc
r5180 r5181 18 18 #include "shell_input.h" 19 19 20 21 22 #include "shell_command.h" 23 #include "shell_completion.h" 20 24 #include "event_handler.h" 21 25 22 #include "shell_command.h"23 26 #include "debug.h" 24 27 #include "list.h" … … 50 53 evh->subscribe(this, ES_SHELL, i); 51 54 55 this->completion = new ShellCompletion; 52 56 } 53 57 … … 58 62 { 59 63 // delete what has to be deleted here 64 delete[] this->inputLine; 65 delete this->completion; 60 66 } 61 67 … … 195 201 this->debug(); 196 202 else if (event.type == SDLK_TAB) 197 ;//this->autoComplete();203 this->completion->autoComplete(this); 198 204 else if (event.type == SDLK_BACKSPACE) 199 205 { -
trunk/src/lib/shell/shell_input.h
r5180 r5181 12 12 // FORWARD DECLARATION 13 13 template<class T> class tList; 14 class ShellCompletion; 14 15 15 16 … … 38 39 private: 39 40 // HANDLING TEXT INPUT 40 char* inputLine; //!< the Char-Array of the Buffer 41 ShellCompletion* completion; //!< The Completion Interface. 42 43 char* inputLine; //!< the Char-Array of the Buffer @todo not needed anymore 41 44 float repeatRate; //!< The Repeat-Delay. 42 45 float repeatDelay; //!< The delay of the first Character of a given Character.
Note: See TracChangeset
for help on using the changeset viewer.