CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
FxUIBaseView.h
Go to the documentation of this file.
1//
2// (C) Copyright 2005-2025 by Graebert GmbH.
3//
4// Permission to use, copy, modify, and distribute this software in
5// object code form for any purpose and without fee is hereby granted,
6// provided that the above copyright notice appears in all copies and
7// that both that copyright notice and the limited warranty and
8// restricted rights notice below appear in all supporting
9// documentation.
10//
11// GRAEBERT PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
12// GRAEBERT SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
13// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. GRAEBERT GMBH
14// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
15// UNINTERRUPTED OR ERROR FREE.
16
17#pragma once
18
19#include "FxUIObject.h"
20#include "FxUISignal.h"
21#include "FxUIEvent.h"
22
23#include "../Core/FxUISize.h"
24#include "../Core/FxUIRect.h"
25#include "../Core/FxUIPalette.h"
26#include "../Core/FxUIPoint.h"
27
28
29class CFxUIBaseViewImpl;
30
34
36{
37public:
38
43 {
44 //The horizontal flags are :
45 AlignLeft = 0x0001, //Aligns with the left edge.
46 AlignRight = 0x0002, //Aligns with the right edge.
47 AlignHCenter = 0x0004, //Centers horizontally in the available space.
48 AlignJustify = 0x0008, //Justifies the text in the available space.
49 //The vertical flags are :
50 AlignTop = 0x0020, //Aligns with the top.
51 AlignBottom = 0x0040, //Aligns with the bottom.
52 AlignVCenter = 0x0080, //Centers vertically in the available space.
53 AlignBaseline = 0x0100, //Aligns with the baseline.
54 AlignCenter = AlignVCenter | AlignHCenter //Centers in both dimensions.
55 };
56
69
81
90
91public:
92
95
97 virtual ~CFxUIBaseView();
98
104 void setDisabled( bool on );
105
111 void setEnabled( bool on );
112
118 bool isEnabled() const;
119
126
134 void setPalette( const CFxUIPalette & );
135
141 const CFxUIPalette& palette() const;
142
148 bool isVisible();
149
155 void setVisible( bool bVisible );
156
162 inline bool isHidden() { return !isVisible(); }
163
169 inline void setHidden( bool bHidden ) { setVisible( !bHidden ); }
170
176 bool hasFocus() const;
177
181 void setFocus();
182
188 void setFocus( int iReason );
189
195 void setFocusPolicy( int iPolicy );
196
204 static void setTabOrder( CFxUIObject* first, CFxUIObject* second );
205
211 int width();
212
218 void setWidth(int w);
219
225 int height();
226
232 void setHeight(int h);
233
237 void update();
238
246 void setBusyState( bool bBusy = false );
247
255 void resize( int w, int h );
256
262 void setCornerRadius( float radius );
263
269 void setBorderWidth( float width );
270
282 void setBorderWidth( float left, float top, float right, float bottom );
283
293 void setBorderColor( int r, int g, int b );
294
295
301 virtual void showEvent( CFxUIShowEvent * event );
302
308 virtual void hideEvent( CFxUIHideEvent * event );
309
315 virtual void paintEvent( CFxUIPaintEvent * event );
316
324 virtual void resizeEvent( CFxUIResizeEvent * event );
325
332
339
345 virtual void mousePressEvent( CFxUIMouseEvent* mouseEvent );
346
354 void setEventAccepted( bool bAccepted = false );
355
363 void setEventRejected( bool bRejected = false );
364
372 void addView( CFxUIBaseView *pChild, float fWeight = 0.0 );
373
383 void insertView( CFxUIBaseView *pChild, int index = 0, float fWeight = 0.0 );
384
390 int indexOf( CFxUIBaseView *pChild );
391
397 void removeView( CFxUIBaseView *pChild );
398
406 void setPreferableSize( int w, int h );
407
413 void setMinimumWidth( int iWidth );
414
420 void setMinimumHeight( int iHeight );
421
422
424
430 void setMaximumWidth( int iWidth );
431
437 void setMaximumHeight( int iHeight );
438
440
447
454
461
468
474
475 void setToolTip(const CFxUIString& sToolTip);
476
483
490
496
497 void setMask( const CFxUIRegion& region );
498
504 void move( const CFxUIPoint& pos );
505
512
519
531 void setMargin( int left, int top, int right, int bottom );
532
540
541 /* Returns the view opacity
542 *
543 * \return _float_ value.
544 */
545 float getViewOpacity() const;
546
552 void setViewOpacity( const float& opacity );
553
558
563
568
573
578
579 //...
580};
#define COMMONUI_API
CFxString CFxUIString
void setMargin(int left, int top, int right, int bottom)
int maximumWidth()
CFxUISignal< void(void)> & aboutToShow()
virtual void focusInEvent(CFxUIFocusEvent *focusInEvent)
float getViewOpacity() const
virtual void hideEvent(CFxUIHideEvent *event)
void setBorderColor(int r, int g, int b)
void setVisible(bool bVisible)
@ eScrollBarAlwaysOn
This enum always shows a scroll bar.
@ eScrollBarAsNeeded
This enum shows a scroll bar when the content is too large to fit and not otherwise.
@ eScrollBarAlwaysOff
This enum never shows a scroll bar.
void setEventAccepted(bool bAccepted=false)
void setMinimumHeight(int iHeight)
virtual ~CFxUIBaseView()
void setBorderWidth(float width)
virtual void paintEvent(CFxUIPaintEvent *event)
CFxUISignal< void(void)> & hoverEnter()
const CFxUIString toolTip()
@ eS
This enum defines size as small.
@ eM
This enum defines size as medium.
@ eXS
This enum defines size as extra small.
@ eL
This enum defines size as large.
@ eXL
This enum defines size as extra large.
virtual void focusOutEvent(CFxUIFocusEvent *focusOutEvent)
void setToolTip(const CFxUIString &sToolTip)
int minimumWidth()
CFxUISize sizeHint() const
virtual void mousePressEvent(CFxUIMouseEvent *mouseEvent)
void setBorderWidth(float left, float top, float right, float bottom)
void setDisabled(bool on)
virtual void resizeEvent(CFxUIResizeEvent *event)
void removeView(CFxUIBaseView *pChild)
void setBusyState(bool bBusy=false)
void move(const CFxUIPoint &pos)
void setHidden(bool bHidden)
void setEnabled(bool on)
CFxUIPoint mapToGlobal(const CFxUIPoint &pos)
static void setTabOrder(CFxUIObject *first, CFxUIObject *second)
void addView(CFxUIBaseView *pChild, float fWeight=0.0)
void setMaximumHeight(int iHeight)
CFxUISignal< void(void)> & hoverLeave()
CFxUISignal< void(void)> & aboutToPassEventToParent()
@ eTabFocus
The widget accepts focus by tabbing.
@ eClickFocus
The widget accepts focus by clicking.
@ eNoFocus
The widget does not accept focus.
@ eKeyboardOnSetfocus
A programmatic SetFocus automatically opens the soft keyboard if available (implemented for Touch).
@ eWheelFocus
The widget accepts focus by using the mouse wheel in addition to eStrongFocus.
@ eStrongFocus
The widget accepts focus by both tabbing and clicking. On macOS it will also accept tab focus in "Tex...
void setMaximumWidth(int iWidth)
CFxUISignal< void(bool)> & visibilityChanged()
void setPreferableSize(int w, int h)
int maximumHeight()
void setViewOpacity(const float &opacity)
void setEventRejected(bool bRejected=false)
void setMinimumSize(const CFxUISize &size)
const CFxUIPalette & palette() const
int minimumHeight()
void setFocus(int iReason)
int indexOf(CFxUIBaseView *pChild)
void setMaximumSize(const CFxUISize &size)
void setFocusPolicy(int iPolicy)
void setMinimumWidth(int iWidth)
void setHeight(int h)
bool hasFocus() const
void setCornerRadius(float radius)
void setParentWidget(CFxUIBaseView *pParent)
void insertView(CFxUIBaseView *pChild, int index=0, float fWeight=0.0)
void setMask(const CFxUIRegion &region)
bool isVisible()
void setPalette(const CFxUIPalette &)
void resize(int w, int h)
virtual void showEvent(CFxUIShowEvent *event)
bool underMouse()
CFxUIPalette::FxUIColorRole backgroundRole()
void setWidth(int w)
bool isEnabled() const
GLfloat GLfloat GLfloat GLfloat w
Definition gles2_ext.h:320
GLsizeiptr size
Definition gles2_ext.h:182
typedef void(APIENTRYP PFNGLACTIVETEXTUREPROC)(GLenum texture)
GLuint index
Definition gles2_ext.h:265