// $Id: togglebutton.cc,v 1.34 2004/05/14 10:01:24 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 "togglebutton.hh" static Gtk_ToggleButton Gtk_ToggleButton(false); const std::string Gtk_ToggleButton::TypeName(const Widget &w) const { return GtkPrefix()+"Toggle"+(IsToolItem(w)?"Tool":"")+"Button"; } const std::string Gtk_ToggleButton::IncludeName(const Widget &w) const { return Configuration.GtkmmIncludePath()+"toggle"+(IsToolItem(w)?"tool":"")+"button.h"; } Gtk_ToggleButton::Gtk_ToggleButton(bool base_class_init) { if (!base_class_init) { Writer["GtkToggleButton"]=this; Writer["togglebutton"]=this; Writer["toggle"]=this; Writer["GtkToggleToolButton"]=this; } } void Gtk_ToggleButton::Configure(const Widget &w, CxxFile &f,const std::string &instance) const { Parent::Configure(w,f,instance); WriteBoolProperty(w,f,instance, "draw_indicator", false, "mode"); WriteBoolProperty(w,f,instance, "active"); } bool Gtk_ToggleButton::isInternalMethod(const Widget &w,std::string &method,const std::string &args,std::string &scope,bool &is_signal) const { const char prefix[]="gtk_toggle_button_"; const int plen(sizeof(prefix)-1); if (method.substr(0,plen)==prefix) method=method.substr(plen); if ((method=="set_mode" && matches("bool\\ \\_",args)) || (method=="set_active" && matches("bool\\ \\_",args))) { scope=Gtk_ToggleButton::TypeName(w); is_signal=false; return true; } return Parent::isInternalMethod(w,method,args,scope,is_signal); } std::string Gtk_ToggleButton::ToolBarElemName(const Widget &w) const { return ToolBarElemPrefix()+"ToggleElem"; }