OSDN Git Service

Big change in GUI appearance on MSW; the MDI interface is gone and all windows can...
[molby/Molby.git] / wxSources / ConsoleFrame.h
1 /*
2  *  ConsoleFrame.h
3  *  Molby
4  *
5  *  Created by Toshi Nagata on 08/10/27.
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 __ConsoleFrame_h__
19 #define __ConsoleFrame_h__
20
21 #include "wx/mdi.h"
22 #include "wx/docview.h"
23 //#include "wx/richtext/richtextctrl.h"
24 #include "wx/textctrl.h"
25
26 #define MAX_HISTORY_LINES 1000
27
28 class wxMenu;
29
30 class ConsoleFrame: public wxFrame
31 {
32
33 public:
34         wxTextCtrl *textCtrl;
35         wxMenu *file_history_menu;
36         wxMenu *edit_menu;
37         
38         wxTextAttr *current_attr;
39         wxFont *default_font;
40
41         char **valueHistory, **commandHistory;
42         int nValueHistory, nCommandHistory;
43         int valueHistoryIndex, commandHistoryIndex;
44         long historyPos;
45         long keyInputPos;
46
47         long selectionFrom, selectionTo;
48         
49         ConsoleFrame(wxFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size, long type);
50         virtual ~ConsoleFrame();
51
52         int AppendConsoleMessage(const char *mes);
53         void FlushConsoleMessage();
54         void SetConsoleColor(int color);
55         
56         void OnCreate();
57         void OnEnterPressed(wxKeyEvent& event);
58         void OnKeyDown(wxKeyEvent &event);
59
60         static ConsoleFrame *CreateConsoleFrame(wxFrame *parent);
61         void OnCloseWindow(wxCloseEvent &event);
62         void OnClose(wxCommandEvent &event);
63         void OnUpdateUI(wxUpdateUIEvent& event);
64
65         void OnSetFocus(wxFocusEvent &event);
66         void OnKillFocus(wxFocusEvent &event);
67         
68         void OnUndo(wxCommandEvent &event);
69         void OnRedo(wxCommandEvent &event);
70
71         void EmptyBuffer(bool showRubyPrompt = true);
72         void ShowHistory(bool up, bool option);
73
74 private:
75         DECLARE_EVENT_TABLE()
76 };
77
78 #endif /* __ConsoleFrame_h__ */