Interactor* FileChooser::Interior(const char* acptLbl) { const int space = Math::round(.5*cm); VBox* titleblock = new VBox( new HBox(title, new HGlue), new HBox(subtitle, new HGlue) ); return new MarginFrame( new VBox( titleblock, new VGlue(space, 0), new Frame(new MarginFrame(_sedit, 2)), new VGlue(space, 0), new Frame(AddScroller(browser())), new VGlue(space, 0), new HBox( new VGlue(space, 0), new HGlue, new PushButton("Cancel", state, '\007'), new HGlue(space, 0), new PushButton(acptLbl, state, '\r') ) ), space, space/2, 0 ); }
FileDialog::FileDialog ( const char* msg, const char* dir, const char* confirmLbl ) { int space = Math::round(fspace*ivcm); _browser = new FileBrowser(state, dir, 20, 35, false, Reversed,"\000\007"); _dirs = new FileBrowser( "dirBrowser", state, dir, 20, 24, true, Reversed,"d\007" ); _dirs->SetTextFilter("^$"); // show directories only _dirs->Update(); _cur_dir = new MarginFrame(new Message("path", FullPath(_dirs))); HBox* dirBox = new HBox( new Message("Directory: "), _cur_dir, new HGlue ); dirBox->Propagate(false); Insert( new MarginFrame( new VBox( new HBox( new VBox( new Message("Change directory to:", Left, 0, hfil), new Frame(AddScroller(_dirs)) ), new HGlue(space, 0), new VBox( new Message(msg, Left, 0, hfil), new Frame(AddScroller(_browser)) ) ), new VGlue(space, 0), dirBox, new VGlue(space, 0), new HBox( new HGlue, new PushButton(" Cancel ", state, '\007'), new HGlue(space, 0), new PushButton(confirmLbl, state, '\r') ) ), space, space, 0 ) ); }