FabGL
ESP32 VGA Controller and Graphics Library
fabgl::uiFrame Class Reference

A frame is a window with a title bar, maximize/minimize/close buttons and that is resizeable or moveable. More...

#include <fabui.h>

Inheritance diagram for fabgl::uiFrame:
Collaboration diagram for fabgl::uiFrame:

Public Member Functions

 uiFrame (uiWindow *parent, char const *title, const Point &pos, const Size &size, bool visible=true)
 Creates an instance of the object. More...
 
uiAnchorsanchors ()
 Allows to switch on or off anchors. More...
 
uiAppapp ()
 Determines the app that owns this object. More...
 
void bringAfter (uiWindow *insertionPoint)
 Brings this window after another one. More...
 
void bringOnTop ()
 Brings this window on top. More...
 
Point clientPos ()
 Determines position of the client area. More...
 
Rect clientRect (uiOrigin origin)
 Determines the client area bounding box. More...
 
Size clientSize ()
 Determines the client area size. More...
 
void exitModal (int modalResult)
 Exits from a modal window. More...
 
uiWindowfirstChild ()
 Gets first child. More...
 
int focusIndex ()
 Determines the focus index (aka tab-index) More...
 
uiFramePropsframeProps ()
 Sets or gets frame properties. More...
 
uiFrameStyleframeStyle ()
 Sets or gets frame style. More...
 
bool hasChildren ()
 Determines whether this window has children. More...
 
bool hasFocus ()
 Determines whether this window or control has focus. More...
 
bool isMouseOver ()
 Determines whether the mouse is over this window. More...
 
uiWindowlastChild ()
 Gets last child. More...
 
Point mouseDownPos ()
 Determines mouse position when left button was down. More...
 
uiWindownext ()
 Gets next sibling. More...
 
uiObjectTypeobjectType ()
 Determines the object type. More...
 
uiWindowparent ()
 Determines the parent window. More...
 
Point pos ()
 Determines the window position relative to parent window. More...
 
uiWindowprev ()
 Gets previous sibling. More...
 
Rect rect (uiOrigin origin)
 Determines the window bounding box. More...
 
void repaint (Rect const &rect)
 Repaints a rectangle of this window. More...
 
void repaint ()
 Repaints this window. More...
 
void setFocusIndex (int value)
 Sets the focus index (aka tab-index) More...
 
void setTitle (char const *value)
 Sets window title. More...
 
void setTitleFmt (const char *format,...)
 Sets window title as formatted text. More...
 
Size size ()
 Determines the window size. More...
 
uiWindowState state ()
 Determines the window state. More...
 
char const * title ()
 Determines the window title. More...
 
Rect transformRect (Rect const &rect, uiWindow *baseWindow)
 Transforms rectangle origins from current window to another one. More...
 
uiWindowPropswindowProps ()
 Sets or gets window properties. More...
 
uiWindowStylewindowStyle ()
 Sets or gets window style. More...
 

Public Attributes

Delegate onClick
 Mouse click event delegate. More...
 
Delegate onDblClick
 Mouse double click event delegate4. More...
 
Delegate onHide
 Hide window event delegate. More...
 
Delegate onResize
 Resize window event delegate. More...
 
Delegate onShow
 Show window event delegate. More...
 
Delegate< uiTimerHandle > onTimer
 Timer event delegate. More...
 

Detailed Description

A frame is a window with a title bar, maximize/minimize/close buttons and that is resizeable or moveable.

Constructor & Destructor Documentation

◆ uiFrame()

fabgl::uiFrame::uiFrame ( uiWindow parent,
char const *  title,
const Point pos,
const Size size,
bool  visible = true 
)

Creates an instance of the object.

Parameters
parentParent window
titleTitle of the frame. An empty string hides the title bar
posTop-left coordinates of the frame relative to the parent
sizeThe frame size
visibleIf true the frame is immediately visible

Member Function Documentation

◆ anchors()

uiAnchors& fabgl::uiWindow::anchors ( )
inlineinherited

Allows to switch on or off anchors.

Returns
An L-value used to switch on or off anchors

◆ app()

uiApp* fabgl::uiEvtHandler::app ( )
inlineinherited

Determines the app that owns this object.

Returns
An uiApp object.

◆ bringAfter()

void fabgl::uiWindow::bringAfter ( uiWindow insertionPoint)
inherited

Brings this window after another one.

Parameters
insertionPointThis window will be placed after insertionPoint window. If insertionPoint is nullptr this window will be placed at the first position (location of less visibility.).

◆ bringOnTop()

void fabgl::uiWindow::bringOnTop ( )
inherited

Brings this window on top.

◆ clientPos()

Point fabgl::uiWindow::clientPos ( )
inherited

Determines position of the client area.

Returns
The top left point where the client area starts

◆ clientRect()

Rect fabgl::uiFrame::clientRect ( uiOrigin  origin)
virtual

Determines the client area bounding box.

Parameters
originDecides the origin of returned rectangle
Returns
The window client area bounding box

Reimplemented from fabgl::uiWindow.

◆ clientSize()

Size fabgl::uiWindow::clientSize ( )
inherited

Determines the client area size.

Returns
The client area size

◆ exitModal()

void fabgl::uiWindow::exitModal ( int  modalResult)
inherited

Exits from a modal window.

To open a modal window use uiApp.showModalWindow().

Parameters
modalResultAn integer value to return to uiApp.showModalWindow().

◆ firstChild()

uiWindow* fabgl::uiWindow::firstChild ( )
inlineinherited

Gets first child.

Returns
First uiWindow object

◆ focusIndex()

int fabgl::uiWindow::focusIndex ( )
inlineinherited

Determines the focus index (aka tab-index)

To set focus index use uiWindow.setFocusIndex().

Returns
The focus index

◆ frameProps()

uiFrameProps& fabgl::uiFrame::frameProps ( )
inline

Sets or gets frame properties.

Returns
L-value representing some frame properties

◆ frameStyle()

uiFrameStyle& fabgl::uiFrame::frameStyle ( )
inline

Sets or gets frame style.

Returns
L-value representing frame style (colors, border size, etc...)

◆ hasChildren()

bool fabgl::uiWindow::hasChildren ( )
inlineinherited

Determines whether this window has children.

Returns
True if window has one o more children

◆ hasFocus()

bool fabgl::uiWindow::hasFocus ( )
inherited

Determines whether this window or control has focus.

To set currently focused window use uiApp.setFocusedWindow().

Returns
True if this window has focus

◆ isMouseOver()

bool fabgl::uiWindow::isMouseOver ( )
inlineinherited

Determines whether the mouse is over this window.

This methods returns True also when the mouse is captured.

Returns
True if the mouse is over the window

◆ lastChild()

uiWindow* fabgl::uiWindow::lastChild ( )
inlineinherited

Gets last child.

Returns
Last uiWindow object

◆ mouseDownPos()

Point fabgl::uiWindow::mouseDownPos ( )
inlineinherited

Determines mouse position when left button was down.

Returns
Mouse position

◆ next()

uiWindow* fabgl::uiWindow::next ( )
inlineinherited

Gets next sibling.

Next sibling is more visible than calling object.

Returns
Next uiWindow object

◆ objectType()

uiObjectType& fabgl::uiObject::objectType ( )
inlineinherited

Determines the object type.

Returns
Object type.

◆ parent()

uiWindow* fabgl::uiWindow::parent ( )
inlineinherited

Determines the parent window.

Returns
Parent window

◆ pos()

Point fabgl::uiWindow::pos ( )
inlineinherited

Determines the window position relative to parent window.

To change window position use uiApp.moveWindow().

Returns
The top left point where this window is located

◆ prev()

uiWindow* fabgl::uiWindow::prev ( )
inlineinherited

Gets previous sibling.

Previous sibling is less visible than calling object.

Returns
Previous uiWindow object

◆ rect()

Rect fabgl::uiWindow::rect ( uiOrigin  origin)
inherited

Determines the window bounding box.

To set window position use uiApp.moveWindow(), to set window size use uiApp.resizeWindow() or uiApp.reshapeWindow().

Parameters
originDecides the origin of returned rectangle
Returns
The window bounding box

◆ repaint() [1/2]

void fabgl::uiWindow::repaint ( Rect const &  rect)
inherited

Repaints a rectangle of this window.

Parameters
rectRectangle to repaint

◆ repaint() [2/2]

void fabgl::uiWindow::repaint ( )
inherited

Repaints this window.

◆ setFocusIndex()

void fabgl::uiWindow::setFocusIndex ( int  value)
inlineinherited

Sets the focus index (aka tab-index)

Parameters
valueThe focus index. -1 = control isn't included into the focusable controls. 0 = first focusable control.

◆ setTitle()

void fabgl::uiFrame::setTitle ( char const *  value)

Sets window title.

Window needs to be repainted in order to display changed title.

Parameters
valueThe window title. nullptr hides the title bar.

◆ setTitleFmt()

void fabgl::uiFrame::setTitleFmt ( const char *  format,
  ... 
)

Sets window title as formatted text.

Window needs to be repainted in order to display changed title.

Parameters
formatFormat specifier like printf.

◆ size()

Size fabgl::uiWindow::size ( )
inlineinherited

Determines the window size.

To set window size use uiApp.resizeWindow().

Returns
The window size

◆ state()

uiWindowState fabgl::uiWindow::state ( )
inlineinherited

Determines the window state.

To set window state (hidden, visible, maximized, minimized) use uiApp.showWindow(), uiApp.maximizeWindow(), uiApp.minimizeWindow().

Returns
Current window state

◆ title()

char const* fabgl::uiFrame::title ( )
inline

Determines the window title.

Returns
The window title

◆ transformRect()

Rect fabgl::uiWindow::transformRect ( Rect const &  rect,
uiWindow baseWindow 
)
inherited

Transforms rectangle origins from current window to another one.

Parameters
rectRectangle to transform
baseWindowWindow where the output rectangle will be relative to
Returns
The translated rectangle

◆ windowProps()

uiWindowProps& fabgl::uiWindow::windowProps ( )
inlineinherited

Sets or gets window properties.

Returns
L-value representing some window properties

◆ windowStyle()

uiWindowStyle& fabgl::uiWindow::windowStyle ( )
inlineinherited

Sets or gets window style.

Returns
L-value representing window style (colors, border size, etc...)

Member Data Documentation

◆ onClick

Delegate fabgl::uiWindow::onClick
inherited

Mouse click event delegate.

This delegate is called when the mouse button is pressed and released on the same position.

◆ onDblClick

Delegate fabgl::uiWindow::onDblClick
inherited

Mouse double click event delegate4.

This delegate is called when the mouse button is double pressed and released on the same position. To change double click time use uiAppProps.doubleClickTime of uiApp.appProps().

◆ onHide

Delegate fabgl::uiFrame::onHide

Hide window event delegate.

This delegate is called when the window is about to be hidden.

◆ onResize

Delegate fabgl::uiFrame::onResize

Resize window event delegate.

This delegate is called after its size has changed.

◆ onShow

Delegate fabgl::uiFrame::onShow

Show window event delegate.

This delegate is called when the window is about to be shown.

◆ onTimer

Delegate<uiTimerHandle> fabgl::uiFrame::onTimer

Timer event delegate.

This delegate is called when the timer expires. To create a timer use uiApp.setTimer().


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