| 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_list.h |
| 21 |
* |
| 22 |
* @author Kai Sterker |
| 23 |
* @brief Instant dialogue preview |
| 24 |
*/ |
| 25 |
|
| 26 |
#ifndef GUI_LIST_H |
| 27 |
#define GUI_LIST_H |
| 28 |
|
| 29 |
#include "dlg_circle.h" |
| 30 |
|
| 31 |
/** |
| 32 |
* This widget uses a GtkList to display an instant preview of the dialogue. |
| 33 |
* It shows the parents and childs of a selected node and allows to navigate |
| 34 |
* through the dialogue by clicking on a line of text. |
| 35 |
*/ |
| 36 |
class GuiList |
| 37 |
{ |
| 38 |
public: |
| 39 |
/** |
| 40 |
* Constructor. Main purpose is to create the drawing area for the |
| 41 |
* graph and to register the GTK+ event callbacks used to catch |
| 42 |
* user input for this widget. |
| 43 |
* @param paned The GtkPaned that will hold the list widget. |
| 44 |
*/ |
| 45 |
GuiList (GtkWidget* paned); |
| 46 |
/** |
| 47 |
* Standard desctructor. |
| 48 |
*/ |
| 49 |
~GuiList (); |
| 50 |
|
| 51 |
/** |
| 52 |
* "Draw" the current contents of the list. |
| 53 |
*/ |
| 54 |
void draw (); |
| 55 |
/** |
| 56 |
* Empties the list and redraws it. |
| 57 |
*/ |
| 58 |
void clear (); |
| 59 |
/** |
| 60 |
* Displays the given Dlgnode in the list, including all of it's parents |
| 61 |
* and children. |
| 62 |
* @param the node currently selected. |
| 63 |
*/ |
| 64 |
void display (DlgNode *node); |
| 65 |
|
| 66 |
private: |
| 67 |
/** |
| 68 |
* Add an item to the list. |
| 69 |
* @param mode Defines whether the circle is selected or not |
| 70 |
* @param circle The circle whose text is to be added to the list |
| 71 |
*/ |
| 72 |
void add (int mode, DlgCircle *circle); |
| 73 |
|
| 74 |
GtkWidget *list; // The actual GTK+ list widget |
| 75 |
}; |
| 76 |
|
| 77 |
#endif // GUI_LIST_H |