5 * Created by Toshi Nagata on 08/10/27.
6 * Copyright 2008 Toshi Nagata. All rights reserved.
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.
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.
18 #ifndef __ConsoleFrame_h__
19 #define __ConsoleFrame_h__
22 #include "wx/docview.h"
23 //#include "wx/richtext/richtextctrl.h"
24 #include "wx/textctrl.h"
26 #define MAX_HISTORY_LINES 1000
30 class ConsoleFrame: public wxFrame
35 wxMenu *file_history_menu;
38 wxTextAttr *current_attr;
41 char **valueHistory, **commandHistory;
42 int nValueHistory, nCommandHistory;
43 int valueHistoryIndex, commandHistoryIndex;
47 long selectionFrom, selectionTo;
49 ConsoleFrame(wxFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size, long type);
50 virtual ~ConsoleFrame();
52 int AppendConsoleMessage(const char *mes);
53 void FlushConsoleMessage();
54 void SetConsoleColor(int color);
57 void OnEnterPressed(wxKeyEvent& event);
58 void OnKeyDown(wxKeyEvent &event);
60 static ConsoleFrame *CreateConsoleFrame(wxFrame *parent);
61 void OnCloseWindow(wxCloseEvent &event);
62 void OnClose(wxCommandEvent &event);
63 void OnUpdateUI(wxUpdateUIEvent& event);
65 void OnSetFocus(wxFocusEvent &event);
66 void OnKillFocus(wxFocusEvent &event);
68 void OnUndo(wxCommandEvent &event);
69 void OnRedo(wxCommandEvent &event);
71 void EmptyBuffer(bool showRubyPrompt = true);
72 void ShowHistory(bool up, bool option);
78 #endif /* __ConsoleFrame_h__ */