wxraytracer - #include #include #include #include #...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
#include <wx/wx.h> #include <wx/dcbuffer.h> #include "wxraytracer.h" #include "main.xpm" #include "bg.xpm" # /******************************************************************************/ /********************* wxraytracerapp *****************************************/ /******************************************************************************/ / BEGIN_EVENT_TABLE(wxraytracerapp, wxApp) END_EVENT_TABLE() E IMPLEMENT_APP(wxraytracerapp) I bool wxraytracerapp::OnInit() { wxInitAllImageHandlers(); frame = new wxraytracerFrame(wxPoint(200,200), wxSize(700,500) ); frame->Centre(); frame->Show(TRUE); SetTopWindow(frame); return TRUE; } int wxraytracerapp::OnExit() { return 0; } void wxraytracerapp::SetStatusText(const wxString& text, int number) { frame->SetStatusText(text, number); } /******************************************************************************/ /********************* wxraytracerFrame ***************************************/ /******************************************************************************/ / BEGIN_EVENT_TABLE( wxraytracerFrame, wxFrame ) EVT_MENU( Menu_Render_Start, wxraytracerFrame::OnRenderStart ) EVT_MENU( Menu_Render_Pause, wxraytracerFrame::OnRenderPause ) EVT_MENU( Menu_Render_Resume, wxraytracerFrame::OnRenderResume ) EVT_MENU( Menu_File_Save, wxraytracerFrame::OnSaveFile ) EVT_MENU( Menu_File_Open, wxraytracerFrame::OnOpenFile ) EVT_MENU( Menu_File_Quit, wxraytracerFrame::OnQuit ) EVT_COMMAND(ID_RENDER_COMPLETED, wxEVT_RENDER, wxraytracerFrame::OnRenderCompleted) END_EVENT_TABLE() E : wxFrame((wxFrame *)NULL, -1, wxT( "Ray Tracer" ), pos, size) { wxMenu *menuFile = new wxMenu;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
.." )); ..")); menuFile->AppendSeparator(); menuFile->Append(Menu_File_Quit, wxT("E&xit")); ..")), FALSE); wxMenu *menuRender = new wxMenu; menuRender->Append(Menu_Render_Start , wxT("&Start" )); menuRender->Append(Menu_Render_Pause , wxT("&Pause" )); menuRender->Append(Menu_Render_Resume, wxT("&Resume")); menuRender->Enable(menuRender->FindItem(wxT("&Start" )), TRUE ); menuRender->Enable(menuRender->FindItem(wxT("&Pause" )), FALSE); menuRender->Enable(menuRender->FindItem(wxT("&Resume")), FALSE); wxMenuBar *menuBar = new wxMenuBar; menuBar->Append(menuFile , wxT("&File" )); menuBar->Append(menuRender, wxT("&Render")); SetMenuBar( menuBar ); canvas = new RenderCanvas(this); CreateStatusBar(); SetStatusText(wxT("Ready")); wxIcon icon(main_xpm); SetIcon(icon); wxStatusBar* statusBar = GetStatusBar(); int widths[] = {150,300}; statusBar->SetFieldsCount(2, widths); } { Close(); }
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/19/2010 for the course CS 390 taught by Professor Hu during the Spring '10 term at Westminster UT.

Page1 / 9

wxraytracer - #include #include #include #include #...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online