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
//
return TRUE;
} // end of wxApp::Initialize
+const char* CANTREGISTERCLASS = " Can't register Class ";
// ---------------------------------------------------------------------------
// RegisterWindowClasses
// ---------------------------------------------------------------------------
#endif // wxUSE_LOG
} // end of wxApp::CleanUp
+//----------------------------------------------------------------------
+// Main wxWindows entry point
+//----------------------------------------------------------------------
int wxEntry(
int argc
, char* argv[]
// nRetValue = -1;
}
}
-
+// Normal exit
wxWindow* pTopWindow = wxTheApp->GetTopWindow();
if (pTopWindow)
wxTheApp->SetTopWindow(NULL);
}
}
+ else // app initialization failed
+ {
+ wxLogLastError(" Gui initialization failed, exitting");
+ }
+#if wxUSE_CONSOLEDEBUG
+ printf("wxTheApp->OnExit ");
+ fflush(stdout);
+#endif
wxTheApp->OnExit();
+#if wxUSE_CONSOLEDEBUG
+ printf("wxApp::CleanUp ");
+ fflush(stdout);
+#endif
wxApp::CleanUp();
+#if wxUSE_CONSOLEDEBUG
+ printf("return %i ", nRetValue);
+ fflush(stdout);
+#endif
return(nRetValue);
} // end of wxEntry
{
BOOL bRc = ::WinGetMsg(vHabmain, &svCurrentMsg, HWND(NULL), 0, 0);
-// wxUsleep(1000);
if (bRc == 0)
{
// got WM_QUIT
if((CHARMSG(pChmsg)->fs & (KC_ALT | KC_CTRL)) && CHARMSG(pChmsg)->chr != 0)
CHARMSG(pChmsg)->chr = (USHORT)wxToupper((UCHAR)uSch);
-
+
for(pWnd = pWndThis; pWnd; pWnd = pWnd->GetParent() )
{
if((bRc = pWnd->OS2TranslateMessage(pWxmsg)) == TRUE)
break;
}
-
+
if(!bRc) // untranslated, should restore original value
CHARMSG(pChmsg)->chr = uSch;
}
memcpy(m_pngData, pBuf, m_pngSize);
+#if wxUSE_STREAMS
wxMemoryInputStream vMstream((char*)m_pngData, m_pngSize);
wxImage vImage;
wxPNGHandler vHandler;
}
m_bitmap = vImage.ConvertToBitmap();
+#endif //wxUSE_STREAMS
+
return m_bitmap.Ok();
}
if (!m_bitmap.Ok())
return;
+#if wxUSE_STREAMS
wxImage vImage(m_bitmap);
wxPNGHandler vHandler;
wxCountingOutputStream vCount;
wxMemoryOutputStream vMstream((char*) m_pngData, m_pngSize);
vHandler.SaveFile(&vImage, vMstream );
+#endif
}
// convert degrees to radians
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
// ===========================================================================
wxDC::wxDC(void)
{
- m_pCanvas = NULL;
+ m_pCanvas = NULL;
- m_hOldBitmap = 0;
- m_hOldPen = 0;
- m_hOldBrush = 0;
- m_hOldFont = 0;
- m_hOldPalette = 0;
+ m_hOldBitmap = 0;
+ m_hOldPen = 0;
+ m_hOldBrush = 0;
+ m_hOldFont = 0;
+ m_hOldPalette = 0;
- m_bOwnsDC = FALSE;
- m_hDC = 0;
- m_nDCCount = 0;
+ m_bOwnsDC = FALSE;
+ m_hDC = 0;
+ m_nDCCount = 0;
+ m_hOldPS = NULL;
+ m_hPS = NULL;
+ m_bIsPaintTime = FALSE;// True at Paint Time
};
wxDC::~wxDC(void)
// 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
// 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
- ,wxCoord width, wxCoord height
- ,double radius
- )
+void wxDC::DoDrawRoundedRectangle(
+ wxCoord vX
+, 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)
// 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()
+ );
+ }
-void wxDC::DoDrawRotatedText(const wxString& text,
- wxCoord x, wxCoord y,
- double angle)
+ 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& rsText
+, wxCoord vX
+, wxCoord vY
+, double dAngle
+)
{
+ if (dAngle == 0.0)
+ {
+ DoDrawText( rsText
+ ,vX
+ ,vY
+ );
+ }
+
// TODO:
/*
if ( angle == 0.0 )
}
}
-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)
{
// TODO
// TODO
}
-void wxDC::SetBackgroundMode(int mode)
+void wxDC::SetBackgroundMode(
+ int nMode
+)
{
- // TODO
+ m_backgroundMode = nMode;
}
void wxDC::SetLogicalFunction(int function)
wxCoord wxDC::GetCharHeight() const
{
// TODO
- return(1);
+ return(8);
}
wxCoord wxDC::GetCharWidth() const
{
// TODO
- return(1);
-}
+ return(8);
+}
+
+void wxDC::DoGetTextExtent(
+ const wxString& rsString
+, wxCoord* pvX
+, wxCoord* pvY
+, wxCoord* pvDecent
+, wxCoord* pvExternalLeading
+, wxFont* pTheFont
+) const
+{
+ 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();
-void wxDC::DoGetTextExtent( const wxString& string
- ,wxCoord* x
- ,wxCoord* y
- ,wxCoord* decent
- ,wxCoord* externalLeading
- ,wxFont* theFont
- ) const
-{
- // TODO:
+ //
+ // 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 )
// They automatically close with the window, unless explicitly detached
// but we need to destroy our PS
//
- ::GpiAssociate(m_hPS, NULLHANDLE);
- ::GpiDestroyPS(m_hPS);
+ if(m_hPS)
+ {
+ ::GpiAssociate(m_hPS, NULLHANDLE);
+ ::GpiDestroyPS(m_hPS);
+ }
m_hPS = NULLHANDLE;
m_hDC = NULLHANDLE;
}
wxClientDC::wxClientDC(wxWindow *the_canvas)
{
- m_pCanvas = the_canvas;
+ SIZEL vSizl = { 0,0};
- //
- // default under PM is that Window and Client DC's are the same
- //
- m_hDC = (WXHDC) ::WinOpenWindowDC(GetWinHwnd(the_canvas));
+ m_pCanvas = the_canvas;
- //
- // Default mode is BM_LEAVEALONE so we make no call Set the mix
- //
- SetBackground(wxBrush(m_pCanvas->GetBackgroundColour(), wxSOLID));
+ //
+ // default under PM is that Window and Client DC's are the same
+ //
+ 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()
m_hDC = 0;
}
-wxPaintDC::wxPaintDC(wxWindow *canvas)
+wxPaintDC::wxPaintDC(
+ wxWindow* pCanvas
+)
{
wxCHECK_RET( canvas, wxT("NULL canvas in wxPaintDC ctor") );
#ifdef __WXDEBUG__
- if ( g_isPainting <= 0 )
+ if (g_isPainting <= 0)
{
wxFAIL_MSG( wxT("wxPaintDC may be created only in EVT_PAINT handler!") );
-
return;
}
#endif // __WXDEBUG__
- m_pCanvas = canvas;
+ m_pCanvas = pCanvas;
- // do we have a DC for this window in the cache?
- wxPaintDCInfo *info = FindInCache();
- if ( info )
+ //
+ // Do we have a DC for this window in the cache?
+ //
+ wxPaintDCInfo* pInfo = FindInCache();
+
+ if (pInfo)
{
- m_hDC = info->hdc;
- info->count++;
+ m_hDC = pInfo->hdc;
+ pInfo->count++;
}
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));
}
SetBackground(wxBrush(m_pCanvas->GetBackgroundColour(), wxSOLID));
if ( !--info->count )
{
::WinEndPaint(m_hPS);
-
+ m_hPS = m_OldhPS;
+ m_bIsPaintTime = FALSE;
ms_cache.Remove(index);
}
//else: cached DC entry is still in use
#include "wx/dcprint.h"
#include "math.h"
+#if wxUSE_PRINTING_ARCHITECTURE
+
IMPLEMENT_CLASS(wxPrinterDC, wxDC)
return (WXHDC) hDC;
}
+#endif //wxUSE_PRINTING_ARCHITECTURE
#include "wx/gdicmn.h"
#include "wx/dnd.h"
+#if wxUSE_DRAG_AND_DROP
+
// ----------------------------------------------------------------------------
// global
// ----------------------------------------------------------------------------
// TODO
};
+#endif //wxUSE_DRAG_AND_DROP
// Copyright: (c) David Webster
// 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
// headers
// ----------------------------------------------------------------------------
+ #include <malloc.h>
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
wxFontRefData::~wxFontRefData()
{
+DEBUG_PRINTF(wxFontRefData::~wxFontRefData!!!)
// TODO:
// if ( m_hFont )
// {
void wxFont::Init()
{
+
+DEBUG_PRINTF(wxFontRefData::~wxFontRefData!!!)
+
if ( wxTheFontList )
wxTheFontList->Append(this);
}
wxFontEncoding encoding)
{
UnRef();
+DEBUG_PRINTF(wxFontRefData::~wxFontRefData!!!)
m_refData = new wxFontRefData(pointSize, family, style, weight,
underlined, faceName, encoding);
wxFont::~wxFont()
{
+ int l;
+ l = sizeof(*this);
+HeapCheck();
+ _heap_check();
+
if ( wxTheFontList )
wxTheFontList->DeleteObject(this);
+HeapCheck();
+ _heap_check();
+
}
// ----------------------------------------------------------------------------
bool wxFont::RealizeResource()
{
+DEBUG_PRINTF(wxFont::RealizeResource)
if ( GetResourceHandle() )
{
// VZ: the old code returned FALSE in this case, but it doesn't seem
fName.usWeightClass = FWEIGHT_BOLD;
break;
}
-
+
if( M_FONTDATA->m_underlined )
fAttrs.fsSelection |= FATTR_SEL_UNDERSCORE;
break;
}
-// Now cheking
+// Now cheking
fLid = 1;
hps = ::WinGetPS( HWND_DESKTOP );
long numLids = ::GpiQueryNumberSetIds( hps );
long gpiError;
-
+
// First we should generate unique id
if( numLids )
{
::WinReleasePS( hps );
return 0;
}
-
+
for(unsigned long LCNum = 0; LCNum < numLids; LCNum++)
if(lIds[LCNum] == fLid)
++fLid;
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
// Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
+#define DEBUG_PRINTF(NAME) { static int raz=0; \
+ printf( #NAME " %i\n",raz); fflush(stdout); \
+ raz++; \
+ }
// ============================================================================
// declarations
wxString wxNativeEncodingInfo::ToString() const
{
wxString s;
-
+
s << (long)encoding << _T(';') << facename;
// TODO: what is this for OS/2?
wxFont wxCreateFontFromLogFont(const LOGFONT *logFont)
{
+DEBUG_PRINTF(wxCreateFontFromLogFont)
+
// extract family from pitch-and-family
int lfFamily = logFont->lfPitchAndFamily;
if ( lfFamily & FIXED_PITCH )
// ----------------------------------------------------------------------------
// static class members
// ----------------------------------------------------------------------------
+#if wxUSE_STATUSBAR
#if wxUSE_NATIVE_STATUSBAR
bool wxFrame::m_bUseNativeStatusBar = TRUE;
bool wxFrame::m_bUseNativeStatusBar = FALSE;
#endif
+#endif //wxUSE_STATUSBAR
+
// ----------------------------------------------------------------------------
// creation/destruction
// ----------------------------------------------------------------------------
SetName(rsName);
m_windowStyle = lulStyle;
m_frameMenuBar = NULL;
+#if wxUSE_TOOLBAR
m_frameToolBar = NULL;
+#endif //wxUSE_TOOLBAR
+
+#if wxUSE_STATUSBAR
m_frameStatusBar = NULL;
+#endif //wxUSE_STATUSBAR
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
if( !pStatusBar )
return NULL;
- //
+ //
// to show statusbar
//
if( ::WinIsWindowShowing(GetHWND()) )
::WinSendMsg(GetHWND(), WM_UPDATEFRAME, (MPARAM)~0, 0);
-
+
return pStatusBar;
} // end of wxFrame::OnCreateStatusBar
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
Refresh();
+#if wxUSE_STATUSBAR
if (m_frameStatusBar)
{
wxSysColourChangedEvent vEvent2;
vEvent2.SetEventObject(m_frameStatusBar);
m_frameStatusBar->GetEventHandler()->ProcessEvent(vEvent2);
}
+#endif //wxUSE_STATUSBAR
//
// Propagate the event to the non-top-level children
m_bFsIsShowing = TRUE;
m_lFsStyle = lStyle;
+#if wxUSE_TOOLBAR
wxToolBar* pTheToolBar = GetToolBar();
+#endif //wxUSE_TOOLBAR
+
+#if wxUSE_STATUSBAR
wxStatusBar* pTheStatusBar = GetStatusBar();
+#endif //wxUSE_STATUSBAR
int nDummyWidth;
+#if wxUSE_TOOLBAR
if (pTheToolBar)
pTheToolBar->GetSize(&nDummyWidth, &m_nFsToolBarHeight);
+#endif //wxUSE_TOOLBAR
+
+#if wxUSE_STATUSBAR
if (pTheStatusBar)
pTheStatusBar->GetSize(&nDummyWidth, &m_nFsStatusBarHeight);
+#endif //wxUSE_STATUSBAR
+#if wxUSE_TOOLBAR
//
// Zap the toolbar, menubar, and statusbar
//
pTheToolBar->SetSize(-1,0);
pTheToolBar->Show(FALSE);
}
+#endif //wxUSE_TOOLBAR
if (lStyle & wxFULLSCREEN_NOMENUBAR)
{
::WinSendMsg((HWND)GetHWND(), WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0);
}
+#if wxUSE_STATUSBAR
//
// Save the number of fields in the statusbar
//
}
else
m_nFsStatusBarFields = 0;
+#endif //wxUSE_STATUSBAR
//
// Zap the frame borders
m_bFsIsShowing = FALSE;
+#if wxUSE_TOOLBAR
wxToolBar* pTheToolBar = GetToolBar();
//
pTheToolBar->SetSize(-1, m_nFsToolBarHeight);
pTheToolBar->Show(TRUE);
}
+#endif //wxUSE_TOOLBAR
+#if wxUSE_STATUSBAR
if ((m_lFsStyle & wxFULLSCREEN_NOSTATUSBAR) && (m_nFsStatusBarFields > 0))
{
CreateStatusBar(m_nFsStatusBarFields);
// PositionStatusBar();
}
+#endif //wxUSE_STATUSBAR
if ((m_lFsStyle & wxFULLSCREEN_NOMENUBAR) && (m_hMenu != 0))
{
return FALSE;
}
- //
+ //
// Now need to subclass window.
//
{
wxPoint vPoint(0, 0);
+#if wxUSE_TOOLBAR
if (GetToolBar())
{
int nWidth;
vPoint.y += nHeight;
}
}
+#endif //wxUSE_TOOLBAR
return vPoint;
} // end of wxFrame::GetClientAreaOrigin
if (!pMenuBar )
return FALSE;
+#if wxUSE_ACCEL
const wxAcceleratorTable& rAcceleratorTable = pMenuBar->GetAccelTable();
return rAcceleratorTable.Translate(GetHWND(), pMsg);
+#else
+ return FALSE;
+#endif //wxUSE_ACCEL
} // end of wxFrame::OS2TranslateMessage
// ---------------------------------------------------------------------------
#endif // wxUSE_NATIVE_STATUSBAR
// PositionStatusBar();
+#if wxUSE_TOOLBAR
PositionToolBar();
+#endif // wxUSE_TOOLBAR
+
wxSizeEvent vEvent( wxSize( nX
,nY
)
case WM_QUERYFRAMECTLCOUNT:
{
USHORT itemCount = SHORT1FROMMR(OS2GetOldWndProc()(GetHWND(), uMessage, wParam, lParam));
+#if wxUSE_STATUSBAR
if(m_frameStatusBar)
++itemCount;
+#endif //wxUSE_STATUSBAR
+
bProcessed = TRUE;
mRc = MRFROMSHORT( itemCount );
}
&& usClient < itemCount)
usClient++;
+#if wxUSE_STATUSBAR
if(m_frameStatusBar)
{
int height;
m_frameStatusBar->GetSize(NULL, &height);
-
+
if(usClient == itemCount)
{
// frame has no client window
++itemCount;
}
}
+#endif //wxUSE_STATUSBAR
+
bProcessed = TRUE;
mRc = MRFROMSHORT(itemCount);
}
#include <wx/dynarray.h>
#include <wx/log.h>
+
#include <wx/config.h>
+#if wxUSE_CONFIG
#include <wx/os2/iniconf.h>
// Not implemented
return FALSE;
}
+
+#endif //wxUSE_CONFIG
#include "wx/dynarray.h"
#include "wx/log.h"
+#if wxUSE_LISTBOX
+
#if wxUSE_OWNER_DRAWN
#include "wx/ownerdrw.h"
#endif
}
#endif
// wxUSE_OWNER_DRAWN
+
+#endif //wxUSE_LISTBOX
bool wxMDIChildFrame::OS2TranslateMessage(WXMSG* msg)
{
+#if wxUSE_ACCEL
return m_acceleratorTable.Translate(GetParent()->GetHWND(), msg);
+#else
+ return FALSE;
+#endif //wxUSE_ACCEL
+
}
// ---------------------------------------------------------------------------
#include "wx/dynarray.h"
#include "wx/confbase.h"
+#if wxUSE_FILE
+
#include "wx/os2/mimetype.h"
// other standard headers
return 0;
}
+#endif //wxUSE_FILE
for ( unsigned int nPage = 0; nPage < nCount; nPage++ ) {
wxNotebookPage *pPage = m_aPages[nPage];
pPage->SetSize(0, 0, w, h);
+#if wxUSE_CONSTRAINTS
if ( pPage->GetAutoLayout() )
pPage->Layout();
+#endif //wxUSE_CONSTRAINTS
+
}
// Processing continues to next OnSize
void wxNotebook::SetConstraintSizes(bool /* recurse */)
{
+#if wxUSE_CONSTRAINTS
// don't set the sizes of the pages - their correct size is not yet known
wxControl::SetConstraintSizes(FALSE);
+#endif
}
bool wxNotebook::DoPhase(int /* nPhase */)
#include "wx/utils.h"
#endif
+#if wxUSE_OWNER_DRAWN
+
#include "wx/ownerdrw.h"
#include "wx/menuitem.h"
return TRUE;
}
+#endif //wxUSE_OWNER_DRAWN
#include "wx/app.h"
#endif
+#if wxUSE_PRINTING_ARCHITECTURE
#include "wx/os2/print.h"
#include "wx/generic/prntdlgg.h"
// TODO
}
+#endif //wxUSE_PRINTING_ARCHITECTURE
,GetGValue(vRef)
,GetBValue(vRef)
);
- return vCol;
break;
case wxSYS_COLOUR_WINDOWFRAME:
,GetGValue(vRef)
,GetBValue(vRef)
);
- return vCol;
break;
case wxSYS_COLOUR_MENUTEXT:
,GetGValue(vRef)
,GetBValue(vRef)
);
- return vCol;
break;
case wxSYS_COLOUR_BTNSHADOW:
,GetGValue(vRef)
,GetBValue(vRef)
);
- return vCol;
break;
case wxSYS_COLOUR_BTNHIGHLIGHT:
,GetGValue(vRef)
,GetBValue(vRef)
);
- return vCol;
break;
//
case wxSYS_COLOUR_INACTIVECAPTIONTEXT:
case wxSYS_COLOUR_BTNTEXT:
case wxSYS_COLOUR_INFOTEXT:
- return(*wxBLACK);
+ vCol = (*wxBLACK);
break;
//
case wxSYS_COLOUR_ACTIVECAPTION:
case wxSYS_COLOUR_ACTIVEBORDER:
case wxSYS_COLOUR_HIGHLIGHT:
- return(*wxBLUE);
+ vCol = (*wxBLUE);
break;
case wxSYS_COLOUR_SCROLLBAR:
case wxSYS_COLOUR_3DDKSHADOW:
case wxSYS_COLOUR_3DLIGHT:
case wxSYS_COLOUR_INFOBK:
- return(*wxLIGHT_GREY);
+ vCol = (*wxLIGHT_GREY);
break;
default:
,GetGValue(vRef)
,GetBValue(vRef)
);
- return vCol;
break;
}
return(vCol);
break;
}
}
+ if(wxSWISS_FONT)
+ return *wxSWISS_FONT;
- return *wxSWISS_FONT;
+ return wxNullFont;
}
// Get a system metric, e.g. scrollbar size
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
+#if wxUSE_SPINBTN
// Can't resolve reference to CreateUpDownControl in
// TWIN32, but could probably use normal CreateWindow instead.
return FALSE;
}
+#endif //wxUSE_SPINBTN
#include "wx/wx.h"
#endif
+#if wxUSE_SPINBTN
+
#include "wx/spinctrl.h"
#include "wx/os2/private.h"
}
*/
}
+
+#endif //wxUSE_SPINBTN
\ No newline at end of file
#define INCL_DOSFILEMGR
#define INCL_WIN
#define INCL_GPI
-#define INCL_PM
+#define INCL_PM
#include <os2.h>
#include <stdio.h>
#include <string.h>
else
{
m_isResource = FALSE;
+#if wxUSE_FILE
wxFile fileWave;
if (!fileWave.Open(fileName, wxFile::read))
fileWave.Read(m_waveData, m_waveLength);
*/
return TRUE;
+#else
+ return FALSE;
+#endif //wxUSE_FILE
}
}
#include <stdio.h>
#endif
+#define DEBUG_PRINTF(NAME) { static int raz=0; \
+ printf( #NAME " %i\n",raz); fflush(stdout); \
+ raz++; \
+ }
+
#if wxUSE_OWNER_DRAWN
#include "wx/ownerdrw.h"
#endif
, WXWORD WXUNUSED(uId)
)
{
+
+DEBUG_PRINTF(wxWindow::OS2Command);
+
return(FALSE);
}
m_lLastMouseY = -1;
m_nLastMouseEvent = -1;
#endif // wxUSE_MOUSEEVENT_HACK
+
+DEBUG_PRINTF(wxWindow::Init-End);
+
} // wxWindow::Init
//
//
wxWindow::~wxWindow()
{
+DEBUG_PRINTF(wxWindow::~wxWindow-Start);
m_isBeingDeleted = TRUE;
OS2DetachWindowMenu();
//
wxRemoveHandleAssociation(this);
}
+DEBUG_PRINTF(wxWindow::~wxWindow-End);
} // end of wxWindow::~wxWindow
bool wxWindow::Create(
const wxFont& rFont
)
{
+DEBUG_PRINTF(wxWindow::SetFont);
if (!wxWindowBase::SetFont(rFont))
{
// nothing to do
, WXLPARAM lParam
)
{
+DEBUG_PRINTF(wxWindow::OS2DefWindowProc);
+
if (m_fnOldWndProc)
return (MRESULT)m_fnOldWndProc(GetHWND(), (ULONG)uMsg, (MPARAM)wParam, (MPARAM)lParam);
else
{
QMSG* pQMsg = (QMSG*)pMsg;
+DEBUG_PRINTF(OS2ProcessMessage);
+
if (m_hWnd != 0 && (GetWindowStyleFlag() & wxTAB_TRAVERSAL))
{
//
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
// ---------------------------------------------------------------------------
// Trace all ulMsgs - useful for the debugging
//
#ifdef __WXDEBUG__
+DEBUG_PRINTF(__WXDEBUG__wxWndProc);
wxLogTrace(wxTraceMessages, wxT("Processing %s(wParam=%8lx, lParam=%8lx)"),
wxGetMessageName(ulMsg), wParam, lParam);
#endif // __WXDEBUG__
break;
case WM_PAINT:
+DEBUG_PRINTF(WM_PAINT)
bProcessed = HandlePaint();
break;
//
bProcessed = TRUE;
mResult = (MRESULT)TRUE;
+DEBUG_PRINTF(WM_CLOSE)
break;
case WM_SHOW:
+DEBUG_PRINTF(WM_SHOW)
bProcessed = HandleShow(wParam != 0, (int)lParam);
break;
{
WORD id, cmd;
WXHWND hwnd;
+DEBUG_PRINTF(WM_COMMAND-in)
UnpackCommand(wParam, lParam, &id, &hwnd, &cmd);
bProcessed = HandleCommand(id, cmd, hwnd);
+DEBUG_PRINTF(WM_COMMAND-out)
}
break;
wxLogLastError("CreateRectRgn");
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);
-/*
- hPS = WinBeginPaint(GetHWND(), 0L, &vRect);
- WinFillRect(hPS, &vRect, SYSCLR_WINDOW);
- WinEndPaint(hPS);
-*/
vEvent.SetEventObject(this);
return (GetEventHandler()->ProcessEvent(vEvent));
} // end of wxWindow::HandlePaint
wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
{
-#if 0
POINT pt2;
pt2.x = pt.x;
pt2.y = pt.y;
win = wxFindWinFromHandle((WXHWND) hWnd) ;
}
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);
-}