paramradiobutton.cpp revision 61edfab2b82c1347e80f19ae297b9c86c4c30833
/** \file
* extension parameter for radiobuttons.
*
* It uses a Gtk:ComboBoxText widget in the extension UI.
*/
/*
* Author:
* Johan Engelen <johan@shouraizou.nl>
*
* Copyright (C) 2006 Author
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <gtkmm/radiobutton.h>
#include <gtkmm/radiobuttongroup.h>
#include <gtkmm/tooltips.h>
#include "extension.h"
#include "prefs-utils.h"
#include "document-private.h"
#include "sp-object.h"
#include "paramradiobutton.h"
/** \brief The root directory in the preferences database for extension
related parameters. */
#define PREF_DIR "extensions"
namespace Inkscape {
namespace Extension {
ParamRadioButton::ParamRadioButton (const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) :
{
// Read XML tree to add enumeration items:
// printf("Extension Constructor: ");
while (child_repr != NULL) {
}
}
}
// Initialize _value with the default value from xml
// for simplicity : default to the contents of the first xml-child
const char * defaultval = NULL;
if (defaultval != NULL)
return;
}
ParamRadioButton::~ParamRadioButton (void)
{
//destroy choice strings
delete text;
}
}
/** \brief A function to set the \c _value
\param in The value to set
\param doc A document that should be used to set the value.
\param node The node where the value may be placed
This function sets ONLY the internal value, but it also sets the value
in the preferences structure. To put it in the right place, \c PREF_DIR
and \c pref_name() are used.
To copy the data into _value the old memory must be free'd first.
It is important to note that \c g_free handles \c NULL just fine. Then
the passed in value is duplicated using \c g_strdup().
*/
const gchar *
{
return _value;
}
/**
\brief A function to get the current value of the parameter in a string form
\return A string with the 'value' as command line argument
*/
ParamRadioButton::string (void)
{
*param_string += "\"";
*param_string += _value;
*param_string += "\"";
return param_string;
}
/** \brief A special radiobutton class to use in ParamRadioButton */
private:
SPDocument * _doc;
public:
/** \brief Build a string preference for the given parameter
\param pref Where to put the radiobutton's string when it is selected.
*/
};
};
void add_changesignal() {
};
void changed (void);
};
/** \brief Respond to the selected radiobutton changing
This function responds to the radiobutton selection changing by grabbing the value
from the text box and putting it in the parameter.
*/
void
ParamRadioButtonWdg::changed (void)
{
if (this->get_active()) {
}
}
/**
\brief Creates a combobox widget for an enumeration parameter
*/
{
// add choice strings as radiobuttons
// and select last selected option (_value)
bool first = true;
if (first) {
first = false;
} else {
}
radio->set_active();
}
}
}
} /* namespace Extension */
} /* namespace Inkscape */