// $Id: bbox.cc,v 1.21 2003/03/05 09:33:34 christof Exp $ /* glade--: C++ frontend for glade (Gtk+ User Interface Builder) * Copyright (C) 1998 Christof Petig * Copyright (C) 1999-2000 Adolf Petig GmbH & Co. KG, written by Christof Petig * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "box.hh" // glade does not have a buttonbox, so this is fully untested / guessed class Gtk_ButtonBox : public Gtk_Box {public: typedef Gtk_Box Parent; virtual const std::string TypeName(const Widget &w) const; virtual const std::string IncludeName(const Widget &w) const; Gtk_ButtonBox(); virtual bool NeedExplicitCtor(const Widget &w) const { return true; } virtual void ConstructionArgs(Widget const &w, CxxFile &f) const; virtual void Configure(const Widget &w, CxxFile &f,const std::string &instance) const; }; static Gtk_ButtonBox Gtk_ButtonBox; const std::string Gtk_ButtonBox::TypeName(const Widget &w) const { return GtkPrefix()+(w.Class()[3]=='H'?"HButtonBox":"VButtonBox"); } const std::string Gtk_ButtonBox::IncludeName(const Widget &w) const { return Configuration.GtkmmIncludePath()+"buttonbox.h"; } Gtk_ButtonBox::Gtk_ButtonBox() { // Writer["GtkButtonBox"]=this; Writer["GtkHButtonBox"]=this; Writer["GtkVButtonBox"]=this; } void Gtk_ButtonBox::ConstructionArgs(Widget const &w, CxxFile &f) const { f.FunctionArg(); if (w.hasProperty("layout_style")) f << Gtkmm2Namespace(w.getProperty("layout_style","GTK_BUTTONBOX_DEFAULT_STYLE")); else f << Gtkmm2Namespace(w.getProperty("layout","GTK_BUTTONBOX_DEFAULT_STYLE")); f.FunctionArg() << w.getIntProperty("spacing"); } void Gtk_ButtonBox::Configure(const Widget &w, CxxFile &f,const std::string &instance) const { Parent::Configure(w,f,instance); if (!w.ChildName().empty()) // our ctor was never called { // property_layout_style() if (GTKMM2) WriteEnumPropertyNS(w,f,instance, "layout_style", true); // set_layout WriteEnumPropertyNS(w,f,instance, "layout"); WriteIntProperty(w,f,instance, "spacing"); } }