Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# messagedialog.h

Go to the documentation of this file.

    00001 /*  Inti: Integrated Foundation Classes
    00002  *  Copyright (C) 2002 The Inti Development Team.
    00003  *
    00004  *  This program is free software; you can redistribute it and/or modify
    00005  *  it under the terms of the GNU General Public License as published by
    00006  *  the Free Software Foundation; either version 2 of the License, or
    00007  *  (at your option) any later version.
    00008  *
    00009  *  This program is distributed in the hope that it will be useful,
    00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012  *  GNU Library General Public License for more details.
    00013  *
    00014  *  You should have received a copy of the GNU Library General Public License
    00015  *  along with this program; if not, write to the Free Software
    00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00017  */
    00018
    00026
    00027 #ifndef INTI_GTK_MESSAGE_DIALOG_H
    00028 #define INTI_GTK_MESSAGE_DIALOG_H
    00029
    00030 #ifndef INTI_GTK_DIALOG_H
    00031 #include <inti/gtk/dialog.h>
    00032 #endif
    00033
    00034 #ifndef __GTK_MESSAGE_DIALOG_H__
    00035 #include <gtk/gtkmessagedialog.h>
    00036 #endif
    00037
    00038 namespace Inti {
    00039
    00040 namespace Gtk {
    00041
    00042 class MessageDialogClass;
    00043
    00046
    00047 enum MessageType
    00048 {
    00049         MESSAGE_INFO = GTK_MESSAGE_INFO,
    00050         MESSAGE_WARNING = GTK_MESSAGE_WARNING,
    00051         MESSAGE_QUESTION = GTK_MESSAGE_QUESTION,
    00052         MESSAGE_ERROR = GTK_MESSAGE_ERROR
    00053 };
    00054
    00058
    00059 enum ButtonType
    00060 {
    00061         BUTTONS_NONE = GTK_BUTTONS_NONE,
    00062         BUTTONS_OK = GTK_BUTTONS_OK,
    00063         BUTTONS_CLOSE = GTK_BUTTONS_CLOSE,
    00064         BUTTONS_CANCEL = GTK_BUTTONS_CANCEL,
    00065         BUTTONS_YES_NO = GTK_BUTTONS_YES_NO,
    00066         BUTTONS_OK_CANCEL = GTK_BUTTONS_OK_CANCEL
    00067 };
    00068
    00096
    00097 class MessageDialog : public Dialog
    00098 {
    00099         friend class G::Object;
    00100         friend class MessageDialogClass;
    00101
    00102         MessageDialog(const MessageDialog&);
    00103         MessageDialog& operator=(const MessageDialog&);
    00104
    00105 protected:
    00108
    00109         explicit MessageDialog(GtkMessageDialog *dialog, bool reference = false);
    00116
    00118 //  Properties
    00119
    00120         typedef G::WritableProperty<ButtonType, int> ButtonsPropertyType;
    00121         typedef G::PropertyProxy<G::Object, ButtonsPropertyType> ButtonsPropertyProxy;
    00122         static const ButtonsPropertyType buttons_property;
    00123
    00124         typedef G::Property<MessageType, int> MessageTypePropertyType;
    00125         typedef G::PropertyProxy<G::Object, MessageTypePropertyType> MessageTypePropertyProxy;
    00126         static const MessageTypePropertyType message_type_property;
    00127
    00128 public:
    00131
    00132         MessageDialog(Window *parent = 0, DialogFlagsField flags = DIALOG_DESTROY_WITH_PARENT);
    00142
    00143         MessageDialog(MessageType type, ButtonType buttons, Window *parent = 0, DialogFlagsField flags = DIALOG_DESTROY_WITH_PARENT);
    00154
    00155         MessageDialog(MessageType type, ButtonType buttons, const String& message, Window *parent = 0, DialogFlagsField flags = DIALOG_DESTROY_WITH_PARENT);
    00166
    00167         virtual ~MessageDialog();
    00169
    00173
    00174         GtkMessageDialog* gtk_message_dialog() const { return (GtkMessageDialog*)instance; }
    00176
    00177         GtkMessageDialogClass* gtk_message_dialog_class() const;
    00179
    00180         operator GtkMessageDialog* () const;
    00182
    00186
    00187         void set_message(const String& message);
    00190
    00191         void set_message(const char *message_format, ...);
    00195
    00199
    00200         const ButtonsPropertyProxy prop_buttons()
    00201         {
    00202                 return ButtonsPropertyProxy(this, &buttons_property);
    00203         }
    00205
    00206         const MessageTypePropertyProxy prop_message_type()
    00207         {
    00208                 return MessageTypePropertyProxy(this, &message_type_property);
    00209         }
    00211
    00213 };
    00214
    00215 } // namespace Gtk
    00216
    00217 } // namespace Inti
    00218
    00219 #endif // INTI_GTK_MESSAGE_DIALOG_H
    00220

Main Page - Footer