|
| CInput (CGUI &pGUI) |
|
virtual | ~CInput () |
|
virtual void | ResetStates () |
|
int | GetMouseHoveringTextPosition () const |
|
int | GetXTextPosition (const std::list< SRow >::const_iterator &c, const float &x, float &wanted) const |
|
| NONCOPYABLE (IGUIObject) |
|
| IGUIObject (CGUI &pGUI) |
|
virtual | ~IGUIObject () |
|
virtual bool | IsMouseOver () const |
| This function checks if the mouse is hovering the rectangle that the base setting "size" makes. More...
|
|
virtual bool | IsMouseHovering () const |
| This function returns true if the mouse is hovering over this GUI object and if this GUI object is the topmost object in that screen location. More...
|
|
const CStr & | GetName () const |
| Get object name, name is unique. More...
|
|
void | SetName (const CStr &Name) |
| Get object name. More...
|
|
CStr | GetPresentableName () const |
|
const std::vector< IGUIObject * > & | GetChildren () const |
| Return all child objects of the current object. More...
|
|
void | RegisterSetting (const CStr &Name, IGUISetting *setting) |
| Registers the given setting with the GUI object. More...
|
|
void | ReregisterSetting (const CStr &Name, IGUISetting *setting) |
|
bool | SettingExists (const CStr &Setting) const |
| Returns whether there is a setting with the given name registered. More...
|
|
bool | SetSettingFromString (const CStr &Setting, const CStrW &Value, const bool SendMessage) |
| Set a setting by string, regardless of what type it is. More...
|
|
bool | IsEnabled () const |
| Returns whether this object is set to be hidden or ghost. More...
|
|
bool | IsHidden () const |
| Returns whether this is object is set to be hidden. More...
|
|
void | SetHidden (bool hidden) |
|
bool | IsHiddenOrGhost () const |
| Returns whether this object is set to be hidden or ghost. More...
|
|
void | PlaySound (const CStrW &soundPath) const |
| Retrieves the configured sound filename from the given setting name and plays that once. More...
|
|
InReaction | SendEvent (EGUIMessageType type, const CStr &eventName) |
| Send event to this GUI object (HandleMessage and ScriptEvent) More...
|
|
InReaction | SendMouseEvent (EGUIMessageType type, const CStr &eventName) |
| Same as SendEvent, but passes mouse coordinates and button state as an argument. More...
|
|
CRect | GetComputedSize () |
| Updates and returns the size of the object. More...
|
|
virtual const CStrW & | GetTooltipText () const |
|
virtual const CStr & | GetTooltipStyle () const |
|
void | RegisterScriptHandler (const CStr &eventName, const CStr &Code, CGUI &pGUI) |
| Set the script handler for a particular object-specific action. More...
|
|
JSObject * | GetJSObject () |
| Retrieves the JSObject representing this GUI object. More...
|
|
virtual void | Tick () |
| Called on every GUI tick unless the object or one of its parent is hidden/ghost. More...
|
|
template<typename... Args> |
void | RecurseObject (bool(IGUIObject::*isRestricted)() const, void(IGUIObject::*callbackFunction)(Args... args), Args &&... args) |
| Calls an IGUIObject member function recursively on this object and its children. More...
|
|
CGUI & | GetGUI () |
|
const CGUI & | GetGUI () const |
|
void | SetFocus () |
| Take focus! More...
|
|
void | ReleaseFocus () |
| Release focus. More...
|
|
| IGUIScrollBarOwner (IGUIObject &m_pObject) |
|
virtual | ~IGUIScrollBarOwner () |
|
virtual void | Draw (CCanvas2D &canvas) |
|
virtual void | HandleMessage (SGUIMessage &Message) |
|
virtual void | ResetStates () |
|
virtual const SGUIScrollBarStyle * | GetScrollBarStyle (const CStr8 &style) const |
| Interface for the m_ScrollBar to use. More...
|
|
virtual void | AddScrollBar (std::unique_ptr< IGUIScrollBar > scrollbar) |
| Add a scroll-bar. More...
|
|
virtual IGUIScrollBar & | GetScrollBar (const int &index) |
| Get Scroll Bar reference (it should be transparent it's actually pointers). More...
|
|
virtual float | GetScrollBarPos (const int index) const |
| Get the position of the scroll bar at. More...
|
|
|
void | SetupGeneratedPlaceholderText () |
|
virtual void | HandleMessage (SGUIMessage &Message) |
|
virtual InReaction | ManuallyHandleKeys (const SDL_Event_ *ev) |
| Handle events manually to catch keyboard inputting. More...
|
|
virtual void | ManuallyMutableHandleKeyDownEvent (const SDL_Keycode keyCode) |
| Handle events manually to catch keys which change the text. More...
|
|
virtual void | ManuallyImmutableHandleKeyDownEvent (const SDL_Keycode keyCode) |
| Handle events manually to catch keys which don't change the text. More...
|
|
virtual InReaction | ManuallyHandleHotkeyEvent (const SDL_Event_ *ev) |
| Handle hotkey events (called by ManuallyHandleKeys) More...
|
|
virtual void | UpdateCachedSize () |
|
virtual void | Draw (CCanvas2D &canvas) |
| Draws the Text. More...
|
|
void | DrawContent (CCanvas2D &canvas) |
|
void | UpdateText (int from=0, int to_before=-1, int to_after=-1) |
| Calculate m_CharacterPosition the main task for this function is to perfom word-wrapping You input from which character it has been changed, because if we add a character to the very last end, we don't want process everything all over again! Also notice you can specify a 'to' also, it will only be used though if a '
' appears, because then the word-wrapping won't change after that. More...
|
|
virtual void | DrawPlaceholderText (CCanvas2D &canvas, const CRect &clipping=CRect()) |
| Draws the text generated for placeholder. More...
|
|
void | DeleteCurSelection () |
| Delete the current selection. More...
|
|
bool | SelectingText () const |
| Is text selected? It can be denote two ways, m_iBufferPos_Tail being -1 or the same as m_iBufferPos. More...
|
|
float | GetTextAreaWidth () |
| Get area of where text can be drawn. More...
|
|
void | UpdateAutoScroll () |
| Called every time the auto-scrolling should be checked. More...
|
|
void | ClearComposedText () |
| Clear composed IME input when supported (SDL2 only). More...
|
|
void | UpdateBufferPositionSetting () |
| Updates the buffer (cursor) position exposed to JS. More...
|
|
virtual InReaction | PreemptEvent (const SDL_Event_ *ev) |
| Some objects need to be able to pre-emptively process SDL_Event_. More...
|
|
bool | ApplyStyle (const CStr &StyleName) |
| Applies the given style to the object. More...
|
|
virtual float | GetBufferedZ () const |
| Returns not the Z value, but the actual buffered Z value, i.e. More...
|
|
void | RegisterChild (IGUIObject *child) |
| Add an object to the hierarchy. More...
|
|
void | UnregisterChild (IGUIObject *child) |
| Remove an object from the hierarchy. More...
|
|
void | SetParent (IGUIObject *pParent) |
| Set parent of this object. More...
|
|
bool | IsFocused () const |
| Check if object is focused. More...
|
|
IGUIObject * | GetParent () const |
| NOTE! This will not just return m_pParent, when that is need use it! There is one exception to it, when the parent is the top-node (the object that isn't a real object), this will return nullptr, so that the top-node's children are seemingly parentless. More...
|
|
virtual bool | HandleAdditionalChildren (const XMBData &file, const XMBElement &child) |
| Handle additional children to the <object>-tag. More...
|
|
virtual void | AdditionalChildrenHandled () |
| Allow the GUI object to process after all child items were handled. More...
|
|
void | ScriptEvent (const CStr &eventName) |
| Execute the script for a particular action. More...
|
|
bool | ScriptEventWithReturn (const CStr &eventName) |
| Execute the script for a particular action. More...
|
|
void | ScriptEvent (const CStr &eventName, const JS::HandleValueArray ¶mData) |
| Execute the script for a particular action. More...
|
|
bool | ScriptEventWithReturn (const CStr &eventName, const JS::HandleValueArray ¶mData) |
| Execute the script for a particular action. More...
|
|
void | SetScriptHandler (const CStr &eventName, JS::HandleObject Function) |
| Assigns a JS function to the event name. More...
|
|
void | UnsetScriptHandler (const CStr &eventName) |
| Deletes an event handler assigned to the given name, if such a handler exists. More...
|
|
void | UpdateMouseOver (IGUIObject *const &pMouseOver) |
| Inputes the object that is currently hovered, this function updates this object accordingly (i.e. More...
|
|
|
int | m_iBufferPos |
| Cursor position. More...
|
|
int | m_iBufferPos_Tail |
| Cursor position we started to select from. More...
|
|
bool | m_ComposingText |
| If we're composing text with an IME. More...
|
|
int | m_iComposedLength |
| The length and position of the current IME composition. More...
|
|
int | m_iComposedPos |
|
int | m_iInsertPos |
| The position to insert committed text. More...
|
|
std::list< SRow > | m_CharacterPositions |
| List of rows to ease changing its size, so iterators stay valid. More...
|
|
float | m_WantedX |
| When you change row with up/down, and the row you jump to does not have anything at that X position, then it will keep the m_WantedX position in mind when switching to the next row. More...
|
|
bool | m_SelectingText |
| If we are in the process of selecting a larger selection of text using the mouse click (hold) and drag, this is true. More...
|
|
bool | m_GeneratedPlaceholderTextValid |
| Whether the cached text is currently valid (if not then SetupText will be called by Draw) More...
|
|
CGUIText | m_GeneratedPlaceholderText |
|
float | m_HorizontalScroll |
|
double | m_PrevTime |
| Used to store the previous time for flashing the cursor. More...
|
|
double | m_CursorBlinkRate |
| Cursor blink rate in seconds, if greater than 0.0. More...
|
|
bool | m_CursorVisState |
| If the cursor should be drawn or not. More...
|
|
CGUISimpleSetting< i32 > | m_BufferPosition |
|
CGUISimpleSetting< float > | m_BufferZone |
|
CGUISimpleSetting< CStrW > | m_Caption |
|
CGUISimpleSetting< CGUIString > | m_PlaceholderText |
|
CGUISimpleSetting< CStrW > | m_Font |
|
CGUISimpleSetting< CStrW > | m_MaskChar |
|
CGUISimpleSetting< bool > | m_Mask |
|
CGUISimpleSetting< i32 > | m_MaxLength |
|
CGUISimpleSetting< bool > | m_MultiLine |
|
CGUISimpleSetting< bool > | m_Readonly |
|
CGUISimpleSetting< bool > | m_ScrollBar |
|
CGUISimpleSetting< CStr > | m_ScrollBarStyle |
|
CGUISimpleSetting< CGUISpriteInstance > | m_Sprite |
|
CGUISimpleSetting< CGUISpriteInstance > | m_SpriteOverlay |
|
CGUISimpleSetting< CGUISpriteInstance > | m_SpriteSelectArea |
|
CGUISimpleSetting< CGUIColor > | m_TextColor |
|
CGUISimpleSetting< CGUIColor > | m_TextColorSelected |
|
CGUISimpleSetting< CGUIColor > | m_PlaceholderColor |
|
CRect | m_CachedActualSize |
| Cached size, real size m_Size is actually dependent on resolution and can have different real outcomes, this is the real outcome cached to avoid slow calculations in real time. More...
|
|
CStr | m_Name |
|
std::vector< IGUIObject * > | m_Children |
|
IGUIObject * | m_pParent |
|
double | m_LastClickTime [6] |
|
bool | m_MouseHovering |
| This variable is true if the mouse is hovering this object and this object is the topmost object shown in this location. More...
|
|
std::map< CStr, IGUISetting * > | m_Settings |
| Settings pool, all an object's settings are located here. More...
|
|
CGUI & | m_pGUI |
|
std::map< CStr, JS::Heap< JSObject * > > | m_ScriptHandlers |
|
std::unique_ptr< IGUIProxyObject > | m_JSObject |
|
CGUISimpleSetting< bool > | m_Enabled |
|
CGUISimpleSetting< bool > | m_Hidden |
|
CGUISimpleSetting< CGUISize > | m_Size |
|
CGUISimpleSetting< CStr > | m_Style |
|
CGUIHotkey | m_Hotkey |
|
CGUISimpleSetting< float > | m_Z |
|
CGUISimpleSetting< bool > | m_Absolute |
|
CGUISimpleSetting< bool > | m_Ghost |
|
CGUISimpleSetting< float > | m_AspectRatio |
|
CGUISimpleSetting< CStrW > | m_Tooltip |
|
CGUISimpleSetting< CStr > | m_TooltipStyle |
|
std::vector< std::unique_ptr< IGUIScrollBar > > | m_ScrollBars |
| Predominately you will only have one, but you can have as many as you like. More...
|
|
Text field where you can input and edit the text.
It doesn't use IGUITextOwner, because we don't need any other features than word-wrapping, and we need to be able to rapidly change the string.
void CInput::ManuallyImmutableHandleKeyDownEvent |
( |
const SDL_Keycode |
keyCode | ) |
|
|
protectedvirtual |
Handle events manually to catch keys which don't change the text.
Conventions for Left/Right when text is selected:
References:
Visual Studio Visual Studio has the 'newer' approach, used by newer versions of things, and in newer applications. A left press will always place the pointer on the left edge of the selection, and then of course remove the selection. Right will do the exact same thing. If you have the pointer on the right edge and press right, it will in other words just remove the selection.
Windows (eg. Notepad) A left press always takes the pointer a step to the left and removes the selection as if it were never there in the first place. Right of course does the same thing but to the right.
I chose the Visual Studio convention. Used also in Word, gtk 2.0, MSN Messenger.
Conventions for Up/Down when text is selected:
References:
Visual Studio Visual Studio has a very strange approach, down takes you below the selection to the next row, and up to the one prior to the whole selection. The weird part is that it is always aligned as the 'pointer'. I decided this is to much work for something that is a bit arbitrary
Windows (eg. Notepad) Just like with left/right, the selection is destroyed and it moves just as if there never were a selection.
I chose the Notepad convention even though I use the VS convention with left/right.