]> git.saurik.com Git - wxWidgets.git/commitdiff
Minor tweaks
authorJulian Smart <julian@anthemion.co.uk>
Sun, 10 Mar 2002 14:41:07 +0000 (14:41 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sun, 10 Mar 2002 14:41:07 +0000 (14:41 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14540 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

utils/emulator/src/Makefile.in
utils/emulator/src/emulator.cpp
utils/emulator/src/emulator.h

index 314b59ac86ce7739f6db25666c89f697ed5da24b..a5965d35a8ed31299a644703d0049b8d6205aac7 100644 (file)
@@ -20,4 +20,4 @@ DEPFILES=$(PROGRAM).d
 
 include ../../../src/makeprog.env
 
-@IF_GNU_MAKE@-include $(DEPFILES)
+-include $(DEPFILES)
index 2740f75923c50e956d596867ebdf7810159c85e8..bf43a462ce39515faca72c8395e29a020a71c3a5 100644 (file)
     #include "wx/wx.h"
 #endif
 
-#include "emulator.h"
-
 #ifdef __WXX11__    
 #include "wx/x11/reparent.h"
 #endif
 
+#include "emulator.h"
+
 // ----------------------------------------------------------------------------
 // resources
 // ----------------------------------------------------------------------------
@@ -113,8 +113,9 @@ bool wxEmulatorApp::OnInit()
     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))
@@ -131,6 +132,8 @@ bool wxEmulatorApp::OnInit()
         frame->Destroy();
         return FALSE;
     }
+
+    m_containerWindow->DoResize();
 #endif
 
     // success: wxApp::OnRun() will be called which will enter the main message
@@ -150,7 +153,7 @@ bool wxEmulatorApp::LoadEmulator()
     // 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);
@@ -230,6 +233,11 @@ wxEmulatorContainer::wxEmulatorContainer(wxWindow* parent, wxWindowID id):
 }
 
 void wxEmulatorContainer::OnSize(wxSizeEvent& event)
+{
+    DoResize();
+}
+
+void wxEmulatorContainer::DoResize()
 {
     wxSize sz = GetClientSize();
     if (wxGetApp().m_emulatorInfo.m_emulatorBackgroundBitmap.Ok() &&
@@ -238,8 +246,8 @@ void wxEmulatorContainer::OnSize(wxSizeEvent& event)
         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;
@@ -259,8 +267,8 @@ void wxEmulatorContainer::OnPaint(wxPaintEvent& event)
         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);
     }
index 34f5d7a8687f413badda2fefbd0dbd8166d0425e..9a59883d67686caba721743fe8e46fe8f9ef1302 100644 (file)
@@ -88,6 +88,8 @@ public:
 
     wxEmulatorContainer(wxWindow* parent, wxWindowID id);
 
+    void DoResize();
+
     void OnSize(wxSizeEvent& event);
     void OnPaint(wxPaintEvent& event);
     void OnEraseBackground(wxEraseEvent& event);