OSDN Git Service

The text edit in MyListCtrl seems weird. Hopefully fixed.
[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();
58         void OnKeyDown(wxKeyEvent &event);
59         void OnTextEnter(wxCommandEvent &event);
60         
61         static ConsoleFrame *CreateConsoleFrame(wxFrame *parent);
62         void OnCloseWindow(wxCloseEvent &event);
63         void OnClose(wxCommandEvent &event);
64         void OnUpdateUI(wxUpdateUIEvent& event);
65
66         void OnSetFocus(wxFocusEvent &event);
67         void OnKillFocus(wxFocusEvent &event);
68         
69         void OnUndo(wxCommandEvent &event);
70         void OnRedo(wxCommandEvent &event);
71
72         void EmptyBuffer(bool showRubyPrompt = true);
73         void ShowHistory(bool up, bool option);
74
75 private:
76         DECLARE_EVENT_TABLE()
77 };
78
79 #endif /* __ConsoleFrame_h__ */