]>
git.saurik.com Git - wxWidgets.git/blob - src/msw/gauge95.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxGauge95 class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "gauge95.h"
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
27 #if wxUSE_GAUGE && defined(__WIN95__)
29 #include "wx/msw/gauge95.h"
30 #include "wx/msw/private.h"
32 #if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS)
36 IMPLEMENT_DYNAMIC_CLASS(wxGauge95
, wxControl
)
38 bool wxGauge95::Create(wxWindow
*parent
, wxWindowID id
,
43 const wxValidator
& validator
,
48 SetValidator(validator
);
49 #endif // wxUSE_VALIDATORS
51 if (parent
) parent
->AddChild(this);
55 SetBackgroundColour(parent
->GetBackgroundColour()) ;
56 SetForegroundColour(parent
->GetForegroundColour()) ;
58 m_windowStyle
= style
;
61 m_windowId
= (int)NewControlId();
70 long msFlags
= WS_CHILD
| WS_VISIBLE
| WS_TABSTOP
;
73 #define PBS_VERTICAL 0x04
76 if (m_windowStyle
& wxGA_VERTICAL
)
77 msFlags
|= PBS_VERTICAL
;
80 #define PBS_SMOOTH 0x01
83 if (m_windowStyle
& wxGA_SMOOTH
)
84 msFlags
|= PBS_SMOOTH
;
87 CreateWindowEx(MakeExtendedStyle(m_windowStyle
), PROGRESS_CLASS
, NULL
, msFlags
,
88 0, 0, 0, 0, (HWND
) parent
->GetHWND(), (HMENU
)m_windowId
,
89 wxGetInstance(), NULL
);
91 m_hWnd
= (WXHWND
)wx_button
;
93 // Subclass again for purposes of dialog editing mode
94 SubclassWin((WXHWND
) wx_button
);
96 SendMessage((HWND
) GetHWND(), PBM_SETRANGE
, 0, MAKELPARAM(0, range
));
98 SetFont(parent
->GetFont());
104 SetSize(x
, y
, width
, height
);
106 ShowWindow((HWND
) GetHWND(), SW_SHOW
);
111 void wxGauge95::SetShadowWidth(int w
)
115 void wxGauge95::SetBezelFace(int w
)
119 void wxGauge95::SetRange(int r
)
123 SendMessage((HWND
) GetHWND(), PBM_SETRANGE
, 0, MAKELPARAM(0, r
));
126 void wxGauge95::SetValue(int pos
)
130 SendMessage((HWND
) GetHWND(), PBM_SETPOS
, pos
, 0);
133 int wxGauge95::GetShadowWidth(void) const
138 int wxGauge95::GetBezelFace(void) const
143 int wxGauge95::GetRange(void) const
148 int wxGauge95::GetValue(void) const
153 bool wxGauge95::SetForegroundColour(const wxColour
& col
)
155 if ( !wxControl::SetForegroundColour(col
) )
158 m_foregroundColour
= col
;
163 bool wxGauge95::SetBackgroundColour(const wxColour
& col
)
165 if ( !wxControl::SetBackgroundColour(col
) )
168 m_backgroundColour
= col
;
173 #endif // wxUSE_GAUGE