Pyrogenesis
13997
|
Text field where you can input and edit the text. More...
#include <CInput.h>
Classes | |
struct | SRow |
Public Member Functions | |
CInput () | |
virtual | ~CInput () |
virtual void | ResetStates () |
int | GetMouseHoveringTextPosition () |
int | GetXTextPosition (const std::list< SRow >::iterator &c, const float &x, float &wanted) |
![]() | |
IGUIScrollBarOwner () | |
virtual | ~IGUIScrollBarOwner () |
virtual const SGUIScrollBarStyle * | GetScrollBarStyle (const CStr &style) const |
Interface for the m_ScrollBar to use. More... | |
virtual void | AddScrollBar (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... | |
![]() | |
IGUIObject () | |
virtual | ~IGUIObject () |
virtual bool | MouseOver () |
Checks if mouse is hovering this object. More... | |
virtual bool | MouseOverIcon () |
Test if mouse position is over an icon. More... | |
const CStr & | GetName () const |
Get object name, name is unique. More... | |
void | SetName (const CStr &Name) |
Get object name. More... | |
CStr | GetPresentableName () const |
void | AddToPointersMap (map_pObjects &ObjectMap) |
Adds object and its children to the map, it's name being the first part, and the second being itself. More... | |
void | AddChild (IGUIObject *pChild) |
Notice nothing will be returned or thrown if the child hasn't been inputted into the GUI yet. More... | |
vector_pObjects::iterator | ChildrenItBegin () |
vector_pObjects::iterator | ChildrenItEnd () |
bool | SettingExists (const CStr &Setting) const |
Checks if settings exists, only available for derived classes that has this set up, that's why the base class just returns false. More... | |
PSRETURN | SetSetting (const CStr &Setting, const CStrW &Value, const bool &SkipMessage=false) |
Set a setting by string, regardless of what type it is. More... | |
PSRETURN | GetSettingType (const CStr &Setting, EGUISettingType &Type) const |
Retrieves the type of a named setting. More... | |
void | RegisterScriptHandler (const CStr &Action, 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... | |
CGUI * | GetGUI () |
const CGUI * | GetGUI () const |
void | SetFocus () |
Take focus! More... | |
Protected Member Functions | |
virtual void | HandleMessage (SGUIMessage &Message) |
virtual InReaction | ManuallyHandleEvent (const SDL_Event_ *ev) |
Handle events manually to catch keyboard inputting. More... | |
virtual InReaction | ManuallyHandleHotkeyEvent (const SDL_Event_ *ev) |
Handle hotkey events (called by ManuallyHandleEvent) More... | |
virtual void | UpdateCachedSize () |
virtual void | Draw () |
Draws the Text. More... | |
void | UpdateText (int from=0, int to_before=-1, int to_after=-1) |
void | DeleteCurSelection () |
bool | SelectingText () const |
float | GetTextAreaWidth () |
void | UpdateAutoScroll () |
![]() | |
void | AddSetting (const EGUISettingType &Type, const CStr &Name) |
Add a setting to m_Settings. More... | |
virtual void | Destroy () |
Calls Destroy on all children, and deallocates all memory. More... | |
void | LoadStyle (CGUI &GUIinstance, const CStr &StyleName) |
Loads a style. More... | |
void | LoadStyle (const SGUIStyle &Style) |
Loads a style. More... | |
virtual float | GetBufferedZ () const |
Returns not the Z value, but the actual buffered Z value, i.e. More... | |
void | SetGUI (CGUI *const &pGUI) |
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 NULL, so that the top-node's children are seemingly parentless. More... | |
CPos | GetMousePos () const |
Get Mouse from CGUI. More... | |
virtual bool | HandleAdditionalChildren (const XMBElement &child, CXeromyces *pFile) |
Handle additional children to the <object>-tag. More... | |
InReaction | SendEvent (EGUIMessageType type, const CStr &EventName) |
Send event to this GUI object (HandleMessage and ScriptEvent) More... | |
void | ScriptEvent (const CStr &Action) |
Execute the script for a particular action. More... | |
void | ScriptEvent (const CStr &Action, const CScriptValRooted &Argument) |
Execute the script for a particular action. More... | |
void | SetScriptHandler (const CStr &Action, JSObject *Function) |
void | UpdateMouseOver (IGUIObject *const &pMouseOver) |
Inputes the object that is currently hovered, this function updates this object accordingly (i.e. More... | |
Protected Attributes | |
int | m_iBufferPos |
int | m_iBufferPos_Tail |
std::list< SRow > | m_CharacterPositions |
float | m_WantedX |
bool | m_SelectingText |
float | m_HorizontalScroll |
double | m_PrevTime |
double | m_CursorBlinkRate |
bool | m_CursorVisState |
![]() | |
std::vector< IGUIScrollBar * > | m_ScrollBars |
Predominately you will only have one, but you can have as many as you like. More... | |
![]() | |
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 |
vector_pObjects | m_Children |
IGUIObject * | m_pParent |
double | m_LastClickTime [6] |
bool | m_MouseHovering |
This is an array of true or false, each element is associated with a string representing a setting. 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.
CInput::CInput | ( | ) |
Definition at line 46 of file CInput.cpp.
|
virtual |
Definition at line 74 of file CInput.cpp.
|
protected |
Definition at line 1863 of file CInput.cpp.
|
protectedvirtual |
int CInput::GetMouseHoveringTextPosition | ( | ) |
Definition at line 1749 of file CInput.cpp.
|
protected |
Definition at line 1897 of file CInput.cpp.
int CInput::GetXTextPosition | ( | const std::list< SRow >::iterator & | c, |
const float & | x, | ||
float & | wanted | ||
) |
Definition at line 1830 of file CInput.cpp.
|
protectedvirtual |
Reimplemented from IGUIScrollBarOwner.
Definition at line 697 of file CInput.cpp.
|
protectedvirtual |
Handle events manually to catch keyboard inputting.
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 exakt 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.
Reimplemented from IGUIObject.
Definition at line 78 of file CInput.cpp.
|
protectedvirtual |
Handle hotkey events (called by ManuallyHandleEvent)
Definition at line 448 of file CInput.cpp.
|
inlinevirtual |
Reimplemented from IGUIScrollBarOwner.
|
protected |
Definition at line 1891 of file CInput.cpp.
|
protected |
Definition at line 1910 of file CInput.cpp.
|
protectedvirtual |
Reimplemented from IGUIObject.
Definition at line 979 of file CInput.cpp.
|
protected |
Definition at line 1378 of file CInput.cpp.