Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 17, 2008, 3:58:19 AM (17 years ago)
Author:
landauf
Message:
  • implemented Shell, but not yet linked with the graphical console
  • added new features (cursor, OIS::KeyCode listener) to InputBuffer
  • changed some includes to avoid circular header-dependencies in OrxonoxClass and Shell
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/console/src/core/InputBuffer.h

    r1312 r1313  
    102102            }
    103103
    104             void set(const std::string& input);
    105             void append(const std::string& input);
    106             void append(const char& input);
    107             void removeLast();
    108             void clear();
     104            void unregisterListener(InputBufferListener* listener);
     105
     106            void set(const std::string& input, bool update = true);
     107            void insert(const std::string& input, bool update = true);
     108            void insert(const char& input, bool update = true);
     109            void clear(bool update = true);
     110            void removeAtCursor(bool update = true);
     111            void removeBehindCursor(bool update = true);
    109112
    110113            void updated();
     
    113116            inline std::string get() const
    114117                { return this->buffer_; }
     118            inline unsigned int getSize() const
     119                { return this->buffer_.size(); }
     120
     121            inline unsigned int getCursorPosition() const
     122                { return this->cursor_; }
     123            inline void setCursorPosition(unsigned int cursor)
     124                { if (cursor <= this->buffer_.size()) { this->cursor_ = cursor; } }
     125            inline void setCursorToEnd()
     126                { this->cursor_ = this->buffer_.size(); }
     127            inline void setCursorToBegin()
     128                { this->cursor_ = 0; }
     129            inline void increaseCursor()
     130                { if (this->cursor_ < this->buffer_.size()) { ++this->cursor_; } }
     131            inline void decreaseCursor()
     132                { if (this->cursor_ > 0) { --this->cursor_; } }
    115133
    116134        private:
     
    124142            std::list<InputBufferListenerTuple> listeners_;
    125143            std::string allowedChars_;
     144            unsigned int cursor_;
    126145    };
    127146}
Note: See TracChangeset for help on using the changeset viewer.