当前位置: 首页>>代码示例>>C++>>正文


C++ FileSel类代码示例

本文整理汇总了C++中FileSel的典型用法代码示例。如果您正苦于以下问题:C++ FileSel类的具体用法?C++ FileSel怎么用?C++ FileSel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了FileSel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnFile

void MainDlg::OnFile()
{
	FileSel dlg;
	dlg.ReadOnlyOption();
	dlg.ExecuteOpen( t_("Test") );
	dlg.ExecuteSaveAs( t_("Test") );
	dlg.ExecuteSelectDir( t_("Test") );
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:8,代码来源:main.cpp

示例2: IdeFs

void IdeFs(FileSel& fs)
{
	fs.WhenIcon = callback(IdeFileIcon);
	fs.AllFilesType();
	fs.Multi();
	fs.NoAsking();
	fs.ReadOnlyOption();
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:8,代码来源:ComDlg.cpp

示例3: DoBrowse

void DlgCompareDir::DoBrowse(Ctrl *field)
{
	FileSel fsel;
	fsel.AllFilesType();
	static String recent_dir;
	fsel <<= Nvl((String)~*field, recent_dir);
	if(fsel.ExecuteSelectDir())
		*field <<= recent_dir = ~fsel;
}
开发者ID:ultimatepp,项目名称:mirror,代码行数:9,代码来源:main.cpp

示例4: sSD

FileSel& sSD()
{
	static bool b;
	static FileSel fs;
	if(!b) {
		fs.AllFilesType();
		b = true;
	}
	return fs;
}
开发者ID:ultimatepp,项目名称:mirror,代码行数:10,代码来源:FindInFiles.cpp

示例5: Save

void LoggerCtrl::Save()
{
	FileSel fs;
	fs.Type("Text file", "*.txt");
	if(!fs.ExecuteSaveAs("Save Log to file")) return;
	String fn = fs.Get();
	if(fn.IsEmpty()) return;
	FileOut out(fn);
	Flush();
	DocEdit::Save(out);
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:11,代码来源:LogCtrl.cpp

示例6: AnyPackageFs

FileSel& AnyPackageFs()
{
	static FileSel fs;
	static bool b;
	if(!b) {
		fs.Type("Ultimate++ package (*.upp)", "*.upp");
		fs.AllFilesType();
		b = true;
	}
	return fs;
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:11,代码来源:ComDlg.cpp

示例7: Pdf

void ReportWindow::Pdf()
{
	static FileSel fs;
	static bool b;
	if(!b) {
		fs.Type(t_("PDF file"), "*.pdf");
		fs.AllFilesType();
	}
	if(!fs.ExecuteSaveAs(t_("Output PDF file")))
		return;
	SaveFile(~fs, UPP::Pdf(*report));
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:12,代码来源:ReportDlg.cpp

示例8: IdeWorkspace

void Ide::CreateMakefile()
{
    const Workspace& wspc = IdeWorkspace();
    if(wspc.GetCount() == 0) {
        PutConsole("Project is empty!");
        return;
    }
    FileSel mfout;
    mfout.AllFilesType();
    mfout <<= AppendFileName(GetFileDirectory(PackagePath(wspc[0])), "Makefile");
    if(!mfout.ExecuteSaveAs("Save makefile as"))
        return;
    SaveMakeFile(~mfout, true);
}
开发者ID:kolyden,项目名称:mirror,代码行数:14,代码来源:Build.cpp

示例9: onOpenList

void bigmailer::onOpenList()
{
	FileSel fs;
	fs.ActiveDir(ConfigFile("")) ;
	fs.Type("list files", "*.list") ;

	if ( ! fs.ExecuteOpen(t_("select a list file") ) )
		return;

	onCloseList() ;

	theDefList.Load(fs.Get()) ;
	SetTitle() ;
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:14,代码来源:listDefinition.cpp

示例10: GetActivePackage

void WorkspaceWork::AddFile(ADDFILE af)
{
	String active = GetActivePackage();
	if(active.IsEmpty()) return;
	FileSel *fs = &OutputFs();
	RealizeDirectory(GetLocalDir());
	switch(af)
	{
	case PACKAGE_FILE: fs = &BasedSourceFs(); fs->BaseDir(GetFileFolder(PackagePathA(active))); break;
	case ANY_FILE:     fs = &AnySourceFs(); break;
	case OUTPUT_FILE:  fs->ActiveDir(GetOutputDir()); break;
	case CONFIG_FILE:  fs->ActiveDir(GetConfigDir()); break;
	case HOME_FILE:    fs->ActiveDir(GetHomeDirectory()); break;
	case LOCAL_FILE:   fs->ActiveDir(GetLocalDir()); break;
	default: ; // GCC warns otherwise
	}
	if(!fs->ExecuteOpen("Add files to package..")) return;
	int fci = filelist.GetCursor();
	int cs = filelist.GetSbPos();
	int ci = fci >= 0 && fci < fileindex.GetCount() ? fileindex[fci] : -1;
	for(int i = 0; i < fs->GetCount(); i++) {
		Package::File& f = ci >= 0 ? actual.file.Insert(ci++) : actual.file.Add();
		f = (*fs)[i];
		f.readonly = fs->GetReadOnly();
	}
	SaveLoadPackage(false);
	filelist.SetSbPos(cs);
	filelist.SetCursor(fci >= 0 ? fci : filelist.GetCount() - 1);
	FileSelected();
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:30,代码来源:UppWspc.cpp

示例11: Browse

void AnimatedClip::Browse() {
	FileSel fs;
	
	fs.PreSelect(~fileName);
	fs.Type("Animation type", "*.gif, *.tif, *.tiff");
	
	if (fs.ExecuteOpen("Choose animation file"))
		fileName <<= ~fs;

	if (!clip.Load(~fileName)) {
		Exclamation("Invalid input");
		return;
	}
	numberPages = FormatInt(clip.GetPageCount());
	openedPage = FormatInt(clip.GetPage());
}
开发者ID:ultimatepp,项目名称:mirror,代码行数:16,代码来源:main.cpp

示例12: LoadImage

void ImageMT::LoadImage()
{
	FileSel dlg;
	dlg.Type("Image files","*.bmp *.png *.tif *.jpg");
	dlg.Type("Image: JPEG","*.jpg");
	dlg.Type("Image: Portable Nework Graphics","*.png");
	dlg.Type("Image: Tagged Image Format","*.tif");
	dlg.Type("Image: Windows Bitmap (24bit)","*.bmp");
	dlg.ActiveDir(GetCurrentDirectory());

	if(!dlg.ExecuteOpen("Open Image"))return;

	SetCurrentDirectory(dlg.GetActiveDir());

	String path = ~dlg;

	FileIn in(path);

	if(in.IsError())
	{
		String s = Format("Error opening image file %s",path);
		PromptOK(s);
		return;
	}

	One<StreamRaster> r = StreamRaster::OpenAny(in);

	if(!r)
	{
		String s = Format("Error opening streamraster file %s",path);
		PromptOK(s);
		return;
	}

	Layer* pLayer = new Layer;

	Size sz = GetSize();

	pLayer->m_img = r->GetImage();
	pLayer->m_rc.left = 0;
	pLayer->m_rc.right = 1;
	pLayer->m_rc.top = 0;
	pLayer->m_rc.bottom = 1;

	m_pLayers.Add(pLayer);
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:46,代码来源:main.cpp

示例13: while

void BaseSetupDlg::OnBrowseUpp()
{
    String s = ~upp;
    int b, e;
    if(upp.HasFocus())
        upp.GetSelection(b, e);
    else
        e = s.GetLength();
    b = e;
    while(b > 0 && s[b - 1] != ';')
        b--;
    while(e < s.GetLength() && s[e] != ';')
        e++;
    FileSel fsel;
    String pre = s.Left(b), post = s.Mid(e);
    fsel.ActiveDir(s.Mid(b, e - b));
    if(fsel.ExecuteSelectDir()) {
        String newdir = ~fsel;
        upp <<= pre + newdir + Nvl(post, ";");
        upp.SetWantFocus();
        OnUpp();
    }
}
开发者ID:kolyden,项目名称:mirror,代码行数:23,代码来源:BaseDlg.cpp

示例14: imageSelCb

// image selection callback
void XMLBarEditor::imageSelCb(void)
{
	static String lastPath = "";
	
	// opens a file selector, allows selection of some
	// kind of image formats
	FileSel fs;
	fs.ActiveDir(lastPath);
	fs.Type(t_("Image files"), "*.png,*.jpg,*.ico,*.bmp");
	if(!fs.ExecuteOpen(t_("Select icon file")))
		return;
	String path = fs.Get();
	lastPath = GetFileFolder(path);
	String ext = ToUpper(GetFileExt(path));
	Image img;
	if(ext != ".ICO")
		img = StreamRaster::LoadFileAny(path);
	else
	{
		String data = LoadFile(path);
		Vector<Image> imgVec;
		try
		{
		 	imgVec = ReadIcon(data);
		}
		catch(...)
		{
		}
		if(imgVec.GetCount())
			img = imgVec[0];
		else
			img = Null;
	}
	curIcon = img;
	itemPane.icon.SetImage(img);
	fieldsModCb();
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:38,代码来源:XMLMenuEditor.cpp

示例15: onCreate

/////////////////////////////////////////////////////////////////////////////////////
// create handler
void TPdfFrontend::onCreate(void)
{

	FileSel fs;
	
	// if no documents, just do nothing
	if(!Documents.GetCount())
		return;
	
	// first, gets last browsed path (if any)
	String cfgPath = GetPdfConfigPath() + "lastpath";
	if(FileExists(cfgPath))
	{
		FileIn f(cfgPath);
		fs.Set(f.GetLine());
	}
	
	// gets the output file name, returns if cancelled
	fs.DefaultExt(".pdf").Type("documenti pdf", "*.pdf");
	if(!fs.ExecuteSaveAs("Nome del documento pdf:"))
		return;

	// stores last active output path
	RealizeDirectory(GetPdfConfigPath());
	FileOut f(cfgPath);
	f.PutLine(fs.Get());

	// creates the command line and executes ghostscript
	String FileName = fs.Get();
    String args =
		"-q -dBATCH -dAutoFilterColorImages=false -sColorImageFilter=FlateEncode -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=\"" +
    	FileName + "\" \"" +
    	Documents[0] + "\"";
    for(int i = 1 ; i < Documents.GetCount(); i++)
    	args = args + " \"" + Documents[i] + "\"";
    String OutStr, ErrStr;
	bool res = SysExec("gs", args, Environment(), OutStr, ErrStr);

	// creates progress bar and hooks inside client
//	Progress progress("Creazione pdf in corso....");
//	Client.setProgress(progress);
//	progress.Create();
	
//	Client.setProgress(0);
//	if(progress.Canceled())
//		res = false;
	// if error, does nothing	
	if(!res)
		return;
	
	// clear collected documents
	ClearDocuments();
	
	// closes application
	Break(0);
	
} // END TPdfFrontend::onCreate()
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:59,代码来源:maxpdf_frontend.cpp


注:本文中的FileSel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。