soccer jersey forums.silverfrost.com :: View topic - New format code %cd
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

New format code %cd
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
wahorger



Joined: 13 Oct 2014
Posts: 1225
Location: Morrison, CO, USA

PostPosted: Tue Aug 29, 2023 4:27 pm    Post subject: Reply with quote

Paul, thanks! This is most helpful, and is exactly what I was looking for.

I think (generally) that you are correct that the flags modification might not be needed.

That said, I have a couple of "specialized" file selections that could be enhanced by using some of the OPN_* flags being set or reset.

Bill
Back to top
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 1225
Location: Morrison, CO, USA

PostPosted: Thu Aug 31, 2023 7:46 pm    Post subject: Reply with quote

I've been experimenting and also adding this new feature into the production code, and have a additional comments as FWIW to those looking to use this.

First Finding: The explanation of the priority of the common dialog to use directories is convoluted; the MSDN explanation is not easily decipherable by humans. That said, there are some things to be aware of when using certain options. This is the example I am dealing with right now.

I was using a relative folder name ".\IMPORT" as input to "[initialdir]". I open the first file of three with this, select the file, all is OK. Next, I select the second file, also with a relative path of ".\IMPORT". Now the folder I am directed to to find the file is: "C:\DATAFOLDER\IMPORT\IMPORT". The third file is is now asked for in the folder "C:\DATAFOLDER\IMPORT\IMPORT\IMPORT". Get the drift.

All this is in keeping with the hierarchy of folders explanation in the MSDN documentation. get_filtered_file@() did not operate this was because you could set the initial folder for the dialog separately and it did not use the previous settings.

I "fixed" this by removing the setting of "[initialdir]", and making the "[file]" set to ".\IMPORT\filename.txt" (for example). Now, the folder relative honors the directory to which I am "attached" in all cases.

Second Finding: I really needed the same functionality as "can exist" and "must exist". To use this, I was able to use the "[flags]" option, get the current default flag bits, and clear the OFN_FILEMUSTEXIST bit.

Similarly, I needed a "Save As" but without the verification of whether to overwrite or not. Again, used the current state of the flags and removed the OFN_OVERWRITEPROMPT, allowing the Save dialog to be shown, but without requiring verification. One reason is that the file extent you choose is not automatically added to the file you select. For example, if I have the file in a folder "ABCD.TXT", and type for the file name "ABCD" and have the "*.txt" specification set then click OK, the file name returned does not have the file extent appended to it, so even if you wanted to verify the overwrite, it wouldn't happen. Some MSDN documentation implies that only 3 character extents can be applied automatically, but I cannot get even that to happen. It is a manual, after-the-fact process to add/modify the file extent, thus doing an overwrite verification in the open/save dialog is not useful.

I am not an MSDN expert by any stretch of the imagination. If anyone has a better understanding OR can shed light on some of these issues, I'd appreciate it!

All that said, it is a much more flexible system to use!
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group