Panda3D
 All Classes Functions Variables Enumerations
pgWaitBar.h
1 // Filename: pgWaitBar.h
2 // Created by: drose (14Mar02)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef PGWAITBAR_H
16 #define PGWAITBAR_H
17 
18 #include "pandabase.h"
19 
20 #include "pgItem.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : PGWaitBar
24 // Description : This is a particular kind of PGItem that draws a
25 // little bar that fills from left to right to indicate
26 // a slow process gradually completing, like a
27 // traditional "wait, loading" bar.
28 ////////////////////////////////////////////////////////////////////
29 class EXPCL_PANDA_PGUI PGWaitBar : public PGItem {
30 PUBLISHED:
31  PGWaitBar(const string &name = "");
32  virtual ~PGWaitBar();
33 
34 protected:
35  PGWaitBar(const PGWaitBar &copy);
36 
37 public:
38  virtual PandaNode *make_copy() const;
39  virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data);
40 
41 PUBLISHED:
42  void setup(PN_stdfloat width, PN_stdfloat height, PN_stdfloat range);
43 
44  INLINE void set_range(PN_stdfloat range);
45  INLINE PN_stdfloat get_range() const;
46 
47  INLINE void set_value(PN_stdfloat value);
48  INLINE PN_stdfloat get_value() const;
49 
50  INLINE PN_stdfloat get_percent() const;
51 
52  INLINE void set_bar_style(const PGFrameStyle &style);
53  INLINE PGFrameStyle get_bar_style() const;
54 
55 private:
56  void update();
57 
58  PN_stdfloat _range, _value;
59  int _bar_state;
60  PGFrameStyle _bar_style;
61  NodePath _bar;
62 
63 public:
64  static TypeHandle get_class_type() {
65  return _type_handle;
66  }
67  static void init_type() {
68  PGItem::init_type();
69  register_type(_type_handle, "PGWaitBar",
70  PGItem::get_class_type());
71  }
72  virtual TypeHandle get_type() const {
73  return get_class_type();
74  }
75  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
76 
77 private:
78  static TypeHandle _type_handle;
79 };
80 
81 #include "pgWaitBar.I"
82 
83 #endif
A basic node of the scene graph or data graph.
Definition: pandaNode.h:72
This is the base class for all the various kinds of gui widget objects.
Definition: pgItem.h:58
This collects together the pieces of data that are accumulated for each node while walking the scene ...
This is a particular kind of PGItem that draws a little bar that fills from left to right to indicate...
Definition: pgWaitBar.h:29
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:165
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling...
Definition: cullTraverser.h:48