本文整理汇总了C++中FileSel::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ FileSel::Get方法的具体用法?C++ FileSel::Get怎么用?C++ FileSel::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileSel
的用法示例。
在下文中一共展示了FileSel::Get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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()
示例2: 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);
}
示例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() ;
}
示例4: 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();
}
示例5: 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() ;
}
}
}