LIGHTNING UK!
14th September 2003 11:39 UTC
DirText issue
When trying to override the default GUI text using the DirText variable, I keep getting the following error from MakeNSISW
DirText expects 0-3 parameters, got 4.
Usage: DirText [directory_page_description] [directory_page_subtext] [browse_button_text] [browse_dlg_text]
Ok, now to me that looks like 4 parameters going by the 'Usage' text, I'm supplying 4, so why does the function want 0 - 3?!
btw, im using the latest nightly cvs snapshot - downloaded about 10 mins ago.
kichik
14th September 2003 11:45 UTC
Thanks, that's a little typo in tokens.cpp. I have fixed this on my local version, but I can't upload right now because it includes far more than just this fix. I hope to upload it this evening. If you have a compiler you can change tokens.cpp line 49 to:
{TOK_DIRTEXT,"DirText",0,4,"[directory_page_description] [directory_page_subtext] [browse_button_text] [browse_dlg_text]"},
LIGHTNING UK!
14th September 2003 12:23 UTC
And just one more thing while im in the 'fixing bugs' frame of mind...
BIF_RETURNONLYFSDIRS doesnt work as it should do on XP and 2003 - and possibly other OS's. The SHBrowseForFolder function needs to also rely on its callback procedure. You can test this by selecting 'My Computer'. It 'should' grey out the Ok button but it doesnt.
I would like to suggest you add the following to 'BrowseCallbackProc' in the file UI.c
else if(uMsg==BFFM_SELCHANGED)
{
TCHAR szDir[MAX_PATH];
if(!SHGetPathFromIDList((LPITEMIDLIST) lparam ,szDir))
{
// Disable the OK button if the currently selected item isnt a valid path
SendMessage(hwnd, BFFM_ENABLEOK, 0, false);
}
}
You might also need to '|' an addition flag 'BIF_VALIDATE' in the BROSWEINFO structure before you call the SHBrowseForFolder function.
kichik
14th September 2003 13:55 UTC
Thanks, fixed that too.
LIGHTNING UK!
14th September 2003 14:48 UTC
Nice one :)
Now I just have to wait and see which nightly snapshot contains the fixes ;)
kichik
15th September 2003 22:55 UTC
Uploaded.