CFx SDK Documentation  2022 SP0
FxUIBaseView.h
Go to the documentation of this file.
1 //
2 // (C) Copyright 2005-2021 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 class CFxUIBaseViewImpl;
24 
30 {
31 public:
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  eXS = 0,
69  eS,
70  eM,
71  eL,
72  eXL
73  };
74 
75 public:
76 
79 
81  virtual ~CFxUIBaseView();
82 
88  void setDisabled( bool on );
89 
95  void setEnabled( bool on );
96 
102  bool isEnabled() const;
103 
109  CFxUIPalette::ColorRole backgroundRole();
110 
118  void setPalette( const CFxUIPalette & );
119 
125  const CFxUIPalette& palette() const;
126 
132  bool isVisible();
133 
139  void setVisible( bool bVisible );
140 
146  bool hasFocus() const;
147 
151  void setFocus();
152 
158  void setFocus( int iReason );
159 
165  void setFocusPolicy( int iPolicy );
166 
174  static void setTabOrder( CFxUIObject* first, CFxUIObject* second );
175 
181  int width();
182 
188  void setWidth(int w);
189 
195  int height();
196 
202  void setHeight(int h);
203 
207  void update();
208 
216  void setBusyState( bool bBusy = false );
217 
225  void resize( int w, int h );
226 
232  void setCornerRadius( float radius );
233 
239  void setBorderWidth( float width );
240 
252  void setBorderWidth( float left, float top, float right, float bottom );
253 
263  void setBorderColor( int r, int g, int b );
264 
265 
271  virtual void showEvent( CFxUIShowEvent * event );
272 
278  virtual void hideEvent( CFxUIHideEvent * event );
279 
285  virtual void paintEvent( CFxUIPaintEvent * event );
286 
294  virtual void resizeEvent( CFxUIResizeEvent * event );
295 
301  virtual void focusInEvent( CFxUIFocusEvent* focusInEvent );
302 
308  virtual void focusOutEvent( CFxUIFocusEvent* focusOutEvent );
309 
317  void setEventAccepted( bool bAccepted = false );
318 
326  void addView( CFxUIBaseView *pChild, float fWeight = 0.0 );
327 
337  void insertView( CFxUIBaseView *pChild, int index = 0, float fWeight = 0.0 );
338 
344  int indexOf( CFxUIBaseView *pChild );
345 
351  void removeView( CFxUIBaseView *pChild );
352 
360  void setPreferableSize( int w, int h );
361 
367  void setMinimumWidth( int iWidth );
368 
374  void setMinimumHeight( int iHeight );
375 
376  void setMinimumSize( const CFxUISize& size );
377 
383  void setMaximumWidth( int iWidth );
384 
390  void setMaximumHeight( int iHeight );
391 
392  void setMaximumSize( const CFxUISize& size );
393 
400 
407 
414 
421 
428  void setToolTip(const CFxUIString& sToolTip);
429 
437 
442 
447 
452 
457 
458  //...
459 };
#define COMMONUI_API
QString CFxUIString
Definition: FxUIObject.h:48
QPalette CFxUIPalette
Definition: FxUIObject.h:46
QSize CFxUISize
Definition: FxUIObject.h:47
int maximumWidth()
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)
const CFxUIString toolTip()
@ eS
This enum defines size as small.
Definition: FxUIBaseView.h:69
@ eM
This enum defines size as medium.
Definition: FxUIBaseView.h:70
@ eL
This enum defines size as large.
Definition: FxUIBaseView.h:71
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)
void setMaximumWidth(int iWidth)
void setPreferableSize(int w, int h)
int maximumHeight()
void setMinimumSize(const CFxUISize &size)
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)
CFxUISignal< void(void)> & aboutToPassEventToParent()
CFxUISignal< void(void)> & aboutToShow()
CFxUISignal< void(void)> & hoverEnter()
void insertView(CFxUIBaseView *pChild, int index=0, float fWeight=0.0)
bool isVisible()
CFxUIPalette::ColorRole backgroundRole()
CFxUISignal< void(void)> & hoverLeave()
void setPalette(const CFxUIPalette &)
void resize(int w, int h)
virtual void showEvent(CFxUIShowEvent *event)
const CFxUIPalette & palette() const
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