| 1 |
/* AbiWord |
| 2 |
* Copyright (C) 2009,2012 Hubert Figuiere |
| 3 |
* |
| 4 |
* This program is free software; you can redistribute it and/or |
| 5 |
* modify it under the terms of the GNU General Public License |
| 6 |
* as published by the Free Software Foundation; either version 2 |
| 7 |
* of the License, or (at your option) any later version. |
| 8 |
* |
| 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. |
| 13 |
* |
| 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 Street, Fifth Floor, Boston, MA |
| 17 |
* 02110-1301 USA. |
| 18 |
*/ |
| 19 |
|
| 20 |
#ifndef __XAP_GTKCOMBOBOXHELPERS_H__ |
| 21 |
#define __XAP_GTKCOMBOBOXHELPERS_H__ |
| 22 |
|
| 23 |
#include <gtk/gtk.h> |
| 24 |
|
| 25 |
#include "ut_vector.h" |
| 26 |
#include <string> |
| 27 |
|
| 28 |
void XAP_makeGtkComboBoxText(GtkComboBox * combo, GType secondaryType); |
| 29 |
void XAP_makeGtkComboBoxText2(GtkComboBox * combo, GType secondaryType, |
| 30 |
GType tertiaryType); |
| 31 |
void XAP_populateComboBoxWithIndex(GtkComboBox * combo, |
| 32 |
const UT_GenericVector<const char*> & vec); |
| 33 |
|
| 34 |
void XAP_appendComboBoxText(GtkComboBox* combo, const char* text); |
| 35 |
void XAP_appendComboBoxTextAndInt(GtkComboBox * combo, const char * text, int value); |
| 36 |
void XAP_appendComboBoxTextAndString(GtkComboBox * combo, const char * text, |
| 37 |
const char * value); |
| 38 |
void XAP_appendComboBoxTextAndStringString(GtkComboBox * combo, |
| 39 |
const char * text, |
| 40 |
const char * value1, |
| 41 |
const char * value2); |
| 42 |
void XAP_appendComboBoxTextAndIntString(GtkComboBox * combo, |
| 43 |
const char * text, |
| 44 |
int value1, |
| 45 |
const char * value2); |
| 46 |
int XAP_comboBoxGetActiveInt(GtkComboBox * combo); |
| 47 |
std::string XAP_comboBoxGetActiveText(GtkComboBox * combo); |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
/** set the active item based on a column value |
| 52 |
* @param combo the combobox |
| 53 |
* @param col the column |
| 54 |
* @param value the value to look for |
| 55 |
* @return true if set, false if not found. |
| 56 |
*/ |
| 57 |
bool XAP_comboBoxSetActiveFromIntCol(GtkComboBox * combo, |
| 58 |
int col, int value); |
| 59 |
|
| 60 |
#endif |