is there a way to disable this conversion?Code: Pascal [Select][+][-]unit Unit1; {$mode objfpc}{$H+} interface uses Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, LCLTaskDialog; type { TForm1 } TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private public end; var Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.Button1Click(Sender: TObject);var td: TTaskDialog;begin td.Content:='Save "c:\new_folder\new.work"?'; td.Execute;end; end.
I would call that a bug. \n has no meaning in pascal.
.........................TTaskDialog = record /// the main title of the dialog window // - if left void, the title of the application main form is used Title: string; /// the main instruction (first line on top of window) // - any '\n' will be converted into a line feed // - if left void, the text is taken from the current dialog icon kind Inst: string; /// the dialog's primary content content text // - any '\n' will be converted into a line feed Content: string; /// a #13#10 or #10 separated list of custom buttons // - they will be identified with an ID number starting at 100 // - by default, the buttons will be created at the dialog bottom, just // like the common buttons // - if tdfUseCommandLinks flag is set, the custom buttons will be created // as big button in the middle of the dialog window; in this case, any // '\n' will be converted as note text (shown with smaller text under native // Vista/Seven TaskDialog, or as popup hint within Delphi emulation) Buttons: string; /// a #13#10 or #10 separated list of custom radio buttons // - they will be identified with an ID number starting at 200 // - aRadioDef parameter can be set to define the default selected value // - '\n' will be converted as note text (shown with smaller text under // native Vista/Seven TaskDialog, or as popup hint within Delphi emulation) Radios: string; /// the expanded information content text // - any '\n' will be converted into a line feed // - the Delphi emulation will always show the Info content (there is no // collapse/expand button) Info: string; /// the button caption to be displayed when the information is collapsed // - not used under XP: the Delphi emulation will always show the Info content InfoExpanded: string; /// the button caption to be displayed when the information is expanded // - not used under XP: the Delphi emulation will always show the Info content InfoCollapse: string; /// the footer content text // - any '\n' will be converted into a line feed Footer: string; /// the text of the bottom most optional checkbox Verify: string; /// a #13#10 or #10 separated list of items to be selected // - if set, a Combo Box will be displayed to select // - if tdfQuery is in the flags, the combo box will be in edition mode, // and the user will be able to edit the Query text or fill the field // with one item of the selection // - this selection is not handled via the Vista/Seven TaskDialog, but // with our Delphi emulation code (via a TComboBox) Selection: string; /// some text to be edited // - if tdfQuery is in the flags, will contain the default query text // - if Selection is set, the Query: string;...........................
So then it is a documented bug ?
So you want to cripple the Window users?what if I want all of that in there ?
A good solution needs no escaping. An user can pass it well-formed pascal strings, and the widgetset-whatever code escapes it to pass to legacy OS services that expect escaping.