Forum > LCL

TTaskDialog musings

<< < (2/7) > >>

wp:

--- Quote from: Martin_fr on September 20, 2022, 07:27:37 pm ---Depends on native Windows:

Flags := [tfUseHiconMain,tfAllowDialogCancellation,tfUseCommandLinks]

vs

Flags := [tfAllowDialogCancellation,tfUseCommandLinks]


similar tfUseCommandLinksNoIcon

--- End quote ---
Whatever combination of flags I use in the LCL TaskDialog, the command links never are above the radiobuttons, in the code that I posted above. I don't understand how a screenshot such as in reply #1 could have been achieved. Is it the Windows version? I am on Win 11...

Arioch:
wp, if yo use Windows you have either to use lower level API than TTaskDialog - or patch LCL
or find Win2000/WinXP :-)

The easiest way for you would be to patch

// D:\fpcupdeluxe\lazarus\lcl\include\interfacebase.inc
function TWidgetSet.GetLCLCapability(ACapability: TLCLCapability): PtrUInt;

and make it return xxX_NO  on lcNativeTaskDialog

or to patch a place in TTaskDialog.DoExecute that checks it (that is what i do)

anyway, i alread y made a patch to fix it - https://forum.lazarus.freepascal.org/index.php/topic,60624.msg454399.html#msg454399

wp:
I am completely lost... You say: "LCL implementation puts command buttons above radiobuttons, native Windows implementation does the opposite." My test shows: No - the command buttons are below the radiobuttons which is like native Windows, according to your statement. Why should I have to patch anything then?

Arioch:

--- Quote from: wp on September 20, 2022, 11:15:50 pm ---I am completely lost... You say: "LCL implementation puts command buttons above radiobuttons, native Windows implementation does the opposite." My test shows: No - the command buttons are below the radiobuttons which is like native Windows, according to your statement. Why should I have to patch anything then?

--- End quote ---

Beause you run Vista implementation. LCL Native implemetation (emulation) is only called when native Windows API is not available.

Since you use Win11, the API is there and native implementation is executed.

Simple test, change Lazarus IDE to some exotic language, then run Test Dialog in the IDE and see if the standard OK/Cancel butto nwould be translated to overrode Lazarus language or remain in Windows language

dialogs.TTaskDialog it NOT implementation, it is merely API bridge, that choses implementation on the run

Arioch:
wp, trace into Execute method and see for yourself, you call Windows API

d:\fpcupdeluxe\lazarus\lcl\lcltaskdialog.pas

line 800


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  if (WidgetSet.GetLCLCapability(lcNativeTaskDialog) = LCL_CAPABILITY_YES) and    Assigned(TaskDialogIndirect) and not aNonNative and     not (tdfQuery in aFlags) and (Selection='') then begin    Dialog.Emulated := False;    // use Vista/Seven TaskDialog implementation (not tdfQuery nor Selection)... 
that is where you go


also TTaskDialogButtonItem(Buttons.Add) is not needed, the Add already returns typecaseted value

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version