GNU Exterior Ballistics Computer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

46 lines
762 B

FileWindow::FileWindow(int w, int h, const char* title, char** fName) : Fl_Window(w,h,title){
this->complete=0;
this->set_modal();
char cwd[1024];
getcwd(cwd,1024);
FN = fName;
begin();
iFile = new Fl_File_Input(30,50,150,35,"File Name");
iFile->value(cwd);
btOK = new Fl_Button(w-55,h-35,50,30,"OK");
btOK->callback(cb_bt_OK,this);
show();
end();
}
FileWindow::~FileWindow(){
complete=1;
}
void FileWindow::cb_bt_OK(Fl_Widget* fw, void* t){
FileWindow* T = (FileWindow*)t;
T->fw_exit();
}
void FileWindow::fw_exit(){
char* k = (char*)malloc(sizeof(char)*strlen(iFile->value()));
strcpy(k,iFile->value());
printf("\nLOCATION 1: %s",k);
*FN = k;
this->~FileWindow();
}