gwenhywfar  4.6.0beta
w_progressbar.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  begin : Mon Feb 15 2010
3  copyright : (C) 2010 by Martin Preuss
4  email : martin@libchipcard.de
5 
6  ***************************************************************************
7  * Please see toplevel file COPYING for license details *
8  ***************************************************************************/
9 
10 
11 #include <gwen-gui-cpp/cppwidget.hpp>
12 
13 
15 public:
17  }
18 
19 
20 
22  }
23 
24 
25 
26  virtual int setup() {
27  QProgressBar *qw;
28  uint32_t flags;
29  GWEN_WIDGET *wParent;
30  QSizePolicy::Policy hpolicy=QSizePolicy::Minimum;
31  QSizePolicy::Policy vpolicy=QSizePolicy::Minimum;
32 
34  wParent=GWEN_Widget_Tree_GetParent(_widget);
35 
36  qw=new QProgressBar();
37  qw->setTextVisible(true);
38 
39  /* handle flags */
40  if (flags & GWEN_WIDGET_FLAGS_FILLX)
41  hpolicy=QSizePolicy::Expanding;
42  if (flags & GWEN_WIDGET_FLAGS_FILLY)
43  vpolicy=QSizePolicy::Expanding;
44  qw->setSizePolicy(hpolicy, vpolicy);
45 
47 
48  if (wParent)
50  return 0;
51  }
52 
53 
54 
56  int index,
57  int value,
58  int doSignal) {
59  QProgressBar *qw;
60 
62  assert(qw);
63 
64  switch(prop) {
66  qw->setValue(value);
67  return 0;
68 
70  qw->setMinimum(value);
71  return 0;
72 
74  qw->setMaximum(value);
75  return 0;
76 
77  default:
78  return Qt4_W_Widget::setIntProperty(prop, index, value, doSignal);
79  }
80  };
81 
82 
83 
85  int index,
86  int defaultValue) {
87  QProgressBar *qw;
88 
90  assert(qw);
91 
92  switch(prop) {
94  return qw->value();
95 
97  return qw->minimum();
98 
100  return qw->maximum();
101 
102  default:
103  return Qt4_W_Widget::getIntProperty(prop, index, defaultValue);
104  }
105  };
106 
107 };
108 
109 
110 
111 
112 
113 
114