]>
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__)
36 #if !USE_SHARED_LIBRARY
37 IMPLEMENT_DYNAMIC_CLASS(wxGauge95
, wxControl
)
40 bool wxGauge95::Create(wxWindow
*parent
, wxWindowID id
,
45 const wxValidator
& validator
,
49 SetValidator(validator
);
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 CreateWindowEx(MakeExtendedStyle(m_windowStyle
), PROGRESS_CLASS
, NULL
, msFlags
,
74 0, 0, 0, 0, (HWND
) parent
->GetHWND(), (HMENU
)m_windowId
,
75 wxGetInstance(), NULL
);
77 m_hWnd
= (WXHWND
)wx_button
;
79 // Subclass again for purposes of dialog editing mode
80 SubclassWin((WXHWND
) wx_button
);
82 SendMessage((HWND
) GetHWND(), PBM_SETRANGE
, 0, MAKELPARAM(0, range
));
84 SetFont(parent
->GetFont());
90 SetSize(x
, y
, width
, height
);
92 ShowWindow((HWND
) GetHWND(), SW_SHOW
);
97 void wxGauge95::SetSize(int x
, int y
, int width
, int height
, int sizeFlags
)
99 int currentX
, currentY
;
100 GetPosition(¤tX
, ¤tY
);
106 if (x
== -1 || (sizeFlags
& wxSIZE_ALLOW_MINUS_ONE
))
108 if (y
== -1 || (sizeFlags
& wxSIZE_ALLOW_MINUS_ONE
))
111 AdjustForParentClientOrigin(x1
, y1
, sizeFlags
);
113 // If we're prepared to use the existing size, then...
114 if (width
== -1 && height
== -1 && ((sizeFlags
& wxSIZE_AUTO
) != wxSIZE_AUTO
))
119 // Deal with default size (using -1 values)
121 w1
= DEFAULT_ITEM_WIDTH
;
124 h1
= DEFAULT_ITEM_HEIGHT
;
126 MoveWindow((HWND
) GetHWND(), x1
, y1
, w1
, h1
, TRUE
);
129 void wxGauge95::SetShadowWidth(int w
)
133 void wxGauge95::SetBezelFace(int w
)
137 void wxGauge95::SetRange(int r
)
141 SendMessage((HWND
) GetHWND(), PBM_SETRANGE
, 0, MAKELPARAM(0, r
));
144 void wxGauge95::SetValue(int pos
)
148 SendMessage((HWND
) GetHWND(), PBM_SETPOS
, pos
, 0);
151 int wxGauge95::GetShadowWidth(void) const
156 int wxGauge95::GetBezelFace(void) const
161 int wxGauge95::GetRange(void) const
166 int wxGauge95::GetValue(void) const
171 void wxGauge95::SetForegroundColour(const wxColour
& col
)
173 m_foregroundColour
= col
;
176 void wxGauge95::SetBackgroundColour(const wxColour
& col
)
178 m_backgroundColour
= col
;
181 #endif // wxUSE_GAUGE