void FormEdit::OpenFile() { UpdateChildZ(); FileSelector fs; fs.Type(t_("Form files"), "*.form"); fs.Type(t_("Form archives"), "*.fz"); fs.AllFilesType(); if (!fs.ExecuteOpen(t_("Open form..."))) return; Clear(); _File = ~fs; bool compression = false; if (Upp::GetFileName(_File).Find(".fz") >= 0) compression = true; _View.LoadAll(_File, compression); UpdateLayoutList(); UpdateChildZ(); Title((t_("Form Editor")) + String(" - ") + ::GetFileName(_File)); _Container.Set(_View, _View.GetPageRect().GetSize()); UpdateTools(); ProjectSaved(true); }
void RasterCtrlTestWindow::Menu_File_Open_cb() { String fileName; FileSelector fs; if(fs.ExecuteOpen("Please select a graphic file to view:")) rasterCtrl.Open(fs); } // END RasterCtrlTestWindow::Menu_File_Open()
void TestLeptonica::onPageLayout() { String fileName; FileSelector fs; Pix source; if(!PromptYesNo( "[= [* Page layout analysis demo]&&" "Please select a 1 bpp scanned image with mixed text and graphics&" "you can take one from TestLeptonica folder if you like&&" "[* CONTINUE ??]]" )) return; fs.ReadOnlyOption(); if(fs.ExecuteOpen("Please select image for page layout analysis:")) { FileIn s; if(!s.Open(~fs)) { PromptOK("Error opening image"); s.Close(); return; } // Loads pixraster from source raster CHECKR(source.Load(s), "Error loading image"); s.Close(); // apply line removal algothithm pixRaster.Clear(); PageLayout(source, pixRaster); // refresh the PixRasterCtrl control with the new image contents pixRasterCtrl.Reload(); pixRasterCtrl.SetPage(0); } }