| 1 |
/* |
| 2 |
Copyright (C) 2002 Kai Sterker <[email protected]> |
| 3 |
Part of the Adonthell Project <http://adonthell.nongnu.org> |
| 4 |
|
| 5 |
Dlgedit is free software; you can redistribute it and/or modify |
| 6 |
it under the terms of the GNU General Public License as published by |
| 7 |
the Free Software Foundation; either version 2 of the License, or |
| 8 |
(at your option) any later version. |
| 9 |
|
| 10 |
Dlgedit is distributed in the hope that it will be useful, |
| 11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
GNU General Public License for more details. |
| 14 |
|
| 15 |
You should have received a copy of the GNU General Public License |
| 16 |
along with Dlgedit. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
*/ |
| 18 |
|
| 19 |
/** |
| 20 |
* @file gui_code.h |
| 21 |
* |
| 22 |
* @author Kai Sterker |
| 23 |
* @brief The Custom Code dialog. |
| 24 |
*/ |
| 25 |
|
| 26 |
#ifndef GUI_CODE_H |
| 27 |
#define GUI_CODE_H |
| 28 |
|
| 29 |
#include "gui_edit.h" |
| 30 |
#include "dlg_module_entry.h" |
| 31 |
|
| 32 |
/** |
| 33 |
* Provides entries for additional import lines, for code to be inserted |
| 34 |
* into constructor and destructor and for defining custom methods. |
| 35 |
*/ |
| 36 |
class GuiCode |
| 37 |
{ |
| 38 |
public: |
| 39 |
/** |
| 40 |
* Create empty Python Code Dialog. |
| 41 |
*/ |
| 42 |
GuiCode (); |
| 43 |
|
| 44 |
/** |
| 45 |
* Cleanup. |
| 46 |
*/ |
| 47 |
~GuiCode (); |
| 48 |
|
| 49 |
/** |
| 50 |
* Global pointer to the custom code dialog |
| 51 |
*/ |
| 52 |
static GuiCode *dialog; |
| 53 |
|
| 54 |
/** |
| 55 |
* Show the dialog and display the contents of the given module. |
| 56 |
* @param entry the custom code of a certain DlgModule to be edited. |
| 57 |
* @param name name of the dialogue whose code is being edited. |
| 58 |
*/ |
| 59 |
void display (DlgModuleEntry *entry, const std::string &name); |
| 60 |
|
| 61 |
/** |
| 62 |
* Store the user's entries once the OK button has been pressed. |
| 63 |
*/ |
| 64 |
void applyChanges (); |
| 65 |
|
| 66 |
private: |
| 67 |
DlgModuleEntry *entry; // The module being edited |
| 68 |
GtkWidget *window; // The dialog window |
| 69 |
GuiEdit *imports; // entry for additional import statements |
| 70 |
GuiEdit *ctor; // entry for code inserted into constructor |
| 71 |
GuiEdit *dtor; // entry for code inserted into destructor |
| 72 |
GuiEdit *methods; // entry for custom methods |
| 73 |
}; |
| 74 |
|
| 75 |
#endif // GUI_CODE_H |