OSDN Git Service

Handling key and mouse events in listctrl is improved
[molby/Molby.git] / wxSources / MyGLCanvas.h
1 /*
2  *  MyGLCanvas.h
3  *  Molby
4  *
5  *  Created by Toshi Nagata on 08/10/24.
6  *  Copyright 2008 Toshi Nagata. All rights reserved.
7  *
8  This program is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation version 2 of the License.
11  
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  GNU General Public License for more details.
16  */
17
18 #ifndef __MyGLCanvas_h__
19 #define __MyGLCanvas_h__
20
21 #include "wx/glcanvas.h"
22 #include "../MolLib/MolLib.h"
23
24 class MoleculeView;
25
26 class MyGLCanvas: public wxGLCanvas
27 {
28 public:
29     MoleculeView *view;
30         wxGLContext *context;
31
32     MyGLCanvas(MoleculeView *v, wxWindow *frame, const wxPoint& pos, const wxSize& size, long style = 0);
33         ~MyGLCanvas();
34         void SetCurrent() { context->SetCurrent(*this); }
35     void OnPaint(wxPaintEvent &event);
36     void OnMouseEvent(wxMouseEvent &event);
37     void OnEraseBackground(wxEraseEvent &event);
38     void OnSize(wxSizeEvent &event);
39         void OnChar(wxKeyEvent &event);
40         void OnCaptureLost(wxMouseCaptureLostEvent &event);
41         void Update();
42         
43 private:
44     DECLARE_EVENT_TABLE()
45 };
46
47
48 #endif  /* __MyGLCanvas_h__ */
49