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


C++ FileSel::ExecuteOpen方法代码示例

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


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

示例1: AddFile

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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: Open

void AddressBook::Open()
{
	if(!fs.ExecuteOpen()) return;
	filename = fs;
	FileIn in(filename);
	if(!in) {
		Exclamation("Unable to open [* " + DeQtf(filename));
		return;
	}
	array.Clear();
	while(!in.IsEof()) {
		Vector<Value> q;
		for(int i = 0; i < 4; i++)
			q.Add(in.GetLine());
		array.Add(q);
	}
}
开发者ID:ultimatepp,项目名称:mirror,代码行数:17,代码来源:AddressBook.cpp

示例7: 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

示例8: DataPageImportCSV

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

	if ( ! fs.ExecuteOpen(t_("")) )
		return;

	csvResult csv ;
	if ( ! csv.ImportFrom(fs.Get()) )
		return ;


	WithcsvToDefLayout<TopWindow> dlg;
	CtrlLayout(dlg, "Import From CSV");
	for (int i = 0; i < csv.fields.GetCount(); i++)
	{
		dlg.dropName.Add( csv.fields[i] ) ;
		dlg.dropEmail.Add( csv.fields[i] ) ;
	}
	dlg.dropName.SetIndex(0) ;
	dlg.dropEmail.SetIndex(1) ;
	dlg.btOk.WhenAction = Breaker(IDOK) ;
	dlg.btCancel.WhenAction = Breaker( IDCANCEL ) ;
	if (dlg.Execute() == IDOK)
	{
		if (PromptOKCancel("Con esta operación se van a eliminar [* TODOS]") == IDOK)
		{
			// añadimos la cabecera
			theDefList.fields.Clear() ;
			theDefList.fields.Add( dlg.dropName.GetValue() ) ;
			theDefList.fields.Add( dlg.dropEmail.GetValue() ) ;

			for (int i = 0; i < csv.fields.GetCount(); i++)
			{
				String f = csv.fields[i] ;
				if (f != theDefList.fields[0] && f != theDefList.fields[1])
					theDefList.fields.Add(f) ;
			}


			theDefList.data.Clear() ;
			for (int i = 0; i < csv.values.GetCount(); i++) // para cada registro
			{
				Vector<String>& line = csv.values[i] ;
				Vector<String>& record = theDefList.data.Add() ;

				for (int j = 0; j < theDefList.fields.GetCount(); j++)
				{
					String fieldName = theDefList.fields[j] ;
					for (int k = 0; k < csv.fields.GetCount(); k++)
					{
						if (fieldName == csv.fields[k])
						{
							record.Add( line[k] ) ;
							break ;
						}
					}
				}
			}

			theDefList.Save() ;
			DataPageFill() ;

		}
	}

}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:69,代码来源:listDefinition.cpp


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