Some framework updates
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7312 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -184,7 +184,7 @@ bool wxApp::RegisterWindowClasses(
|
|||||||
if (!::WinRegisterClass( vHab
|
if (!::WinRegisterClass( vHab
|
||||||
,wxFrameClassName
|
,wxFrameClassName
|
||||||
,(PFNWP)wxWndProc
|
,(PFNWP)wxWndProc
|
||||||
,CS_SIZEREDRAW | CS_SYNCPAINT
|
,CS_SIZEREDRAW | CS_MOVENOTIFY | CS_SYNCPAINT
|
||||||
,sizeof(ULONG)
|
,sizeof(ULONG)
|
||||||
))
|
))
|
||||||
{
|
{
|
||||||
@@ -210,7 +210,7 @@ bool wxApp::RegisterWindowClasses(
|
|||||||
if (!::WinRegisterClass( vHab
|
if (!::WinRegisterClass( vHab
|
||||||
,wxMDIFrameClassName
|
,wxMDIFrameClassName
|
||||||
,(PFNWP)wxWndProc
|
,(PFNWP)wxWndProc
|
||||||
,CS_SIZEREDRAW | CS_SYNCPAINT
|
,CS_SIZEREDRAW | CS_MOVENOTIFY | CS_SYNCPAINT
|
||||||
,0
|
,0
|
||||||
))
|
))
|
||||||
{
|
{
|
||||||
|
152
src/os2/dc.cpp
152
src/os2/dc.cpp
@@ -42,6 +42,13 @@ static const int VIEWPORT_EXTENT = 1000;
|
|||||||
static const int MM_POINTS = 9;
|
static const int MM_POINTS = 9;
|
||||||
static const int MM_METRIC = 10;
|
static const int MM_METRIC = 10;
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
// private functions
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// convert degrees to radians
|
||||||
|
static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; }
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// implementation
|
// implementation
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -52,17 +59,17 @@ static const int MM_METRIC = 10;
|
|||||||
|
|
||||||
wxDC::wxDC(void)
|
wxDC::wxDC(void)
|
||||||
{
|
{
|
||||||
m_canvas = NULL;
|
m_pCanvas = NULL;
|
||||||
|
|
||||||
m_oldBitmap = 0;
|
m_hOldBitmap = 0;
|
||||||
m_oldPen = 0;
|
m_hOldPen = 0;
|
||||||
m_oldBrush = 0;
|
m_hOldBrush = 0;
|
||||||
m_oldFont = 0;
|
m_hOldFont = 0;
|
||||||
m_oldPalette = 0;
|
m_hOldPalette = 0;
|
||||||
|
|
||||||
m_bOwnsDC = FALSE;
|
m_bOwnsDC = FALSE;
|
||||||
m_hDC = 0;
|
m_hDC = 0;
|
||||||
m_hDCCount = 0;
|
m_nDCCount = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
wxDC::~wxDC(void)
|
wxDC::~wxDC(void)
|
||||||
@@ -77,52 +84,59 @@ void wxDC::SelectOldObjects(WXHDC dc)
|
|||||||
{
|
{
|
||||||
if (dc)
|
if (dc)
|
||||||
{
|
{
|
||||||
if (m_oldBitmap)
|
if (m_hOldBitmap)
|
||||||
{
|
{
|
||||||
// ::SelectObject((HDC) dc, (HBITMAP) m_oldBitmap);
|
// ::SelectObject((HDC) dc, (HBITMAP) m_oldBitmap);
|
||||||
if (m_selectedBitmap.Ok())
|
if (m_vSelectedBitmap.Ok())
|
||||||
{
|
{
|
||||||
m_selectedBitmap.SetSelectedInto(NULL);
|
m_vSelectedBitmap.SetSelectedInto(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_oldBitmap = 0;
|
m_hOldBitmap = 0;
|
||||||
if (m_oldPen)
|
if (m_hOldPen)
|
||||||
{
|
{
|
||||||
// ::SelectObject((HDC) dc, (HPEN) m_oldPen);
|
// ::SelectObject((HDC) dc, (HPEN) m_oldPen);
|
||||||
}
|
}
|
||||||
m_oldPen = 0;
|
m_hOldPen = 0;
|
||||||
if (m_oldBrush)
|
if (m_hOldBrush)
|
||||||
{
|
{
|
||||||
// ::SelectObject((HDC) dc, (HBRUSH) m_oldBrush);
|
// ::SelectObject((HDC) dc, (HBRUSH) m_oldBrush);
|
||||||
}
|
}
|
||||||
m_oldBrush = 0;
|
m_hOldBrush = 0;
|
||||||
if (m_oldFont)
|
if (m_hOldFont)
|
||||||
{
|
{
|
||||||
// ::SelectObject((HDC) dc, (HFONT) m_oldFont);
|
// ::SelectObject((HDC) dc, (HFONT) m_oldFont);
|
||||||
}
|
}
|
||||||
m_oldFont = 0;
|
m_hOldFont = 0;
|
||||||
if (m_oldPalette)
|
if (m_hOldPalette)
|
||||||
{
|
{
|
||||||
// ::SelectPalette((HDC) dc, (HPALETTE) m_oldPalette, TRUE);
|
// ::SelectPalette((HDC) dc, (HPALETTE) m_oldPalette, TRUE);
|
||||||
}
|
}
|
||||||
m_oldPalette = 0;
|
m_hOldPalette = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_brush = wxNullBrush;
|
m_brush = wxNullBrush;
|
||||||
m_pen = wxNullPen;
|
m_pen = wxNullPen;
|
||||||
m_palette = wxNullPalette;
|
m_palette = wxNullPalette;
|
||||||
m_font = wxNullFont;
|
m_font = wxNullFont;
|
||||||
m_backgroundBrush = wxNullBrush;
|
m_backgroundBrush = wxNullBrush;
|
||||||
m_selectedBitmap = wxNullBitmap;
|
m_vSelectedBitmap = wxNullBitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// clipping
|
// clipping
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxDC::DoSetClippingRegionAsRegion(const wxRegion& region)
|
#define DO_SET_CLIPPING_BOX() \
|
||||||
{
|
{ \
|
||||||
// TODO
|
RECT rect; \
|
||||||
|
\
|
||||||
|
GetClipBox(GetHdc(), &rect); \
|
||||||
|
\
|
||||||
|
m_clipX1 = (wxCoord) XDEV2LOG(rect.left); \
|
||||||
|
m_clipY1 = (wxCoord) YDEV2LOG(rect.top); \
|
||||||
|
m_clipX2 = (wxCoord) XDEV2LOG(rect.right); \
|
||||||
|
m_clipY2 = (wxCoord) YDEV2LOG(rect.bottom); \
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y
|
void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y
|
||||||
@@ -132,14 +146,9 @@ void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y
|
|||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoClipping(WXHDC dc)
|
void wxDC::DoSetClippingRegionAsRegion(const wxRegion& region)
|
||||||
{
|
{
|
||||||
if (m_clipping && dc)
|
// TODO
|
||||||
{
|
|
||||||
// TODO:
|
|
||||||
// IntersectClipRect((HDC) dc, XLOG2DEV(m_clipX1), YLOG2DEV(m_clipY1),
|
|
||||||
// XLOG2DEV(m_clipX2), YLOG2DEV(m_clipY2));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DestroyClippingRegion(void)
|
void wxDC::DestroyClippingRegion(void)
|
||||||
@@ -213,6 +222,12 @@ void wxDC::DoDrawArc( wxCoord x1, wxCoord y1
|
|||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxDC::DoDrawCheckMark(wxCoord x1, wxCoord y1,
|
||||||
|
wxCoord width, wxCoord height)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawPoint(wxCoord x, wxCoord y)
|
void wxDC::DoDrawPoint(wxCoord x, wxCoord y)
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
@@ -280,6 +295,11 @@ void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
|
|||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxDC::DrawAnyText(const wxString& text, wxCoord x, wxCoord y)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawRotatedText(const wxString& text,
|
void wxDC::DoDrawRotatedText(const wxString& text,
|
||||||
wxCoord x, wxCoord y,
|
wxCoord x, wxCoord y,
|
||||||
double angle)
|
double angle)
|
||||||
@@ -496,71 +516,43 @@ void wxDC::SetDeviceOrigin( wxCoord x, wxCoord y )
|
|||||||
|
|
||||||
wxCoord wxDCBase::DeviceToLogicalX(wxCoord x) const
|
wxCoord wxDCBase::DeviceToLogicalX(wxCoord x) const
|
||||||
{
|
{
|
||||||
wxCoord new_x = x - m_deviceOriginX;
|
return (wxCoord) (((x) - m_deviceOriginX)/(m_logicalScaleX*m_userScaleX*m_signX*m_scaleX) - m_logicalOriginX);
|
||||||
if (new_x > 0)
|
}
|
||||||
return (wxCoord)((double)(new_x) / m_scaleX + 0.5) * m_signX + m_logicalOriginX;
|
|
||||||
else
|
|
||||||
return (wxCoord)((double)(new_x) / m_scaleX - 0.5) * m_signX + m_logicalOriginX;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxCoord wxDCBase::DeviceToLogicalXRel(wxCoord x) const
|
wxCoord wxDCBase::DeviceToLogicalXRel(wxCoord x) const
|
||||||
{
|
{
|
||||||
if (x > 0)
|
return (wxCoord) ((x)/(m_logicalScaleX*m_userScaleX*m_signX*m_scaleX));
|
||||||
return (wxCoord)((double)(x) / m_scaleX + 0.5);
|
}
|
||||||
else
|
|
||||||
return (wxCoord)((double)(x) / m_scaleX - 0.5);
|
|
||||||
};
|
|
||||||
|
|
||||||
wxCoord wxDCBase::DeviceToLogicalY(wxCoord y) const
|
wxCoord wxDCBase::DeviceToLogicalY(wxCoord y) const
|
||||||
{
|
{
|
||||||
wxCoord new_y = y - m_deviceOriginY;
|
return (wxCoord) (((y) - m_deviceOriginY)/(m_logicalScaleY*m_userScaleY*m_signY*m_scaleY) - m_logicalOriginY);
|
||||||
if (new_y > 0)
|
}
|
||||||
return (wxCoord)((double)(new_y) / m_scaleY + 0.5) * m_signY + m_logicalOriginY;
|
|
||||||
else
|
|
||||||
return (wxCoord)((double)(new_y) / m_scaleY - 0.5) * m_signY + m_logicalOriginY;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxCoord wxDCBase::DeviceToLogicalYRel(wxCoord y) const
|
wxCoord wxDCBase::DeviceToLogicalYRel(wxCoord y) const
|
||||||
{
|
{
|
||||||
if (y > 0)
|
return (wxCoord) ((y)/(m_logicalScaleY*m_userScaleY*m_signY*m_scaleY));
|
||||||
return (wxCoord)((double)(y) / m_scaleY + 0.5);
|
}
|
||||||
else
|
|
||||||
return (wxCoord)((double)(y) / m_scaleY - 0.5);
|
|
||||||
};
|
|
||||||
|
|
||||||
wxCoord wxDCBase::LogicalToDeviceX(wxCoord x) const
|
wxCoord wxDCBase::LogicalToDeviceX(wxCoord x) const
|
||||||
{
|
{
|
||||||
wxCoord new_x = x - m_logicalOriginX;
|
return (wxCoord) ((x - m_logicalOriginX)*m_logicalScaleX*m_userScaleX*m_signX*m_scaleX + m_deviceOriginX);
|
||||||
if (new_x > 0)
|
}
|
||||||
return (wxCoord)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX;
|
|
||||||
else
|
|
||||||
return (wxCoord)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxCoord wxDCBase::LogicalToDeviceXRel(wxCoord x) const
|
wxCoord wxDCBase::LogicalToDeviceXRel(wxCoord x) const
|
||||||
{
|
{
|
||||||
if (x > 0)
|
return (wxCoord) (x*m_logicalScaleX*m_userScaleX*m_signX*m_scaleX);
|
||||||
return (wxCoord)((double)(x) * m_scaleX + 0.5);
|
}
|
||||||
else
|
|
||||||
return (wxCoord)((double)(x) * m_scaleX - 0.5);
|
|
||||||
};
|
|
||||||
|
|
||||||
wxCoord wxDCBase::LogicalToDeviceY(wxCoord y) const
|
wxCoord wxDCBase::LogicalToDeviceY(wxCoord y) const
|
||||||
{
|
{
|
||||||
wxCoord new_y = y - m_logicalOriginY;
|
return (wxCoord) ((y - m_logicalOriginY)*m_logicalScaleY*m_userScaleY*m_signY*m_scaleY + m_deviceOriginY);
|
||||||
if (new_y > 0)
|
}
|
||||||
return (wxCoord)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY;
|
|
||||||
else
|
|
||||||
return (wxCoord)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxCoord wxDCBase::LogicalToDeviceYRel(wxCoord y) const
|
wxCoord wxDCBase::LogicalToDeviceYRel(wxCoord y) const
|
||||||
{
|
{
|
||||||
if (y > 0)
|
return (wxCoord) (y*m_logicalScaleY*m_userScaleY*m_signY*m_scaleY);
|
||||||
return (wxCoord)((double)(y) * m_scaleY + 0.5);
|
}
|
||||||
else
|
|
||||||
return (wxCoord)((double)(y) * m_scaleY - 0.5);
|
|
||||||
};
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// bit blit
|
// bit blit
|
||||||
|
@@ -351,7 +351,6 @@ void wxFrame::DoShowWindow(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
::WinShowWindow(m_hFrame, (BOOL)bShowCmd);
|
::WinShowWindow(m_hFrame, (BOOL)bShowCmd);
|
||||||
::WinShowWindow(GetHwnd(), (BOOL)bShowCmd);
|
|
||||||
} // end of wxFrame::DoShowWindow
|
} // end of wxFrame::DoShowWindow
|
||||||
|
|
||||||
bool wxFrame::Show(
|
bool wxFrame::Show(
|
||||||
@@ -852,7 +851,7 @@ bool wxFrame::OS2Create(
|
|||||||
,HWND_TOP // Sibling
|
,HWND_TOP // Sibling
|
||||||
,(ULONG)nId // ID
|
,(ULONG)nId // ID
|
||||||
,(PVOID)&vFrameCtlData // Creation data
|
,(PVOID)&vFrameCtlData // Creation data
|
||||||
,NULL // Window Pres Params
|
,NULL // Window Pres Params
|
||||||
)) == 0L)
|
)) == 0L)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -867,7 +866,7 @@ bool wxFrame::OS2Create(
|
|||||||
,0L
|
,0L
|
||||||
,0L
|
,0L
|
||||||
,m_hFrame
|
,m_hFrame
|
||||||
,HWND_BOTTOM
|
,HWND_TOP
|
||||||
,(unsigned long)FID_CLIENT
|
,(unsigned long)FID_CLIENT
|
||||||
,NULL
|
,NULL
|
||||||
,NULL
|
,NULL
|
||||||
@@ -885,7 +884,7 @@ bool wxFrame::OS2Create(
|
|||||||
,nY
|
,nY
|
||||||
,nWidth
|
,nWidth
|
||||||
,nHeight
|
,nHeight
|
||||||
,SWP_SIZE | SWP_MOVE | SWP_ACTIVATE
|
,SWP_SIZE | SWP_MOVE | SWP_ACTIVATE | SWP_ZORDER
|
||||||
))
|
))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
@@ -901,10 +900,6 @@ bool wxFrame::OS2Create(
|
|||||||
else if (vSwp[i].hwnd == m_hTitleBar)
|
else if (vSwp[i].hwnd == m_hTitleBar)
|
||||||
memcpy(&m_vSwpTitleBar, &vSwp[i], sizeof(SWP));
|
memcpy(&m_vSwpTitleBar, &vSwp[i], sizeof(SWP));
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Set the client window's background, otherwise it is transparent!
|
|
||||||
//
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} // end of wxFrame::OS2Create
|
} // end of wxFrame::OS2Create
|
||||||
|
|
||||||
|
@@ -2394,6 +2394,7 @@ bool wxWindow::OS2Create(
|
|||||||
wxLogError("Can't create window of class %s!. Error: %s\n", zClass, sError);
|
wxLogError("Can't create window of class %s!. Error: %s\n", zClass, sError);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
::WinSetWindowULong(m_hWnd, QWL_USER, (ULONG) this);
|
||||||
wxWndHook = NULL;
|
wxWndHook = NULL;
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
|
Reference in New Issue
Block a user