/////////////////////////////////////////////////////////////////////////////
-// Name: slider.cpp
+// Name: src/os2/slider.cpp
// Purpose: wxSlider
// Author: David Webster
// Modified by:
#endif
#ifndef WX_PRECOMP
-#include <stdio.h>
-#include <wx/utils.h>
-#include <wx/brush.h>
-#include <wx/scrolwin.h>
+ #include <stdio.h>
+ #include "wx/utils.h"
+ #include "wx/brush.h"
+ #include "wx/scrolwin.h"
#endif
#if wxUSE_SLIDER
m_windowStyle = lStyle;
m_nTickFreq = 0;
- if (vId == -1)
+ if (vId == wxID_ANY)
m_windowId = (int)NewControlId();
else
m_windowId = vId;
)
) + 4; // for bordersizes
- wxColour vColour;
+ wxColour vColour(*wxBLACK);
- vColour.Set(wxString(wxT("BLACK")));
-
- LONG lColor = (LONG)vColour.GetPixel();
+ LONG lColor = (LONG)vColour.GetPixel();
::WinSetPresParam( m_hStaticMin
,PP_FOREGROUNDCOLOR
return true;
} // end of wxSlider::Create
-void wxSlider::DoSetSize(
- int nX
-, int nY
-, int nWidth
-, int nHeight
-, int nSizeFlags
-)
+void wxSlider::DoSetSize( int nX,
+ int nY,
+ int nWidth,
+ int nHeight,
+ int nSizeFlags )
{
- int nX1 = nX;
- int nY1 = nY;
- int nWidth1 = nWidth;
- int nHeight1 = nHeight;
- int nXOffset = nX;
- int nYOffset = nY;
- int nCx; // slider,min,max sizes
- int nCy;
- int nCyf;
- int nCurrentX;
- int nCurrentY;
- wxChar zBuf[300];
- wxFont vFont = this->GetFont();
+ int nX1 = nX;
+ int nY1 = nY;
+ int nWidth1 = nWidth;
+ int nHeight1 = nHeight;
+ int nXOffset = nX;
+ int nYOffset = nY;
+ int nCx; // slider,min,max sizes
+ int nCy;
+ int nCyf;
+ int nCurrentX;
+ int nCurrentY;
+ wxChar zBuf[300];
+ wxFont vFont = this->GetFont();
//
// Adjust for OS/2's reverse coordinate system
if (nOS2Height < 0)
nOS2Height = 20;
+ CacheBestSize(wxSize(nWidth,nOS2Height));
if (pParent)
{
- int nOS2ParentHeight = GetOS2ParentHeight(pParent);
+ int nOS2ParentHeight = GetOS2ParentHeight(pParent);
nYOffset = nOS2ParentHeight - (nYOffset + nOS2Height);
- if (nY != -1)
+ if (nY != wxDefaultCoord)
nY1 = nOS2ParentHeight - (nY1 + nOS2Height);
}
else
{
- RECTL vRect;
+ RECTL vRect;
::WinQueryWindowRect(HWND_DESKTOP, &vRect);
nYOffset = vRect.yTop - (nYOffset + nOS2Height);
- if (nY != -1)
+ if (nY != wxDefaultCoord)
nY1 = vRect.yTop - (nY1 + nOS2Height);
}
m_nSizeFlags = nSizeFlags;
- GetPosition( &nCurrentX
- ,&nCurrentY
- );
+ GetPosition( &nCurrentX, &nCurrentY );
if (nX == -1 && !(nSizeFlags & wxSIZE_ALLOW_MINUS_ONE))
nX1 = nCurrentX;
if (nY == -1 && !(nSizeFlags & wxSIZE_ALLOW_MINUS_ONE))
vPoint.x -= vPt.x;
vPoint.y -= vPt.y;
}
- *pnX = vPoint.x;
- *pnY = vPoint.y;
+ if (pnX)
+ *pnX = vPoint.x;
+ if (pnY)
+ *pnY = vPoint.y;
} // end of wxSlider::GetPosition
int wxSlider::GetSelEnd() const