OS/2 updates for statusbar processing and easier VA debugging

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8633 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster
2000-10-24 21:48:58 +00:00
parent 28be2e8a17
commit 7e99520bd3
21 changed files with 621 additions and 105 deletions

View File

@@ -115,6 +115,28 @@ bool wxApp::Initialize(
HAB vHab HAB vHab
) )
{ {
#if defined(wxUSE_CONSOLEDEBUG)
#if wxUSE_CONSOLEDEBUG
/***********************************************/
/* Code for using stdout debug */
/* To use it you mast link app as "Window" - EK*/
/***********************************************/
{
PPIB pib;
PTIB tib;
printf("In console\n");
DosGetInfoBlocks(&tib, &pib);
/* Try morphing into a PM application. */
// if(pib->pib_ultype == 2) /* VIO */
pib->pib_ultype = 3;
}
/**********************************************/
/**********************************************/
#endif //wxUSE_CONSOLEDEBUG
#endif
// //
// OS2 has to have an anchorblock // OS2 has to have an anchorblock
// //
@@ -169,6 +191,7 @@ bool wxApp::Initialize(
return TRUE; return TRUE;
} // end of wxApp::Initialize } // end of wxApp::Initialize
const char* CANTREGISTERCLASS = " Can't register Class ";
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// RegisterWindowClasses // RegisterWindowClasses
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
@@ -402,6 +425,9 @@ void wxApp::CleanUp()
#endif // wxUSE_LOG #endif // wxUSE_LOG
} // end of wxApp::CleanUp } // end of wxApp::CleanUp
//----------------------------------------------------------------------
// Main wxWindows entry point
//----------------------------------------------------------------------
int wxEntry( int wxEntry(
int argc int argc
, char* argv[] , char* argv[]
@@ -460,7 +486,7 @@ int wxEntry(
// nRetValue = -1; // nRetValue = -1;
} }
} }
// Normal exit
wxWindow* pTopWindow = wxTheApp->GetTopWindow(); wxWindow* pTopWindow = wxTheApp->GetTopWindow();
if (pTopWindow) if (pTopWindow)
@@ -478,8 +504,24 @@ int wxEntry(
wxTheApp->SetTopWindow(NULL); wxTheApp->SetTopWindow(NULL);
} }
} }
else // app initialization failed
{
wxLogLastError(" Gui initialization failed, exitting");
}
#if wxUSE_CONSOLEDEBUG
printf("wxTheApp->OnExit ");
fflush(stdout);
#endif
wxTheApp->OnExit(); wxTheApp->OnExit();
#if wxUSE_CONSOLEDEBUG
printf("wxApp::CleanUp ");
fflush(stdout);
#endif
wxApp::CleanUp(); wxApp::CleanUp();
#if wxUSE_CONSOLEDEBUG
printf("return %i ", nRetValue);
fflush(stdout);
#endif
return(nRetValue); return(nRetValue);
} // end of wxEntry } // end of wxEntry
@@ -550,7 +592,6 @@ bool wxApp::DoMessage()
{ {
BOOL bRc = ::WinGetMsg(vHabmain, &svCurrentMsg, HWND(NULL), 0, 0); BOOL bRc = ::WinGetMsg(vHabmain, &svCurrentMsg, HWND(NULL), 0, 0);
// wxUsleep(1000);
if (bRc == 0) if (bRc == 0)
{ {
// got WM_QUIT // got WM_QUIT
@@ -749,13 +790,13 @@ bool wxApp::ProcessMessage(
if((CHARMSG(pChmsg)->fs & (KC_ALT | KC_CTRL)) && CHARMSG(pChmsg)->chr != 0) if((CHARMSG(pChmsg)->fs & (KC_ALT | KC_CTRL)) && CHARMSG(pChmsg)->chr != 0)
CHARMSG(pChmsg)->chr = (USHORT)wxToupper((UCHAR)uSch); CHARMSG(pChmsg)->chr = (USHORT)wxToupper((UCHAR)uSch);
for(pWnd = pWndThis; pWnd; pWnd = pWnd->GetParent() ) for(pWnd = pWndThis; pWnd; pWnd = pWnd->GetParent() )
{ {
if((bRc = pWnd->OS2TranslateMessage(pWxmsg)) == TRUE) if((bRc = pWnd->OS2TranslateMessage(pWxmsg)) == TRUE)
break; break;
} }
if(!bRc) // untranslated, should restore original value if(!bRc) // untranslated, should restore original value
CHARMSG(pChmsg)->chr = uSch; CHARMSG(pChmsg)->chr = uSch;
} }

View File

@@ -313,6 +313,7 @@ bool wxBitmapDataObject::SetData(
memcpy(m_pngData, pBuf, m_pngSize); memcpy(m_pngData, pBuf, m_pngSize);
#if wxUSE_STREAMS
wxMemoryInputStream vMstream((char*)m_pngData, m_pngSize); wxMemoryInputStream vMstream((char*)m_pngData, m_pngSize);
wxImage vImage; wxImage vImage;
wxPNGHandler vHandler; wxPNGHandler vHandler;
@@ -323,6 +324,8 @@ bool wxBitmapDataObject::SetData(
} }
m_bitmap = vImage.ConvertToBitmap(); m_bitmap = vImage.ConvertToBitmap();
#endif //wxUSE_STREAMS
return m_bitmap.Ok(); return m_bitmap.Ok();
} }
@@ -331,6 +334,7 @@ void wxBitmapDataObject::DoConvertToPng()
if (!m_bitmap.Ok()) if (!m_bitmap.Ok())
return; return;
#if wxUSE_STREAMS
wxImage vImage(m_bitmap); wxImage vImage(m_bitmap);
wxPNGHandler vHandler; wxPNGHandler vHandler;
wxCountingOutputStream vCount; wxCountingOutputStream vCount;
@@ -343,5 +347,6 @@ void wxBitmapDataObject::DoConvertToPng()
wxMemoryOutputStream vMstream((char*) m_pngData, m_pngSize); wxMemoryOutputStream vMstream((char*) m_pngData, m_pngSize);
vHandler.SaveFile(&vImage, vMstream ); vHandler.SaveFile(&vImage, vMstream );
#endif
} }

View File

@@ -54,6 +54,74 @@ static const int MM_METRIC = 10;
// convert degrees to radians // convert degrees to radians
static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; } static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; }
int SetTextColor(
HPS hPS
, int nForegroundColour
)
{
CHARBUNDLE vCbnd;
vCbnd.lColor = nForegroundColour;
::GpiSetAttrs( hPS // presentation-space handle
,PRIM_CHAR // Char primitive.
,CBB_COLOR // sets color.
,0 //
,&vCbnd // buffer for attributes.
);
return 0;
}
int QueryTextBkColor(
HPS hPS
)
{
CHARBUNDLE vCbnd;
::GpiQueryAttrs(hPS // presentation-space handle
PRIM_CHAR // Char primitive.
CBB_BACK_COLOR // Background color.
&vCbnd // buffer for attributes.
return vCbnd.lBackColor;
}
int SetTextBkColor(
HPS hPS
, int nBackgroundColour
)
{
CHARBUNDLE vCbnd;
int rc;
rc = QueryTextBkColor(hPS);
vCbnd.lBackColor = nBackgroundColour;
::GpiSetAttrs(hPS, // presentation-space handle
PRIM_CHAR, // Char primitive.
CBB_BACK_COLOR, // sets color.
0,
&vCbnd // buffer for attributes.
);
return rc;
}
int SetBkMode(
HPS hPS
, int nBackgroundMode
)
{
if(nBackgroundMode == wxTRANSPARENT)
::GpiSetBackMix( hPS
,BM_LEAVEALONE
);
else
// the background of the primitive takes over whatever is underneath.
::GpiSetBackMix( hPS
,BM_OVERPAINT
);
return 0;
}
// =========================================================================== // ===========================================================================
// implementation // implementation
// =========================================================================== // ===========================================================================
@@ -64,17 +132,20 @@ static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; }
wxDC::wxDC(void) wxDC::wxDC(void)
{ {
m_pCanvas = NULL; m_pCanvas = NULL;
m_hOldBitmap = 0; m_hOldBitmap = 0;
m_hOldPen = 0; m_hOldPen = 0;
m_hOldBrush = 0; m_hOldBrush = 0;
m_hOldFont = 0; m_hOldFont = 0;
m_hOldPalette = 0; m_hOldPalette = 0;
m_bOwnsDC = FALSE; m_bOwnsDC = FALSE;
m_hDC = 0; m_hDC = 0;
m_nDCCount = 0; m_nDCCount = 0;
m_hOldPS = NULL;
m_hPS = NULL;
m_bIsPaintTime = FALSE;// True at Paint Time
}; };
wxDC::~wxDC(void) wxDC::~wxDC(void)
@@ -214,9 +285,22 @@ void wxDC::DoCrossHair(wxCoord x, wxCoord y)
// TODO // TODO
} }
void wxDC::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) void wxDC::DoDrawLine(
wxCoord vX1
, wxCoord vY1
, wxCoord vX2
, wxCoord vY2
)
{ {
// TODO POINTL vPoint[2];
vPoint[0].x = vX1;
vPoint[0].y = vY1;
vPoint[1].x = vX2;
vPoint[1].y = vY2;
// ::GpiSetColor(m_hPS,CLR_RED); //DEbug
::GpiMove(m_hPS, &vPoint[0]);
::GpiLine(m_hPS, &vPoint[1]);
} }
void wxDC::DoDrawArc( wxCoord x1, wxCoord y1 void wxDC::DoDrawArc( wxCoord x1, wxCoord y1
@@ -253,17 +337,51 @@ void wxDC::DoDrawLines( int n, wxPoint points[]
// TODO // TODO
} }
void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height) void wxDC::DoDrawRectangle(
wxCoord vS
, wxCoord vY
, wxCoord vWidth
, wxCoord vHeight
)
{ {
// TODO POINTL vPoint[2];
vPoint[0].x = vX;
vPoint[0].y = vY;
vPoint[1].x = vX + Width;
vPoint[1].y = vY - Height; //mustdie !!! ??
::GpiMove(m_hPS, &vPoint[0]);
::GpiBox( m_hPS // handle to a presentation space
,DRO_OUTLINE // draw the box outline ? or ?
,&vPoint[1] // address of the corner
,0L // horizontal corner radius
,0L // vertical corner radius
);
} }
void wxDC::DoDrawRoundedRectangle( wxCoord x, wxCoord y void wxDC::DoDrawRoundedRectangle(
,wxCoord width, wxCoord height wxCoord vX
,double radius , wxCoord vY
) , wxCoord vWidth
, wxCoord vHeight
, double dRadius
)
{ {
// TODO POINTL vPoint[2];
vPoint[0].x = vX;
vPoint[0].y = vY;
vPoint[1].x = vX + vWidth;
vPoint[1].y = vY + vHeight; //or -height aka mustdie !!! ??
::GpiMove(m_hPS, &vPoint[0]);
::GpiBox( m_hPS // handle to a presentation space
,DRO_OUTLINE // draw the box outline ? or ?
,&vPoint[1] // address of the corner
,(LONG)radius // horizontal corner radius
,(LONG)radius // vertical corner radius
);
} }
void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height) void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
@@ -295,20 +413,93 @@ void wxDC::DoDrawBitmap( const wxBitmap &bmp
// TODO // TODO
} }
void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y) void wxDC::DoDrawText(
const wxString& rsText
, wxCoord vX
, wxCoord vY
)
{ {
// TODO DrawAnyText( rsText
,vX
,vY
);
} }
void wxDC::DrawAnyText(const wxString& text, wxCoord x, wxCoord y) void wxDC::DrawAnyText(
const wxString& rsText
, wxCoord vX
, wxCoord vY
)
{ {
// TODO int nOldBackground = 0;
POINTL vPtlStart;
LONG lHits;
//
// prepare for drawing the text
//
//
// Set text color attributes
//
if (m_textForegroundColour.Ok())
{
SetTextColor( m_hPS
,(int)m_textForegroundColour.GetPixel()
);
}
if (m_textBackgroundColour.Ok())
{
nOldBackground = SetTextBkColor( m_hPS
,(int)m_textBackgroundColour.GetPixel()
);
}
SetBkMode( m_hPS
,m_backgroundMode
);
vPtlStart.x = vX;
vPtlStart.y = vY;
lHits = ::GpiCharStringAt( m_hPS
,&vPtlStart
,rsText.length()
,(PCH)rsText.c_str()
);
if (lHits != GPI_OK)
{
wxLogLastError(wxT("TextOut"));
}
//
// Restore the old parameters (text foreground colour may be left because
// it never is set to anything else, but background should remain
// transparent even if we just drew an opaque string)
//
if (m_textBackgroundColour.Ok())
SetTextBkColor( m_hPS
,nOldBackground
);
SetBkMode( m_hPS
,wxTRANSPARENT
);
} }
void wxDC::DoDrawRotatedText(const wxString& text, void wxDC::DoDrawRotatedText(
wxCoord x, wxCoord y, const wxString& rsText
double angle) , wxCoord vX
, wxCoord vY
, double dAngle
)
{ {
if (dAngle == 0.0)
{
DoDrawText( rsText
,vX
,vY
);
}
// TODO: // TODO:
/* /*
if ( angle == 0.0 ) if ( angle == 0.0 )
@@ -405,10 +596,39 @@ void wxDC::SetFont(
} }
} }
void wxDC::SetPen(const wxPen& pen) void wxDC::SetPen(
const wxPen& rPen
)
{ {
// TODO wxCHECK_RET( Ok(), wxT("invalid window dc") );
if (m_pen == rPen)
return;
m_pen = rPen;
if (!m_pen.Ok())
return;
int nWidth = m_pen.GetWidth();
if (nWidth <= 0)
{
nWidth = 1;
}
else
{
double dW = 0.5 +
( fabs((double) XLOG2DEVREL(width)) +
fabs((double) YLOG2DEVREL(width))
) / 2.0;
nWidth = (int)dW;
}
wxColour vColor = m_pen.GetColour();
::GpiSetColor( m_hPS
,vColor.GetPixel()
); //DEbug ??
} }
void wxDC::SetBrush(const wxBrush& brush) void wxDC::SetBrush(const wxBrush& brush)
{ {
// TODO // TODO
@@ -419,9 +639,11 @@ void wxDC::SetBackground(const wxBrush& brush)
// TODO // TODO
} }
void wxDC::SetBackgroundMode(int mode) void wxDC::SetBackgroundMode(
int nMode
)
{ {
// TODO m_backgroundMode = nMode;
} }
void wxDC::SetLogicalFunction(int function) void wxDC::SetLogicalFunction(int function)
@@ -486,24 +708,78 @@ void wxDC::EndPage()
wxCoord wxDC::GetCharHeight() const wxCoord wxDC::GetCharHeight() const
{ {
// TODO // TODO
return(1); return(8);
} }
wxCoord wxDC::GetCharWidth() const wxCoord wxDC::GetCharWidth() const
{ {
// TODO // TODO
return(1); return(8);
} }
void wxDC::DoGetTextExtent( const wxString& string void wxDC::DoGetTextExtent(
,wxCoord* x const wxString& rsString
,wxCoord* y , wxCoord* pvX
,wxCoord* decent , wxCoord* pvY
,wxCoord* externalLeading , wxCoord* pvDecent
,wxFont* theFont , wxCoord* pvExternalLeading
) const , wxFont* pTheFont
) const
{ {
// TODO: POINTL avPoint[TXTBOX_COUNT];
POINTL vPtMin;
POINTL vPtMax;
int i;
int l;
FONTMETRICS vFM; // metrics structure
BOOL bRc;
char* pStr;
ERRORID vErrorCode; // last error id code
wxFont* pFontToUse = (wxFont*)pTheFont;
if (!pFontToUse)
pFontToUse = (wxFont*)&m_font;
l = rsString.length();
pStr = (PCH) rsString.c_str();
//
// In world coordinates.
//
bRc = ::GpiQueryTextBox( m_hPS
,l
,pStr
,TXTBOX_COUNT // return maximum information
,avPoint // array of coordinates points
)
if(!bRc)
{
vErrorCode = ::WinGetLastError(wxGetInstance());
}
vPtMin.x = avPoint[0].x;
vPtMax.x = avPoint[0].x;
vPtMin.y = avPoint[0].y;
vPtMax.y = avPoint[0].y;
for (i = 1; i < 4; i++)
{
if(vPtMin.x > avPoint[i].x) vPtMin.x = avPoint[i].x;
if(vPtMin.y > avPoint[i].y) vPtMin.y = avPoint[i].y;
if(vPtMax.x < avPoint[i].x) vPtMax.x = avPoint[i].x;
if(vPtMax.y < avPoint[i].y) vPtMax.y = avPoint[i].y;
}
::GpiQueryFontMetrics( m_hPS
,sizeof(FONTMETRICS)
,&vFM
);
if (pvX)
*pvX = (wxCoord)(vPtMax.x - vPtMin.x + 1);
if (pvY)
*pvY = (wxCoord)(vPtMax.y - vPtMin.y + 1);
if (pvDescent)
*pvDescent = vFM.lMaxDescender;
if (externalLeading)
*pvExternalLeading = vFM.lExternalLeading;
} }
void wxDC::SetMapMode( int mode ) void wxDC::SetMapMode( int mode )

View File

@@ -117,8 +117,11 @@ wxWindowDC::~wxWindowDC()
// They automatically close with the window, unless explicitly detached // They automatically close with the window, unless explicitly detached
// but we need to destroy our PS // but we need to destroy our PS
// //
::GpiAssociate(m_hPS, NULLHANDLE); if(m_hPS)
::GpiDestroyPS(m_hPS); {
::GpiAssociate(m_hPS, NULLHANDLE);
::GpiDestroyPS(m_hPS);
}
m_hPS = NULLHANDLE; m_hPS = NULLHANDLE;
m_hDC = NULLHANDLE; m_hDC = NULLHANDLE;
} }
@@ -137,17 +140,27 @@ wxClientDC::wxClientDC()
wxClientDC::wxClientDC(wxWindow *the_canvas) wxClientDC::wxClientDC(wxWindow *the_canvas)
{ {
m_pCanvas = the_canvas; SIZEL vSizl = { 0,0};
// m_pCanvas = the_canvas;
// default under PM is that Window and Client DC's are the same
//
m_hDC = (WXHDC) ::WinOpenWindowDC(GetWinHwnd(the_canvas));
// //
// Default mode is BM_LEAVEALONE so we make no call Set the mix // default under PM is that Window and Client DC's are the same
// //
SetBackground(wxBrush(m_pCanvas->GetBackgroundColour(), wxSOLID)); m_hDC = (WXHDC) ::WinOpenWindowDC(GetWinHwnd(the_canvas));
m_hPS = ::GpiCreatePS( wxGetInstance()
,m_hDC
,&sizl
,PU_PELS | GPIF_LONG | GPIA_ASSOC
);
//
// Default mode is BM_LEAVEALONE so we make no call Set the mix
//
SetBackground(wxBrush( m_pCanvas->GetBackgroundColour()
,wxSOLID
)
);
} }
wxClientDC::~wxClientDC() wxClientDC::~wxClientDC()
@@ -191,31 +204,48 @@ wxPaintDC::wxPaintDC()
m_hDC = 0; m_hDC = 0;
} }
wxPaintDC::wxPaintDC(wxWindow *canvas) wxPaintDC::wxPaintDC(
wxWindow* pCanvas
)
{ {
wxCHECK_RET( canvas, wxT("NULL canvas in wxPaintDC ctor") ); wxCHECK_RET( canvas, wxT("NULL canvas in wxPaintDC ctor") );
#ifdef __WXDEBUG__ #ifdef __WXDEBUG__
if ( g_isPainting <= 0 ) if (g_isPainting <= 0)
{ {
wxFAIL_MSG( wxT("wxPaintDC may be created only in EVT_PAINT handler!") ); wxFAIL_MSG( wxT("wxPaintDC may be created only in EVT_PAINT handler!") );
return; return;
} }
#endif // __WXDEBUG__ #endif // __WXDEBUG__
m_pCanvas = canvas; m_pCanvas = pCanvas;
// do we have a DC for this window in the cache? //
wxPaintDCInfo *info = FindInCache(); // Do we have a DC for this window in the cache?
if ( info ) //
wxPaintDCInfo* pInfo = FindInCache();
if (pInfo)
{ {
m_hDC = info->hdc; m_hDC = pInfo->hdc;
info->count++; pInfo->count++;
} }
else // not in cache, create a new one else // not in cache, create a new one
{ {
m_hDC = (WXHDC)::WinBeginPaint(GetWinHwnd(m_pCanvas), NULLHANDLE, &g_paintStruct); HPS hPS;
hPS = ::WinBeginPaint( GetWinHwnd(m_pCanvas)
,NULLHANDLE
,&g_paintStruct
);
if(hPS)
{
m_hOldPS = m_hPS;
m_hPS = hPS;
}
m_bIsPaintTime = TRUE;
m_hDC = (WXHDC) -1; // to satisfy those anonizmous efforts
m_vRclPaint = g_paintStruct;
ms_cache.Add(new wxPaintDCInfo(m_pCanvas, this)); ms_cache.Add(new wxPaintDCInfo(m_pCanvas, this));
} }
SetBackground(wxBrush(m_pCanvas->GetBackgroundColour(), wxSOLID)); SetBackground(wxBrush(m_pCanvas->GetBackgroundColour(), wxSOLID));
@@ -235,7 +265,8 @@ wxPaintDC::~wxPaintDC()
if ( !--info->count ) if ( !--info->count )
{ {
::WinEndPaint(m_hPS); ::WinEndPaint(m_hPS);
m_hPS = m_OldhPS;
m_bIsPaintTime = FALSE;
ms_cache.Remove(index); ms_cache.Remove(index);
} }
//else: cached DC entry is still in use //else: cached DC entry is still in use

View File

@@ -27,6 +27,8 @@
#include "wx/dcprint.h" #include "wx/dcprint.h"
#include "math.h" #include "math.h"
#if wxUSE_PRINTING_ARCHITECTURE
IMPLEMENT_CLASS(wxPrinterDC, wxDC) IMPLEMENT_CLASS(wxPrinterDC, wxDC)
@@ -328,3 +330,4 @@ WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& printDataConst)
return (WXHDC) hDC; return (WXHDC) hDC;
} }
#endif //wxUSE_PRINTING_ARCHITECTURE

View File

@@ -21,6 +21,8 @@
#include "wx/gdicmn.h" #include "wx/gdicmn.h"
#include "wx/dnd.h" #include "wx/dnd.h"
#if wxUSE_DRAG_AND_DROP
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// global // global
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -134,3 +136,4 @@ void wxDropSource::Init()
// TODO // TODO
}; };
#endif //wxUSE_DRAG_AND_DROP

View File

@@ -8,6 +8,36 @@
// Copyright: (c) David Webster // Copyright: (c) David Webster
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#define DEBUG_PRINTF(NAME) { static int raz=0; \
printf( #NAME " %i\n",raz); fflush(stdout); \
raz++; \
}
#include <malloc.h>
#include <stdio.h>
int HeapCheck(void)
{
int rc;
if (_HEAPOK != (rc = _heapchk()))
{
switch(rc)
{
case _HEAPEMPTY:
puts("The heap has not been initialized.");
break;
case _HEAPBADNODE:
puts("A memory node is corrupted or the heap is damaged.");
break;
case _HEAPBADBEGIN:
puts("The heap specified is not valid.");
break;
}
fflush(stdout);
}
return 0;
}
// ============================================================================ // ============================================================================
// declarations // declarations
@@ -17,6 +47,7 @@
// headers // headers
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#include <malloc.h>
// For compilers that support precompilation, includes "wx.h". // For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h" #include "wx/wxprec.h"
@@ -135,6 +166,7 @@ void wxFontRefData::Init(int pointSize,
wxFontRefData::~wxFontRefData() wxFontRefData::~wxFontRefData()
{ {
DEBUG_PRINTF(wxFontRefData::~wxFontRefData!!!)
// TODO: // TODO:
// if ( m_hFont ) // if ( m_hFont )
// { // {
@@ -151,6 +183,9 @@ wxFontRefData::~wxFontRefData()
void wxFont::Init() void wxFont::Init()
{ {
DEBUG_PRINTF(wxFontRefData::~wxFontRefData!!!)
if ( wxTheFontList ) if ( wxTheFontList )
wxTheFontList->Append(this); wxTheFontList->Append(this);
} }
@@ -167,6 +202,7 @@ bool wxFont::Create(int pointSize,
wxFontEncoding encoding) wxFontEncoding encoding)
{ {
UnRef(); UnRef();
DEBUG_PRINTF(wxFontRefData::~wxFontRefData!!!)
m_refData = new wxFontRefData(pointSize, family, style, weight, m_refData = new wxFontRefData(pointSize, family, style, weight,
underlined, faceName, encoding); underlined, faceName, encoding);
@@ -177,8 +213,16 @@ bool wxFont::Create(int pointSize,
wxFont::~wxFont() wxFont::~wxFont()
{ {
int l;
l = sizeof(*this);
HeapCheck();
_heap_check();
if ( wxTheFontList ) if ( wxTheFontList )
wxTheFontList->DeleteObject(this); wxTheFontList->DeleteObject(this);
HeapCheck();
_heap_check();
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -190,6 +234,7 @@ wxFont::~wxFont()
bool wxFont::RealizeResource() bool wxFont::RealizeResource()
{ {
DEBUG_PRINTF(wxFont::RealizeResource)
if ( GetResourceHandle() ) if ( GetResourceHandle() )
{ {
// VZ: the old code returned FALSE in this case, but it doesn't seem // VZ: the old code returned FALSE in this case, but it doesn't seem
@@ -273,7 +318,7 @@ bool wxFont::RealizeResource()
fName.usWeightClass = FWEIGHT_BOLD; fName.usWeightClass = FWEIGHT_BOLD;
break; break;
} }
if( M_FONTDATA->m_underlined ) if( M_FONTDATA->m_underlined )
fAttrs.fsSelection |= FATTR_SEL_UNDERSCORE; fAttrs.fsSelection |= FATTR_SEL_UNDERSCORE;
@@ -339,13 +384,13 @@ bool wxFont::RealizeResource()
break; break;
} }
// Now cheking // Now cheking
fLid = 1; fLid = 1;
hps = ::WinGetPS( HWND_DESKTOP ); hps = ::WinGetPS( HWND_DESKTOP );
long numLids = ::GpiQueryNumberSetIds( hps ); long numLids = ::GpiQueryNumberSetIds( hps );
long gpiError; long gpiError;
// First we should generate unique id // First we should generate unique id
if( numLids ) if( numLids )
{ {
@@ -358,7 +403,7 @@ bool wxFont::RealizeResource()
::WinReleasePS( hps ); ::WinReleasePS( hps );
return 0; return 0;
} }
for(unsigned long LCNum = 0; LCNum < numLids; LCNum++) for(unsigned long LCNum = 0; LCNum < numLids; LCNum++)
if(lIds[LCNum] == fLid) if(lIds[LCNum] == fLid)
++fLid; ++fLid;
@@ -513,7 +558,14 @@ void wxFont::SetEncoding(wxFontEncoding encoding)
int wxFont::GetPointSize() const int wxFont::GetPointSize() const
{ {
return M_FONTDATA->m_pointSize; DEBUG_PRINTF(wxFont::GetPointSize)
wxFontRefData* pTmp;
pTmp = M_FONTDATA;
if(pTmp)
return pTmp->m_pointSize;
else
return 10;
} }
int wxFont::GetFamily() const int wxFont::GetFamily() const

View File

@@ -8,6 +8,10 @@
// Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> // Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows license // Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#define DEBUG_PRINTF(NAME) { static int raz=0; \
printf( #NAME " %i\n",raz); fflush(stdout); \
raz++; \
}
// ============================================================================ // ============================================================================
// declarations // declarations
@@ -85,7 +89,7 @@ bool wxNativeEncodingInfo::FromString(const wxString& s)
wxString wxNativeEncodingInfo::ToString() const wxString wxNativeEncodingInfo::ToString() const
{ {
wxString s; wxString s;
s << (long)encoding << _T(';') << facename; s << (long)encoding << _T(';') << facename;
// TODO: what is this for OS/2? // TODO: what is this for OS/2?
@@ -334,6 +338,8 @@ void wxFillLogFont(LOGFONT *logFont, const wxFont *font)
wxFont wxCreateFontFromLogFont(const LOGFONT *logFont) wxFont wxCreateFontFromLogFont(const LOGFONT *logFont)
{ {
DEBUG_PRINTF(wxCreateFontFromLogFont)
// extract family from pitch-and-family // extract family from pitch-and-family
int lfFamily = logFont->lfPitchAndFamily; int lfFamily = logFont->lfPitchAndFamily;
if ( lfFamily & FIXED_PITCH ) if ( lfFamily & FIXED_PITCH )

View File

@@ -64,6 +64,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// static class members // static class members
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#if wxUSE_STATUSBAR
#if wxUSE_NATIVE_STATUSBAR #if wxUSE_NATIVE_STATUSBAR
bool wxFrame::m_bUseNativeStatusBar = TRUE; bool wxFrame::m_bUseNativeStatusBar = TRUE;
@@ -71,6 +72,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
bool wxFrame::m_bUseNativeStatusBar = FALSE; bool wxFrame::m_bUseNativeStatusBar = FALSE;
#endif #endif
#endif //wxUSE_STATUSBAR
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// creation/destruction // creation/destruction
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -124,8 +127,13 @@ bool wxFrame::Create(
SetName(rsName); SetName(rsName);
m_windowStyle = lulStyle; m_windowStyle = lulStyle;
m_frameMenuBar = NULL; m_frameMenuBar = NULL;
#if wxUSE_TOOLBAR
m_frameToolBar = NULL; m_frameToolBar = NULL;
#endif //wxUSE_TOOLBAR
#if wxUSE_STATUSBAR
m_frameStatusBar = NULL; m_frameStatusBar = NULL;
#endif //wxUSE_STATUSBAR
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE)); SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
@@ -487,12 +495,12 @@ wxStatusBar* wxFrame::OnCreateStatusBar(
if( !pStatusBar ) if( !pStatusBar )
return NULL; return NULL;
// //
// to show statusbar // to show statusbar
// //
if( ::WinIsWindowShowing(GetHWND()) ) if( ::WinIsWindowShowing(GetHWND()) )
::WinSendMsg(GetHWND(), WM_UPDATEFRAME, (MPARAM)~0, 0); ::WinSendMsg(GetHWND(), WM_UPDATEFRAME, (MPARAM)~0, 0);
return pStatusBar; return pStatusBar;
} // end of wxFrame::OnCreateStatusBar } // end of wxFrame::OnCreateStatusBar
@@ -674,6 +682,7 @@ void wxFrame::OnSysColourChanged(
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE)); SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
Refresh(); Refresh();
#if wxUSE_STATUSBAR
if (m_frameStatusBar) if (m_frameStatusBar)
{ {
wxSysColourChangedEvent vEvent2; wxSysColourChangedEvent vEvent2;
@@ -681,6 +690,7 @@ void wxFrame::OnSysColourChanged(
vEvent2.SetEventObject(m_frameStatusBar); vEvent2.SetEventObject(m_frameStatusBar);
m_frameStatusBar->GetEventHandler()->ProcessEvent(vEvent2); m_frameStatusBar->GetEventHandler()->ProcessEvent(vEvent2);
} }
#endif //wxUSE_STATUSBAR
// //
// Propagate the event to the non-top-level children // Propagate the event to the non-top-level children
@@ -702,16 +712,27 @@ bool wxFrame::ShowFullScreen(
m_bFsIsShowing = TRUE; m_bFsIsShowing = TRUE;
m_lFsStyle = lStyle; m_lFsStyle = lStyle;
#if wxUSE_TOOLBAR
wxToolBar* pTheToolBar = GetToolBar(); wxToolBar* pTheToolBar = GetToolBar();
#endif //wxUSE_TOOLBAR
#if wxUSE_STATUSBAR
wxStatusBar* pTheStatusBar = GetStatusBar(); wxStatusBar* pTheStatusBar = GetStatusBar();
#endif //wxUSE_STATUSBAR
int nDummyWidth; int nDummyWidth;
#if wxUSE_TOOLBAR
if (pTheToolBar) if (pTheToolBar)
pTheToolBar->GetSize(&nDummyWidth, &m_nFsToolBarHeight); pTheToolBar->GetSize(&nDummyWidth, &m_nFsToolBarHeight);
#endif //wxUSE_TOOLBAR
#if wxUSE_STATUSBAR
if (pTheStatusBar) if (pTheStatusBar)
pTheStatusBar->GetSize(&nDummyWidth, &m_nFsStatusBarHeight); pTheStatusBar->GetSize(&nDummyWidth, &m_nFsStatusBarHeight);
#endif //wxUSE_STATUSBAR
#if wxUSE_TOOLBAR
// //
// Zap the toolbar, menubar, and statusbar // Zap the toolbar, menubar, and statusbar
// //
@@ -720,6 +741,7 @@ bool wxFrame::ShowFullScreen(
pTheToolBar->SetSize(-1,0); pTheToolBar->SetSize(-1,0);
pTheToolBar->Show(FALSE); pTheToolBar->Show(FALSE);
} }
#endif //wxUSE_TOOLBAR
if (lStyle & wxFULLSCREEN_NOMENUBAR) if (lStyle & wxFULLSCREEN_NOMENUBAR)
{ {
@@ -728,6 +750,7 @@ bool wxFrame::ShowFullScreen(
::WinSendMsg((HWND)GetHWND(), WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0); ::WinSendMsg((HWND)GetHWND(), WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0);
} }
#if wxUSE_STATUSBAR
// //
// Save the number of fields in the statusbar // Save the number of fields in the statusbar
// //
@@ -739,6 +762,7 @@ bool wxFrame::ShowFullScreen(
} }
else else
m_nFsStatusBarFields = 0; m_nFsStatusBarFields = 0;
#endif //wxUSE_STATUSBAR
// //
// Zap the frame borders // Zap the frame borders
@@ -819,6 +843,7 @@ bool wxFrame::ShowFullScreen(
m_bFsIsShowing = FALSE; m_bFsIsShowing = FALSE;
#if wxUSE_TOOLBAR
wxToolBar* pTheToolBar = GetToolBar(); wxToolBar* pTheToolBar = GetToolBar();
// //
@@ -829,12 +854,15 @@ bool wxFrame::ShowFullScreen(
pTheToolBar->SetSize(-1, m_nFsToolBarHeight); pTheToolBar->SetSize(-1, m_nFsToolBarHeight);
pTheToolBar->Show(TRUE); pTheToolBar->Show(TRUE);
} }
#endif //wxUSE_TOOLBAR
#if wxUSE_STATUSBAR
if ((m_lFsStyle & wxFULLSCREEN_NOSTATUSBAR) && (m_nFsStatusBarFields > 0)) if ((m_lFsStyle & wxFULLSCREEN_NOSTATUSBAR) && (m_nFsStatusBarFields > 0))
{ {
CreateStatusBar(m_nFsStatusBarFields); CreateStatusBar(m_nFsStatusBarFields);
// PositionStatusBar(); // PositionStatusBar();
} }
#endif //wxUSE_STATUSBAR
if ((m_lFsStyle & wxFULLSCREEN_NOMENUBAR) && (m_hMenu != 0)) if ((m_lFsStyle & wxFULLSCREEN_NOMENUBAR) && (m_hMenu != 0))
{ {
@@ -977,7 +1005,7 @@ bool wxFrame::OS2Create(
return FALSE; return FALSE;
} }
// //
// Now need to subclass window. // Now need to subclass window.
// //
@@ -1058,6 +1086,7 @@ wxPoint wxFrame::GetClientAreaOrigin() const
{ {
wxPoint vPoint(0, 0); wxPoint vPoint(0, 0);
#if wxUSE_TOOLBAR
if (GetToolBar()) if (GetToolBar())
{ {
int nWidth; int nWidth;
@@ -1077,6 +1106,7 @@ wxPoint wxFrame::GetClientAreaOrigin() const
vPoint.y += nHeight; vPoint.y += nHeight;
} }
} }
#endif //wxUSE_TOOLBAR
return vPoint; return vPoint;
} // end of wxFrame::GetClientAreaOrigin } // end of wxFrame::GetClientAreaOrigin
@@ -1199,8 +1229,12 @@ bool wxFrame::OS2TranslateMessage(
if (!pMenuBar ) if (!pMenuBar )
return FALSE; return FALSE;
#if wxUSE_ACCEL
const wxAcceleratorTable& rAcceleratorTable = pMenuBar->GetAccelTable(); const wxAcceleratorTable& rAcceleratorTable = pMenuBar->GetAccelTable();
return rAcceleratorTable.Translate(GetHWND(), pMsg); return rAcceleratorTable.Translate(GetHWND(), pMsg);
#else
return FALSE;
#endif //wxUSE_ACCEL
} // end of wxFrame::OS2TranslateMessage } // end of wxFrame::OS2TranslateMessage
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
@@ -1334,7 +1368,10 @@ bool wxFrame::HandleSize(
#endif // wxUSE_NATIVE_STATUSBAR #endif // wxUSE_NATIVE_STATUSBAR
// PositionStatusBar(); // PositionStatusBar();
#if wxUSE_TOOLBAR
PositionToolBar(); PositionToolBar();
#endif // wxUSE_TOOLBAR
wxSizeEvent vEvent( wxSize( nX wxSizeEvent vEvent( wxSize( nX
,nY ,nY
) )
@@ -1534,8 +1571,11 @@ MRESULT wxFrame::OS2WindowProc(
case WM_QUERYFRAMECTLCOUNT: case WM_QUERYFRAMECTLCOUNT:
{ {
USHORT itemCount = SHORT1FROMMR(OS2GetOldWndProc()(GetHWND(), uMessage, wParam, lParam)); USHORT itemCount = SHORT1FROMMR(OS2GetOldWndProc()(GetHWND(), uMessage, wParam, lParam));
#if wxUSE_STATUSBAR
if(m_frameStatusBar) if(m_frameStatusBar)
++itemCount; ++itemCount;
#endif //wxUSE_STATUSBAR
bProcessed = TRUE; bProcessed = TRUE;
mRc = MRFROMSHORT( itemCount ); mRc = MRFROMSHORT( itemCount );
} }
@@ -1556,12 +1596,13 @@ MRESULT wxFrame::OS2WindowProc(
&& usClient < itemCount) && usClient < itemCount)
usClient++; usClient++;
#if wxUSE_STATUSBAR
if(m_frameStatusBar) if(m_frameStatusBar)
{ {
int height; int height;
m_frameStatusBar->GetSize(NULL, &height); m_frameStatusBar->GetSize(NULL, &height);
if(usClient == itemCount) if(usClient == itemCount)
{ {
// frame has no client window // frame has no client window
@@ -1601,6 +1642,8 @@ MRESULT wxFrame::OS2WindowProc(
++itemCount; ++itemCount;
} }
} }
#endif //wxUSE_STATUSBAR
bProcessed = TRUE; bProcessed = TRUE;
mRc = MRFROMSHORT(itemCount); mRc = MRFROMSHORT(itemCount);
} }

View File

@@ -21,7 +21,9 @@
#include <wx/dynarray.h> #include <wx/dynarray.h>
#include <wx/log.h> #include <wx/log.h>
#include <wx/config.h> #include <wx/config.h>
#if wxUSE_CONFIG
#include <wx/os2/iniconf.h> #include <wx/os2/iniconf.h>
@@ -461,3 +463,5 @@ bool wxIniConfig::RenameGroup(const wxString& oldName, const wxString& newName)
// Not implemented // Not implemented
return FALSE; return FALSE;
} }
#endif //wxUSE_CONFIG

View File

@@ -30,6 +30,8 @@
#include "wx/dynarray.h" #include "wx/dynarray.h"
#include "wx/log.h" #include "wx/log.h"
#if wxUSE_LISTBOX
#if wxUSE_OWNER_DRAWN #if wxUSE_OWNER_DRAWN
#include "wx/ownerdrw.h" #include "wx/ownerdrw.h"
#endif #endif
@@ -774,3 +776,5 @@ bool wxListBox::OS2OnDraw(WXDRAWITEMSTRUCT *item)
} }
#endif #endif
// wxUSE_OWNER_DRAWN // wxUSE_OWNER_DRAWN
#endif //wxUSE_LISTBOX

View File

@@ -996,7 +996,12 @@ MRESULT wxMDIChildFrame::OS2DefWindowProc(WXUINT message, WXWPARAM wParam, WXLPA
bool wxMDIChildFrame::OS2TranslateMessage(WXMSG* msg) bool wxMDIChildFrame::OS2TranslateMessage(WXMSG* msg)
{ {
#if wxUSE_ACCEL
return m_acceleratorTable.Translate(GetParent()->GetHWND(), msg); return m_acceleratorTable.Translate(GetParent()->GetHWND(), msg);
#else
return FALSE;
#endif //wxUSE_ACCEL
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------

View File

@@ -27,6 +27,8 @@
#include "wx/dynarray.h" #include "wx/dynarray.h"
#include "wx/confbase.h" #include "wx/confbase.h"
#if wxUSE_FILE
#include "wx/os2/mimetype.h" #include "wx/os2/mimetype.h"
// other standard headers // other standard headers
@@ -450,3 +452,4 @@ size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& mimetypes)
return 0; return 0;
} }
#endif //wxUSE_FILE

View File

@@ -347,8 +347,11 @@ void wxNotebook::OnSize(wxSizeEvent& event)
for ( unsigned int nPage = 0; nPage < nCount; nPage++ ) { for ( unsigned int nPage = 0; nPage < nCount; nPage++ ) {
wxNotebookPage *pPage = m_aPages[nPage]; wxNotebookPage *pPage = m_aPages[nPage];
pPage->SetSize(0, 0, w, h); pPage->SetSize(0, 0, w, h);
#if wxUSE_CONSTRAINTS
if ( pPage->GetAutoLayout() ) if ( pPage->GetAutoLayout() )
pPage->Layout(); pPage->Layout();
#endif //wxUSE_CONSTRAINTS
} }
// Processing continues to next OnSize // Processing continues to next OnSize
@@ -410,8 +413,10 @@ void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
void wxNotebook::SetConstraintSizes(bool /* recurse */) void wxNotebook::SetConstraintSizes(bool /* recurse */)
{ {
#if wxUSE_CONSTRAINTS
// don't set the sizes of the pages - their correct size is not yet known // don't set the sizes of the pages - their correct size is not yet known
wxControl::SetConstraintSizes(FALSE); wxControl::SetConstraintSizes(FALSE);
#endif
} }
bool wxNotebook::DoPhase(int /* nPhase */) bool wxNotebook::DoPhase(int /* nPhase */)

View File

@@ -26,6 +26,8 @@
#include "wx/utils.h" #include "wx/utils.h"
#endif #endif
#if wxUSE_OWNER_DRAWN
#include "wx/ownerdrw.h" #include "wx/ownerdrw.h"
#include "wx/menuitem.h" #include "wx/menuitem.h"
@@ -192,3 +194,4 @@ bool wxOwnerDrawn::OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODSt
return TRUE; return TRUE;
} }
#endif //wxUSE_OWNER_DRAWN

View File

@@ -19,6 +19,7 @@
#include "wx/app.h" #include "wx/app.h"
#endif #endif
#if wxUSE_PRINTING_ARCHITECTURE
#include "wx/os2/print.h" #include "wx/os2/print.h"
#include "wx/generic/prntdlgg.h" #include "wx/generic/prntdlgg.h"
@@ -94,3 +95,4 @@ void wxPrintPreview::DetermineScaling()
// TODO // TODO
} }
#endif //wxUSE_PRINTING_ARCHITECTURE

View File

@@ -44,7 +44,6 @@ wxColour wxSystemSettings::GetSystemColour(
,GetGValue(vRef) ,GetGValue(vRef)
,GetBValue(vRef) ,GetBValue(vRef)
); );
return vCol;
break; break;
case wxSYS_COLOUR_WINDOWFRAME: case wxSYS_COLOUR_WINDOWFRAME:
@@ -56,7 +55,6 @@ wxColour wxSystemSettings::GetSystemColour(
,GetGValue(vRef) ,GetGValue(vRef)
,GetBValue(vRef) ,GetBValue(vRef)
); );
return vCol;
break; break;
case wxSYS_COLOUR_MENUTEXT: case wxSYS_COLOUR_MENUTEXT:
@@ -79,7 +77,6 @@ wxColour wxSystemSettings::GetSystemColour(
,GetGValue(vRef) ,GetGValue(vRef)
,GetBValue(vRef) ,GetBValue(vRef)
); );
return vCol;
break; break;
case wxSYS_COLOUR_BTNSHADOW: case wxSYS_COLOUR_BTNSHADOW:
@@ -91,7 +88,6 @@ wxColour wxSystemSettings::GetSystemColour(
,GetGValue(vRef) ,GetGValue(vRef)
,GetBValue(vRef) ,GetBValue(vRef)
); );
return vCol;
break; break;
case wxSYS_COLOUR_BTNHIGHLIGHT: case wxSYS_COLOUR_BTNHIGHLIGHT:
@@ -103,7 +99,6 @@ wxColour wxSystemSettings::GetSystemColour(
,GetGValue(vRef) ,GetGValue(vRef)
,GetBValue(vRef) ,GetBValue(vRef)
); );
return vCol;
break; break;
// //
@@ -118,7 +113,7 @@ wxColour wxSystemSettings::GetSystemColour(
case wxSYS_COLOUR_INACTIVECAPTIONTEXT: case wxSYS_COLOUR_INACTIVECAPTIONTEXT:
case wxSYS_COLOUR_BTNTEXT: case wxSYS_COLOUR_BTNTEXT:
case wxSYS_COLOUR_INFOTEXT: case wxSYS_COLOUR_INFOTEXT:
return(*wxBLACK); vCol = (*wxBLACK);
break; break;
// //
@@ -128,7 +123,7 @@ wxColour wxSystemSettings::GetSystemColour(
case wxSYS_COLOUR_ACTIVECAPTION: case wxSYS_COLOUR_ACTIVECAPTION:
case wxSYS_COLOUR_ACTIVEBORDER: case wxSYS_COLOUR_ACTIVEBORDER:
case wxSYS_COLOUR_HIGHLIGHT: case wxSYS_COLOUR_HIGHLIGHT:
return(*wxBLUE); vCol = (*wxBLUE);
break; break;
case wxSYS_COLOUR_SCROLLBAR: case wxSYS_COLOUR_SCROLLBAR:
@@ -142,7 +137,7 @@ wxColour wxSystemSettings::GetSystemColour(
case wxSYS_COLOUR_3DDKSHADOW: case wxSYS_COLOUR_3DDKSHADOW:
case wxSYS_COLOUR_3DLIGHT: case wxSYS_COLOUR_3DLIGHT:
case wxSYS_COLOUR_INFOBK: case wxSYS_COLOUR_INFOBK:
return(*wxLIGHT_GREY); vCol = (*wxLIGHT_GREY);
break; break;
default: default:
@@ -154,7 +149,6 @@ wxColour wxSystemSettings::GetSystemColour(
,GetGValue(vRef) ,GetGValue(vRef)
,GetBValue(vRef) ,GetBValue(vRef)
); );
return vCol;
break; break;
} }
return(vCol); return(vCol);
@@ -187,8 +181,10 @@ wxFont wxSystemSettings::GetSystemFont(int index)
break; break;
} }
} }
if(wxSWISS_FONT)
return *wxSWISS_FONT;
return *wxSWISS_FONT; return wxNullFont;
} }
// Get a system metric, e.g. scrollbar size // Get a system metric, e.g. scrollbar size

View File

@@ -21,6 +21,7 @@
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/wx.h" #include "wx/wx.h"
#endif #endif
#if wxUSE_SPINBTN
// Can't resolve reference to CreateUpDownControl in // Can't resolve reference to CreateUpDownControl in
// TWIN32, but could probably use normal CreateWindow instead. // TWIN32, but could probably use normal CreateWindow instead.
@@ -159,3 +160,4 @@ bool wxSpinButton::OS2Command(WXUINT cmd, WXWORD id)
return FALSE; return FALSE;
} }
#endif //wxUSE_SPINBTN

View File

@@ -31,6 +31,8 @@
#include "wx/wx.h" #include "wx/wx.h"
#endif #endif
#if wxUSE_SPINBTN
#include "wx/spinctrl.h" #include "wx/spinctrl.h"
#include "wx/os2/private.h" #include "wx/os2/private.h"
@@ -292,3 +294,5 @@ void wxSpinCtrl::DoMoveWindow(int x, int y, int width, int height)
} }
*/ */
} }
#endif //wxUSE_SPINBTN

View File

@@ -23,7 +23,7 @@
#define INCL_DOSFILEMGR #define INCL_DOSFILEMGR
#define INCL_WIN #define INCL_WIN
#define INCL_GPI #define INCL_GPI
#define INCL_PM #define INCL_PM
#include <os2.h> #include <os2.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@@ -86,6 +86,7 @@ bool wxWave::Create(const wxString& fileName, bool isResource)
else else
{ {
m_isResource = FALSE; m_isResource = FALSE;
#if wxUSE_FILE
wxFile fileWave; wxFile fileWave;
if (!fileWave.Open(fileName, wxFile::read)) if (!fileWave.Open(fileName, wxFile::read))
@@ -101,6 +102,9 @@ bool wxWave::Create(const wxString& fileName, bool isResource)
fileWave.Read(m_waveData, m_waveLength); fileWave.Read(m_waveData, m_waveLength);
*/ */
return TRUE; return TRUE;
#else
return FALSE;
#endif //wxUSE_FILE
} }
} }

View File

@@ -37,6 +37,11 @@
#include <stdio.h> #include <stdio.h>
#endif #endif
#define DEBUG_PRINTF(NAME) { static int raz=0; \
printf( #NAME " %i\n",raz); fflush(stdout); \
raz++; \
}
#if wxUSE_OWNER_DRAWN #if wxUSE_OWNER_DRAWN
#include "wx/ownerdrw.h" #include "wx/ownerdrw.h"
#endif #endif
@@ -244,6 +249,9 @@ bool wxWindow::OS2Command(
, WXWORD WXUNUSED(uId) , WXWORD WXUNUSED(uId)
) )
{ {
DEBUG_PRINTF(wxWindow::OS2Command);
return(FALSE); return(FALSE);
} }
@@ -293,6 +301,9 @@ void wxWindow::Init()
m_lLastMouseY = -1; m_lLastMouseY = -1;
m_nLastMouseEvent = -1; m_nLastMouseEvent = -1;
#endif // wxUSE_MOUSEEVENT_HACK #endif // wxUSE_MOUSEEVENT_HACK
DEBUG_PRINTF(wxWindow::Init-End);
} // wxWindow::Init } // wxWindow::Init
// //
@@ -300,6 +311,7 @@ void wxWindow::Init()
// //
wxWindow::~wxWindow() wxWindow::~wxWindow()
{ {
DEBUG_PRINTF(wxWindow::~wxWindow-Start);
m_isBeingDeleted = TRUE; m_isBeingDeleted = TRUE;
OS2DetachWindowMenu(); OS2DetachWindowMenu();
@@ -318,6 +330,7 @@ wxWindow::~wxWindow()
// //
wxRemoveHandleAssociation(this); wxRemoveHandleAssociation(this);
} }
DEBUG_PRINTF(wxWindow::~wxWindow-End);
} // end of wxWindow::~wxWindow } // end of wxWindow::~wxWindow
bool wxWindow::Create( bool wxWindow::Create(
@@ -500,6 +513,7 @@ bool wxWindow::SetFont(
const wxFont& rFont const wxFont& rFont
) )
{ {
DEBUG_PRINTF(wxWindow::SetFont);
if (!wxWindowBase::SetFont(rFont)) if (!wxWindowBase::SetFont(rFont))
{ {
// nothing to do // nothing to do
@@ -1505,6 +1519,8 @@ MRESULT wxWindow::OS2DefWindowProc(
, WXLPARAM lParam , WXLPARAM lParam
) )
{ {
DEBUG_PRINTF(wxWindow::OS2DefWindowProc);
if (m_fnOldWndProc) if (m_fnOldWndProc)
return (MRESULT)m_fnOldWndProc(GetHWND(), (ULONG)uMsg, (MPARAM)wParam, (MPARAM)lParam); return (MRESULT)m_fnOldWndProc(GetHWND(), (ULONG)uMsg, (MPARAM)wParam, (MPARAM)lParam);
else else
@@ -1517,6 +1533,8 @@ bool wxWindow::OS2ProcessMessage(
{ {
QMSG* pQMsg = (QMSG*)pMsg; QMSG* pQMsg = (QMSG*)pMsg;
DEBUG_PRINTF(OS2ProcessMessage);
if (m_hWnd != 0 && (GetWindowStyleFlag() & wxTAB_TRAVERSAL)) if (m_hWnd != 0 && (GetWindowStyleFlag() & wxTAB_TRAVERSAL))
{ {
// //
@@ -1703,7 +1721,11 @@ bool wxWindow::OS2TranslateMessage(
WXMSG* pMsg WXMSG* pMsg
) )
{ {
return m_acceleratorTable.Translate(m_hWnd, pMsg); #if wxUSE_ACCEL
return m_acceleratorTable.Translate(m_hWnd, pMsg);
#else
return FALSE;
#endif //wxUSE_ACCEL
} // end of wxWindow::OS2TranslateMessage } // end of wxWindow::OS2TranslateMessage
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
@@ -1789,6 +1811,7 @@ MRESULT EXPENTRY wxWndProc(
// Trace all ulMsgs - useful for the debugging // Trace all ulMsgs - useful for the debugging
// //
#ifdef __WXDEBUG__ #ifdef __WXDEBUG__
DEBUG_PRINTF(__WXDEBUG__wxWndProc);
wxLogTrace(wxTraceMessages, wxT("Processing %s(wParam=%8lx, lParam=%8lx)"), wxLogTrace(wxTraceMessages, wxT("Processing %s(wParam=%8lx, lParam=%8lx)"),
wxGetMessageName(ulMsg), wParam, lParam); wxGetMessageName(ulMsg), wParam, lParam);
#endif // __WXDEBUG__ #endif // __WXDEBUG__
@@ -1928,6 +1951,7 @@ MRESULT wxWindow::OS2WindowProc(
break; break;
case WM_PAINT: case WM_PAINT:
DEBUG_PRINTF(WM_PAINT)
bProcessed = HandlePaint(); bProcessed = HandlePaint();
break; break;
@@ -1938,9 +1962,11 @@ MRESULT wxWindow::OS2WindowProc(
// //
bProcessed = TRUE; bProcessed = TRUE;
mResult = (MRESULT)TRUE; mResult = (MRESULT)TRUE;
DEBUG_PRINTF(WM_CLOSE)
break; break;
case WM_SHOW: case WM_SHOW:
DEBUG_PRINTF(WM_SHOW)
bProcessed = HandleShow(wParam != 0, (int)lParam); bProcessed = HandleShow(wParam != 0, (int)lParam);
break; break;
@@ -1979,9 +2005,11 @@ MRESULT wxWindow::OS2WindowProc(
{ {
WORD id, cmd; WORD id, cmd;
WXHWND hwnd; WXHWND hwnd;
DEBUG_PRINTF(WM_COMMAND-in)
UnpackCommand(wParam, lParam, &id, &hwnd, &cmd); UnpackCommand(wParam, lParam, &id, &hwnd, &cmd);
bProcessed = HandleCommand(id, cmd, hwnd); bProcessed = HandleCommand(id, cmd, hwnd);
DEBUG_PRINTF(WM_COMMAND-out)
} }
break; break;
@@ -2828,12 +2856,21 @@ bool wxWindow::HandlePaint()
wxLogLastError("CreateRectRgn"); wxLogLastError("CreateRectRgn");
return FALSE; return FALSE;
} }
//
// Debug code
//
#ifdef __WXDEBUG__
{
HWND hWnd
HWND hWnd0 = NULLHANDLE;
hWnd = GetHwnd();
if(hWnd != hWnd0)
printf("HandlePaint hWnd=%x ",hWnd);
}
#endif
m_updateRegion = wxRegion(hRgn); m_updateRegion = wxRegion(hRgn);
/*
hPS = WinBeginPaint(GetHWND(), 0L, &vRect);
WinFillRect(hPS, &vRect, SYSCLR_WINDOW);
WinEndPaint(hPS);
*/
vEvent.SetEventObject(this); vEvent.SetEventObject(this);
return (GetEventHandler()->ProcessEvent(vEvent)); return (GetEventHandler()->ProcessEvent(vEvent));
} // end of wxWindow::HandlePaint } // end of wxWindow::HandlePaint
@@ -3982,7 +4019,6 @@ wxWindow* wxFindWindowAtPointer(wxPoint& pt)
wxWindow* wxFindWindowAtPoint(const wxPoint& pt) wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
{ {
#if 0
POINT pt2; POINT pt2;
pt2.x = pt.x; pt2.x = pt.x;
pt2.y = pt.y; pt2.y = pt.y;
@@ -3998,18 +4034,6 @@ wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
win = wxFindWinFromHandle((WXHWND) hWnd) ; win = wxFindWinFromHandle((WXHWND) hWnd) ;
} }
return win; return win;
#endif
return (wxWindow*)NULL;
} }
// Get the current mouse position.
wxPoint wxGetMousePosition()
{
#if 0
POINT pt;
GetCursorPos( & pt );
return wxPoint(pt.x, pt.y);
#endif
return wxPoint(0,0);
}