cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Saving to textfile problem

Text file saving problem

Only 2 question
1. Why I have to type ./Text1.txt.txt To Get The file dialog work
2. How can I filter only text file using DG::FileDialog
	DG::FileDialog dlg (DG::FileDialog::Save);
	dlg.SetTitle ("Save File");
    dlg.SetOKButtonText ("Save");
    dlg.SetCancelButtonText ("Cancel");
	dlg.SelectFile (IO::Location ("./Text1.txt.txt"));
	dlg.Invoke();
	int count = dlg.GetSelectionCount ();
Is this a bug

I'm using API Devkit 14.2550
4 Replies 4
Paodekcal wrote:
Text file saving problem Only 2 question
1. Why I have to type ./Text1.txt.txt To Get The file dialog work
2. How can I filter only text file using DG::FileDialog
You could try using DGGetSaveFile instead.
Ralph Wessel BArch
Central Innovation
Anonymous
Not applicable
Thanks , and I find this board

http://archicad-talk.graphisoft.com/viewtopic.php?p=116737&highlight=dggetsavefile#116737

I can find. But I don't know how to use.

Do you have any example code?

I don't know what meaning of the parameter to use.
Paodekcal wrote:
I can find. But I don't know how to use.
Do you have any example code?
I don't know what meaning of the parameter to use.
In the past, there was example code for this with the API. It's missing in more recent releases, but please find the original code below:
	DGTypePopupItem	popup[1] = {
		{"Text File",			"txt",		'TEXT'}
	};


	CIO::Location	loc;
	long			typeID;
	CIO::Location	defLoc("Text1.txt");
	if (!DGGetSaveFile (&loc, &typeID, 1, popup, &defLoc, "DGTest: Save File",
		DG_OF_DONT_DISPLAY_EXTENSIONS | DG_OF_NO_ROOT_GROUP))
	{
		return (false);
	}
Ralph Wessel BArch
Central Innovation
Anonymous
Not applicable
I have tested your code. It can solve problem.
Thank you very much.

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!