#include "wx/wx.h"
#endif
-#include "emulator.h"
-
#ifdef __WXX11__
#include "wx/x11/reparent.h"
#endif
+#include "emulator.h"
+
// ----------------------------------------------------------------------------
// resources
// ----------------------------------------------------------------------------
m_xnestWindow = new wxAdoptedWindow;
wxString cmd;
- cmd.Printf(wxT("Xnest :100 -geometry %dx%d+50+50"),
- (int) m_emulatorScreenSize.x, (int) m_emulatorScreenSize.y);
+ // cmd.Printf(wxT("Xnest :100 -geometry %dx%d+50+50"),
+ cmd.Printf(wxT("Xnest :100 -geometry %dx%d"),
+ (int) m_emulatorInfo.m_emulatorScreenSize.x, (int) m_emulatorInfo.m_emulatorScreenSize.y);
// Asynchronously executes Xnest
if (0 == wxExecute(cmd))
frame->Destroy();
return FALSE;
}
+
+ m_containerWindow->DoResize();
#endif
// success: wxApp::OnRun() will be called which will enter the main message
// The offset from the top-left of the main emulator
// bitmap and the virtual screen (where Xnest is
// positioned)
- m_emulatorInfo.m_emulatorScreenPosition = wxPoint(45, 57);
+ m_emulatorInfo.m_emulatorScreenPosition = wxPoint(56, 69);
// The emulated screen size
m_emulatorInfo.m_emulatorScreenSize = wxSize(240, 320);
}
void wxEmulatorContainer::OnSize(wxSizeEvent& event)
+{
+ DoResize();
+}
+
+void wxEmulatorContainer::DoResize()
{
wxSize sz = GetClientSize();
if (wxGetApp().m_emulatorInfo.m_emulatorBackgroundBitmap.Ok() &&
int bitmapWidth = wxGetApp().m_emulatorInfo.m_emulatorBackgroundBitmap.GetWidth();
int bitmapHeight = wxGetApp().m_emulatorInfo.m_emulatorBackgroundBitmap.GetHeight();
- int x = wxMax(0, (sz.x - bitmapWidth)/2.0);
- int y = wxMax(0, (sz.y - bitmapHeight)/2.0);
+ int x = wxMax(0, (int) ((sz.x - bitmapWidth)/2.0));
+ int y = wxMax(0, (int) ((sz.y - bitmapHeight)/2.0));
x += wxGetApp().m_emulatorInfo.m_emulatorScreenPosition.x;
y += wxGetApp().m_emulatorInfo.m_emulatorScreenPosition.y;
int bitmapWidth = wxGetApp().m_emulatorInfo.m_emulatorBackgroundBitmap.GetWidth();
int bitmapHeight = wxGetApp().m_emulatorInfo.m_emulatorBackgroundBitmap.GetHeight();
- int x = wxMax(0, (sz.x - bitmapWidth)/2.0);
- int y = wxMax(0, (sz.y - bitmapHeight)/2.0);
+ int x = wxMax(0, (int) ((sz.x - bitmapWidth)/2.0));
+ int y = wxMax(0, (int) ((sz.y - bitmapHeight)/2.0));
dc.DrawBitmap(wxGetApp().m_emulatorInfo.m_emulatorBackgroundBitmap, x, y);
}