Home2L - C/C++ API  v1.2-2-ga4fe (2023-04-15)
Smart Tools for a Private Home
List of all members
CInputLine Class Reference

Description

Input line widget.

Definition at line 793 of file ui_widgets.H.

#include "ui_widgets.H"

Inheritance diagram for CInputLine:
Inheritance graph
[legend]

Public Member Functions

Setup ...
void Setup (int fontSize=INPUTLINE_FONTSIZE)
 
void SetInput (const char *_inputStr=NULL, int _mark0=0, int _markD=0)
 Set the input contents; implicitly calls 'ClearHistory' afterwards.
 
void ClearHistory ()
 Clear the undo & redo history.
 
Obtaining the result ...
void GetInput (CString *ret)
 Retrieve the current string.
 
bool InputModified ()
 Return if anything may have changed.
 
Editing ...
int GetMark0 ()
 Return the cursor position.
 
int GetMarkD ()
 
void SetMark (int _mark0, int _markD=0)
 
void MoveMark (int _mark0)
 Set 'mark0' while leaving 'mark0 + markD' constant.
 
void InsChar (char c)
 
void InsText (const char *txt, int chars=-1)
 
void DelMarked ()
 
void DelChar (int pos)
 
CStringGetInput ()
 Return string (ISO 8859!) that may be modified arbitrarily, followed by a call to ChangedInput().
 
void ChangedInput ()
 To be called if the imput string was changed.
 
Clipboard ...
void ClipboardCopy ()
 
void ClipboardCut ()
 
void ClipboardPaste ()
 
Undo/redo ...
void Undo ()
 
void Redo ()
 
Suggestions (TBD: yet to be implemented) ...
void SetSuggestion (int _suggPos, const char *_suggText, int _suggMark0=-1, int _suggMarkD=0)
 
void ClearSuggestion ()
 
void ApplySuggestion ()
 
virtual void CheckSuggestion ()
 
void SetCbCheckSuggestion (void(*_cbSuggCheck)(CInputLine *, void *), void *_suggData)
 
Callbacks...
virtual void Render (SDL_Renderer *ren)
 Render this widget. More...
 
virtual bool HandleEvent (SDL_Event *ev)
 Handle wiping/scrolling events, if virtual area is wider (higher) than physical area.
 
- Public Member Functions inherited from CCanvas
void SetDefaults ()
 Set default colors and scrollbar appearance.
 
void SetColors (TColor _backColor=BLACK, TColor _scrollbarColor=ToColor(255, 255, 255, 32))
 
void SetScrollbarWidth (int width=8)
 
void SetArea (SDL_Rect _area)
 
void SetVirtArea (SDL_Rect r)
 Set the virtual area in screen coordinates; ('virtArea' == 'area' represents no displacement); The areas of all subwidgets are relative to the virtual area.
 
SDL_Rect * GetVirtArea ()
 
void MoveVirtArea (int toX0, int toY0)
 
void LimitVirtArea (SDL_Rect *r=NULL)
 Move virtual area (or 'r') so that the visible area is completely filled.
 
void ScrollTo (SDL_Rect r, int hAlign=0, int vAlign=-1)
 Scroll such that 'r' is aligned according to '[vh]Align' (-1 = left/up, 0 = center, 1 = right/down).
 
void ScrollIn (SDL_Rect r)
 Scroll just enough to get 'r' fully visible.
 
void WidgetToScreenCoords (int *x, int *y)
 
void ScreenToWidgetCoords (int *x, int *y)
 
void AddWidget (CWidget *widget)
 
void DelWidget (CWidget *widget)
 
void DelAllWidgets ()
 
bool IsVisible (SDL_Rect *r)
 
bool IsVisible (CWidget *w)
 
- Public Member Functions inherited from CWidget
void Set (SDL_Surface *_surf, int x0, int y0)
 
void SetArea (SDL_Rect _area)
 
SDL_Rect * GetArea ()
 
class CScreenGetScreen ()
 
bool IsOnScreen (class CScreen *_screen)
 
class CCanvasGetCanvas ()
 
void LocalToScreenCoords (int *x, int *y)
 
void ScreenToLocalCoords (int *x, int *y)
 
void GetMouseEventPos (SDL_Event *ev, int *x, int *y)
 
void SetSurface (SDL_Surface *_surface)
 Set the static surface to display. The caller stays owner of surface, must not delete it as long as it is set here. The surface dimensions must match 'area'.
 
virtual SDL_Surface * GetSurface ()
 Get an up-to-date surface or 'NULL' if none is available.
 
void GetRenderArea (SDL_Rect *ra)
 Transpose 'area' to the current screen coordinates to be passed to all SDL rendering functions.
 
virtual SDL_Texture * GetTexture ()
 Return an up-to-date texture. More...
 
void SetTextureBlendMode (SDL_BlendMode _sdlBlendMode)
 Set the blend mode for the texture created by the default implementation of GetTexture(). The default is SDL_BLENDMODE_NONE.
 
void ClearTexture ()
 Clear the internally cached texture object to save memory.
 

Additional Inherited Members

- Protected Member Functions inherited from CWidget
void ChangedSurface ()
 Mark (only) the surface as changed to trigger a redrawing at next occasion.
 
void Changed ()
 Anything may have changed: Trigger a redrawing at next occasion.
 

Member Function Documentation

◆ Render()

virtual void CInputLine::Render ( SDL_Renderer *  ren)
virtual

Render this widget.

The default implementation uses the 'GetTexture()' method above. By overriding this method it is possible to define widgets with a custom SDL rendering procedure, which may be more efficient than preparing a single texture containing the complete widget.

It is allowed to pass 'ren == NULL', in which case all textures and internal data structures are (re-)calculated, but nothing is actually rendered.

Reimplemented from CCanvas.


The documentation for this class was generated from the following file: