// -*- c++ -*- // Generated by gtkmmproc from ./../dialog.gen_h -- DO NOT MODIFY! #ifndef _GNOMEMM_DIALOG_H #define _GNOMEMM_DIALOG_H /* $Id: dialog.gen_h,v 1.53 2001/08/03 20:00:29 murrayc Exp $ */ /* dialog.gen_h, dialog.h * * Copyright (C) 1998 EMC Capital Management Inc. * Developed by Havoc Pennington * * Copyright (C) 1999 The Gtk-- Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include namespace Gtk { class Editable; class VBox; class Button; } namespace Gnome { class Dialog; class Dialog_Class; } namespace Gtk { Gnome::Dialog *wrap (GnomeDialog *o); } namespace Gnome { //: Create popup windows. //- Unlike GnomeDialog in C, Gnome::Dialog does not self-destruct when //- run() or run_and_close() returns, so you can use it again. //- Just delete it later, like any other Window. class Dialog : public Gtk::Window { public: typedef Dialog CppObjectType; typedef Dialog_Class CppClassType; typedef GnomeDialog BaseObjectType; typedef GnomeDialogClass BaseClassType; private: friend class Dialog_Class; static CppClassType dialog_class; Dialog(const Dialog&); Dialog& operator=(const Dialog&); // not implemented protected: void initialize_class(); explicit Dialog(GnomeDialog *castitem); public: static GtkType get_type(); GnomeDialog* gtkobj() { return (GnomeDialog*)(gtkobject); } const GnomeDialog* gtkobj() const { return (GnomeDialog*)(gtkobject); } static bool isA(Gtk::Object *checkcast); // Hook for proxies static const char* const signal_names[]; virtual ~Dialog(); private: public: typedef SigC::Slot0 Callback; Dialog(); Dialog(const Gtk::string &title, const Gtk::SArray &buttons); public: Gtk::VBox* get_vbox() const; //: returns the button indexed by number. Gtk::Button* get_button(gint number) const; //: connects a callback to a button. //- This is short for dialog.get_button(number)->clicked.connect(s) void connect(gint number, const Callback& s); void set_parent(Gtk::Window& parent); //: Make the dialog modal until a button is clicked. //- returns button number or -1 for none. gint run(); gint run_and_close(); //: Set the default button void set_default(gint button); //: Set button sensitivity void set_sensitive(gint button,gboolean setting); //: Accelerator for a button void set_accelerator(gint button,const guchar accelerator_key,guint8 accelerator_mods); //: Close the dialog, either by hiding or destroying void cause_close(); //: Whether the dialog does delete_self() or just hide() on close. //- For Gnome-- this is set in the constructor. //- It is very unlikely that you would want to set this to false, //- because it could free the memory used by member variables, //- or leave your pointers pointing to freed memory. void close_hides(gboolean just_hide=true); //: Whether any button click should trigger a close. void set_close(gboolean click_closes); //: Use a stock button name to get stock features, or just use your own text. //- e.g. GNOME_STOCK_BUTTON_OK: See gnome-stock.h void append_button(const Gtk::string& name); void append_button(const Gtk::string& name,const Gtk::string& pixmap); // Will wrap those only if there's a request for it - GL // gnome_dialog_append_buttons() // gnome_dialog_append_buttonsv() // gnome_dialog_append_buttons_with_pixmaps() //: Whether pushing return in this editable should //: activate the default button. void editable_enters(Gtk::Editable& e); //: gint is the button number. //: //- For Gtk+, the return value of the close handler allows or blocks //- the close; for gtk--, it is basically irrelevant (just override the //- default close_impl to block the close) public: union { CppObjectType * dialog_self; Gtk::ProxySignal1 clicked; Gtk::ProxySignal0 close; }; protected: // impl functions virtual void clicked_impl(gint p0); virtual gboolean close_impl(); }; // Stock dialogs namespace Dialogs { // these produce popup dialogs of various types. // ones with a parent are best done using Gnome::App::dialogname // // We are going to reverse the argument from the way they are in gnome. // (as we overload). Parent is really the most important argument. // // All are managed and will automatically free when finished. (?) //: Create a ok message dialog. //- Use this when you have a message which must be acknoledged by the //- user. If you are just placing a status try {Gnome::App::flash()} Dialog* ok(const Gtk::string &msg); Dialog* ok(Gtk::Window& parent,const Gtk::string &msg); //: Create a fatal error dialog. //- This should represent a fatal error which the program will likely //- save and quit. It contains a ok button. Dialog* error(const Gtk::string &msg); Dialog* error(Gtk::Window& parent,const Gtk::string &msg); //: Create a warning dialog. //- This is more sever than an ok dialog but not fatal. Dialog* warning(const Gtk::string &msg); Dialog* warning(Gtk::Window& parent,const Gtk::string &msg); //: Create a yes/no question dialog. Dialog* question(const Gtk::string& msg, ReplyCallback callback = 0); Dialog* question(Gtk::Window &parent, const Gtk::string &msg, ReplyCallback callback=0); //: Create a yes/no question dialog (modal). Dialog* question_modal(const Gtk::string &msg, ReplyCallback callback=0); Dialog* question_modal(Gtk::Window &parent, const Gtk::string &msg, ReplyCallback callback=0); //: Create a ok/cancel dialog (modal). Dialog* ok_cancel(const Gtk::string &msg, ReplyCallback callback=0); Dialog* ok_cancel(Gtk::Window &parent, const Gtk::string &msg, ReplyCallback callback=0); Dialog* ok_cancel_modal(const Gtk::string &msg, ReplyCallback callback=0); Dialog* ok_cancel_modal(Gtk::Window &parent, const Gtk::string &msg, ReplyCallback callback=0); Dialog* request(bool hidden, const Gtk::string &prompt, const Gtk::string &default_text, const guint16 max_length, StringCallback cb=0); Dialog* request(Gtk::Window& parent, bool hidden, const Gtk::string &prompt, const Gtk::string &default_text, const guint16 max_length, StringCallback cb=0); } /* namespace Dialogs */ } #endif .