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

Description

Widget that can pop up on a screen, such as a menu or a message box.

Definition at line 77 of file ui_widgets.H.

#include "ui_widgets.H"

Inheritance diagram for CModalWidget:
Inheritance graph
[legend]

Public Member Functions

Running the widget ...
int Run (CScreen *_screen)
 Run the widget until it is cancelled or a status >= 0 is set; return status.
 
virtual void Start (CScreen *_screen)
 Just start the modal widget.
 
bool IsRunning ()
 Must be invoked regularly (in each UI iteration), if Run() is not used.
 
virtual void Stop ()
 Remove widget from screen (e.g. useful for inactivity timeout).
 
Status ...
int GetStatus ()
 Get status: -2: running, -1: cancelled (e.g. by touching outside), >= 0: success, user-defined code set by 'SetStatus'.
 
void SetStatus (int _status)
 Set a status code.
 
Behaviour for events outside the widget ...
void SetNoCancelArea (SDL_Rect _rNoCancel)
 Set the no-cancel area. More...
 
void RemoveNoCancelArea ()
 
Callbacks...
virtual bool HandleEvent (SDL_Event *ev)
 Handle event: must always be called last.
 
- 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.
 
virtual void Render (SDL_Renderer *ren)
 Render this widget. More...
 
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

◆ SetNoCancelArea()

void CModalWidget::SetNoCancelArea ( SDL_Rect  _rNoCancel)
inline

Set the no-cancel area.

     A touch outside this area is interpreted as a "cancel" operation. Normally and by default, this is equal
     to the area of this menu ('rFrame'), but there may be cases where this area needs to be extended,
     for example, if a combination of menus are presented simultaneously such as the month/year selector in the calendar app. 

Definition at line 97 of file ui_widgets.H.


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