CFx SDK Documentation  2020SP3
FxUIBaseView.h
Go to the documentation of this file.
1 //
2 // (C) Copyright 2005-2020 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 
381  void setMaximumWidth( int iWidth );
382 
388  void setMaximumHeight( int iHeight );
389 
396 
403 
410 
417 
424  void setToolTip(const CFxUIString& sToolTip);
425 
433 
438 
443 
448 
453 
454  //...
455 };
CFxUIBaseView::hoverEnter
CFxUISignal< void(void)> & hoverEnter()
CFxUIBaseView::maximumWidth
int maximumWidth()
CFxUIResizeEvent
Definition: FxUIEvent.h:134
CFxUIBaseView::setBorderColor
void setBorderColor(int r, int g, int b)
CFxUIBaseView::setHeight
void setHeight(int h)
CFxUIBaseView::aboutToPassEventToParent
CFxUISignal< void(void)> & aboutToPassEventToParent()
CFxUIBaseView::height
int height()
CFxUIBaseView::TextAlignment
TextAlignment
Definition: FxUIBaseView.h:37
CFxUIBaseView::setBorderWidth
void setBorderWidth(float left, float top, float right, float bottom)
CFxUIBaseView::setCornerRadius
void setCornerRadius(float radius)
CFxUIBaseView
Definition: FxUIBaseView.h:30
CFxUIBaseView::resize
void resize(int w, int h)
CFxUIBaseView::eM
@ eM
This enum defines size as medium.
Definition: FxUIBaseView.h:70
CFxUIBaseView::setFocusPolicy
void setFocusPolicy(int iPolicy)
CFxUISignal
Definition: FxUISignal.h:74
index
GLuint index
Definition: gles2_ext.h:265
CFxUIBaseView::backgroundRole
CFxUIPalette::ColorRole backgroundRole()
w
GLfloat GLfloat GLfloat GLfloat w
Definition: gles2_ext.h:320
CFxUIBaseView::hoverLeave
CFxUISignal< void(void)> & hoverLeave()
CFxUIBaseView::~CFxUIBaseView
virtual ~CFxUIBaseView()
CFxUIBaseView::setMaximumHeight
void setMaximumHeight(int iHeight)
CFxUIBaseView::showEvent
virtual void showEvent(CFxUIShowEvent *event)
CFxUIBaseView::aboutToShow
CFxUISignal< void(void)> & aboutToShow()
CFxUIBaseView::palette
const CFxUIPalette & palette() const
CFxUIBaseView::toolTip
const CFxUIString toolTip()
CFxUIBaseView::update
void update()
CFxUIBaseView::indexOf
int indexOf(CFxUIBaseView *pChild)
CFxUIBaseView::width
int width()
CFxUIBaseView::setWidth
void setWidth(int w)
CFxUIPaintEvent
Definition: FxUIEvent.h:89
CFxUIBaseView::CFxUIBaseView
CFxUIBaseView()
CFxUIBaseView::minimumWidth
int minimumWidth()
CFxUIBaseView::setMinimumWidth
void setMinimumWidth(int iWidth)
CFxUIBaseView::maximumHeight
int maximumHeight()
CFxUIBaseView::setFocus
void setFocus(int iReason)
CFxUIBaseView::eS
@ eS
This enum defines size as small.
Definition: FxUIBaseView.h:69
CFxUIBaseView::resizeEvent
virtual void resizeEvent(CFxUIResizeEvent *event)
CFxUIShowEvent
Definition: FxUIEvent.h:57
CFxUIBaseView::eL
@ eL
This enum defines size as large.
Definition: FxUIBaseView.h:71
CFxUIBaseView::removeView
void removeView(CFxUIBaseView *pChild)
CFxUIBaseView::setPreferableSize
void setPreferableSize(int w, int h)
FxUIEvent.h
width
GLint GLenum GLsizei width
Definition: gles2_ext.h:110
CFxUIBaseView::setEventAccepted
void setEventAccepted(bool bAccepted=false)
CFxUIBaseView::addView
void addView(CFxUIBaseView *pChild, float fWeight=0.0)
CFxUIFocusEvent
Definition: FxUIEvent.h:171
CFxUIBaseView::paintEvent
virtual void paintEvent(CFxUIPaintEvent *event)
CFxUIBaseView::hideEvent
virtual void hideEvent(CFxUIHideEvent *event)
CFxUIBaseView::isEnabled
bool isEnabled() const
CFxUIBaseView::isVisible
bool isVisible()
CFxUIBaseView::minimumHeight
int minimumHeight()
CFxUIBaseView::FocusPolicyType
FocusPolicyType
Definition: FxUIBaseView.h:55
CFxUIBaseView::setTabOrder
static void setTabOrder(CFxUIObject *first, CFxUIObject *second)
CFxUIBaseView::focusOutEvent
virtual void focusOutEvent(CFxUIFocusEvent *focusOutEvent)
CFxUIBaseView::setMaximumWidth
void setMaximumWidth(int iWidth)
CFxUIString
QString CFxUIString
Definition: FxUIObject.h:46
CFxUIBaseView::insertView
void insertView(CFxUIBaseView *pChild, int index=0, float fWeight=0.0)
CFxUIBaseView::setVisible
void setVisible(bool bVisible)
COMMONUI_API
#define COMMONUI_API
Definition: FxCommonFramework.h:4
CFxUIBaseView::setDisabled
void setDisabled(bool on)
CFxUIBaseView::setEnabled
void setEnabled(bool on)
CFxUIPalette
QPalette CFxUIPalette
Definition: FxUIObject.h:44
CFxUIBaseView::hasFocus
bool hasFocus() const
CFxUIBaseView::setPalette
void setPalette(const CFxUIPalette &)
CFxUIBaseView::setMinimumHeight
void setMinimumHeight(int iHeight)
CFxUIBaseView::UIWidthSizePolicy
UIWidthSizePolicy
Definition: FxUIBaseView.h:67
CFxUIBaseView::setBorderWidth
void setBorderWidth(float width)
CFxUIObject
Definition: FxUIObject.h:101
void
typedef void(APIENTRYP PFNGLACTIVETEXTUREPROC)(GLenum texture)
FxUIObject.h
CFxUIBaseView::setBusyState
void setBusyState(bool bBusy=false)
CFxUIBaseView::focusInEvent
virtual void focusInEvent(CFxUIFocusEvent *focusInEvent)
FxUISignal.h
CFxUIHideEvent
Definition: FxUIEvent.h:73
CFxUIBaseView::setToolTip
void setToolTip(const CFxUIString &sToolTip)
CFxUIBaseView::setFocus
void setFocus()