OSDN Git Service

initial import
[molby/Molby.git] / wxSources / GlobalParameterFilesFrame.h
1 /*
2  *  GlobalParameterFilesFrame.h
3  *  Molby
4  *
5  *  Created by Toshi Nagata on 09/11/14.
6  *  Copyright 2009 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 __GlobalParameterFilesFrame_h__
19 #define __GlobalParameterFilesFrame_h__
20
21 #include "wx/mdi.h"
22 #include "MyListCtrl.h"
23 #include "wx/sizer.h"
24
25 class wxMenu;
26 class GlobalParameterFilesFrame: public wxMDIChildFrame, public MyListCtrlDataSource
27 {
28 public:
29         MyListCtrl *listctrl;
30         wxButton *add_button, *remove_button;
31         wxMenu *file_history_menu;
32         wxMenu *edit_menu;
33         
34         GlobalParameterFilesFrame(wxMDIParentFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size, long type);
35         virtual ~GlobalParameterFilesFrame();
36         
37         MyListCtrl *GetListCtrl() { return listctrl; }
38         
39         void OnCreate();
40         
41         static GlobalParameterFilesFrame *CreateGlobalParameterFilesFrame(wxMDIParentFrame *parent);
42         
43         void OnCloseWindow(wxCloseEvent &event);
44         void OnClose(wxCommandEvent &event);
45         void OnUpdateUI(wxUpdateUIEvent& event);
46         void OnAddGlobalParameterFile(wxCommandEvent& event);
47         void OnRemoveGlobalParameterFile(wxCommandEvent& event);
48
49         /*  MyListCtrlDataSource functions  */
50         virtual int GetItemCount(MyListCtrl *ctrl);
51         virtual wxString GetItemText(MyListCtrl *ctrl, long row, long column) const;
52         virtual int SetItemText(MyListCtrl *ctrl, long row, long column, const wxString &value);
53         virtual void DragSelectionToRow(MyListCtrl *ctrl, long row);
54         virtual bool IsItemEditable(MyListCtrl *ctrl, long row, long column);
55         virtual bool IsDragAndDropEnabled(MyListCtrl *ctrl);
56         virtual void OnSelectionChanged(MyListCtrl *ctrl);
57         virtual int SetItemColor(MyListCtrl *ctrl, long row, long col, float *fg, float *bg);
58         
59 private:
60         DECLARE_EVENT_TABLE()
61 };
62
63 #endif /* __GlobalParameterFilesFrame_h__ */