// generated by Fast Light User Interface Designer (fluid) version 1.0109 #include "fdtool.h" // (c) Robert Shingledecker #include using namespace std; void btnCallback(Fl_Widget*, void* userdata) { if (userdata == "cancel") exit(1); string command; string commandA = "aterm +tr -bg white -fg black -geometry 80x4 -T "; string commandB = " -e floppytool.sh "; if (userdata == "format") { command = commandA + "\"Ridimensionamento e Formattazione Floppy\" " + commandB; if (btn1440 -> value() == 1) command += "format 1440"; else command += "format 1722"; } else { string strImagePath = inpImagePath -> value(); if (userdata == "mkimage" ) { command = commandA + "\"Creazione Immagine da Floppy\"" + commandB; if (btn1440 -> value() == 1) command += "makeimage 1440 " + strImagePath; else command += "makeimage 1722 " + strImagePath; } if (userdata == "apimage") { command = commandA + "\"Creazione Floppy da File Immagine\"" + commandB; if (btn1440 -> value() == 1) command += "applyimage 1440 " + strImagePath; else command += "applyimage 1449 " + strImagePath; } } system(command.c_str()); } void inp_callback(Fl_Widget*, void*) { btnMkImage->activate(); btnApImage->activate(); } Fl_Round_Button *btn1440=(Fl_Round_Button *)0; Fl_Round_Button *btn1722=(Fl_Round_Button *)0; Fl_Input *inpImagePath=(Fl_Input *)0; Fl_Button *btnMkImage=(Fl_Button *)0; Fl_Button *btnApImage=(Fl_Button *)0; int main(int argc, char **argv) { Fl_Double_Window* w; { Fl_Double_Window* o = new Fl_Double_Window(490, 155); w = o; { Fl_Box* o = new Fl_Box(10, 29, 470, 116, "Strumento x Floppy Disk"); o->box(FL_EMBOSSED_FRAME); o->align(FL_ALIGN_TOP); } // Fl_Box* o { btn1440 = new Fl_Round_Button(125, 40, 64, 15, "1&440k"); btn1440->down_box(FL_ROUND_DOWN_BOX); btn1440->value(1); btn1440->selection_color((Fl_Color)2); btn1440->type(FL_RADIO_BUTTON); } // Fl_Round_Button* btn1440 { btn1722 = new Fl_Round_Button(265, 40, 64, 15, "1&722k"); btn1722->down_box(FL_ROUND_DOWN_BOX); btn1722->selection_color((Fl_Color)2); btn1722->type(FL_RADIO_BUTTON); } // Fl_Round_Button* btn1722 { inpImagePath = new Fl_Input(105, 65, 355, 25, "Perc. Immag.:"); inpImagePath->callback((Fl_Callback*)inp_callback); inpImagePath->when(FL_WHEN_CHANGED); } // Fl_Input* inpImagePath { Fl_Button* o = new Fl_Button(40, 100, 90, 25, "&Formatta"); o->tooltip("Formats FAT of selected size."); o->callback((Fl_Callback*)btnCallback, (void*)("format")); } // Fl_Button* o { btnMkImage = new Fl_Button(145, 100, 90, 25, "&Crea Imm."); btnMkImage->tooltip("Copies floppy to image path entered,"); btnMkImage->callback((Fl_Callback*)btnCallback, (void*)("mkimage")); btnMkImage->deactivate(); } // Fl_Button* btnMkImage { btnApImage = new Fl_Button(250, 100, 90, 25, "A&pplica Imm."); btnApImage->tooltip("Writes image path file to floppy."); btnApImage->callback((Fl_Callback*)btnCallback, (void*)("apimage")); btnApImage->deactivate(); } // Fl_Button* btnApImage { Fl_Button* o = new Fl_Button(355, 100, 90, 25, "&Annulla"); o->callback((Fl_Callback*)btnCallback, (void*)("cancel")); } // Fl_Button* o o->end(); } // Fl_Double_Window* o w->show(argc, argv); return Fl::run(); }