Forum > LCL

Unable to set / get margins from PageSetupDialog in Linux

(1/2) > >>

fedkad:
I am on the latest trunk of Linux. But, version 1.8.2 also has the same problem. Windows is OK.

* On a new form add a TPageSetupDialog and a button.
* On the click event of the button run:

--- 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";}};} ---PageSetupDialog1.Execute* The setup dialog will be displayed, but with empty Margin values.
* If you change the Margin values, nothing happens on the sample page in the dialog box.
* If you close and click again on the button to reopen the PageSetupDialog, the margin values are again empty.
* The Margins group box does not display any metric (like "inches")
* There is a useless "Printer..." button at the bottom right.
* "Source" is disabled.
* We have also a funny tab order for the controls on this dialog box.

And; yes, I do have a default printer defined on the system.
System: Ubuntu Linux 17.10 / Gtk2

jamie:
maybe its a unsupported feature of the printer?

fedkad:
No, I have tested with physical (e.g., HP-LaserJet-Pro-P1102w) and virtual (e.g., Boomaga) printers. Always the same thing.

I guess, somebody implemented the control halfway through and did not even bother to do an initial test for it.  :D For example, the input boxes for margins accept any character (alphabetic etc.) with no input validation, even after pressing OK. This is not the case for Windows where you cannot enter invalid values for margins in the first place.

zeljko:
Please fill an issue against gtk2 printerdlg implementation in that case.

fedkad:
I did yesterday:
https://bugs.freepascal.org/view.php?id=33427

I tried to trace the problem. (Unfortunately, I am not very competent on this.) I have a feeling that something is missing between lines 128 and 129 in the file: components/printers/unix/cupsprndialogs.inc


--- 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";}};} ---function TPageSetupDialog.DoExecute: Boolean;var  Dlg: TDlgPageSetup;begin  Dlg:=TdlgPageSetup.Create(nil);  if Title<>'' then    Dlg.Caption:=Title  else    Dlg.Caption:=DefaultTitle;  try    Result:=(Dlg.ShowModal=mrOk);    if Result then begin   /// <<-- I THINK, SOMETHING IS MISSING HERE    end;  finally    Dlg.Free;  end;end;        

Navigation

[0] Message Index

[#] Next page

Go to full version