|
Replies:
20
-
Last Post:
Oct 14, 2016 7:38 AM
Last Post By: Tom Roberts
|
|
|
Posts:
4
Registered:
4/11/99
|
|
My application is built with Delphi 10 Seattle on Windows 10.
I have encountered an issue with the TSaveDialog component when a custom style is used, any of the Embarcadero custom styles. In the TSaveDialog I have the ofOverwritePrompt option set. When I try to save to an existing file the overwrite prompt dialog box is not displayed properly. Only the top left corner is visible, about 30 x 60 pixels, so the text and buttons are not visible, in fact most users would not even notice it on the screen. The dialog is still active so pressing the spacebar clicks the default NO button and closes the dialog.
if I set the Style back to the default Windows style, the overwrite prompt displays properly.
I did find a workaround. By removing the shDialogs flag from the TStyleManager,SystemHooks property the overwrite prompt dialog displays properly when using custom Styles.
I believe this is a bug in the Seattle version that needs to be corrected. I have been using custom styles since the XE3 version and never encountered this issue until upgrading to Seattle Update 1.
Another oddity...
On my Windows 10 development machine the overwrite prompt dialog displays properly with custom styles without the workaround.
Running the same executable on my test client machine, the overwrite prompt dialog shows only the upper left corner. With the workaround applied the overwrite prompt displays properly.
This makes me wonder if there is some distributable files required for the custom styles with Seattle?
I've never had to distribute any files to use custom style in previous versions.
Edited by: Hal Burton on Jan 22, 2016 6:47 PM
|
|
|
Posts:
4
Registered:
9/22/99
|
|
I just encountered the same problem. Not a problem previously. Perhaps some Windows 10 update causes a problem. I have not recently updated Delphi. I am sure it worked fine a few weeks ago.
P.S. I just installed update 1 for Delphi 10 and have the same problem. It is rather embarrassing to release software with this problem!
Jim
My application is built with Delphi 10 Seattle on Windows 10.
I have encountered an issue with the TSaveDialog component when a custom style is used, any of the Embarcadero custom styles. In the TSaveDialog I have the ofOverwritePrompt option set. When I try to save to an existing file the overwrite prompt dialog box is not displayed properly. Only the top left corner is visible, about 30 x 60 pixels, so the text and buttons are not visible, in fact most users would not even notice it on the screen. The dialog is still active so pressing the spacebar clicks the default NO button and closes the dialog.
if I set the Style back to the default Windows style, the overwrite prompt displays properly.
I did find a workaround. By removing the shDialogs flag from the TStyleManager,SystemHooks property the overwrite prompt dialog displays properly when using custom Styles.
I believe this is a bug in the Seattle version that needs to be corrected. I have been using custom styles since the XE3 version and never encountered this issue until upgrading to Seattle Update 1.
Another oddity...
On my Windows 10 development machine the overwrite prompt dialog displays properly with custom styles without the workaround.
Running the same executable on my test client machine, the overwrite prompt dialog shows only the upper left corner. With the workaround applied the overwrite prompt displays properly.
This makes me wonder if there is some distributable files required for the custom styles with Seattle?
I've never had to distribute any files to use custom style in previous versions.
Edited by: Hal Burton on Jan 22, 2016 6:47 PM
Edited by: F.James Rohlf on Jan 25, 2016 10:20 PM
|
|
|
|
Posts:
2
Registered:
2/23/01
|
|
Did you enter a bug report for this? It is definitely a problem.
|
|
|
|
Posts:
4
Registered:
9/22/99
|
|
No, I did not. I have not done that before. Not sure of the procedure.
Did you enter a bug report for this? It is definitely a problem.
|
|
|
|
Posts:
1,227
Registered:
12/16/99
|
|
F.James Rohlf wrote:
No, I did not. I have not done that before. Not sure of the procedure.
Did you enter a bug report for this? It is definitely a problem.
Go to https://quality.embarcadero.com . Log in using the EDN account
you used to register your Delphi/RAD Studio. The rest should be fairly
self-explanatory.
--
Peter Below
TeamB
|
|
|
|
Posts:
4
Registered:
4/11/99
|
|
I have not submitted a bug report either. If you have, or will be submitting a bug report I will stay out if it. If you are not submitting the bug report then I will.
No, I did not. I have not done that before. Not sure of the procedure.
Did you enter a bug report for this? It is definitely a problem.
|
|
|
|
Posts:
4
Registered:
9/22/99
|
|
I just submitted a report.
I have not submitted a bug report either. If you have, or will be submitting a bug report I will stay out if it. If you are not submitting the bug report then I will.
No, I did not. I have not done that before. Not sure of the procedure.
Did you enter a bug report for this? It is definitely a problem.
|
|
|
|
Posts:
4
Registered:
4/11/99
|
|
Thanks James.
I just submitted a report.
I have not submitted a bug report either. If you have, or will be submitting a bug report I will stay out if it. If you are not submitting the bug report then I will.
No, I did not. I have not done that before. Not sure of the procedure.
Did you enter a bug report for this? It is definitely a problem.
|
|
|
|
Posts:
124
Registered:
3/29/00
|
|
|
|
|
Posts:
9,447
Registered:
12/23/01
|
|
Carl wrote:
Here is a link to the Quality Central bug report on this one
You mean Quality Portal instead, since Quality Central is deprecated.
--
Remy Lebeau (TeamB)
|
|
|
|
Posts:
124
Registered:
3/29/00
|
|
You mean Quality Portal instead, since Quality Central is deprecated.
Remy Lebeau (TeamB)
LOL - I get enough "is deprecated" compiler warnings already. Now I'm even getting them in the forums! 
|
|
|
|
Posts:
46
Registered:
5/20/00
|
|
I had the same recently and,a after a day, traced it to the manifest settings. I was using a custom manifest. Even changing this to Auto Generate didn't work until I ticked the "Enable High-DPI" option, then it worked on Windows 10.
There is a closed QC item on this: RSP-12942. It needs to be reopened as I believe it remains an issue in 10.1 Berlin.
|
|
|
|
Posts:
1
Registered:
3/3/14
|
|
I had the same recently and,a after a day, traced it to the manifest settings. I was using a custom manifest. Even changing this to Auto Generate didn't work until I ticked the "Enable High-DPI" option, then it worked on Windows 10.
There is a closed QC item on this: RSP-12942. It needs to be reopened as I believe it remains an issue in 10.1 Berlin.
Today i installed Delphi Berlin 10.1 Update 1 on Windows 10 Aniversary Update (Version 1607)
The issue still exists in Berlin Prof, even if you enable High-DPI von VCL
|
|
|
|
Posts:
9
Registered:
6/18/12
|
|
Same problem for me, I have Berlin 10.1 with Update 1 on Windows 10.
Who has solved this problem ???
This is very annoying !
Thanks
Franck
|
|
|
|
Posts:
124
Registered:
3/29/00
|
|
|
|
|
Posts:
9
Registered:
6/18/12
|
|
Thanks a lot Carl,
I've tried this in the OnCreate of the form and it works:
if TStyleManager.IsCustomStyleActive then
begin
TStyleManager.SystemHooks := TStyleManager.SystemHooks - [shDialogs]
end;
Many thanks !
Franck
|
|
|
|
Posts:
102
Registered:
6/21/05
|
|
I've tried this in the OnCreate of the form and it works:
if TStyleManager.IsCustomStyleActive then
begin
TStyleManager.SystemHooks := TStyleManager.SystemHooks - [shDialogs]
end;
Many thanks !
Franck
I'm having the same problem with the TSaveDialog. Could anyone kindly give me the c++ builder translation of the above code?
|
|
|
|
Posts:
9,447
Registered:
12/23/01
|
|
Tom wrote:
Could anyone kindly give me the c++ builder translation
of the above code?
if (TStyleManager::IsCustomStyleActive)
{
TStyleManager::SystemHooks = TStyleManager::SystemHooks >> TSystemHook::shDialogs;
}
--
Remy Lebeau (TeamB)
|
|
|
|
Posts:
102
Registered:
6/21/05
|
|
Thanks Remy and Franck. I couldn't look up Carl's contribution as the bug link isn't working.
|
|
|
|
Posts:
124
Registered:
3/29/00
|
|
Thanks Remy and Franck. I couldn't look up Carl's contribution as the bug link isn't working.
Here is the routine I'm using, that I posted to the bug report, posted here for convenience. Be sure to read the comment at the very bottom for an optional way of doing things.
function ThemeSafeLaunchSaveDialog(SaveDialog:TSaveDialog):Boolean;
{
@@@@@@ This is a wrapper function for SaveDialog.Execute, in order
to work around a bug in Delphi @@@@@.
This "fixes" a bug in Delphi XE10 (and possibly other versions) where if
a VCLStyle is active the TSaveDialogs with the ofOverwritePrompt enabled
will lock up when it asks the user to overwrite a file. (Actually it does
not lock up exactly, but instead displays the "Do you want to replace it?"
prompt all tiny and scrunched up so the user can't click on the response
buttons.
This fix prevents that from happening.
To use this routine, replace code like this:
Result:=MySaveDialog.Execute;
...with code like this:
Result:=ThemeSafeLaunchSaveDialog(MySaveDialog);
For info on this bug, see:
https://quality.embarcadero.com/browse/RSP-13720?jql=text%20~%20%22TSaveDialog%22
https://forums.embarcadero.com/thread.jspa;jsessionid=5A34E74989CC46CCE41C5022E40935F5?messageID=772902
}
var
OldOverwriteValue,DoneFlag:Boolean;
resourcestring
sOverwriteOK1='%s already exists.';
sOverwriteOK2='Do you want to replace it?';
begin
{See if Overwrite flag was set.}
OldOverWriteValue:=ofOverwritePrompt in SaveDialog.Options;
{If the overwrite flag was not set, or if theming is not enabled,
then just call the standard dialog as normal, since there is no Delphi bug
to fix here.}
if (OldOverwriteValue=False) or (TStyleManager.IsCustomStyleActive=False) then
begin
Result:=SaveDialog.Execute();
exit;
end;
{If the overwrite flag was set, and we are theming, then remove that flag,
so we can handle this condition ourselves.}
SaveDialog.Options:=SaveDialog.Options-[ofOverwritePrompt];
{Launch the dialog.}
Result:=SaveDialog.Execute();
{If the dialog was not canceled, but the file exists, then ask user if they want to overwrite.}
if (Result=True) and FileExists(SaveDialog.FileName) then
begin
{Loop until either the user cancels out, or accepts the overwrite option.}
DoneFlag:=False;
While DoneFlag=False do
begin
{Prompt for overwrite.}
if MessageDlg(Format(sOverwriteOK1,[SaveDialog.FileName])+#13+#13+sOverwriteOK2,
mtWarning,[mbYes,mbNo],0,mbNo)=mrYes then
begin
{User says okay to overwrite, so move on.}
DoneFlag:=True;
end
else
begin
{User did not want to overwrite, so return back to dialog.}
SaveDialog.FileName:=''; // Clear out the file name to match normal TSaveDialog behavior.
Result:=SaveDialog.Execute(); // Re-display the dialog.
if Result=False then
begin
{User canceled the dialog, so we are done here}
DoneFlag:=True;
end;
end;
end;
end;
{Restore the Overwrite value back to the dialog.}
SaveDialog.Options:=SaveDialog.Options+[ofOverwritePrompt];
{Note: An option here instead of all the mess above, is to simply disable
themes for the dialog completely. That can be accomplished with the
code below, but of course the dialog is no longer themed and will clash
with the rest of the software.
HadHook:=(shDialogs in TStyleManager.SystemHooks);
if TStyleManager.IsCustomStyleActive then TStyleManager.SystemHooks := TStyleManager.SystemHooks - [shDialogs];
Result:=SaveDialog.Execute();
if HadHook then TStyleManager.SystemHooks := TStyleManager.SystemHooks + [shDialogs]
}
end;
Procedure FixStyledSaveDialogOverwritePrompt;
begin
{@@@@@@ This is a Delphi Bug Fix. Basically, if a Style is active, then
TSaveDialogs go goofy when asking to overwrite an existing file, where the
prompt for that appears as a tiny shrunk message that locks up the user's
PC. This fix prevents that from happening.
See: https://forums.embarcadero.com/thread.jspa;jsessionid=5A34E74989CC46CCE41C5022E40935F5?messageID=772902
@@@@@@}
if TStyleManager.IsCustomStyleActive then TStyleManager.SystemHooks := TStyleManager.SystemHooks - [shDialogs]
end;
|
|
|
|
Posts:
102
Registered:
6/21/05
|
|
|
|
|
Legend
|
|
Helpful Answer
(5 pts)
|
|
Correct Answer
(10 pts)
|
|
Connect with Us