Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/pgui/pgWaitBar.I

Go to the documentation of this file.
00001 // Filename: pgWaitBar.I
00002 // Created by:  drose (14Mar02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 
00020 ////////////////////////////////////////////////////////////////////
00021 //     Function: PGWaitBar::set_range
00022 //       Access: Published
00023 //  Description: Sets the value at which the WaitBar indicates 100%.
00024 ////////////////////////////////////////////////////////////////////
00025 INLINE void PGWaitBar:: 
00026 set_range(float range) {
00027   _range = range;
00028   _bar_state = -1;
00029 }
00030 
00031 ////////////////////////////////////////////////////////////////////
00032 //     Function: PGWaitBar::get_range
00033 //       Access: Published
00034 //  Description: Returns the value at which the WaitBar indicates 100%.
00035 ////////////////////////////////////////////////////////////////////
00036 INLINE float PGWaitBar:: 
00037 get_range() const {
00038   return _range;
00039 }
00040 
00041 ////////////////////////////////////////////////////////////////////
00042 //     Function: PGWaitBar::set_value
00043 //       Access: Published
00044 //  Description: Sets the current value of the bar.  This should range
00045 //               between 0 and get_range().
00046 ////////////////////////////////////////////////////////////////////
00047 INLINE void PGWaitBar:: 
00048 set_value(float value) {
00049   _value = value;
00050   _bar_state = -1;
00051 }
00052 
00053 ////////////////////////////////////////////////////////////////////
00054 //     Function: PGWaitBar::get_value
00055 //       Access: Published
00056 //  Description: Returns the current value of the bar.
00057 ////////////////////////////////////////////////////////////////////
00058 INLINE float PGWaitBar:: 
00059 get_value() const {
00060   return _value;
00061 }
00062 
00063 ////////////////////////////////////////////////////////////////////
00064 //     Function: PGWaitBar::get_percent
00065 //       Access: Published
00066 //  Description: Returns the percentage complete.
00067 ////////////////////////////////////////////////////////////////////
00068 INLINE float PGWaitBar:: 
00069 get_percent() const {
00070   return (_value / _range) * 100.0f;
00071 }
00072 
00073 ////////////////////////////////////////////////////////////////////
00074 //     Function: PGWaitBar::set_bar_style
00075 //       Access: Published
00076 //  Description: Sets the kind of frame that is drawn on top of the
00077 //               WaitBar to represent the amount completed.
00078 ////////////////////////////////////////////////////////////////////
00079 INLINE void PGWaitBar:: 
00080 set_bar_style(const PGFrameStyle &style) {
00081   _bar_style = style;
00082   _bar_state = -1;
00083 }
00084 
00085 ////////////////////////////////////////////////////////////////////
00086 //     Function: PGWaitBar::get_bar_style
00087 //       Access: Published
00088 //  Description: Returns the kind of frame that is drawn on top of the
00089 //               WaitBar to represent the amount completed.
00090 ////////////////////////////////////////////////////////////////////
00091 INLINE PGFrameStyle PGWaitBar:: 
00092 get_bar_style() const {
00093   return _bar_style;
00094 }

Generated on Fri May 2 00:42:46 2003 for Panda by doxygen1.3