CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
FxUIBaseView.h
Go to the documentation of this file.
1//
2// (C) Copyright 2005-2023 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
23class CFxUIBaseViewImpl;
24
30{
31public:
32
37 {
38 //The horizontal flags are :
39 AlignLeft = 0x0001, //Aligns with the left edge.
40 AlignRight = 0x0002, //Aligns with the right edge.
41 AlignHCenter = 0x0004, //Centers horizontally in the available space.
42 AlignJustify = 0x0008, //Justifies the text in the available space.
43 //The vertical flags are :
44 AlignTop = 0x0020, //Aligns with the top.
45 AlignBottom = 0x0040, //Aligns with the bottom.
46 AlignVCenter = 0x0080, //Centers vertically in the available space.
47 AlignBaseline = 0x0100, //Aligns with the baseline.
48 AlignCenter = AlignVCenter | AlignHCenter //Centers in both dimensions.
49 };
50
55 {
56 eNoFocus = 0,
57 eTabFocus = 0x1,
58 eClickFocus = 0x2,
59 eStrongFocus = eTabFocus | eClickFocus | 0x8,
60 eWheelFocus = eStrongFocus | 0x4,
61 eKeyboardOnSetfocus = 0x10
62 };
67 {
68 eExpanding = -1,
69 eXS = 0,
73 eXL
74 };
75
76public:
77
80
82 virtual ~CFxUIBaseView();
83
89 void setDisabled( bool on );
90
96 void setEnabled( bool on );
97
103 bool isEnabled() const;
104
110 CFxUIPalette::ColorRole backgroundRole();
111
119 void setPalette( const CFxUIPalette & );
120
126 const CFxUIPalette& palette() const;
127
133 bool isVisible();
134
140 void setVisible( bool bVisible );
141
147 bool hasFocus() const;
148
152 void setFocus();
153
159 void setFocus( int iReason );
160
166 void setFocusPolicy( int iPolicy );
167
175 static void setTabOrder( CFxUIObject* first, CFxUIObject* second );
176
182 int width();
183
189 void setWidth(int w);
190
196 int height();
197
203 void setHeight(int h);
204
208 void update();
209
217 void setBusyState( bool bBusy = false );
218
226 void resize( int w, int h );
227
233 void setCornerRadius( float radius );
234
240 void setBorderWidth( float width );
241
253 void setBorderWidth( float left, float top, float right, float bottom );
254
264 void setBorderColor( int r, int g, int b );
265
266
272 virtual void showEvent( CFxUIShowEvent * event );
273
279 virtual void hideEvent( CFxUIHideEvent * event );
280
286 virtual void paintEvent( CFxUIPaintEvent * event );
287
295 virtual void resizeEvent( CFxUIResizeEvent * event );
296
302 virtual void focusInEvent( CFxUIFocusEvent* focusInEvent );
303
309 virtual void focusOutEvent( CFxUIFocusEvent* focusOutEvent );
310
318 void setEventAccepted( bool bAccepted = false );
319
327 void addView( CFxUIBaseView *pChild, float fWeight = 0.0 );
328
338 void insertView( CFxUIBaseView *pChild, int index = 0, float fWeight = 0.0 );
339
345 int indexOf( CFxUIBaseView *pChild );
346
352 void removeView( CFxUIBaseView *pChild );
353
361 void setPreferableSize( int w, int h );
362
368 void setMinimumWidth( int iWidth );
369
375 void setMinimumHeight( int iHeight );
376
378
384 void setMaximumWidth( int iWidth );
385
391 void setMaximumHeight( int iHeight );
392
394
401
408
415
422
429 void setToolTip(const CFxUIString& sToolTip);
430
438
443
448
453
458
463
464 //...
465};
#define COMMONUI_API
QString CFxUIString
Definition: FxUIObject.h:48
QPalette CFxUIPalette
Definition: FxUIObject.h:46
QSize CFxUISize
Definition: FxUIObject.h:47
int maximumWidth()
CFxUISignal< void(void)> & aboutToShow()
virtual void focusInEvent(CFxUIFocusEvent *focusInEvent)
virtual void hideEvent(CFxUIHideEvent *event)
void setBorderColor(int r, int g, int b)
void setVisible(bool bVisible)
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.
Definition: FxUIBaseView.h:70
@ eM
This enum defines size as medium.
Definition: FxUIBaseView.h:71
@ eL
This enum defines size as large.
Definition: FxUIBaseView.h:72
virtual void focusOutEvent(CFxUIFocusEvent *focusOutEvent)
void setToolTip(const CFxUIString &sToolTip)
int minimumWidth()
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 setEnabled(bool on)
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()
void setMaximumWidth(int iWidth)
CFxUISignal< void(bool)> & visibilityChanged()
void setPreferableSize(int w, int h)
int maximumHeight()
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 insertView(CFxUIBaseView *pChild, int index=0, float fWeight=0.0)
bool isVisible()
CFxUIPalette::ColorRole backgroundRole()
void setPalette(const CFxUIPalette &)
void resize(int w, int h)
virtual void showEvent(CFxUIShowEvent *event)
void setWidth(int w)
bool isEnabled() const
GLfloat GLfloat GLfloat GLfloat w
Definition: gles2_ext.h:320
GLint GLenum GLsizei width
Definition: gles2_ext.h:110
GLsizeiptr size
Definition: gles2_ext.h:182
typedef void(APIENTRYP PFNGLACTIVETEXTUREPROC)(GLenum texture)
GLuint index
Definition: gles2_ext.h:265