Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

ThyrixMainFrame.h

Go to the documentation of this file.
00001 #ifndef THYRIXMAINFRAME_H
00002 #define THYRIXMAINFRAME_H
00003 
00004 #include "SimulatorThread.h"
00005 #include "GUIWx.h"
00006 
00007 class World;
00008 
00009 // Define a new frame type: this is going to be our main frame
00010 class ThyrixMainFrame : public wxFrame{
00011 public:
00012     enum {Unused = 100,
00013           kMenuTimePause,
00014           kMenuTimeDiv10,
00015           kMenuTimeX1,
00016           kMenuTimeX3,
00017           kMenuTimeX10,
00018           kMenuTimeX30,
00019           kMenuTimeX100,
00020           kMenuTimeMax,
00021           
00022           kMenuFps30,
00023           kMenuFps60,
00024           kMenuFps90,
00025           
00026           kMenuStep,
00027                kMenuCapture
00028     };
00029 
00030     
00031 
00032    // constructors, destructors
00033    ThyrixMainFrame(const wxString& title, World* world, 
00034       int bufferWidth=600, int bufferHeight=400, int zoom=100);
00035    virtual ~ThyrixMainFrame();
00036 
00038    void start();
00039 
00040    void buildMenu();
00041 
00042    // event handlers (these functions should _not_ be virtual)
00043    void OnClose(wxCloseEvent& event);
00044    //void OnQuit(wxCommandEvent& event);
00045    //void OnAbout(wxCommandEvent& event);
00046    
00047    void onSetSpeed(wxCommandEvent& event);
00048    void onSetFps(wxCommandEvent& event);
00049    
00050 
00051    //void OnIdle(wxIdleEvent& event);
00052 
00054    //void onPaint(wxPaintEvent& event);
00055 
00057    //void onThreadPaintCommand(wxCommandEvent& event);
00058    
00060    //void onEraseBackground(wxEraseEvent& event);
00061    
00063    void onMotion(wxMouseEvent& event);
00064 
00066    void onLeftDown(wxMouseEvent& event);
00067 
00069    void onLeftUp(wxMouseEvent& event);
00070 
00071    void onRightDown(wxMouseEvent& event);
00072    void onRightUp(wxMouseEvent& event);
00073    
00074    void onStep(wxCommandEvent& event);
00075    void onCapture(wxCommandEvent& event);
00076    
00078    void paintDC(wxDC* dc);
00079    
00081    void paint();
00082 
00083    World* world;
00084 
00085 private:
00086    //Used inside a class declaration to declare that the class should be 
00087    //made known to the class hierarchy, but objects of this class cannot 
00088    //be created dynamically
00089    // (?)
00090    DECLARE_CLASS(ThyrixMainFrame); //?
00091 
00092    // any class wishing to process wxWindows events must use this macro
00093    DECLARE_EVENT_TABLE();
00094 
00095    SimulatorThread thread;
00096    
00098    wxMemoryDC buffer;
00099    
00101    wxBitmap bitmap;
00102    
00104    int bufferWidth, bufferHeight;
00105 
00107    GUIWx *gui;
00108 
00110    int zoom;
00111 };
00112 
00113 #endif // THYRIXMAINFRAME_H

Thyrix homepageUsers' guide

(C) Arxia 2004-2005