git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51290
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
dc.SetBackgroundMode(wxTRANSPARENT);
dc.SetBackgroundMode(wxTRANSPARENT);
-#ifdef __WXPM__
- wxColour vColor;
-
- vColor = wxSystemSettings::GetColour(wxSYS_COLOUR_MENUBAR);
- ::WinFillRect(dc.m_hPS, &dc.m_vRclPaint, vColor.GetPixel());
-#endif
-
for (int i = 0; i < m_nFields; i ++)
DrawField(dc, i);
}
for (int i = 0; i < m_nFields; i ++)
DrawField(dc, i);
}
#ifndef WX_PRECOMP
#endif
#ifndef WX_PRECOMP
#endif
+#include "wx/os2/dcclient.h"
#include "wx/os2/private.h"
#include "wx/os2/private.h"
//
int nX1 = 0;
int nY1 = 0;
//
int nX1 = 0;
int nY1 = 0;
- int nWidth = vDc.m_vRclPaint.xRight - vDc.m_vRclPaint.xLeft;
- int nHeight = vDc.m_vRclPaint.yTop - vDc.m_vRclPaint.yBottom;
+ wxPMDCImpl *impl = (wxPMDCImpl*) vDc.GetImpl();
+ int nWidth = impl->m_vRclPaint.xRight - impl->m_vRclPaint.xLeft;
+ int nHeight = impl->m_vRclPaint.yTop - impl->m_vRclPaint.yBottom;
int nBmpWidth = pBitmap->GetWidth();
int nBmpHeight = pBitmap->GetHeight();
int nBmpWidth = pBitmap->GetWidth();
int nBmpHeight = pBitmap->GetHeight();
// Note: DrawLine expects wxWidgets coordinate system so swap
//
rDC.SetPen(bSel ? vDarkShadowPen : vHiLitePen);
// Note: DrawLine expects wxWidgets coordinate system so swap
//
rDC.SetPen(bSel ? vDarkShadowPen : vHiLitePen);
+ wxPMDCImpl *impl = (wxPMDCImpl*) rDC.GetImpl();
- rDC.DrawLine( rDC.m_vRclPaint.xLeft + 1
- ,rDC.m_vRclPaint.yBottom + 1
- ,rDC.m_vRclPaint.xRight - 1
- ,rDC.m_vRclPaint.yBottom + 1
+ rDC.DrawLine( impl->m_vRclPaint.xLeft + 1
+ ,impl->m_vRclPaint.yBottom + 1
+ ,impl->m_vRclPaint.xRight - 1
+ ,impl->m_vRclPaint.yBottom + 1
- rDC.DrawLine( rDC.m_vRclPaint.xLeft + 1
- ,rDC.m_vRclPaint.yBottom + 1
- ,rDC.m_vRclPaint.xLeft + 1
- ,rDC.m_vRclPaint.yTop - 1
+ rDC.DrawLine( impl->m_vRclPaint.xLeft + 1
+ ,impl->m_vRclPaint.yBottom + 1
+ ,impl->m_vRclPaint.xLeft + 1
+ ,impl->m_vRclPaint.yTop - 1
);
rDC.SetPen(bSel ? vHiLitePen : vDarkShadowPen);
// bottom
);
rDC.SetPen(bSel ? vHiLitePen : vDarkShadowPen);
// bottom
- rDC.DrawLine( rDC.m_vRclPaint.xLeft + 1
- ,rDC.m_vRclPaint.yTop - 1
- ,rDC.m_vRclPaint.xRight - 1
- ,rDC.m_vRclPaint.yTop - 1
+ rDC.DrawLine( impl->m_vRclPaint.xLeft + 1
+ ,impl->m_vRclPaint.yTop - 1
+ ,impl->m_vRclPaint.xRight - 1
+ ,impl->m_vRclPaint.yTop - 1
- rDC.DrawLine( rDC.m_vRclPaint.xRight - 1
- ,rDC.m_vRclPaint.yBottom + 1
- ,rDC.m_vRclPaint.xRight - 1
- ,rDC.m_vRclPaint.yTop - 1
+ rDC.DrawLine( impl->m_vRclPaint.xRight - 1
+ ,impl->m_vRclPaint.yBottom + 1
+ ,impl->m_vRclPaint.xRight - 1
+ ,impl->m_vRclPaint.yTop - 1
);
} // end of wxBitmapButton::DrawFace
);
} // end of wxBitmapButton::DrawFace
// Note: DrawLine expects wxWidgets coordinate system so swap
//
rDC.SetPen(vBlackPen);
// Note: DrawLine expects wxWidgets coordinate system so swap
//
rDC.SetPen(vBlackPen);
+ wxPMDCImpl *impl = (wxPMDCImpl*) rDC.GetImpl();
- rDC.DrawLine( rDC.m_vRclPaint.xLeft
- ,rDC.m_vRclPaint.yBottom
- ,rDC.m_vRclPaint.xRight
- ,rDC.m_vRclPaint.yBottom
+ rDC.DrawLine( impl->m_vRclPaint.xLeft
+ ,impl->m_vRclPaint.yBottom
+ ,impl->m_vRclPaint.xRight
+ ,impl->m_vRclPaint.yBottom
- rDC.DrawLine( rDC.m_vRclPaint.xRight
- ,rDC.m_vRclPaint.yBottom
- ,rDC.m_vRclPaint.xRight
- ,rDC.m_vRclPaint.yTop
+ rDC.DrawLine( impl->m_vRclPaint.xRight
+ ,impl->m_vRclPaint.yBottom
+ ,impl->m_vRclPaint.xRight
+ ,impl->m_vRclPaint.yTop
- rDC.DrawLine( rDC.m_vRclPaint.xRight
- ,rDC.m_vRclPaint.yTop
- ,rDC.m_vRclPaint.xLeft
- ,rDC.m_vRclPaint.yTop
+ rDC.DrawLine( impl->m_vRclPaint.xRight
+ ,impl->m_vRclPaint.yTop
+ ,impl->m_vRclPaint.xLeft
+ ,impl->m_vRclPaint.yTop
- rDC.DrawLine( rDC.m_vRclPaint.xLeft
- ,rDC.m_vRclPaint.yTop
- ,rDC.m_vRclPaint.xLeft
- ,rDC.m_vRclPaint.yBottom
+ rDC.DrawLine( impl->m_vRclPaint.xLeft
+ ,impl->m_vRclPaint.yTop
+ ,impl->m_vRclPaint.xLeft
+ ,impl->m_vRclPaint.yBottom
);
} // end of wxBitmapButton::DrawButtonFocus
);
} // end of wxBitmapButton::DrawButtonFocus
// Note: DrawLine expects wxWidgets coordinate system so swap
//
rDC.SetPen(vGreyPen);
// Note: DrawLine expects wxWidgets coordinate system so swap
//
rDC.SetPen(vGreyPen);
+ wxPMDCImpl *impl = (wxPMDCImpl*) rDC.GetImpl();
- rDC.DrawLine( rDC.m_vRclPaint.xLeft
- ,rDC.m_vRclPaint.yBottom
- ,rDC.m_vRclPaint.xRight
- ,rDC.m_vRclPaint.yBottom
+ rDC.DrawLine( impl->m_vRclPaint.xLeft
+ ,impl->m_vRclPaint.yBottom
+ ,impl->m_vRclPaint.xRight
+ ,impl->m_vRclPaint.yBottom
- rDC.DrawLine( rDC.m_vRclPaint.xRight
- ,rDC.m_vRclPaint.yBottom
- ,rDC.m_vRclPaint.xRight
- ,rDC.m_vRclPaint.yTop
+ rDC.DrawLine( impl->m_vRclPaint.xRight
+ ,impl->m_vRclPaint.yBottom
+ ,impl->m_vRclPaint.xRight
+ ,impl->m_vRclPaint.yTop
- rDC.DrawLine( rDC.m_vRclPaint.xRight
- ,rDC.m_vRclPaint.yTop
- ,rDC.m_vRclPaint.xLeft
- ,rDC.m_vRclPaint.yTop
+ rDC.DrawLine( impl->m_vRclPaint.xRight
+ ,impl->m_vRclPaint.yTop
+ ,impl->m_vRclPaint.xLeft
+ ,impl->m_vRclPaint.yTop
- rDC.DrawLine( rDC.m_vRclPaint.xLeft
- ,rDC.m_vRclPaint.yTop
- ,rDC.m_vRclPaint.xLeft
- ,rDC.m_vRclPaint.yBottom
+ rDC.DrawLine( impl->m_vRclPaint.xLeft
+ ,impl->m_vRclPaint.yTop
+ ,impl->m_vRclPaint.xLeft
+ ,impl->m_vRclPaint.yBottom
);
wxDisableBitmap(rBmp, vGreyPen.GetColour().GetPixel());
} // end of wxBitmapButton::DrawButtonDisable
);
wxDisableBitmap(rBmp, vGreyPen.GetColour().GetPixel());
} // end of wxBitmapButton::DrawButtonDisable
#include "wx/font.h"
#endif
#include "wx/font.h"
#endif
#include "wx/ownerdrw.h"
#define INCL_PM
#include "wx/ownerdrw.h"
#define INCL_PM
- ::WinQueryWindowRect( m_pParent->GetHWND(), &rDc.m_vRclPaint );
+
+ wxPMDCImpl *impl = (wxPMDCImpl*) rDc.GetImpl();
+ ::WinQueryWindowRect( m_pParent->GetHWND(), &impl->m_vRclPaint );
if (IsChecked())
eStat = (wxOwnerDrawn::wxODStatus)(eStat | wxOwnerDrawn::wxODChecked);
if (IsChecked())
eStat = (wxOwnerDrawn::wxODStatus)(eStat | wxOwnerDrawn::wxODChecked);
//
HBITMAP hChkBmp = ::WinGetSysBitmap( HWND_DESKTOP, SBMP_MENUCHECK );
POINTL vPoint = {nX, nOldY + 3};
//
HBITMAP hChkBmp = ::WinGetSysBitmap( HWND_DESKTOP, SBMP_MENUCHECK );
POINTL vPoint = {nX, nOldY + 3};
-
- ::WinDrawBitmap( rDc.GetHPS(),
+ wxPMDCImpl *impl = (wxPMDCImpl*) rDc.GetImpl();
+ ::WinDrawBitmap( impl->GetHPS(),
#include "wx/window.h"
#endif
#include "wx/window.h"
#endif
+#include "wx/os2/dcclient.h"
#include "wx/os2/private.h"
#define INCL_M
#include "wx/os2/private.h"
#define INCL_M
+ wxClientDC vDc(this);
+ wxPMDCImpl *impl = (wxPMDCImpl*) vDc.GetImpl();
wxPoint pt1( pDrawStruct->rclItem.xLeft, pDrawStruct->rclItem.yTop );
wxPoint pt2( pDrawStruct->rclItem.xRight, pDrawStruct->rclItem.yBottom );
wxRect vRect( pt1, pt2 );
wxPoint pt1( pDrawStruct->rclItem.xLeft, pDrawStruct->rclItem.yTop );
wxPoint pt2( pDrawStruct->rclItem.xRight, pDrawStruct->rclItem.yBottom );
wxRect vRect( pt1, pt2 );
- vDc.SetHPS(pDrawStruct->hps);
+ impl->SetHPS(pDrawStruct->hps);
if (pDrawStruct->fsAttribute == pDrawStruct->fsAttributeOld)
{
if (pDrawStruct->fsAttribute == pDrawStruct->fsAttributeOld)
{
#endif
#include "wx/ownerdrw.h"
#endif
#include "wx/ownerdrw.h"
+#include "wx/os2/dcclient.h"
// ============================================================================
// implementation of wxOwnerDrawn class
// ============================================================================
// implementation of wxOwnerDrawn class
}
vDC.SetFont(GetFont());
vDC.GetTextExtent( sStr
}
vDC.SetFont(GetFont());
vDC.GetTextExtent( sStr
- ,(long *)pWidth
- ,(long *)pHeight
+ ,(wxCoord *)pWidth
+ ,(wxCoord *)pHeight
);
if (!m_strAccel.empty())
{
);
if (!m_strAccel.empty())
{
// Make sure that this item is at least as
// tall as the user's system settings specify
//
// Make sure that this item is at least as
// tall as the user's system settings specify
//
- if (*pHeight < m_nMinHeight)
- *pHeight = m_nMinHeight;
+ const size_t heightStd = 6; // FIXME: get value from the system
+ if ( *pHeight < heightStd )
+ *pHeight = heightStd;
m_nHeight = *pHeight; // remember height for use in OnDrawItem
return true;
} // end of wxOwnerDrawn::OnMeasureItem
m_nHeight = *pHeight; // remember height for use in OnDrawItem
return true;
} // end of wxOwnerDrawn::OnMeasureItem
+ wxPMDCImpl *impl = (wxPMDCImpl*) rDC.GetImpl();
+ HPS hPS= impl->GetHPS();
wxColour vColBack;
wxColour vColText;
COLORREF vRef;
wxColour vColBack;
wxColour vColText;
COLORREF vRef;
bFoundMnemonic = true;
sTmp.Remove(nIndex);
rDC.GetTextExtent( sTmp
bFoundMnemonic = true;
sTmp.Remove(nIndex);
rDC.GetTextExtent( sTmp
- ,(long *)&nWidth
- ,(long *)&nHeight
+ ,(wxCoord *)&nWidth
+ ,(wxCoord *)&nHeight
);
sTmp = sFullString[(size_t)(nIndex + 1)];
rDC.GetTextExtent( sTmp
);
sTmp = sFullString[(size_t)(nIndex + 1)];
rDC.GetTextExtent( sTmp
- ,(long *)&nCharWidth
- ,(long *)&nHeight
+ ,(wxCoord *)&nCharWidth
+ ,(wxCoord *)&nHeight
);
sFullString.Replace(sTgt.c_str(), wxEmptyString, true);
}
);
sFullString.Replace(sTgt.c_str(), wxEmptyString, true);
}
// Draw the main item text sans the accel text
//
POINTL vPntStart = {nX, rRect.y + 4};
// Draw the main item text sans the accel text
//
POINTL vPntStart = {nX, rRect.y + 4};
- ::GpiCharStringAt( rDC.GetHPS()
+ ::GpiCharStringAt( impl->GetHPS()
,&vPntStart
,sFullString.length()
,sFullString.char_str()
,&vPntStart
,sFullString.length()
,sFullString.char_str()
size_t nHeight;
rDC.GetTextExtent( sAccel
size_t nHeight;
rDC.GetTextExtent( sAccel
- ,(long *)&nWidth
- ,(long *)&nHeight
+ ,(wxCoord *)&nWidth
+ ,(wxCoord *)&nHeight
);
//
// Back off the starting position from the right edge
//
vPntStart.x = rRect.width - (nWidth + 7);
vPntStart.y = rRect.y + 4;
);
//
// Back off the starting position from the right edge
//
vPntStart.x = rRect.width - (nWidth + 7);
vPntStart.y = rRect.y + 4;
- ::GpiCharStringAt( rDC.GetHPS()
+ ::GpiCharStringAt( impl->GetHPS()
,&vPntStart
,sAccel.length()
,sAccel.char_str()
,&vPntStart
,sAccel.length()
,sAccel.char_str()
#endif
#include "wx/tooltip.h"
#endif
#include "wx/tooltip.h"
+#include "wx/os2/dcclient.h"
bool wxToolBar::m_bInitialized = false;
bool wxToolBar::m_bInitialized = false;
- ::WinFillRect(vDc.GetHPS(), &vDc.m_vRclPaint, GetBackgroundColour().GetPixel());
+ wxPMDCImpl *impl = (wxPMDCImpl*) vDc.GetImpl();
+ ::WinFillRect(impl->GetHPS(), &impl->m_vRclPaint, GetBackgroundColour().GetPixel());
for ( wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst();
node;
node = node->GetNext() )
for ( wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst();
node;
node = node->GetNext() )
#include <stdio.h>
#endif
#include <stdio.h>
#endif
+#include "wx/os2/dcclient.h"
+
#if wxUSE_OWNER_DRAWN
#include "wx/ownerdrw.h"
#endif
#if wxUSE_OWNER_DRAWN
#include "wx/ownerdrw.h"
#endif
QMSG s_currentMsg;
#if wxUSE_MENUS_NATIVE
QMSG s_currentMsg;
#if wxUSE_MENUS_NATIVE
-wxMenu* wxCurrentPopupMenu = NULL;
+extern wxMenu* wxCurrentPopupMenu;
#endif // wxUSE_MENUS_NATIVE
// ---------------------------------------------------------------------------
#endif // wxUSE_MENUS_NATIVE
// ---------------------------------------------------------------------------
bool bIsWaiting = true;
int nHeight;
bool bIsWaiting = true;
int nHeight;
- // Protect against recursion
- if (wxCurrentPopupMenu)
- return false;
-
pMenu->SetInvokingWindow(this);
pMenu->UpdateUI();
pMenu->SetInvokingWindow(this);
pMenu->UpdateUI();
WXDRAWITEMSTRUCT* pItemStruct )
{
#if wxUSE_OWNER_DRAWN
WXDRAWITEMSTRUCT* pItemStruct )
{
#if wxUSE_OWNER_DRAWN
#if wxUSE_MENUS_NATIVE
//
#if wxUSE_MENUS_NATIVE
//
,pMeasureStruct->rclItem.xRight - pMeasureStruct->rclItem.xLeft
,pMeasureStruct->rclItem.yTop - pMeasureStruct->rclItem.yBottom
);
,pMeasureStruct->rclItem.xRight - pMeasureStruct->rclItem.xLeft
,pMeasureStruct->rclItem.yTop - pMeasureStruct->rclItem.yBottom
);
- vDc.SetHDC( hDC, false );
- vDc.SetHPS( pMeasureStruct->hps );
+
+ wxPMDCImpl *impl = (wxPMDCImpl*) vDc.GetImpl();
+ impl->SetHDC( hDC, false );
+ impl->SetHPS( pMeasureStruct->hps );
//
// Load the wxWidgets Pallete and set to RGB mode
//
//
// Load the wxWidgets Pallete and set to RGB mode
//
- HDC hDC = (HDC)wxPaintDC::FindDCInCache((wxWindow*) rEvent.GetEventObject());
+ HDC hDC = (HDC)wxPaintDCImpl::FindDCInCache((wxWindow*) rEvent.GetEventObject());
if (vSwp.fl & SWP_MINIMIZE)
return true;
if (vSwp.fl & SWP_MINIMIZE)
return true;
- wxDC vDC;
-
- vDC.m_hPS = (HPS)hDC; // this is really a PS
- vDC.SetWindow((wxWindow*)this);
+ wxClientDC vDC(this);
+ wxPMDCImpl *impl = (wxPMDCImpl*) vDC.GetImpl();
+ impl->SetHDC(hDC);
+ impl->SetHPS((HPS)hDC); // this is really a PS
wxEraseEvent vEvent(m_windowId, &vDC);
wxEraseEvent vEvent(m_windowId, &vDC);
rc = HandleWindowEvent(vEvent);
rc = HandleWindowEvent(vEvent);
- vDC.m_hPS = NULLHANDLE;
+ impl->SetHPS(NULLHANDLE);
return true;
} // end of wxWindowOS2::HandleEraseBkgnd
void wxWindowOS2::OnEraseBackground(wxEraseEvent& rEvent)
{
RECTL vRect;
return true;
} // end of wxWindowOS2::HandleEraseBkgnd
void wxWindowOS2::OnEraseBackground(wxEraseEvent& rEvent)
{
RECTL vRect;
- HPS hPS = rEvent.GetDC()->GetHPS();
+ wxPMDCImpl *impl = (wxPMDCImpl*) rEvent.GetDC()->GetImpl();
+ HPS hPS = impl->GetHPS();
APIRET rc;
LONG lColor = m_backgroundColour.GetPixel();
APIRET rc;
LONG lColor = m_backgroundColour.GetPixel();