Changeset View
Changeset View
Standalone View
Standalone View
source/gui/CInput.h
Show All 35 Lines | |||||
protected: // forwards | protected: // forwards | ||||
struct SRow; | struct SRow; | ||||
public: | public: | ||||
CInput(CGUI* pGUI); | CInput(CGUI* pGUI); | ||||
virtual ~CInput(); | virtual ~CInput(); | ||||
virtual void AddSettings() override; | |||||
/** | /** | ||||
* @see IGUIObject#ResetStates() | * @see IGUIObject#ResetStates() | ||||
*/ | */ | ||||
virtual void ResetStates() { IGUIScrollBarOwner::ResetStates(); } | virtual void ResetStates() override { IGUIScrollBarOwner::ResetStates(); } | ||||
// Check where the mouse is hovering, and get the appropriate text position. | // Check where the mouse is hovering, and get the appropriate text position. | ||||
// return is the text-position index. | // return is the text-position index. | ||||
int GetMouseHoveringTextPosition() const; | int GetMouseHoveringTextPosition() const; | ||||
// Same as above, but only on one row in X, and a given value, not the mouse's. | // Same as above, but only on one row in X, and a given value, not the mouse's. | ||||
// wanted is filled with x if the row didn't extend as far as the mouse pos. | // wanted is filled with x if the row didn't extend as far as the mouse pos. | ||||
int GetXTextPosition(const std::list<SRow>::const_iterator& c, const float& x, float& wanted) const; | int GetXTextPosition(const std::list<SRow>::const_iterator& c, const float& x, float& wanted) const; | ||||
protected: | protected: | ||||
/** | /** | ||||
* @see IGUIObject#HandleMessage() | * @see IGUIObject#HandleMessage() | ||||
*/ | */ | ||||
virtual void HandleMessage(SGUIMessage& Message); | virtual void HandleMessage(SGUIMessage& Message) override; | ||||
/** | /** | ||||
* Handle events manually to catch keyboard inputting. | * Handle events manually to catch keyboard inputting. | ||||
*/ | */ | ||||
virtual InReaction ManuallyHandleEvent(const SDL_Event_* ev); | virtual InReaction ManuallyHandleEvent(const SDL_Event_* ev) override; | ||||
/** | /** | ||||
* Handle events manually to catch keys which change the text. | * Handle events manually to catch keys which change the text. | ||||
*/ | */ | ||||
virtual void ManuallyMutableHandleKeyDownEvent(const SDL_Keycode keyCode, CStrW* pCaption); | virtual void ManuallyMutableHandleKeyDownEvent(const SDL_Keycode keyCode, CStrW* pCaption); | ||||
/** | /** | ||||
* Handle events manually to catch keys which don't change the text. | * Handle events manually to catch keys which don't change the text. | ||||
*/ | */ | ||||
virtual void ManuallyImmutableHandleKeyDownEvent(const SDL_Keycode keyCode, CStrW* pCaption); | virtual void ManuallyImmutableHandleKeyDownEvent(const SDL_Keycode keyCode, CStrW* pCaption); | ||||
/** | /** | ||||
* Handle hotkey events (called by ManuallyHandleEvent) | * Handle hotkey events (called by ManuallyHandleEvent) | ||||
*/ | */ | ||||
virtual InReaction ManuallyHandleHotkeyEvent(const SDL_Event_* ev); | virtual InReaction ManuallyHandleHotkeyEvent(const SDL_Event_* ev); | ||||
/** | /** | ||||
* @see IGUIObject#UpdateCachedSize() | * @see IGUIObject#UpdateCachedSize() | ||||
*/ | */ | ||||
virtual void UpdateCachedSize(); | virtual void UpdateCachedSize() override; | ||||
/** | /** | ||||
* Draws the Text | * Draws the Text | ||||
*/ | */ | ||||
virtual void Draw(); | virtual void Draw() override; | ||||
/** | /** | ||||
* Calculate m_CharacterPosition | * Calculate m_CharacterPosition | ||||
* the main task for this function is to perfom word-wrapping | * the main task for this function is to perfom word-wrapping | ||||
* You input from which character it has been changed, because | * You input from which character it has been changed, because | ||||
* if we add a character to the very last end, we don't want | * if we add a character to the very last end, we don't want | ||||
* process everything all over again! Also notice you can | * process everything all over again! Also notice you can | ||||
* specify a 'to' also, it will only be used though if a '\n' | * specify a 'to' also, it will only be used though if a '\n' | ||||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator