// Created: 30.12.01
// RCS-ID: $Id$
// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
-// License: wxWindows license
+// License: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
#include "wx/containr.h" // wxSetFocusToChild()
#endif //WX_PRECOMP
+#include "wx/module.h" // wxSetFocusToChild()
#include "wx/os2/private.h"
// ----------------------------------------------------------------------------
// Dialog window proc
MRESULT EXPENTRY wxDlgProc( HWND WXUNUSED(hWnd)
,UINT uMessage
- ,MPARAM WXUNUSED(wParam)
- ,MPARAM WXUNUSED(lParam)
+ ,void * WXUNUSED(wParam)
+ ,void * WXUNUSED(lParam)
)
{
switch(uMessage)
//
// Restore focus to the child which was last focused
//
- wxLogTrace(_T("focus"), _T("wxTLW %08x activated."), m_hWnd);
+ wxLogTrace(_T("focus"), _T("wxTLW %08lx activated."), m_hWnd);
wxWindow* pParent = m_pWinLastFocused ? m_pWinLastFocused->GetParent()
: NULL;
}
wxLogTrace(_T("focus"),
- _T("wxTLW %08x deactivated, last focused: %08x."),
+ _T("wxTLW %08lx deactivated, last focused: %08lx."),
m_hWnd,
m_pWinLastFocused ? GetHwndOf(m_pWinLastFocused)
: NULL);
if ( !m_hWnd )
{
- wxFAIL_MSG(_("Did you forget to include wx/os2/wx.rc in your resources?"));
+ wxFAIL_MSG(wxT("Did you forget to include wx/os2/wx.rc in your resources?"));
- wxLogSysError(_("Can't create dialog using template '%ul'"), ulDlgTemplate);
+ wxLogSysError(wxT("Can't create dialog using template '%ld'"), ulDlgTemplate);
return FALSE;
}
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError("Error creating frame. Error: %s\n", sError);
+ wxLogError("Error creating frame. Error: %s\n", sError.c_str());
return FALSE;
}
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError("Error creating frame. Error: %s\n", sError);
+ wxLogError("Error creating frame. Error: %s\n", sError.c_str());
return FALSE;
}
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError("Error sizing frame. Error: %s\n", sError);
+ wxLogError("Error sizing frame. Error: %s\n", sError.c_str());
return FALSE;
}
lStyle = ::WinQueryWindowULong( m_hWnd
, wxWindowID vId
, const wxString& rsTitle
, const wxPoint& rPos
-, const wxSize& rSize
+, const wxSize& rSizeOrig
, long lStyle
, const wxString& rsName
)
m_windowStyle = lStyle;
SetName(rsName);
m_windowId = vId == -1 ? NewControlId() : vId;
+
+ // always create a frame of some reasonable, even if arbitrary, size (at
+ // least for MSW compatibility)
+ wxSize rSize = rSizeOrig;
+ if ( rSize.x == -1 || rSize.y == -1 )
+ {
+ wxSize sizeDpy = wxGetDisplaySize();
+ if ( rSize.x == -1 )
+ rSize.x = sizeDpy.x / 3;
+ if ( rSize.y == -1 )
+ rSize.y = sizeDpy.y / 5;
+ }
+
wxTopLevelWindows.Append(this);
if (pParent)
pParent->AddChild(this);
{
int nShowCmd;
SWP vSwp;
- RECTL vRect;
if (bShow != IsShown() )
{
// We can't maximize the hidden frame because it shows it as well, so
// just remember that we should do it later in this case
//
- m_bMaximizeOnShow = TRUE;
+ m_bMaximizeOnShow = bMaximize;
}
} // end of wxTopLevelWindowOS2::Maximize
bool wxTopLevelWindowOS2::IsMaximized() const
{
- bool bIconic;
::WinQueryWindowPos(m_hFrame, (PSWP)&m_vSwp);
return (m_vSwp.fl & SWP_MAXIMIZE);