[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[no subject]



Hello,

I'm trying to make a list of files, just like (well, almost)  the one in
vide (Project| Edit, files tab), except not a toggle Frame.

Trouble is, the pane to hold the list of selected files never get's updated,
i.e. always remians blank.  File selection appears to work because slecting
the same file twice brings up the "File already selected" message.
Because the code's so close to that in vide, I can't wee why it doesn't
work...

Here's snippets of relevant code:

File selection constructor:

batDlg::batDlg(vBaseWindow *base,char *title, vSList
*list):vModalDialog(base,title)
{

	batlist=list;
	AddDialogCmds(BatchCmds);

}

(vSList * is passed from the cmdwindow)

void batDlg::DialogCommand(ItemVal id,ItemVal retval, CmdType ctype)
{

	switch(id){

		case btnAddInpFile:
			{
				char MSDOSpath[200]="";
				int fi=0;
				static char *
makeFilter[]={"*.cpj","*.*",0};
				vFileSelect fsel(this);
				
				int oans=fsel.FileSelect("Add a Source
File",MSDOSpath,199,makeFilter,fi);

				if(oans && *MSDOSpath){//filename picked

					ta=1;//target file added
					char uxfn[200]="";
					Dos2UxFName(MSDOSpath,uxfn,0);

					if(!addFile(uxfn)){

						vNoticeDialog note(this);
						note.Notice("File already
selected!");

					}

				}

				SetValue(fList,-1,ChangeList);//Doesn't do
anything!!

				break;

			}

	}

	vModalDialog::DialogCommand(id,retval,ctype);

}

bool batDlg::addFile(char *n)
{

	if (!*n){

		return false;

	}

    // Filter name here... (add a behavior switch eventually)

    char* addName = stripDir(n);	// strip leading dir part

    for (int ix = 0 ; batlist->list[ix] != 0 ; ++ix){

		if (strcmp(batlist->list[ix], addName) == 0){
	
		    return false; //don't add a obj file twice

		}

	}

	batlist->insert(-1,addName);

    return true;

}


Martin

------------------------------------
Martin E. J. Waller
http://www.tgis.co.uk/home/mwaller/web/



Reply to: