]>
git.saurik.com Git - wxWidgets.git/blob - src/common/gaugecmn.cpp
   1 /////////////////////////////////////////////////////////////////////////////// 
   2 // Name:        src/common/gaugecmn.cpp 
   3 // Purpose:     wxGaugeBase: common to all ports methods of wxGauge 
   4 // Author:      Vadim Zeitlin 
   8 // Copyright:   (c) 2001 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> 
   9 // License:     wxWindows licence 
  10 /////////////////////////////////////////////////////////////////////////////// 
  12 // ============================================================================ 
  14 // ============================================================================ 
  16 // ---------------------------------------------------------------------------- 
  18 // ---------------------------------------------------------------------------- 
  20 // For compilers that support precompilation, includes "wx.h". 
  21 #include "wx/wxprec.h" 
  34 const wxChar wxGaugeNameStr
[] = wxT("gauge"); 
  36 // ============================================================================ 
  38 // ============================================================================ 
  40 wxGaugeBase::~wxGaugeBase() 
  42     // this destructor is required for Darwin 
  45 // ---------------------------------------------------------------------------- 
  47 // ---------------------------------------------------------------------------- 
  49 bool wxGaugeBase::Create(wxWindow 
*parent
, 
  55                          const wxValidator
& validator
, 
  58     if ( !wxControl::Create(parent
, id
, pos
, size
, style
, validator
, name
) ) 
  64     SetValidator(validator
); 
  65 #endif // wxUSE_VALIDATORS 
  69 #if wxGAUGE_EMULATE_INDETERMINATE_MODE 
  70     m_nDirection 
= wxRIGHT
; 
  76 // ---------------------------------------------------------------------------- 
  77 // wxGauge determinate mode range/position 
  78 // ---------------------------------------------------------------------------- 
  80 void wxGaugeBase::SetRange(int range
) 
  85 int wxGaugeBase::GetRange() const 
  90 void wxGaugeBase::SetValue(int pos
) 
  95 int wxGaugeBase::GetValue() const 
 100 // ---------------------------------------------------------------------------- 
 101 // wxGauge indeterminate mode 
 102 // ---------------------------------------------------------------------------- 
 104 void wxGaugeBase::Pulse() 
 106 #if wxGAUGE_EMULATE_INDETERMINATE_MODE 
 107     // simulate indeterminate mode 
 108     int curr 
= GetValue(), max 
= GetRange(); 
 110     if (m_nDirection 
== wxRIGHT
) 
 117             m_nDirection 
= wxLEFT
; 
 127             m_nDirection 
= wxRIGHT
; 
 133 // ---------------------------------------------------------------------------- 
 134 // wxGauge appearance params 
 135 // ---------------------------------------------------------------------------- 
 137 void wxGaugeBase::SetShadowWidth(int WXUNUSED(w
)) 
 141 int wxGaugeBase::GetShadowWidth() const 
 147 void wxGaugeBase::SetBezelFace(int WXUNUSED(w
)) 
 151 int wxGaugeBase::GetBezelFace() const 
 156 #endif // wxUSE_GAUGE