]>
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 USE_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);
54 SetBackgroundColour(parent
->GetDefaultBackgroundColour()) ;
55 SetForegroundColour(parent
->GetDefaultForegroundColour()) ;
57 m_windowStyle
= style
;
60 m_windowId
= (int)NewControlId();
69 long msFlags
= WS_CHILD
| WS_VISIBLE
| WS_TABSTOP
;
72 CreateWindowEx(MakeExtendedStyle(m_windowStyle
), PROGRESS_CLASS
, NULL
, msFlags
,
73 0, 0, 0, 0, (HWND
) parent
->GetHWND(), (HMENU
)m_windowId
,
74 wxGetInstance(), NULL
);
76 m_hWnd
= (WXHWND
)wx_button
;
78 // Subclass again for purposes of dialog editing mode
79 SubclassWin((WXHWND
) wx_button
);
81 SendMessage((HWND
) GetHWND(), PBM_SETRANGE
, 0, MAKELPARAM(0, range
));
83 SetFont(* parent
->GetFont());
89 SetSize(x
, y
, width
, height
);
91 ShowWindow((HWND
) GetHWND(), SW_SHOW
);
96 void wxGauge95::SetSize(int x
, int y
, int width
, int height
, int sizeFlags
)
98 int currentX
, currentY
;
99 GetPosition(¤tX
, ¤tY
);
105 if (x
== -1 || (sizeFlags
& wxSIZE_ALLOW_MINUS_ONE
))
107 if (y
== -1 || (sizeFlags
& wxSIZE_ALLOW_MINUS_ONE
))
110 AdjustForParentClientOrigin(x1
, y1
, sizeFlags
);
112 // If we're prepared to use the existing size, then...
113 if (width
== -1 && height
== -1 && ((sizeFlags
& wxSIZE_AUTO
) != wxSIZE_AUTO
))
118 // Deal with default size (using -1 values)
120 w1
= DEFAULT_ITEM_WIDTH
;
123 h1
= DEFAULT_ITEM_HEIGHT
;
125 MoveWindow((HWND
) GetHWND(), x1
, y1
, w1
, h1
, TRUE
);
128 void wxGauge95::SetShadowWidth(int w
)
132 void wxGauge95::SetBezelFace(int w
)
136 void wxGauge95::SetRange(int r
)
140 SendMessage((HWND
) GetHWND(), PBM_SETRANGE
, 0, MAKELPARAM(0, r
));
143 void wxGauge95::SetValue(int pos
)
147 SendMessage((HWND
) GetHWND(), PBM_SETPOS
, pos
, 0);
150 int wxGauge95::GetShadowWidth(void) const
155 int wxGauge95::GetBezelFace(void) const
160 int wxGauge95::GetRange(void) const
165 int wxGauge95::GetValue(void) const
170 void wxGauge95::SetForegroundColour(const wxColour
& col
)
172 m_foregroundColour
= col
;
175 void wxGauge95::SetBackgroundColour(const wxColour
& col
)
177 m_backgroundColour
= col
;