From: Julian Smart Date: Sat, 26 Feb 2005 20:03:27 +0000 (+0000) Subject: Added wxFULL_REPAINT_ON_RESIZE and sample icon to OpenGL samples X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3a9929405bf1556a7ddccad8ae96e3440e2124e0 Added wxFULL_REPAINT_ON_RESIZE and sample icon to OpenGL samples git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32394 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/opengl/cube/cube.cpp b/samples/opengl/cube/cube.cpp index de01375415..eda0d5e612 100644 --- a/samples/opengl/cube/cube.cpp +++ b/samples/opengl/cube/cube.cpp @@ -30,6 +30,7 @@ #endif #include "cube.h" +#include "../../sample.xpm" #ifndef __WXMSW__ // for wxStopWatch, see remark below #if defined(__WXMAC__) && !defined(__DARWIN__) @@ -182,7 +183,7 @@ unsigned long TestGLCanvas::m_gsynct; TestGLCanvas::TestGLCanvas(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name) - : wxGLCanvas(parent, (wxGLCanvas*) NULL, id, pos, size, style, name ) + : wxGLCanvas(parent, (wxGLCanvas*) NULL, id, pos, size, style|wxFULL_REPAINT_ON_RESIZE , name ) { m_init = false; m_gllist = 0; @@ -193,7 +194,7 @@ TestGLCanvas::TestGLCanvas(wxWindow *parent, wxWindowID id, TestGLCanvas::TestGLCanvas(wxWindow *parent, const TestGLCanvas &other, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) - : wxGLCanvas(parent, other.GetContext(), id, pos, size, style, name) + : wxGLCanvas(parent, other.GetContext(), id, pos, size, style|wxFULL_REPAINT_ON_RESIZE , name) { m_init = false; m_gllist = other.m_gllist; // share display list @@ -440,6 +441,7 @@ MyFrame::MyFrame(wxWindow *parent, const wxString& title, const wxPoint& pos, : wxFrame(parent, wxID_ANY, title, pos, size, style) { m_canvas = NULL; + SetIcon(wxIcon(sample_xpm)); } // Intercept menu commands @@ -457,11 +459,6 @@ void MyFrame::OnExit( wxCommandEvent& WXUNUSED(event) ) MyFrame *frame = new MyFrame(NULL, str, wxDefaultPosition, wxSize(400, 300)); - // Give it an icon -#ifdef __WXMSW__ - frame->SetIcon(wxIcon(_T("mondrian"))); -#endif - // Make a menubar wxMenu *winMenu = new wxMenu; diff --git a/samples/opengl/isosurf/isosurf.cpp b/samples/opengl/isosurf/isosurf.cpp index 95485de92d..f6cbe36c7c 100644 --- a/samples/opengl/isosurf/isosurf.cpp +++ b/samples/opengl/isosurf/isosurf.cpp @@ -54,6 +54,8 @@ #include "isosurf.h" +#include "../../sample.xpm" + // The following part is taken largely unchanged from the original C Version GLboolean speed_test = GL_FALSE; @@ -315,6 +317,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, : wxFrame(frame, wxID_ANY, title, pos, size, style) { m_canvas = NULL; + SetIcon(wxIcon(sample_xpm)); } MyFrame::~MyFrame() @@ -344,7 +347,7 @@ END_EVENT_TABLE() TestGLCanvas::TestGLCanvas(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name, int* gl_attrib) - : wxGLCanvas(parent, id, pos, size, style, name, gl_attrib) + : wxGLCanvas(parent, id, pos, size, style|wxFULL_REPAINT_ON_RESIZE, name, gl_attrib) { parent->Show(true); SetCurrent(); diff --git a/samples/opengl/penguin/penguin.cpp b/samples/opengl/penguin/penguin.cpp index e991ad06ec..d6d0393601 100644 --- a/samples/opengl/penguin/penguin.cpp +++ b/samples/opengl/penguin/penguin.cpp @@ -40,12 +40,13 @@ # include #endif +#include "../../sample.xpm" + #define VIEW_ASPECT 1.3 // `Main program' equivalent, creating windows and returning main app frame bool MyApp::OnInit() { - // Create the main frame window MyFrame *frame = new MyFrame(NULL, wxT("wxWidgets OpenGL Penguin Sample"), wxDefaultPosition, wxDefaultSize); @@ -82,6 +83,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, : wxFrame(frame, wxID_ANY, title, pos, size, style) { m_canvas = NULL; + SetIcon(wxIcon(sample_xpm)); } /* Intercept menu commands */ @@ -100,7 +102,7 @@ END_EVENT_TABLE() TestGLCanvas::TestGLCanvas(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name) - : wxGLCanvas(parent, id, pos, size, style, name) + : wxGLCanvas(parent, id, pos, size, style|wxFULL_REPAINT_ON_RESIZE, name) { block = false; } diff --git a/samples/opengl/penguin/penguin.rc b/samples/opengl/penguin/penguin.rc index 626b82f58a..f3accc6acf 100644 --- a/samples/opengl/penguin/penguin.rc +++ b/samples/opengl/penguin/penguin.rc @@ -1,3 +1,3 @@ -/* mondrian ICON "mondrian.ico" */ -#include "wx/msw/wx.rc" +// #include "wx/msw/wx.rc" +#include "../../sample.rc"