build error log:
Building file: ../dialogs/MasterConfigurationDialog.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"dialogs/MasterConfigurationDialog.d" -MT"dialogs/MasterConfigurationDialog.d" -o"dialogs/MasterConfigurationDialog.o" "../dialogs/MasterConfigurationDialog.cpp"
/usr/include/FL/Fl_Group.H: In copy constructor MasterConfigurationDialog::Transformation::Transformation(const MasterConfigurationDialog::Transformation&):
/usr/include/FL/Fl_Group.H:47: error: Fl_Group::Fl_Group(const Fl_Group&) is private
../dialogs/../include/MasterConfigurationDialog.h:77: error: within this context
../dialogs/MasterConfigurationDialog.cpp: In constructor MasterConfigurationDialog::MasterConfigurationDialog():
../dialogs/MasterConfigurationDialog.cpp:55: note: synthesized method MasterConfigurationDialog::Transformation::Transformation(const MasterConfigurationDialog::Transformation&) first required here
make: *** [dialogs/MasterConfigurationDialog.o] Error 1
make: Target `all' not remade because of errors.
code (incomplete)
// transformation class widget
class Transformation : public Fl_Group {
public:
// the format for fields is "<type1:|field1|field2|field3|" ... "|fieldN|><type2:|field1|field2||field3|" ... "|fieldN|>" ...
// name must be a key; name is the currently selected key
Transformation(int x, int y, const char* fields, bool active) :
Fl_Group(x, y, WIDTH - 10, 2*(DEFAULT_TEXTSIZE) + 6) {
this->end();
string transforms = string(fields);
transformTypes = vector<string>();
// initialize data
format = string(fields);
this->fields = vector<Fl_Float_Input*>();
// initialize the members
typeMenu = new Fl_Menu_Button(x + 30, y, 100, DEFAULT_TEXTSIZE + 6);
activeButton = new Fl_Check_Button(x, y, DEFAULT_TEXTSIZE + 6, DEFAULT_TEXTSIZE + 6);
activeButton->value(active);
// find all the transformation types
while(true) {
// find the < and : to get the types
string::size_type start = transforms.find("<", 0);
string::size_type end = transforms.find(":", 0);
// get the type
string key = transforms.substr( start+1, end - (start+1) );
// add the type
transformTypes.push_back( key );
// advance transforms
transforms = transforms.substr( end+1 );
// break when we run out of string
if(transforms.length() <= 2)
break;
}
// build the transformation types menu
for(vector<string>::iterator i = transformTypes.begin(); i != transformTypes.end(); i++) {
typeMenu->add( i->c_str(), 0, this->getTransformationCallback, this);
}
// label it
// typeMenu->label(name);
// add the widgets
this->add(typeMenu);
this->add(activeButton);
}
virtual ~Transformation() { }
// read the transformation type from the menu
static void getTransformationCallback(Fl_Widget* w, void* data) {
Transformation* t = (Transformation*)(data);
Fl_Menu_Button* mb = (Fl_Menu_Button*)(w);
t->getTransformationCallback_real(t, mb);
}
// getters
string getTransformationType(void) { return string( typeMenu->label() ); }
vector<string> getSupportedTransformations(void) { return transformTypes; }
bool isActive(void) { return activeButton->value(); }
// return string representation in BZW format
string toString() {
return string(typeMenu->label()) + "\n";
}
private:
// label the menu button with the selection
void getTransformationCallback_real(Transformation* t, Fl_Menu_Button* mb) {
const Fl_Menu_Item* menu = mb->menu();
mb->label(menu[mb->value()].label());
}
// change callbacks based on a new selection
void changeFields(const char* name) {
string transformation = string( name );
// remove previous fields
if(fields.size() != 0) {
for(vector<Fl_Float_Input*>::iterator i = fields.begin(); i != fields.end(); i++) {
this->remove(*i);
delete *i;
}
}
// cut out the list of fields
string::size_type startIndex = format.find("<" + transformation + ":", 0);
startIndex = format.find("|", startIndex);
string::size_type endIndex = format.find("|>", startIndex);
string fieldList = format.substr(startIndex, endIndex - startIndex);
printf("%s\n", fieldList.c_str());
// find all fields and make them
}
// data
vector<string> transformTypes;
Fl_Menu_Button* typeMenu;
Fl_Check_Button* activeButton;
vector<Fl_Float_Input*> fields;
string format;
};