2
* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License as
6
* published by the Free Software Foundation; version 2 of the
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20
#ifndef __grt_code_editor_h__
21
#define __grt_code_editor_h__
23
#include "mforms/box.h"
24
#include "mforms/code_editor.h"
25
#include "mforms/splitter.h"
26
#include "mforms/panel.h"
27
#include "mforms/tabview.h"
28
#include "mforms/textentry.h"
29
#include "mforms/textbox.h"
30
#include "mforms/filechooser.h"
35
class GRTCodeEditor : public mforms::Box
38
GRTCodeEditor(GRTShellWindow *owner, bool module, const std::string &language);
39
virtual ~GRTCodeEditor();
41
void set_path(const std::string &path);
42
const std::string& get_path() { return _filename; };
43
const std::string& get_language() { return _language; };
44
void set_text(const std::string &text);
45
std::string get_title();
46
std::string get_text();
48
bool is_dirty() const { return _dirty; }
51
bool load(const std::string &path);
52
bool save(bool choose_file);
55
GRTShellWindow *get_shell_window() { return _owner; }
57
mforms::CodeEditor *get_editor() { return &_text; }
63
GRTShellWindow *_owner;
65
mforms::CodeEditor _text;
67
std::string _filename;
68
std::string _language;
69
bool _debugging_supported;
73
void text_changed(int line, int linesAdded);
80
#endif /* __grt_code_editor.h__ */