]>
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
,
47 SetValidator(validator
);
49 if (parent
) parent
->AddChild(this);
53 SetBackgroundColour(parent
->GetBackgroundColour()) ;
54 SetForegroundColour(parent
->GetForegroundColour()) ;
56 m_windowStyle
= style
;
59 m_windowId
= (int)NewControlId();
68 long msFlags
= WS_CHILD
| WS_VISIBLE
| WS_TABSTOP
;
71 #define PBS_VERTICAL 0x04
74 if (m_windowStyle
& wxGA_VERTICAL
)
75 msFlags
|= PBS_VERTICAL
;
78 #define PBS_SMOOTH 0x01
81 if (m_windowStyle
& wxGA_SMOOTH
)
82 msFlags
|= PBS_SMOOTH
;
85 CreateWindowEx(MakeExtendedStyle(m_windowStyle
), PROGRESS_CLASS
, NULL
, msFlags
,
86 0, 0, 0, 0, (HWND
) parent
->GetHWND(), (HMENU
)m_windowId
,
87 wxGetInstance(), NULL
);
89 m_hWnd
= (WXHWND
)wx_button
;
91 // Subclass again for purposes of dialog editing mode
92 SubclassWin((WXHWND
) wx_button
);
94 SendMessage((HWND
) GetHWND(), PBM_SETRANGE
, 0, MAKELPARAM(0, range
));
96 SetFont(parent
->GetFont());
102 SetSize(x
, y
, width
, height
);
104 ShowWindow((HWND
) GetHWND(), SW_SHOW
);
109 void wxGauge95::SetShadowWidth(int w
)
113 void wxGauge95::SetBezelFace(int w
)
117 void wxGauge95::SetRange(int r
)
121 SendMessage((HWND
) GetHWND(), PBM_SETRANGE
, 0, MAKELPARAM(0, r
));
124 void wxGauge95::SetValue(int pos
)
128 SendMessage((HWND
) GetHWND(), PBM_SETPOS
, pos
, 0);
131 int wxGauge95::GetShadowWidth(void) const
136 int wxGauge95::GetBezelFace(void) const
141 int wxGauge95::GetRange(void) const
146 int wxGauge95::GetValue(void) const
151 bool wxGauge95::SetForegroundColour(const wxColour
& col
)
153 if ( !wxControl::SetForegroundColour(col
) )
156 m_foregroundColour
= col
;
161 bool wxGauge95::SetBackgroundColour(const wxColour
& col
)
163 if ( !wxControl::SetBackgroundColour(col
) )
166 m_backgroundColour
= col
;
171 #endif // wxUSE_GAUGE