Re: [Lazarus] Changes to TProcess

2024-01-03 Thread zeljko via lazarus



On 03. 01. 2024. 14:28, Michael Van Canneyt via lazarus wrote:


Hello,

I merged a significant evolution of the TProcess component to FPC trunk.

Until recently, there were 2 options for TProcess when starting a new
process:

- use the parent process standard input/output/error
- use pipes to make the standard input/output/error available as streams 
in the parent process.


This has been enhanced with the following new possibilities:

- For the new process, the standard input/output/error can be configured 
separately.


- You can specify a filename as input/output/error.
   (additionally, you can rewrite or append to the file in case of output)

- You can specify a custom I/O handle as input/output/error
   (e;g. at least on unix, you can pass a socket handle)

- You can specify the null file (/dev/null on unixes or NULL on windows)

- You can specify another TProcess instance.

The last option means that you can now chain processes, just as the 
command shell does.


So the equivalent of the following chain of commands:

command  file.txt

would then be

   Proc.Executable:='command';
   Proc.InputDescriptor.FileName:='input.txt';
   Proc2.Executable:='sed';
   Proc2.Parameters.Add('s/delphi/FPC/g');
   Proc2.OutputDescriptor.FileName:='file.txt';
   Proc.OutputDescriptor.Process:=Proc2;
   Proc2.Execute;
   Proc.execute;

Needless to say, the component remains backwards compatible.

There is now a testsuite for the TProcess command, so everything was 
tested.

but nothing beats testing in the wild, so I would appreciate it if people
could test it and provide feedback.



Great feature :)

Thanks Michael

zeljko


--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] GTK 3 Widget Set Status?

2023-09-26 Thread zeljko via lazarus



On 26. 09. 2023. 19:18, John Landmesser via lazarus wrote:

Am 26.09.23 um 16:40 schrieb Anthony Walter via lazarus:

Would someone be so kind to tell me if the GTK 3 widget set is working
yet? Does the IDE work when built using GTK 3 and can I write most
normal desktop applications using GTK 3 right now when using the a
most recent trunk revision? What's not working in a general sense?

I thought I'd ask you guys rather than clone Lazarus from git, build
it, and hunt for problems.

Thanks.


I just compiled this lazarus trunk  with gtk3 (Alpha)

Lazarus 3.99 (rev main_3_99-346-g925ffd19ad) FPC 3.2.2 x86_64-linux-gtk2


It compiles ok but it does not start,

My conclusion: Ít is still not usable!

But perhaps someone with knowledge in details can tell you more.


Discussion is here:
https://forum.lazarus.freepascal.org/index.php/topic,64732.0.html

zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazarus Release Candidate 1 of 3.0

2023-07-10 Thread zeljko via lazarus




On 03. 07. 2023. 13:33, Mattias Gaertner via lazarus wrote:

The Lazarus team is glad to announce the first release candidate of
Lazarus 3.0.

This release was built with FPC 3.2.2.

Here is the list of changes for Lazarus and Free Pascal:
http://wiki.lazarus.freepascal.org/Lazarus_3.0_release_notes
http://wiki.lazarus.freepascal.org/User_Changes_3.2.2

Here is the list of fixes for Lazarus 3.x:
https://gitlab.com/freepascal.org/lazarus/lazarus/-/commits/fixes_3_0/

The release is available for download on SourceForge:
http://sourceforge.net/projects/lazarus/files/

Choose your CPU, OS, distro and then the "Lazarus 3.0RC1" directory.

Checksums for the SourceForge files:
https://www.lazarus-ide.org/index.php?page=checksums#3_0RC1

Minimum requirements:

Windows:
2k, 32 or 64bit.

FreeBSD/Linux:
gtk 2.24 for gtk2, qt4.5 for qt, qt5.6 for qt5, 32 or 64bit.

Mac OS X:
Cocoa (64bit) 10.12, Carbon (32bit) 10.5 to 10.14, qt and
qt5 (32 or 64bit).


Sorry for late response, Qt6 is missing.
Windows: Qt, Qt5, Qt6 (64bit only)
FreeBSD/Linux: Add Qt6.2 for qt6
MacOS: Add Qt6 (64bit only).

zeljko

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Qt5 IDE fails to build on Linux

2023-06-12 Thread zeljko via lazarus




On 12. 06. 2023. 13:35, Giuliano Colla via lazarus wrote:
Attempting to build latest Lazarus trunk on Linux CentOs7 with Qt5 fails 
with error:


/home/colla/Applicazioni/lazarus_main/lcl/interfaces//qt5/qtobject.inc:44: 
undefined reference to `QGuiApplication_setFallbackSessionManagementEnabled'

It succeeds setting

{$DEFINE QT_NO_SESSIONMANAGER}

in qtdefines.inc

My cbindings outdated or bug?


Your bindings are outdated. If you use trunk lazarus then you must build 
your own bindings. Besides that, bindings won't change soon, so current 
trunk libQt5Pas v.1.2.13 will be pushed to 2.4 and distros.


zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] runcommand doesn't work?

2023-03-10 Thread zeljko via lazarus



On 10. 03. 2023. 02:28, john Ward via lazarus wrote:
*I have a program, segment included below, that partially works.  The 
first 'runcommand' example works, but the 2nd doesn't?*

*If I type the lp command line, it prints perfectly..*
  if RunCommand('unix2dos', ['-n', '-f', 
'/mbs/mbs/file/cust.f','/mbs/mbs/file/cust.frm'],s) then

  writeln(s);
   if RunCommand('/bin/lp', ['-d', ' printer1','-o=raw' 
,'/mbs/mbs/file/cust.frm'], s) then

   writeln(s);
   errormsg.text := 'We are done with runcommand now s= '+ s;
*Fedora 37, Lazarus 2.2.4 FPC 3.2.2  X64 Linux gtk2*


Are you sure that lp is in /bin directory ?
Try lp instead of /bin/lp (if cmd lp works)

zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] small issue

2023-03-02 Thread zeljko via lazarus




On 02. 03. 2023. 16:22, John Landmesser via lazarus wrote:
if i try to compile an application with qt5 LCLwidgetType i get an error 
messages and thats ok:



Error: /home/john1/lazarus/lcl/interfaces//qt5/qtobject.inc:43: 
undefined reference to 
`QGuiApplication_setFallbackSessionManagementEnabled'

Alter_berechnen.lpr(20,1) Error: Error while linking


You must rebuild libQt5Pas. You're using trunk lazarus and distro 
compiled libQt5Pas which had been changed in the meantime.


zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] strange focus behaviour on source editor window

2023-02-27 Thread zeljko via lazarus



On 27. 02. 2023. 18:51, Mgr. Janusz Chmiel via lazarus wrote:

Dear Lazarus developers,

    I have found out very interesting and strange focus 
behaviour in Lazarus IDE.


When I edit The source code in The source editor Editable field. And 
when I switch window to desktop and when I switch back to Lazarus IDE, 
focus is not located at source editor editable field.


Focus jump automatically to The TAB with components list. The object 
class name is


Does this behaviour have a good thinked intention for developers? Or it 
should not appear?


I must always press F12 twice to have source editor Edit box on focus.

Thank you for your explanation.


Operating system ? Lazarus version ? Widgetset if it's x11 ?

zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Minor annoyance in IDE

2023-01-15 Thread zeljko via lazarus



On 15. 01. 2023. 04:03, Don Ziesig via lazarus wrote:

Hi All!

It's been years (unfortunately much ill health/hospitalization) but I'm 
back.


I upgraded to Lazarus 2.2.4 before getting back to work and my memory of 
the annoyance from earlier versions may be erroneous (I don't remember 
it happening in the past).


When I have a non-Lazarus window overlapping the main IDE window and I 
move the mouse over the main window the main window raises itself over 
everything else on the desktop.  This is exceedingly annoying.  My 
normal muscle-memory is that I am the only one who explicitly raises 
windows using a mouse click (too much MS Windows in the distant past?).


Is there any way to disable this?  I have looked at all of the 
configuration menus/pages but didn't see any thing that looks appropriate.


Or might it just be the OS (Linux Mint XFCE)?


Some window managers have such configuration, focus on mouse over or 
similar, so that could be your problem.

Search for window focusing in xfce configuration.

zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] ***SPAM*** Re: ***SPAM*** Re: Install of Qt5 widgetset fails on Mac Ventura

2022-11-27 Thread zeljko via lazarus



On 27. 11. 2022. 23:47, Giuliano Colla wrote:

Il 26/11/22 09:20, zeljko ha scritto:




On 25. 11. 2022. 23:01, Giuliano Colla wrote:

Il 25/11/2022 21:58, zeljko ha scritto:




On 25. 11. 2022. 19:29, Giuliano Colla via lazarus wrote:
I tried to install QT5 version 5.6.2 on my Mac, following the wiki 
instructions but installation fails.


qmake executes properly and generates a Makefile, but make fails 
with this error message:


  ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see 
invocation)

make: *** [Qt5Pas.framework/Qt5Pas] Error 1

Actally all the object files generated in the tmp directory are for 
arm64 and not x86_64-darwin as expected.


Any hint?


Never tried build on arm64 (have intel macbook pro). Can you try 
with Qt6 ?


z.
I didn't find a place from where download open source Qt6. Do you 
have a reliable link?


https://download.qt.io/official_releases/online_installers/qt-unified-mac-x64-online.dmg



In the meantime I'll give a try with 5.6.11.

However all Lazarus is compiled for x86_64 architecture, and runs in 
arm64 architecture via Rosetta. Intel version of Qt would be just 
fine, if qmake didn't decide to make for the arm64 architecture. Any 
idea of how to tell qmake the right architecture?


You have to read qmake manual:
https://doc.qt.io/qt-6/qmake-manual.html

zeljko


Two issues:

First issue is that it appears that you can't call qmake from command line.

Either there's a bug somewhere on the Mac Ventura, or I'm missing some 
detail. I tried to build the Qt5Pas library by submitting Qt5Pas.pro to 
Qt Designer. It generated correct x86_64 objects, and the generated 
framework contains a:


Qt5Pas: Mach-O 64-bit dynamically linked shared library x86_64

Just to understand what was going on, I then tried again with the 
command line options, passing qmake exactly the same parameters which Qt 
Designer used, and the result was the same error as before, with the tmp 
folder populated with arm64 object files. It would appear that qmake 
ignores the x86_64 switch when called from command line. If this is 
confirmed it would be good to update the wiki page.


Second issue.

Lazarus does not build with Qt. I have set the appropriate symlink in 
the /Library/Frameworks folder, but build of Lazarus fails with the 
error message:


ld: framework not found Qt5Pas

I have added /Library/Frameworks to the compiler paths 
(-FI/Library/Frameworks). Should I tell something to the linker too?



1. I had problem on intel mac when installed qt6.2 (qt5.15 was already 
installed) , but make clean and removing .qmake_stash and .qcmake_xx 
files manually from cbindings directory helped me a lot. So maybe you 
should remove such files and then start qmake-6 again (for arm).


2.On newer macs Library/Frameworks is not in path by default, I've found 
that symlinking Qt5Pas to Library/Frameworks and 
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks 
fixed problem for make bigide.


3.You should add "-k -F/Library/Frameworks" to the configure "Build 
Lazarus" dialog if you want to rebuild lazarus for Qt5, or for your 
projects in Project Options check "Pass options with linker with "k" 
" -F/Library/Frameworks and then it should work



zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] ***SPAM*** Re: Install of Qt5 widgetset fails on Mac Ventura

2022-11-26 Thread zeljko via lazarus



On 25. 11. 2022. 23:01, Giuliano Colla wrote:

Il 25/11/2022 21:58, zeljko ha scritto:




On 25. 11. 2022. 19:29, Giuliano Colla via lazarus wrote:
I tried to install QT5 version 5.6.2 on my Mac, following the wiki 
instructions but installation fails.


qmake executes properly and generates a Makefile, but make fails with 
this error message:


  ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see 
invocation)

make: *** [Qt5Pas.framework/Qt5Pas] Error 1

Actally all the object files generated in the tmp directory are for 
arm64 and not x86_64-darwin as expected.


Any hint?


Never tried build on arm64 (have intel macbook pro). Can you try with 
Qt6 ?


z.
I didn't find a place from where download open source Qt6. Do you have a 
reliable link?


https://download.qt.io/official_releases/online_installers/qt-unified-mac-x64-online.dmg



In the meantime I'll give a try with 5.6.11.

However all Lazarus is compiled for x86_64 architecture, and runs in 
arm64 architecture via Rosetta. Intel version of Qt would be just fine, 
if qmake didn't decide to make for the arm64 architecture. Any idea of 
how to tell qmake the right architecture?


You have to read qmake manual:
https://doc.qt.io/qt-6/qmake-manual.html

zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Install of Qt5 widgetset fails on Mac Ventura

2022-11-25 Thread zeljko via lazarus



On 25. 11. 2022. 19:29, Giuliano Colla via lazarus wrote:
I tried to install QT5 version 5.6.2 on my Mac, following the wiki 
instructions but installation fails.


qmake executes properly and generates a Makefile, but make fails with 
this error message:


  ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see 
invocation)

make: *** [Qt5Pas.framework/Qt5Pas] Error 1

Actally all the object files generated in the tmp directory are for 
arm64 and not x86_64-darwin as expected.


Any hint?


Never tried build on arm64 (have intel macbook pro). Can you try with Qt6 ?

z.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Qt6 widgetset

2022-11-11 Thread zeljko via lazarus

Hi all,
I've just committed Qt6 widgetset into main :)
Tested only under linux atm (win32/64 and mac users can try to build 
libQt6Pas, if something went wrong pls inform me or open an issue about 
it), lazarus ide qt6 works just fine.


libQt6Pas is based on LTS Qt6-6.2.3, so to build libQt6Pas.so.6.2.3 you 
must have installed Qt6 with minimum version 6.2.

Read lcl/interfaces/qt6/cbindings/README howto build libQt6Pas.
Printing (Printers4Lazarus) is not yet implemented, but other stuff is 
complete.
libQt6Pas does not depend on qtnetwork anymore, it's removed since fpc 
have complete network solution.


Bug reports are welcome :)

zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] testing demorestbridge without a web server: is that possible?

2022-10-27 Thread zeljko via lazarus




On 27. 10. 2022. 20:29, duilio foschi wrote:

Dear Zeljko,


If this results in error 400-40xx


this is exactly what happens :)

c:\>curl -u Detlef:secret   -H "Content-Type: application/json"
"http://localhost:3000/REST/metadata;
{
   "error" : {
 "code" : 404,
 "message" : "NOT FOUND"
   }
}



then you must include connection after

REST
eg  http://localhost:3000/REST/YOURDEFAULTCONNECTIONNAME/metadata


gulp! Which is my default connection name?


check TSQLDBRestDispatcher.Connections, there should be at least one 
connection and check that connection name.


zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] testing demorestbridge without a web server: is that possible?

2022-10-27 Thread zeljko via lazarus




On 27. 10. 2022. 19:03, duilio foschi via lazarus wrote:

I tried to run demorestbridge inside Lazarus in debug mode.

When the web browser points to
http://localhost:3000/REST/metadata

the debugger shows an error message that says:

'project SQLDB REST bridge raised an exception of class 'EHTTP' with
message: No REQUEST_METHOD passed from server.. At address 10009D512'

Any idea what this could mean?


Yes, browsers by default do not send requested params (eg. request 
method). Use curl to test your server.

eg

curl -u YOURUSERNAME:PASSWORD -H "Content-Type: application/json" 
"http://localhost:3000/REST/metadata;


curl by default set request method to GET.
curl -u YOURUSERNAME:PASSWORD -H "Content-Type: application/json"  -X 
GET "http://localhost:3000/REST/metadata;


If this results in error 400-40xx then you must include connection after 
REST eg  http://localhost:3000/REST/YOURDEFAULTCONNECTIONNAME/metadata


zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] demorestbridge

2022-10-23 Thread zeljko via lazarus




On 23. 10. 2022. 19:49, duilio foschi via lazarus wrote:

I am trying to use the demo that I find in directory

C:\lazarus\fpc\3.2.2\source\packages\fcl-web\examples\restbridge

Following the instructions in file readme.txt,

1. I created a firebird database (test.fdb)
2. I run expenses-fb.sql to create the db structure
3. I run expenses-data.sql to insert some data in the tables

Now I read:

<<
You must edit the program to provide the correct database credentials:
look for the ExposeDatabase() call, and edit the username/password.
You must also change the name and location of the database




so I changed the original line
FDisp.ExposeDatabase(TPQConnectionDef.TypeName,'localhost','expensetracker','You','YourSecret',Nil,[foFilter,foInInsert,foInUpdate,foOrderByDesc]);

into
FDisp.ExposeDatabase(TPQConnectionDef.TypeName,'localhost','c:\\test.fdb','sysadm','masterkey',Nil,[foFilter,foInInsert,foInUpdate,foOrderByDesc]);


TPQConnection is postgresql thing only, you must use TIBConnection for 
firebird.


zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] More Gtk3 Status

2022-07-20 Thread zeljko via lazarus



On 20. 07. 2022. 01:46, Maxim Ganetsky via lazarus wrote:

19.07.2022 10:50, zeljko via lazarus пишет:



On 18. 07. 2022. 17:53, Alexey Torgashin via lazarus wrote:


Zeljko, currently gtk3 WS is not able to run my text editor app. 
Various visual bugs in the main form. I will be happy to pay you 
(initial author) 200$ if you fix the gtk3 for my editor (others will 
benefit too in theory).


Sorry, but I don't have enough spare time to play with gtk3, but even 
if I fix it I don't need money for that work, better give it to 
lazarus project. Can you point to specific issues ?


E. g.

https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/39335

It even has a patch attached, which needs a review.



That patch isn't ok. Just drop simple TStringGrid with ScrollBars = 
sbAutoBoth and increase row count so it needs scrollbar: it is not 
visible even if you have thousands of rows, but scrolling looks ok, 
better than it's now.


zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] More Gtk3 Status

2022-07-19 Thread zeljko via lazarus




On 18. 07. 2022. 17:53, Alexey Torgashin via lazarus wrote:


Zeljko, currently gtk3 WS is not able to run my text editor app. Various 
visual bugs in the main form. I will be happy to pay you (initial 
author) 200$ if you fix the gtk3 for my editor (others will benefit too 
in theory).


Sorry, but I don't have enough spare time to play with gtk3, but even if 
I fix it I don't need money for that work, better give it to lazarus 
project. Can you point to specific issues ?


zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] More Gtk3 Status

2022-07-18 Thread zeljko via lazarus



On 15. 07. 2022. 13:47, Anthony Walter via lazarus wrote:

Denis,

I will attempt the big design flaws I have found so far while wrangling 
with the current Gtk3 widget implementation.

There are three main layers underpinning cross platform LCL widgetset.

1) We obviously have the LCL itself that mimics the VCL and creates a 
cross platform component and control library with the same classes and 
hierarchy across multiple platforms. This piece works well enough.


2) We have underlying native toolkits written in C or C++, or some other 
language, whose functionality is exposed to Free Pascal by a flat C 
style API of imported functions, enumerations, constants, and 
records. This piece works well enough also.


3) We have a series of pascal WS (widgetset) classes used in conjunction 
with the "RegisterWSComponent(TSomeControl, TWSSomeControl);" that is 
responsible for binding the 1 and 2 layers. The WS classes are 
responsible for creating the actual underlying native toolkit widget or 
control from layers 2 and bridging access to specific properties and 
methods to layer 1. Okay, this works.  I would have designed a set of 
interfaces to bridge this piece instead, but we have these WS classes. 
I'll deal with it.


Now here is the first big problem with the Gtk3 widgetset 
as implemented. Somehow someone decided it would be a neat idea to add a 
4th piece just for Gtk3. This piece attempts to wedge itself between 2 
and 3 by recreating the already existing flat C style API from piece 3 
as a big series of pascal objects that redeclare the Gtk3 API as a 
series of objects (see TGtk3Widget in the file gtk3widgets.pas). Now we 
have a 4th layer just for Gtk3 that not only adds more complexity, but 
also introduces peculiar behaviors altering what someone writing a Gtk3 
native widget port needs to know while following through with creating a 
control or component.



I've commited gtk3 skeleton and basic controls + some winapi functions 
(AFAIR it was 2012 or even 2013). Everything is based on 
qt/qt5/carbon/cocoa philosophy already inside LCL. At that time I've 
maintained gtk2 and it's not so pleasant for maintainer (maybe for you 
as programmer of your apps, but not lazarus lcl-ws maintainer) so my 
decision was to  encapsulate gtk3 to pascal objects, and if someone ask 
me to introduce gtk4 I'll do it in same way. Why ? Easy maintaining.
Also, after I commited gtk3 there were none or just few commiters to the 
gtk3 ws (I could not continue with gtk3 ws because of lacking spare time).




For an example of the problem this additional with Gtk3 4th layer 
introduces, consider my attempts to take some Gtk2 widgets I have 
written and also support them in Gtk3 with its extra layer. I recently 
updated my gtk vte (virtual terminal emulator control, code here 
 and video here 
) that currently 
works under Gtk2. While writing the Gtk2 version I referenced the flat C 
API from here 
 and had 
little to no problems getting it working. With the Gtk2 widgetset 
implementation in Lazarus I was able to just use the Gtk2 documents 
online to see what functions existed related to working with Gtk2 
widgets and it worked. This is what I expect when working with a native 
widgetset, that is I read the documentation provided by the actual 
widget to toolkit maker (reading documentation at gnome.og).



You're mixing apples & oranges (LCL vs your application). They're 
different in many ways. Just simple example is event filters and event 
triggering at the right time - eg TListView.OnSelectItem ... 
mousedown->onselectitem->mouseup (order isn't important here, but point 
is that such order should be same on all platforms, and ppl are filling 
bugs about it, so maintainer should fix that if possible).





Now with the current Gtk3 widget implementation tries to introduce a 
whole other extra layer that works differently than the actual Gtk3 
documentation provides. Not only are the Gtk/Gdk functions I need hidden 
elsewhere, but they work differently in most cases, as decided by 
whomever is maintaining the base Gtk3 widgetset for Lazarus. I DO NOT 
want to spend my time trying to figure out where someone has hidden a 
Gtk3 widget API inside some class from which I am supposed to figure out 
to inherit in the hopes that the Gtk3 widgetset maker got right. This 
whole declaration of the flat Gtk3 C style API and putting them into 
another set of pascal classes that are then references by WS classes and 
then referenced by LCL controls and components is just BAD BAD BAD.


It should be KISS. Just make the control handle an actual reference to 
the underlying system toolkit handle, and please DO NOT attempt to 
recreate another object hierarchy (in addition to the WS classes) of 
each possible widget or object type present on a platform or toolkit 

Re: [Lazarus] Treeview Question

2020-06-30 Thread zeljko via lazarus

On 6/30/20 1:10 AM, Martin via lazarus wrote:

Hi,

I'm porting an application I started (but never finished) in Pyside to 
Lazarus. This question is only about cosmetics as Treeview works as I 
want it to.


In Pyside I could set a space between nodes by setting the node text as 
"" and disabling that node so it never gets selection, e.g.


     self.tvSpace001 = QTreeWidgetItem(self.leftTreeWidget)
     self.tvSpace001.setText(0, "")
     self.tvSpace001.setDisabled(True)

In Lazarus there seems to be no disabled property for nodes, so when 
transversing a node with text "" with the keyboard, it will move onto 
that empty node but not highlight it, when I would prefer it instead 
moved onto the next or previous node and highlight it.


I could write a workaround, storing the last node index, working out if 
the user has moved up or down, checking if the text is "" and 
highlighting the previous or next node as required, BUT I just wondered 
if anyone has a more simple, more elegant solution please?


It's only to show visual definition between groups of parents and childs 
and doesn't actually affect how the application works.


Lazarus uses it's own implementation of TTreeView, so you have to create 
your own LCL wrapper for QTreeWidget.


zeljko

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Embed other application window with qt5

2020-06-09 Thread zeljko via lazarus

On 6/9/20 9:08 AM, Luca Olivetti via lazarus wrote:


procedure TForm1.Button1Click(Sender: TObject);
var kk:QWindowH;
   cc: QWidgetH;
begin
   kk:=QWindow_fromWinID(StrToInt64(Edit1.text));
   QWindow_setFlags(kk,QtFramelessWindowHint);
   cc:=QWidget_createWindowContainer(kk);
   QWidget_setParent(cc,TQtWidget(Self.Handle).Widget);
end;



I also tried

    QWidget.setParent(cc, TQTMainWindow(handle).GetContainerWidget)

and

    QWidget.setParent(cc, TQTMainWindow(handle).Widget)

as well as TQTWidget(panel1.handle).widget


This works fine here (TPanel on main form, embedded google chrome ):

  AWindow := QWindow_fromWinID(PtrUInt($861)); // found id by xwininfo
  AWidget := QWidget_createWindowContainer(AWindow, nil, QtWidget or 
QtForeignWindow);

  QWidget_setParent(AWidget, TQtWidget(Panel1.Handle).Widget);
  QWidget_show(AWidget);

You're missing QtForeignWindow flag and QWidget_show() for container 
widget.



zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Gtk2 under X11 new feature - accurate frame size - need users feedback

2020-04-16 Thread zeljko via lazarus

Hi all,

Finally I've fixed gtk2 under x11 too (qt/qt5 are fixed 2 days ago), now
GetWindowRect() returns correct form size (with frame around) , so
now eg poScreenCenter/poWorkAreaCenter (poWorkAreaCenter is also fixed - 
Screen.WorkAreaRect was same as Screen.DesktopRect because of wrong 
implementation of SPI_GETWORKAREA) is perfectly centered on screen.


https://bugs.freepascal.org/view.php?id=36897
https://bugs.freepascal.org/view.php?id=36919

Feature can be disabled with -disableaccurateframe.

Please test and send feedback, or open issues about it :)

zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] EAccessViolation exception on exit qt5 project in Kubuntu 19.10

2020-04-15 Thread zeljko via lazarus

On 4/15/20 5:36 PM, Florian Klämpfl via lazarus wrote:

Am 15.04.20 um 09:24 schrieb zeljko:

On 4/14/20 8:24 PM, Florian Klämpfl via lazarus wrote:

Sorry, I were not precise enough. Can you also post a disassembly of 
the swap procedure at 0x7666c7f1?



0x7666c7f1 is at line 382 inside assembler.txt. That's all I 
can get.


The offending line is
=> 0x7666c7f1 <+385>:   movaps %xmm0,0x50(%rsp)

So it is very likely an unaligned data sig fault (rsp not divisable by 
8). This is fixed by r38400. Note that in some configurations it might 
work, in others not.


Thanks, that's the reason why 3.2 and fpc trunk works ok.

zeljko

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] EAccessViolation exception on exit qt5 project in Kubuntu 19.10

2020-04-15 Thread zeljko via lazarus

On 4/14/20 8:24 PM, Florian Klämpfl via lazarus wrote:

Sorry, I were not precise enough. Can you also post a disassembly of the 
swap procedure at 0x7666c7f1?



0x7666c7f1 is at line 382 inside assembler.txt. That's all I can 
get.


zeljko
Dump of assembler code for function 
QCoreApplication::removePostedEvents(QObject*, int):
Address range 0x7666c670 to 0x7666cbca:
   0x7666c670 <+0>: endbr64 
   0x7666c674 <+4>: push   %r15
   0x7666c676 <+6>: push   %r14
   0x7666c678 <+8>: mov%rdi,%r14
   0x7666c67b <+11>:push   %r13
   0x7666c67d <+13>:push   %r12
   0x7666c67f <+15>:push   %rbp
   0x7666c680 <+16>:push   %rbx
   0x7666c681 <+17>:sub$0x898,%rsp
   0x7666c688 <+24>:mov%esi,0xc(%rsp)
   0x7666c68c <+28>:mov%fs:0x28,%rax
   0x7666c695 <+37>:mov%rax,0x888(%rsp)
   0x7666c69d <+45>:xor%eax,%eax
   0x7666c69f <+47>:test   %rdi,%rdi
   0x7666c6a2 <+50>:je 0x7666caf0 

   0x7666c6a8 <+56>:mov0x8(%rdi),%rax
   0x7666c6ac <+60>:mov0x38(%rax),%r13
   0x7666c6b0 <+64>:lea0x30(%r13),%rbx
   0x7666c6b4 <+68>:mov%rbx,%rdi
   0x7666c6b7 <+71>:mov%rbx,0x20(%rsp)
   0x7666c6bc <+76>:callq  0x764c2780 
   0x7666c6c1 <+81>:mov0x8(%r14),%rax
   0x7666c6c5 <+85>:mov0x24(%rax),%ecx
   0x7666c6c8 <+88>:test   %ecx,%ecx
   0x7666c6ca <+90>:je 0x7666ca10 

   0x7666c6d0 <+96>:lea0x70(%rsp),%rdi
   0x7666c6d5 <+101>:   xor%esi,%esi
   0x7666c6d7 <+103>:   callq  0x76671030 ::QVarLengthArray(int)>
   0x7666c6dc <+108>:   mov0x18(%r13),%rax
   0x7666c6e0 <+112>:   mov0x4(%rax),%edx
   0x7666c6e3 <+115>:   test   %edx,%edx
   0x7666c6e5 <+117>:   jle0x7666cb18 

   0x7666c6eb <+123>:   lea-0x1(%rdx),%esi
   0x7666c6ee <+126>:   lea0x18(%r13),%rcx
   0x7666c6f2 <+130>:   movl   $0x0,0x8(%rsp)
   0x7666c6fa <+138>:   xor%ebx,%ebx
   0x7666c6fc <+140>:   mov%rsi,(%rsp)
   0x7666c700 <+144>:   lea0x80(%rsp),%rsi
   0x7666c708 <+152>:   mov%rsi,0x18(%rsp)
   0x7666c70d <+157>:   mov%rcx,0x28(%rsp)
   0x7666c712 <+162>:   mov%rsi,0x30(%rsp)
   0x7666c717 <+167>:   mov%rsi,0x38(%rsp)
   0x7666c71c <+172>:   nopl   0x0(%rax)
   0x7666c720 <+176>:   mov0x10(%rax),%rbp
   0x7666c724 <+180>:   lea(%rbx,%rbx,2),%r12
   0x7666c728 <+184>:   shl$0x3,%r12
   0x7666c72c <+188>:   add%r12,%rbp
   0x7666c72f <+191>:   add%rax,%rbp
   0x7666c732 <+194>:   test   %r14,%r14
   0x7666c735 <+197>:   je 0x7666c820 

   0x7666c73b <+203>:   cmp%r14,0x0(%rbp)
   0x7666c73f <+207>:   je 0x7666c820 

   0x7666c745 <+213>:   mov0x20(%r13),%edx
   0x7666c749 <+217>:   test   %edx,%edx
   0x7666c74b <+219>:   jne0x7666c7ff 

   0x7666c751 <+225>:   cmp%ebx,0x8(%rsp)
   0x7666c755 <+229>:   je 0x7666c7fa 

   0x7666c75b <+235>:   mov(%rax),%eax
   0x7666c75d <+237>:   cmp$0x1,%eax
   0x7666c760 <+240>:   mov0x18(%r13),%rax
--Type  for more, q to quit, c to continue without paging--
   0x7666c764 <+244>:   jbe0x7666c788 

   0x7666c766 <+246>:   mov0x8(%rax),%edx
   0x7666c769 <+249>:   and$0x7fff,%edx
   0x7666c76f <+255>:   je 0x7666c940 

   0x7666c775 <+261>:   mov0x4(%rax),%esi
   0x7666c778 <+264>:   mov0x28(%rsp),%rdi
   0x7666c77d <+269>:   xor%ecx,%ecx
   0x7666c77f <+271>:   callq  0x766711f0 
::reallocData(int, int, 
QFlags)>
   0x7666c784 <+276>:   mov0x18(%r13),%rax
   0x7666c788 <+280>:   mov%rax,%rdx
   0x7666c78b <+283>:   movslq 0x8(%rsp),%rcx
   0x7666c790 <+288>:   lea(%rcx,%rcx,2),%rcx
   0x7666c794 <+292>:   lea(%rdx,%rcx,8),%rbp
   0x7666c798 <+296>:   add0x10(%rdx),%rbp
   0x7666c79c <+300>:   mov(%rdx),%edx
   0x7666c79e <+302>:   cmp$0x1,%edx
   0x7666c7a1 <+305>:   jbe0x7666c7c5 

   0x7666c7a3 <+307>:   mov0x8(%rax),%edx
   0x7666c7a6 <+310>:   and$0x7fff,%edx
   0x7666c7ac <+316>:   je 0x7666c920 

   0x7666c7b2 <+322>:   mov0x4(%rax),%esi
   0x7666c7b5 <+325>:   mov0x28(%rsp),%rdi
   0x7666c7ba <+330>:   xor%ecx,%ecx
   0x7666c7bc <+332>:   callq  0x766711f0 
::reallocData(int, int, 
QFlags)>
   0x7666c7c1 <+337>:  

Re: [Lazarus] EAccessViolation exception on exit qt5 project in Kubuntu 19.10

2020-04-14 Thread zeljko via lazarus

On 4/14/20 6:28 PM, Florian Klämpfl via lazarus wrote:

Am 14.04.20 um 12:55 schrieb zeljko via lazarus:

On 4/13/20 7:43 PM, Luca Olivetti via lazarus wrote:


Now I tried installing the packaged libqt5pas and still see no segfault.
Note that this isn't a fresh install, I dist-upgraded it (or better 
do-release-upgraded it) many times, but I don't think that should 
matter.


IMO, fpc version is important. fpc-3.0.4 from distro crashes, 


Does anybody have a stack dump of the crash? Maybe it's related to the 
stack alignment issues which are fixed in 3.2+?


This is crash dump - Fedora 30 64bit , fpc-3.0.4, Qt5 lcl.

Thread 1 "lazarus" received signal SIGSEGV, Segmentation fault.
0x7666c7f1 in std::swap (__b=..., __a=...) at 
/usr/include/c++/9/bits/move.h:182

warning: Source file is more recent than executable.
182 swap(_Tp& __a, _Tp& __b)
(gdb) bt
#0  0x7666c7f1 in std::swap (__b=..., __a=...) at 
/usr/include/c++/9/bits/move.h:182
#1  qSwap (value2=..., value1=...) at 
../../include/QtCore/../../src/corelib/global/qglobal.h:915
#2  QCoreApplication::removePostedEvents (receiver=0x3e702c0, 
eventType=0) at kernel/qcoreapplication.cpp:1883
#3  0x7669489e in QObjectPrivate::~QObjectPrivate 
(this=0x3c8e4e0, __in_chrg=) at kernel/qobject.cpp:258
#4  0x7fffe65993a0 in 
QDBusAbstractInterfacePrivate::~QDBusAbstractInterfacePrivate 
(this=0x3c8e4e0, __in_chrg=)

at /usr/include/c++/9/bits/atomic_base.h:326
#5  QDBusAbstractInterfacePrivate::~QDBusAbstractInterfacePrivate 
(this=0x3c8e4e0, __in_chrg=) at qdbusabstractinterface_p.h:88
#6  0x7669bcd7 in QScopedPointerDeleter::cleanup 
(pointer=) at 
../../include/QtCore/../../src/corelib/tools/qscopedpointer.h:52
#7  QScopedPointer 
>::~QScopedPointer (this=0x3e702c8, __in_chrg=)

at ../../include/QtCore/../../src/corelib/tools/qscopedpointer.h:107
#8  QObject::~QObject (this=, __in_chrg=) 
at kernel/qobject.cpp:891
#9  0x7fffe569752d in 
OrgKdeKDirNotifyInterface::~OrgKdeKDirNotifyInterface (this=0x3e702c0, 
__in_chrg=)
at 
/usr/src/debug/kf5-kio-5.68.0-1.fc30.x86_64/src/core/kdirnotify.cpp:34
#10 0x7669ad3c in QObjectPrivate::deleteChildren 
(this=this@entry=0x3ecf5f0) at kernel/qobject.cpp:2016
#11 0x7669bc8f in QObject::~QObject (this=, 
__in_chrg=) at kernel/qobject.cpp:1032
#12 0x7fffe56b8ffe in KCoreDirListerCache::~KCoreDirListerCache 
(this=0x7fffe5728500 <(anonymous 
namespace)::Q_QGS_kDirListerCache::innerFunction()::holder>,

__in_chrg=) at /usr/include/c++/9/bits/atomic_base.h:326
#13 0x7fffe56b947d in (anonymous 
namespace)::Q_QGS_kDirListerCache::Holder::~Holder (this=out>, __in_chrg=)
at 
/usr/src/debug/kf5-kio-5.68.0-1.fc30.x86_64/src/core/kcoredirlister.cpp:54

#14 0x77778680 in __run_exit_handlers () from /lib64/libc.so.6
#15 0x777787c0 in exit () from /lib64/libc.so.6
#16 0x77761f4a in __libc_start_main () from /lib64/libc.so.6
#17 0x7fffdcf0 in ?? ()
#18 0x in ?? ()
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Qt/Qt5 under X11 new feature - accurate frame size

2020-04-14 Thread zeljko via lazarus

On 4/14/20 3:41 PM, zeljko via lazarus wrote:

Please test and report if there's any problem under x11 with qt/qt5 
(minimum is lazarus svn r62975 :)


Just to correct my self (fix in the meantime), minimum for testing 
should be trunk lazarus r62977


zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] EAccessViolation exception on exit qt5 project in Kubuntu 19.10

2020-04-14 Thread zeljko via lazarus

On 4/14/20 1:33 PM, Luca Olivetti via lazarus wrote:

El 14/4/20 a les 12:55, zeljko ha escrit:

On 4/13/20 7:43 PM, Luca Olivetti via lazarus wrote:


Now I tried installing the packaged libqt5pas and still see no segfault.
Note that this isn't a fresh install, I dist-upgraded it (or better 
do-release-upgraded it) many times, but I don't think that should 
matter.


IMO, fpc version is important. 


Yes, I meant that what doesn't matter is that I didn't install 19.10 
clean but via do-release-upgrade


fpc-3.0.4 from distro crashes, fpc-3.0.4 built via fpcupdeluxe works, 
fpc-3.2.0beta works (because it's built via fpcupdeluxe ? ).
Also, KDE Plasma have bug somewhere in KioCore which triggers on qt 
app close - for this, I must test pure Qt5 application to see what's 
going on. In this case Qt4 apps are crashing too.
How to reproduce such crash: simple form with TOpenDialog or 
TSaveDialog, start your project, open dialog, close dialog, close app 
and you'll segfaulted.


not with fpc 3.2.0rc1 (I tried without opening the dialog, opening but 
cancelling it, opening and selecting a file).


That's good to know :) I've tested dialogs with fpc-3.0.4 and it 
segfaults even with my own build of fpc-3.0.4.


zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Qt/Qt5 under X11 new feature - accurate frame size

2020-04-14 Thread zeljko via lazarus

Hi all,

Why this feature ?
1.Assume form with position poWorkAreaRect - you expect that your form
  will be shown in the middle of the screen, taking systray into account.
2.Inside FormCreate() you change your form width and height eg:
  Width := Screen.Width - (Screen.Width div 10);
  Height := Screen.Height - (Screen.Height div 10);

3.Now show your form. It's not centered but offsetted right-down by left 
border and title bar - so not in center (gtk2 has this problem too).
Problem comes from fact that x11 does not provide window frame until 
window is mapped , so we calculate eg form position with wrong values 
because we are missing complete window frame info.


Problem is visible by using GetWindowRect() anywhere in code where 
handle is allocated but window isn't mapped by window manager (x11).


There's no way to know decorations size (borders, title bar) under X11 
when window is not mapped (but eg handle exists) - so it is much 
different from eg win32 which have full frame correct even when window 
is not visible.


I've decided to fix it (thanks to more spare time those days) and 
finally I've managed GetWindowRect() (and maybe other later) to get 
accurate frame size under X11.


I set it up by using dummy widget in the background when app starts and 
creates it's Application.MainForm handle, so after Application.MainForm 
handle is created we have WM frame size.
If you don't want to use this trick then pass -disableaccurateframe to 
your app.


I've tested both qt and qt5 on Mint 19.2 64bit on KDE, cinnamon, xfce, 
openbox, lxde and xfce, and same WMs under Fedora 30 64bit and it work 
like a charm.
Note that creation of dummy widget is pretty fast on my machines (20-30 
msec) so it's not big deal in comparision to this feature. I would like 
to get some feedback about timings from older hardware and older distros 
if possible (qt or qt5).

If someone want to debug dummy widget timings add -dDEBUGQTFRAMESIZE.

Please test and report if there's any problem under x11 with qt/qt5 
(minimum is lazarus svn r62975 :)


Later, maybe gtk2 can be fixed in same way, so probably no more 
segfaults with size messages because of invalid GetWindowRect().


zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Completely solve the GTK trouble

2020-04-14 Thread zeljko via lazarus

On 4/14/20 10:07 AM, jiaxing ruan via lazarus wrote:
Do you need tester? I can help with testing. But anything needs more 
knowledge I afraid I can't.


Anyway, did we at any time found it's tired to catch up with GTK? May be 
we could keep the current GTK3 interface. But my suggestion also deal 
with GTK4, GTK5... One IUP interface, we could choose the appropriate 
GTK version. IUP currently supports both GTK2 and GTK3 and the API still 
the same. What I appreciate IUP is it focuses on a stable API. As I 
said, programs written for IUP 3.15 still compile and run fine with IUP 
3.27. Investing on an IUP interface rather than GTK4, GTK5... interface 
is the most reasonable way to go.


Never heard about IUP, but maybe we can get ideas for various gtk3 
implementations from IUP. Maybe you should provide direct link to IUP 
library, not to your h2pas conversion.


zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] EAccessViolation exception on exit qt5 project in Kubuntu 19.10

2020-04-14 Thread zeljko via lazarus

On 4/13/20 7:43 PM, Luca Olivetti via lazarus wrote:


Now I tried installing the packaged libqt5pas and still see no segfault.
Note that this isn't a fresh install, I dist-upgraded it (or better 
do-release-upgraded it) many times, but I don't think that should matter.


IMO, fpc version is important. fpc-3.0.4 from distro crashes, fpc-3.0.4 
built via fpcupdeluxe works, fpc-3.2.0beta works (because it's built via 
fpcupdeluxe ? ).
Also, KDE Plasma have bug somewhere in KioCore which triggers on qt app 
close - for this, I must test pure Qt5 application to see what's going 
on. In this case Qt4 apps are crashing too.
How to reproduce such crash: simple form with TOpenDialog or 
TSaveDialog, start your project, open dialog, close dialog, close app 
and you'll segfaulted.


zeljko

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] We are planning the next release: Lazarus 2.0.8

2020-04-10 Thread zeljko via lazarus

On 4/10/20 1:28 AM, Denis Kozlov via lazarus wrote:

Hello Martin,

If it's not too late, can r62551 be merged too?

Bug report #36490:
Bitmap transparency (mask) not respected by TMenuItem
https://bugs.freepascal.org/view.php?id=36490


There are fixes for gtk2,qt,qt5 for same thing too

zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Qt/Qt5 users - need trunk testing

2020-04-06 Thread zeljko via lazarus

On 4/5/20 8:09 PM, Alexey Tor. via lazarus wrote:
after updating Laz to today's trunk, CudaText qt5 build has broken look 
of tabs. angled side of tab. and X sign. they are painted via 
canvas.StretchDraw.


I've tested with old code (before stretchdraw changes) and it's same 
problem (I've already write notes at issue). Please create simple 
example and attach to the issue. Your paint code is pretty complex and I 
don't have enough free time to study your code and search for problem.
I guess that there's something with QScreen_grabWindow() , maybe 
coordinates from ATTabs are bad or similar. NOTE: I've tested with 
lazarus trunk from 4.1.2019 (so 15 months old trunk) and it have same issue.


zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Qt/Qt5 users - need trunk testing

2020-04-06 Thread zeljko via lazarus

On 4/5/20 8:09 PM, Alexey Tor. via lazarus wrote:
after updating Laz to today's trunk, CudaText qt5 build has broken look 
of tabs. angled side of tab. and X sign. they are painted via 
canvas.StretchDraw.


In that case:
1.Open issue about it.
2.Create simple example project so I don't need to install cudatext or 
any other components to fix it.


zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Qt/Qt5 users - need trunk testing

2020-04-05 Thread zeljko via lazarus

On 4/5/20 5:08 PM, Fabio Luis Girardi via lazarus wrote:

Ok. I'll test.


Thanks, just use current trunk eg. r62891 since I've fixed more Qt/Qt5 
things.


zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Qt/Qt5 users - need trunk testing

2020-04-03 Thread zeljko via lazarus

Hi all,

For all Qt/Qt5 users of lazarus trunk: I've improved StretchMaskBlt() 
(BitBlt(), StretchBlt()) and fixed some issues #32137 and #32141 
(r62870).Usually those winapi functions are used by Canvas.CopyRect() 
and StretchDraw().


So, I need feedback if anything went wrong with such changes (linux, 
win32, mac).


Thanks,

zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Which Lazarus version that uses FPC v3.2?

2020-01-30 Thread zeljko via lazarus

On 1/30/20 12:46 PM, Mr Bee via lazarus wrote:

Error: /freepascal/fpc/bin/x86_64-darwin/ppcx64 returned an error 
exitcode

fpcupdeluxe: Start of compile error summary.
fpcupdeluxe: ERROR: LazarusNativeInstaller (BuildModuleCustom: 
Lazbuild): make returned error code #512

fpcupdeluxe: Done !!

“” is the folder of installation.

I also have tried FPC fixes3.2 with Lazarus trunk and Lazarus fixes (in 
fpcUpDeluxe), it also failed with similar error message.


Any hints please? Thank you.


Lazarus trunk can be compiled and used with fpc 3.2 fixes without problem.

zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] FPC trunk cannot compile Lazarus Qt5 lib

2019-11-15 Thread zeljko via lazarus

On 11/14/19 7:56 PM, AlexeyT via lazarus wrote:

Lazarus trunk, fpc 3.3.1-r43462 Linux x64

qt56.pas(12495,37) Error: Enumeration symbols can only have values in 
the range of -2^31 to 2^31-1


     QStyleCE_CustomBase = $f000 );



Issue is already opened. I'll wait fpc developers to shed some light on 
this. You can temporary compile it with cast QStyleCE_CustomBase = 
longint($f000)

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Why is there a define switch UseCThreads?

2019-11-11 Thread zeljko via lazarus

On 11/11/19 6:03 PM, Bo Berglund via lazarus wrote:


then the idea is that if building for Linux and you use threads
anywhere you need to put this first in the project file, right?


Lazarus trunk -> New project automatically adds cthreads enclosed with 
IFDEF UNIX, if you create your program manually the you should add it 
manually there.


z.

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Why is there a define switch UseCThreads?

2019-11-10 Thread zeljko via lazarus

On 11/10/19 11:29 PM, Bo Berglund via lazarus wrote:

I have ported a console application from Windows to Linux (Raspbian
Buster) and I got to wonder about the check for a defined symbol
appearing in the beginning of the code as produced by the Lazarus
template:

uses
   {$IFDEF UNIX}{$IFDEF UseCThreads}
   cthreads,
   {$ENDIF}{$ENDIF}

Would it not be enough to use this instead:
uses
   {$IFDEF UNIX}
   cthreads,
   {$ENDIF}


AFAIK, in lazarus trunk there's no more {$IFDEF UseCThreads} when 
creating new project, only {$IFDEF UNIX}cthreads{$ENDIF}


zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Qt5 bindings misses QTextEdit_setPlaceholderText

2019-10-26 Thread zeljko via lazarus

On 10/26/19 10:22 AM, AlexeyT via lazarus wrote:

This looks like missed export in qt5.pas

https://raw.githubusercontent.com/graemeg/lazarus/upstream/lcl/interfaces/qt5/cbindings/qt5.pas

file has the

procedure QLineEdit_setPlaceholderText(handle: QLineEditH; AnonParam1: 
PWideString); cdecl; external Qt5PasLib name 'QLineEdit_setPlaceholderText';

but don't have QTextEdit_setPlaceholderText.


No, that means that distro packager did not update libQt5Pas from 
lazarus trunk.

Latest version is 1.2.7, not 1.2.6.

zeljko




On 26.10.2019 10:01, AlexeyT via lazarus wrote:
./cudatext: undefined symbol: QTextEdit_setPlaceholderText 


--
Regards,
Alexey




--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Qt5 build of program, modal dialogs go to background

2019-10-26 Thread zeljko via lazarus

On 10/26/19 6:25 AM, AlexeyT via lazarus wrote:
I made Qt5 build of CudaText, pls test and see is my bug present? I test 
on Ubuntu w/o Qt5:


user@PC:~$ qmake --version
qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such 
file or directory

user@PC:~$ qmake-qt5 --version
Command 'qmake-qt5' not found, did you mean:
   command 'qmake-qt4' from deb qt4-qmake (4:4.8.7+dfsg-7ubuntu1)

steps.

- get beta of Qt5 build 
https://sourceforge.net/projects/cudatext/files/beta_version/


- configure Python engine in it: 
https://wiki.freepascal.org/CudaText#Python_on_Linux.2C_BSD.2C_Solaris


- open Plugins / Options Editor dialog, and drag this dialog by it 
caption. Here dialog always jumps to BACK of main cudatext dialog during 
dragging (and it jumps by pixels too). About dialog don't jump.




Sorry, but I don't understand what is exact problem. You cannot build 
libQt5Pas with qmake or you have problem with Qt5LCL application ?
I'm using LinuxMint 19.2 on my laptop and there I have qmake (qt5) and 
qmake-qt4 installed.


zeljko

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Qt4 crash in CudaText

2019-09-28 Thread zeljko via lazarus

On 09/28/2019 09:54 AM, AlexeyT wrote:

Qt4 version.


Ok, as I can see it's 4.8.7, so last Qt4 release and it's ok.
Please open an issue about it, in this case I must install your 
components and see what's going on inside your atlistbox.pas , and what 
kind of image is that.


zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Qt4 crash in CudaText

2019-09-28 Thread zeljko via lazarus

On 09/27/2019 07:40 PM, AlexeyT wrote:

 >>    if (not EqualRect(LocalRect, sourceRect^) then

Changed this; still crash. call stack is similar:


In that case it looks like a bug in Qt library (QPainter::drawImage is 
called after our libQt4Pas inside Qt lib). What is your qt4 library 
version ?




#0 QTransform::type() const at :0
#1 ?? at :0
#2 QPainter::drawImage(QRectF const&, QImage const&, QRectF const&, 
QFlags) at :0

#3 QPainter_drawImage2 at :0
#4 DRAWIMAGE(0x7fffdd6aad80, 0x7fffb2f4, 0x184edd0, 0x7fffb304, 
0x0, 0x7fffb2e4, 0) at qt/qtobjects.pas:3612
#5 STRETCHMASKBLT(0x7fffef808d30, 140736908144000, 0, 0, 438, 256, 
140736908144384, 0, 0, 438, 256, 0, 0, 0, 13369376) at qt/qtwinapi.inc:6990
#6 STRETCHBLT(0x7fffef808d30, 140736908144000, 0, 0, 438, 256, 
140736908144384, 0, 0, 438, 256, 13369376) at qt/qtwinapi.inc:6787
#7 STRETCHBLT(140736908144000, 0, 0, 438, 256, 140736908144384, 0, 0, 
438, 256, 13369376) at include/winapi.inc:1025
#8 COPYRECT(0x7fffd6997ae0, {LEFT = 0, TOP = 0, RIGHT = 438, BOTTOM = 
256, TOPLEFT = {X = 0, Y = 0}, BOTTOMRIGHT = {X = 438, Y = 256}, VECTOR 
= {0, 0, 438, 256}}, 0x7fffd6997f00, {LEFT = 0, TOP = 0, RIGHT = 438, 
BOTTOM = 256, TOPLEFT = {X = 0, Y = 0}, BOTTOMRIGHT = {X = 438, Y = 
256}, VECTOR = {0, 0, 438, 256}}) at include/canvas.inc:122

#9 PAINT(0x7fffd6eae8f0) at atlistbox.pas:541




--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Qt4 crash in CudaText

2019-09-27 Thread zeljko via lazarus

On 09/27/2019 06:57 PM, AlexeyT via lazarus wrote:

Stack trace.

#0 QTransform::type() const at :0

#1 ?? at :0
#2 QPainter::drawImage(QRectF const&, QImage const&, QRectF const&, 
QFlags) at :0


This is crash in Qt library.


#3 QPainter_drawImage2 at :0
#4 DRAWIMAGE(0x7fffdd6aad80, 0x7fffb2e4, 0x18bd8a0, 0x7fffb2f4, 
0x0, 0x7fffb2d4, 0) at qt/qtobjects.pas:3568


At line 3568 we are trying to draw image which is converted from 
QImageFormat_RGB32 format to QImageFormat_ARGB32.
That conversion is needed to fix few issues we had in past with various 
qt versions on linux and windows. See issues #11713 and #25590 for 
details. Quick check if that works is to change line (above line 3568 in 
qtobjects.pas)


if (not EqualRect(LocalRect, sourceRect^) or (Mask = nil)) and
  (QImage_format(Image) = QImageFormat_RGB32) then
 ...
to
if (not EqualRect(LocalRect, sourceRect^) then
 

and give feedback. As I can see from stack trace your LocalRect and 
SourceRect are equal , so it will not convert your image to 
QImageFormat_ARGB32 , but it will directly draw it in line 3611 
(qtobjects.pas).


Just change that, rebuild your project and test.


zeljko





#5 STRETCHMASKBLT(0x7fffef808d30, 140736908144000, 0, 0, 438, 256, 
140736908144384, 0, 0, 438, 256, 0, 0, 0, 13369376) at qt/qtwinapi.inc:6990
#6 STRETCHBLT(0x7fffef808d30, 140736908144000, 0, 0, 438, 256, 
140736908144384, 0, 0, 438, 256, 13369376) at qt/qtwinapi.inc:6787
#7 STRETCHBLT(140736908144000, 0, 0, 438, 256, 140736908144384, 0, 0, 
438, 256, 13369376) at include/winapi.inc:1025
#8 COPYRECT(0x7fffd6997ae0, {LEFT = 0, TOP = 0, RIGHT = 438, BOTTOM = 
256, TOPLEFT = {X = 0, Y = 0}, BOTTOMRIGHT = {X = 438, Y = 256}, VECTOR 
= {0, 0, 438, 256}}, 0x7fffd6997f00, {LEFT = 0, TOP = 0, RIGHT = 438, 
BOTTOM = 256, TOPLEFT = {X = 0, Y = 0}, BOTTOMRIGHT = {X = 438, Y = 
256}, VECTOR = {0, 0, 438, 256}}) at include/canvas.inc:122

#9 PAINT(0x7fffd6eae8f0) at atlistbox.pas:541
#10 PAINTWINDOW(0x7fffd6eae8f0, 140736908144000) at 
include/customcontrol.inc:118
#11 PAINTHANDLER(0x7fffd6eae8f0, {MSG = 15, UNUSEDMSG = 0, DC = 
140736908144000, PAINTSTRUCT = 0x7fffd6cf69c0, RESULT = 0}) at 
include/wincontrol.inc:4856
#12 WMPAINT(0x7fffd6eae8f0, {MSG = 15, UNUSEDMSG = 0, DC = 
140736908144000, PAINTSTRUCT = 0x7fffd6cf69c0, RESULT = 0}) at 
include/wincontrol.inc:6828
#13 WMPAINT(0x7fffd6eae8f0, {MSG = 15, UNUSEDMSG = 0, DC = 
140736908144000, PAINTSTRUCT = 0x7fffd6cf69c0, RESULT = 0}) at 
include/customcontrol.inc:98

#14 SYSTEM$_$TOBJECT_$__$$_DISPATCH$formal at :0
#15 ?? at :0
#16 ?? at :0
#17 ?? at :0
#18 ?? at :0
#19 .Ld255 at :0
#20 ?? at :0
#21 ?? at :0
#22 ?? at :0
#23 ?? at :0
#24 ?? at :0


Alex



--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Qt4 crash in CudaText

2019-09-27 Thread zeljko via lazarus

On 09/27/2019 03:46 PM, AlexeyT via lazarus wrote:
I just tested CudaText Linux x64 qt4 build: it now crashes on showing 
Command Palette dialog. Crash inside ATListbox.pas in Paint handler, in 
some Qt painting code. (I tried to change ATListbox.DoubleBuffered, no 
help.)


Please send gdb stacktrace.

zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Qt4: circle painted with artifact

2019-05-12 Thread zeljko via lazarus

On 05/12/2019 01:45 PM, AlexeyT via lazarus wrote:
I noticed that Qt4 build of CudaText paints tabs' X on mouse-over wrong. 
Picture attached (1K). It is ATTabs code - see here


https://github.com/Alexey-T/ATTabs/blob/master/attabs/attabs.pas#L1486

attabs.pas, procedure TATTabs.DoPaintXTo


Please open an issue about it and attach example project, I won't 
install any 3rd party components to fix that. Also, what about Qt5 ?


zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Building lazarus from cli - how to specify target widgetset

2019-04-14 Thread zeljko via lazarus

On 04/14/2019 05:54 PM, Graeme Geldenhuys via lazarus wrote:

As the subject lines says, how do I build lazarus IDE and LCL from the
Linux command line and specify a specific widgetset target. eg: lcl-gtk1
instead of the default lcl-gtk2.


make LCL_PLATFORM=gtk , gtk2 is default so make only is sufficient.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Compilation error Lazarus r.60828

2019-04-04 Thread zeljko via lazarus

On 04/04/2019 03:00 PM, leyba bronstain via lazarus wrote:

When I try to compile subj I get error message

(3104) Compiling generatefppkgconfigurationdlg.pas
d:\\lazarus_21_r60828\ide\generatefppkgconfigurationdlg.pas(9
1,63) Error: (5000) Identifier not found "GetFPCVer"
d:\\lazarus_21_r60828\ide\generatefppkgconfigurationdlg.pas(9
1,92) Error: (5000) Identifier not found "GetFPCVer"
generatefppkgconfigurationdlg.pas(490) Fatal: (10026) There were 2 
errors compil

ing module, stopping
Fatal: (1018) Compilation aborted
make[2]: *** [lazarus.exe] Error 1
make[2]: Leaving directory `d://lazarus_21_r60828/ide'
make[1]: *** [bigide] Error 2
make[1]: Leaving directory `d://lazarus_21_r60828/ide'
make: *** [idebig] Error 2


What is your fpc version ?

zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Is LCL-GTK still possible?

2019-03-26 Thread zeljko via lazarus

On 03/26/2019 10:50 AM, leledumbo via lazarus wrote:

Am I correct, that the LCL widgetset should auto compile, even though my

Lazarus IDE is compiled with LCL-GTK2?

Yes, it should. I build my apps for both GTK2 and QT(4) using build modes in
one go. My IDE stays at QT. Maybe activate clean before build?


Seem that Graeme is talking about Gtk1, not Gtk2.

zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Universal FontDialog for LCL

2019-03-07 Thread zeljko via lazarus

On 03/06/2019 07:54 PM, AlexeyT via lazarus wrote:
I have an idea to make LCL based TFontDialog- which will be LCL form, 
which can be called by TFontDialog.Execute (if Boolean variable in LCL 
is set). Why make it?


- we can make all best features of FontDlgs from all WSes

- we can make additional events- e,g, OnSelectFont (called when used 
selects name in listbox)


- we can make it resizable (and save/load size)

- same look on all WS

If it's good- ok to merge to Laz?



Not as default TFontDialog. Maybe as TLazFontDialog or similar.

zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TListView + OwnerData=true + CheckBoxes

2018-12-11 Thread zeljko via lazarus

On 12/11/2018 01:18 PM, Marcos Douglas B. Santos via lazarus wrote:


I've searched by TVirtualStringTree  on
http://packages.lazarus-ide.org/ and haven't found.
My ENV is Lazarus 1.9.0 r58537 FPC 3.1.1 i386-win32-win32/win64
I have several IDE versions but, for that project I cannot update my
ENV cause other developers are using the same version above.

But, about TVirtualStringTree, is it easy to do what I need, ie, using
virtual data (as records) with checkboxes showing automagically?


Yes, TVirtualStringTree have great concept so you can do whatever with 
your data. It load's millions of rows in a part of second.

CheckBoxes can be in any column.

zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TListView + OwnerData=true + CheckBoxes

2018-12-10 Thread zeljko via lazarus

On 12/10/2018 08:38 PM, Marcos Douglas B. Santos via lazarus wrote:


I don't know what Themes is.
I want to use just default components.

...and nobody more answered.
Is everybody using TDBGrid to show their data?  :)


No. Use TVirtualStringTree instead of TListView, it's x10 faster.

zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Qt patch needs /const/ word

2018-12-10 Thread zeljko via lazarus

On 12/10/2018 10:02 AM, AlexeyT via lazarus wrote:
https://github.com/graemeg/lazarus/commit/16dea52f979acc4a2998942f07d2e17ea5233aa5 



I see N functions with somename(s: string). they need word /const/ for 
parameter.




Done.

zeljko

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TListView + OwnerData=true + CheckBoxes

2018-12-09 Thread zeljko via lazarus

On 12/09/2018 12:58 PM, Marcos Douglas B. Santos via lazarus wrote:

Hi,
Has anybody already used, with success, virtual ListView showing CheckBoxes?

There are any links on Internet, most about Delphi, but each one say 
something little different then other.
I've tried a few combinations reading those links with no success. I 
haven't tried any that says that we need to paint the checkboxes with 
complex algorithms because I think that it should be simpler.


If you use Themes for checkboxes it's pretty easy. Never used virtual 
TListView with checkboxes so don't know it's behaviour


zeljko

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Order of OnCreate and OnActivate in Qt4

2018-11-25 Thread zeljko via lazarus

On 11/25/2018 04:43 PM, Vojtěch Čihák via lazarus wrote:


CRASH, because code in OnActivate assumes that FrmContext already exists.

So, Qt4+Plastique has different order of events than Qt4+QtCurve.

Unfortunately, I cannot reproduce with simple demo.

What I'm doing wrong? Do I rely on something that is not guaranteed?


Try to disable usage of QtNativeEventFilter in qtdefines.inc if it's 
enabled.


zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Order of OnCreate and OnActivate in Qt4

2018-11-25 Thread zeljko via lazarus

On 11/25/2018 04:43 PM, Vojtěch Čihák via lazarus wrote:

Today I used tool qtconfig and changed style (Appearance) from Plastique 
to QtCurve. Now my code crashes, order of events is:


FrmMain.Create

FrmMain.Activate

CRASH, because code in OnActivate assumes that FrmContext already exists.

So, Qt4+Plastique has different order of events than Qt4+QtCurve.

Unfortunately, I cannot reproduce with simple demo.

What I'm doing wrong? Do I rely on something that is not guaranteed?


Afaik not, that should work w/o problems. Never seen such kind of 
problem with different themes. In any case, without example project I 
cannot help.


zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Scaling of menuitem icons

2018-10-19 Thread zeljko via Lazarus

On 10/19/2018 11:46 AM, Ondrej Pokorny wrote:

On 19.10.2018 11:43, zeljko wrote:
QProxyStyle can return any size for PM_SmallIconSize, but in that case 
we should know what's the current size of "normal" icons in LCL.


The current size of "normal" icons in LCL is perfectly known, as well as 
the size of any menu icon in LCL. Call the TMenuItem.GetIconSize 
function to get it.


Tnx

zeljko
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Scaling of menuitem icons

2018-10-19 Thread zeljko via Lazarus

On 10/19/2018 10:15 AM, Ondrej Pokorny via Lazarus wrote:
 >  On my Linux + KDE system however icons of the IDE's main menuitems 
do not scale.
 > In KDE settings panel -> Fonts I set the "Force font's DPI" value to 
144 which is about 150%.


I remember I worked on it:

1.) Gtk2: I added support for Gtk2. See screenshot. It works well for me 
if I use "xrandr --dpi 144x144" as it is suggested in 
http://wiki.lazarus.freepascal.org/High_DPI


Your settings revealed a bug in Gtk2 bindings. Patch is attached.

2.) Qt: I wasn't able to add support of high-resolution icons in menus 
under Qt. My conclusion was that either Qt itself or LCL-Qt bindings do 
not support big icons in menus. When I used the correct size icon in the 
menu it was always (badly) downscaled to 16x16 pixels.


Probably the only solution is to use QProxyStyle class.
There's no QProxyStyle class in Qt4/Qt5 C bindings and to fix this 
problem it should be implemented with it's overrides.
QProxyStyle can return any size for PM_SmallIconSize, but in that case 
we should know what's the current size of "normal" icons in LCL.


zeljko
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] MDI problem and fix for Windows with Qt4/Qt5

2018-09-06 Thread zeljko via Lazarus

On 09/05/2018 08:38 PM, Rudolf Cornelissen via Lazarus wrote:

Hi all,

This is my first post here, I hope my input is considered helpfull.

Anyhow, I am busy converting a Delphi MDI application (which I develop 
as a daytime job) to Lazarus using Qt/Qt5.

Compared to Win32 Widgeset indeed Qt has much more stuff in place.

A problem I encountered is a mouse offset between mouseposition in the 
MDI child window 'onscreen' and the position as handled internally in 
LCL when a button in pressed.


The effect is that for instance if I have a button onscreen, and I hover 
over it, the color correctly changes hinting me that I can press that 
button. When I do however, the button is not activated unless I hover my 
mouse 'titlebar height' above the button.


There is a simple fix possible for this my modifying the file 
'qtwidgets.pas' in both Qt and Qt5 LCL/interfaces folders.


When I modify routine 'TQtMainWindow.OffsetMousePos' in the below way 
MDI works fully correctly concerning the mouse positions here (windows7 
tested):



procedure TQtMainWindow.OffsetMousePos(APoint: PQtPoint);
var
   MyWidget : QWidgetH;
   MyStyle  : QStyleH;
   MyTitleBarHeight : Integer;
begin
   inherited OffsetMousePos(APoint);

   if IsMdiChild and not IsMaximized then
   begin
     //correct windowed Y-pos
     //dec(APoint^.Y, GetSystemMetrics(SM_CYCAPTION)); //windows only
     MyWidget := GetWidget;
     MyStyle  := QWidget_style(MyWidget);
     MyTitleBarHeight := QStyle_pixelMetric(MyStyle 
,QStylePM_TitleBarHeight, nil, MyWidget);

     dec(APoint^.Y, MyTitleBarHeight);

     //correct windowed X-pos
     dec(APoint^.X, (self.getFrameSize.Width - 
self.getClientBounds.Size.Width) div 2);

   end;
end;


Can someone validate I am not doing something stupid here and update the 
sources if not?

That would save me some work manually modifying these routines over here..

Thanks for taking the time to look at this..


Please open an issue about it and attach example project.

zeljko


--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] spinedit issue with qt5

2018-06-11 Thread zeljko via Lazarus

On 11.06.2018 11:43, Luca Olivetti via Lazarus wrote:

El 11/06/18 a les 11:30, Luca Olivetti via Lazarus ha escrit:


I changed that to

 if (ACustomFloatSpinEdit.MaxValue > 
ACustomFloatSpinEdit.MinValue) then

 begin
   ASpinWidget.setMinimum(ACustomFloatSpinEdit.MinValue);
   ASpinWidget.setMaximum(ACustomFloatSpinEdit.MaxValue);
 end
 else
 begin
   if ASpinWidget is TQtFloatSpinBox then
   begin
 ASpinWidget.setMinimum(-MaxDouble);
 ASpinWidget.setMaximum(MaxDouble);
   end else
   begin
 ASpinWidget.setMinimum(-$7fff);
 ASpinWidget.setMaximum($7fff);
   end;
 end;


And it still fails :-(
If I use -MaxInt and MaxInt it works (albeit with a reduced range)



Please open an issue and attach example project.

zeljko
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Let's make a web browser

2018-05-18 Thread zeljko via Lazarus

On 05/18/2018 10:46 AM, Michael Van Canneyt via Lazarus wrote:



I thought it was perhaps chrome embedded ?


Maybe, there are Delphi bindings around for chrome embedded

z.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Control's default Height and AutoSize

2018-05-14 Thread zeljko via Lazarus

On 05/14/2018 01:40 PM, Gabor Boros via Lazarus wrote:

Hi All,

I have three machines. One physical with Windows 10 (1703) and two 
virtual, one with Ubuntu Server 14.04.1 + KDE4 and Qt4 and one with RHEL 
7.5 + KDE4 and Qt4. Start a new project with trunk (57932), drop a TEdit 
on Form1 and change it's font to Droid Sans Mono Regular 10. With 
Windows the TEdit's original Height is 23, after font change 23 too. 
With Ubuntu 23 and 25, with RHEL 22 and 23. Why is the difference and 
what it's source?


Default TEdit height (autosize=true) depends on Qt4 theme. Some themes, 
eg KDE breeze from fedora 26 gives 28 px which is taken from the current 
desktop environment, but eg -style windows it's size is 23.


zeljko
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TStringGrid sort symbol in TitleButton

2018-05-14 Thread zeljko via Lazarus

On 05/14/2018 01:43 PM, Landmesser John via Lazarus wrote:
In a StringGrid without(!) defined columns you never see that up and 
down arrow in the TitleButton if you click to sort this column.


It's ok if you define at least one column, but i think that shouldn't be 
this way.


I don't get what is exact problem. If there's no columns why Sort 
indicator should be visible at all (and where) ?

In any case you can create bug report and attach example project.

zeljko



Attached patch comments out

//FImageIndex := -1;

My first patch :-)

Lazarus 1.9.0 r57932M FPC 3.0.4 i386-win32-win32/win64





--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazarus win32 with fpc-3.0.4 no memory left problem

2018-05-13 Thread zeljko via Lazarus

On 05/13/2018 02:05 PM, Martin Frb via Lazarus wrote:


If it happens while linking, try to disable smart-linking.


That fixed problem. Thanks !

zeljko

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Lazarus win32 with fpc-3.0.4 no memory left problem

2018-05-13 Thread zeljko via Lazarus

Hi,
Using trunk lazarus r57911 and fpc-3.0.4 (32 bit), Windows 10.
When rebuilding ide from lazarus got "No memory left" while linking IDE.
I have bunch of 3rd party packages so I guess that too many units 
triggers this error since "make bigide" from cmd works fine.
With fpc-3.0.0 everything works fine. Both win32 and win32-qt shows same 
error.

Does anybody have such problem ? Is there any way to fix it ?
Does 3.1.1 trunk have such problem ?

Thanks,

zeljko
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Canvas cannot draw properly if has an alpha channel?

2018-04-25 Thread zeljko via Lazarus

On 25.04.2018 16:30, Anthony Walter via Lazarus wrote:
I am trying to paint controls, so I need to eventually Canvas.Draw() to 
get a graphic onto a control. I've been working on creating a fully 
featured web browser for Lazarus and have been looking at the underlying 
widgetset interface code.


Gtk3, which my project currently works great on, uses the now required 
Cairo system for painting Gtk widgets. I've already had to patch the 
Gtk3 LCL interface section quite a bit to fix errors and I'll submit 
those changes when I publish my project.


That would be nice.



However, the LCL Gtk2 widgetset is stuck using the Gdk system for 
drawing, even though that was deprecated early on in the Gtk2 lifetime 
and Cairo has been recommend for a decade or more. I would like to 
submit a patch for Gtk2 replacing Gdk with Cairo, but using a swtich 
setting that could be changed at runtime.


+1, maybe add Gtk2UseCairo as default.

 paths are also welcome, afair win32,qt and gtk2/3 supports paths 
and it can be implemented inside widgetsets.


zeljko
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Color and transparancy selection ?

2018-03-23 Thread zeljko via Lazarus

On 03/23/2018 10:27 AM, Michael Van Canneyt via Lazarus wrote:
ported platforms.


Well, Qt works on all supported desktop platforms :)


Oh please, you know what I meant :)

s/platforms/platforms+widgetsets/g  :)


Of course I know :)

zeljko

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Color and transparancy selection ?

2018-03-23 Thread zeljko via Lazarus

On 03/23/2018 09:27 AM, Michael Van Canneyt via Lazarus wrote:



On Fri, 23 Mar 2018, zeljko wrote:


On 03/22/2018 08:49 PM, Michael Van Canneyt via Lazarus wrote:


Hello,

Is there a version of TColorDialog which allows to specify an Alpha 
channel ?


Qt4/Qt5 ws have alpha option in standard color dialog.


That's no good to me. It needs to work on all platforms, all widgetsets.

This is lazarus, after all - it should work on all supported platforms.


Well, Qt works on all supported desktop platforms :)

zeljko

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Color and transparancy selection ?

2018-03-23 Thread zeljko via Lazarus

On 03/22/2018 08:49 PM, Michael Van Canneyt via Lazarus wrote:


Hello,

Is there a version of TColorDialog which allows to specify an Alpha 
channel ?


Qt4/Qt5 ws have alpha option in standard color dialog.

zeljko
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Linux make libQt5Pas fails

2018-03-19 Thread zeljko via Lazarus

On 03/19/2018 05:03 AM, Anthony Walter via Lazarus wrote:

Building on Ubuntu 16.04. Any suggestions?


Probably you're using Qt5 lib < 5.6. AFAIR Ubuntu 16.04 have Qt-5.5 by 
default (same as mint 18.3), I've successfully installed Qt5 5.6.1 from 
some ubuntu repo and it works like a charm.


zeljko

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Special Request: Theme entire IDE support

2018-03-14 Thread zeljko via Lazarus

On 03/14/2018 03:00 PM, Juha Manninen via Lazarus wrote:

On Sat, Mar 10, 2018 at 6:41 AM, AlexeyT via Lazarus
 wrote:

I made big work to theme scrollbars in CudaText.


TScrollBar is a native widget, isn't it? Why does it not follow the
native theme?


It follows native theme of the widgetset, but not eg color setted up 
from lcl (well, Qt can handle that but not for mswindows and cocoa 
themes). I think that Alexey wants to customize scrollbars (eg with 
different color), but he cannot do so with lcl TScrollbar which is 
native widgetset control. Same as you cannot set TBitBtn.Color under 
win32 ws.


zeljko
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TStringGrid and cancelling a modal form

2018-03-13 Thread zeljko via Lazarus

On 03/12/2018 08:05 PM, Mark Morgan Lloyd via Lazarus wrote:

On 12/03/18 17:45, José Mejuto via Lazarus wrote:
El 12/03/2018 a las 18:25, Mark Morgan Lloyd via Lazarus escribió:> 


On the main form I've got (a tabbed notebook containing multiple > 
instances of) a TStringGrid. The OnSelection event invokes a modal 
form > (containing nothing of significant complexity) with OK and 
Cancel > buttons, and stripped down looks like this:

Hello,
Just for testing the OnSelection is raised by mouse click ? If the 
answer is yes, try to click the cell and keep the mouse button 
pressed. If the form appears the grid is still waiting for a MOUSE_UP 
(thinking you are holding MOUSE_DOWN to perform a selection) and the 
modal form has its own queue, so MOUSE_UP never arrives.


Yes, the modal form appears while the mouse button is held down (for 
both GTK2 and Qt).




So, yes, seem that grid expects mouseup
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TStringGrid and cancelling a modal form

2018-03-12 Thread zeljko via Lazarus

On 03/12/2018 06:25 PM, Mark Morgan Lloyd via Lazarus wrote:
Running on (Debian) Linux on AMD64 or ARM, Lazarus 1.6.4 and FPC 3.0.2, 
I'm seeing different behaviour depending on whether a program uses Qt or 
GTK2. The program changes the hardware configuration of a mouse 
(Logitech G600) using hidraw, and as such needs to run with root 
privilege (e.g. kdesudo or sudo -E).


On the main form I've got (a tabbed notebook containing multiple 
instances of) a TStringGrid. The OnSelection event invokes a modal form 
(containing nothing of significant complexity) with OK and Cancel 
buttons, and stripped down looks like this:


procedure TFormLG600.StringGridMode1UnshiftedSelection(Sender: TObject; 
aCol, aRow: Integer);


begin
{...}
   if ButtonsAndKeys.ShowModal() = mrOk then begin
{...}
   end
end;

This is fine if built for Qt, but if built for GTK2 what I see is that 
after the modal form is exited any mouse activity over the grid appears 
to cause an erratic multicell selection and the modal form immediately 
pops up again. This is reproducible if the Cancel button is pressed, and 
in at least some cases after OK.


I've seen indeterminate discussion of this in the foramina, and have 
followed up the indicated wiki pages etc. Does anybody have any 
suggestions, preferably not along the lines of "don't use GTK2" since I 
was thinking of sticking this on Sourceforge and that restriction would 
probably be unpopular?




hmm, try LCLIntf.SetCapture(0) after closing modal form , just to 
isolate capture problems.


zeljko

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Special Request: Theme entire IDE support

2018-03-10 Thread zeljko via Lazarus

On 03/10/2018 02:41 PM, Vojtěch Čihák via Lazarus wrote:

Hi,

you can do it for Qt applications, just run Lazarus (or any Laz. project 
built as Qt) as:


./lazarus -stylesheet mydarkstyle.qss

where mydarkstyle.qss must be valid Qt Style Sheet file, 
see: http://doc.qt.io/archives/qt-4.8/stylesheet.html#stylesheet


But again I've found scrollbars problematic since they look ugly when 
they're completely drawn by stylesheet :)


zeljko
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] An expression is returning false, why?

2018-03-04 Thread zeljko via Lazarus

On 03/04/2018 09:48 PM, Lubos Pintes via Lazarus wrote:
Hello and thank for a reply. Do I understand correctly that a form is a 
special case?
What about TEdit or TButton for example? I am encapsulating a TControl 
instance and am asking for properties needed for UI Automation, 
occasionally asking if the encapsulated control is a TWinControl instance.
I tested the simplest LCL program, just an empty form, and it really 
caused me headache. I just forcefully set the HasKeyboardFocus property 
to true for testing and the form was reported correctly.


Use MyForm.ActiveControl to get focused control on active form.

zeljko
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] ll 1.8.0 compiles fail with "Error while linking"

2018-02-11 Thread zeljko via Lazarus

On 11.02.2018 23:36, Tom Lisjac via Lazarus wrote:


Thanks Zeljke, Péter and Mattias.

Plenty of space on all three OS'es and I installed all the dependencies 
that the rpm's (from sourceforge) required.


I've upgraded the Fedora 19 install many times without issues. This is 
the error after upgrading to 1.8.0 when compiling a blank form or the 
IDE from the ide:


Build IDE: Exit code 512, Errors: 1
[lazarus] Error 1
[idepkg] Error 2
make: *** [idepkg] Error 2
lazarus.pp(161,1) Error: Error while linking

It was originally the same on a new Fedora 23, but booted the VM up 
again today and now see this with a blank form compile:


Compile Project, Target: /home/user/tmp/project1: Exit code 256, Errors: 
1, Warnings: 2
project1.lpr(20,1) Warning: "crtbeginS.o" not found, this will probably 
cause a linking failure
project1.lpr(20,1) Warning: "crtendS.o" not found, this will probably 
cause a linking failure

project1.lpr(20,1) Error: Error while linking

A forum search search suggested checking the path in /etc/fpc.cfg:

# path to the gcclib
#ifdef cpui386
-Fl/usr/lib/gcc/x86_64-redhat-linux/4.8.3/32
#endif
#ifdef cpux86_64
-Fl/usr/lib/gcc/x86_64-redhat-linux/4.8.3
#endif


eg. my current Fedora 26 have
/usr/lib/gcc/x86_64-redhat-linux/7
/usr/lib/gcc/x86_64-redhat-linux/7/32
so just change fpc.cfg according to your gcc dir.
In any case warning about crtbeginS.o and crtendS.o won't break linking 
stage, something else is missing.


--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] ll 1.8.0 compiles fail with "Error while linking"

2018-02-11 Thread zeljko via Lazarus

On 02/10/2018 11:50 PM, Tom Lisjac via Lazarus wrote:

Hi all,

Getting "Error while linking" when trying to compile the 1.8.0 ide or 
any test programs on an old Fedora 19 and fresh installs of Fedora 23 
and Centos 6.8. Reviewed some bugs and forum postings, but there doesn't 
seem to be a fix or workaround available.


I'd like to get this working on an RPM based distro, but am wondering if 
I'd have better luck trying a debian flavor.


Any suggestions would be appreciated.


You're probably missing some devel packages.

zeljko
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Problem with fpc-3.0.4 and double

2018-02-02 Thread zeljko via Lazarus

On 02/02/2018 04:10 PM, Marco van de Voort wrote:

On Wed, Jan 31, 2018 at 07:31:56PM +0100, zeljko via Lazarus wrote:

Using binary floats, there are just too many values that can't be
represented 100%, regardless of the length of the mantissa.
https://en.wikipedia.org/wiki/Floating-point_arithmetic#Accuracy_problems


Thanks Ralf, I know what is floating point arithmetic, but something is
changed between 3.0.2 and 3.0.4 and I want to know what it is.


It could be as simple as slightly different codegeneration that eliminates a
temporary variable or adds it.

The x87 CPU calculates with 80-bits, but storing it into a double variable
(e.g.  a local variable on the stack) will round it to 64-bit double. This
can cause small precision fluctuations, and, as with all regular float
comparison issues, it is something of all times and all compilers.



Today I've found exact where's problem.
It's zeoslib 7.2.1 which uses fastcode (ZFastCode) implementation and 
results of StrToFloatDef() are bit different than results which is given 
by fpc's StrToFloatDef().

Changed code to use fpc functions and everything is correct now :)

Thanks for your time ppl

zeljko


--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Problem with fpc-3.0.4 and double

2018-01-31 Thread zeljko via Lazarus

On 01/31/2018 07:27 PM, Ralf Quint via Lazarus wrote:


Comparing any floating point value like this is pure luck when you claim 
that it worked in the past. In any programming language, unless maybe 
you are using one that by default utilizes BCD floats.
Using binary floats, there are just too many values that can't be 
represented 100%, regardless of the length of the mantissa.

https://en.wikipedia.org/wiki/Floating-point_arithmetic#Accuracy_problems


Thanks Ralf, I know what is floating point arithmetic, but something is 
changed between 3.0.2 and 3.0.4 and I want to know what it is.


zeljko
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Problem with fpc-3.0.4 and double

2018-01-31 Thread zeljko via Lazarus

Hi all,
In one of my applications I'm using someDouble1 <> someDouble2 for 
years, now got problem with fpc-3.0.4 (all previous fpc versions were ok 
(3.0.2, 3.0.0, 2.6.4, 2.6.2, 2.6.0...etc) + kylix + delphi7), so now 
must use IsSameValue(someDouble1,someDouble2) to get correct comparision 
of double types.


What exactly have been changed in fpc-3.0.4 with double types (or 
generally with floats) ?  Do I have to check all of my code now and 
change comparisions of doubles to use IsSameValue() ?


Anyone boomed by such problem ?

P.S: Sorry for writing in lazarus list, don't have fpc list account...

zeljko
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Rebuilding IDE Gtk/Qt

2018-01-02 Thread zeljko via Lazarus

On 02.01.2018 16:01, Vojtěch Čihák via Lazarus wrote:

Hi,
  
I sometimes experienced that IDE does not follow the value in combobox in Tools -> Configure "Build Lazarus". Setting Qt is ignored and IDE rebuilds to GTk. But when I change the value in Project Options -> Additions and Overrides -> LCL Widget Type and then I rebuild IDE, it rebuilds to correct widgetset.

However, it is not reproducible always, so I'd like to ask if someone 
experienced this too.
  
Note that it is not new, it was there before 1.8.


I can confirm that. Don't know how to reproduce - it just happens 
sometimes especially if current project ws is eg gtk2. Laz rebuild looks 
into project ws, not one mentioned in laz build dialog.
Similar problem perists with build many modes. I've spotted that max 2 
months ago ... eg I'm using linux 64bit qtlcl for my builds , all builds 
are qt based (win32, linux32,linux64) and for win32 & linux32 cpu = 
i386, for win32 os = win32, for linux32 and linux64 it's "Default", but 
sometimes when I rebuild all modes, after win32 is finished (note that 
win32 OS = win32, not "Default"), it tries to build next one as win32 OS 
- eg linux 64bit, and stops since I don't have win64 compiler ...do OS 
target isn't updated.


zeljko
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TTrackbar and Wine

2017-12-22 Thread zeljko via Lazarus

On 12/22/2017 01:26 PM, Vojtěch Čihák via Lazarus wrote:
I can confirm behavior in Wine. When you change trVertical to 
trHorizotal - everything OK. But oppositely, trackbar calculates with 
new width and OLD height and ticks remain horizontal. When you resize it 
at least 1 pixel, everything is OK.


But I'm not able to say if the issue is in Wine or in Lazarus.


What widgetset win32 or qt ?

zeljko
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] ButtonPanel uses not same back color as Form uses

2017-12-21 Thread zeljko via Lazarus

On 12/21/2017 08:11 AM, Alexey via Lazarus wrote:

This is on Ubuntu 17.10, default theme, gtk2. Pucture, buttonpanel below.


Let me power on my crystal ball to see what lazarus version is there
Maybe this one hits you: https://bugs.freepascal.org/view.php?id=32779
So, if you are at lazarus trunk >= 56684 then try to change default (as 
in patch at that issue) from clBackground to clForm and then see if that 
helps.


zeljko
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Qt Ws doesn't support properly GetWindowSize() and GetWindowRect()

2017-12-15 Thread zeljko via Lazarus

On 15.12.2017 17:08, Giuliano Colla via Lazarus wrote:
This snippet of code, which executes as expected with GTK2 WS, fails 
with QT WS:



procedure TForm1.btnWsizeClick(Sender: TObject);
var  aHandle: THandle;
   aWidth,aHeight: Integer;
   aRect: TRect;
begin
   aHandle:= Form1.Handle;
   if GetWindowSize(aHandle,aWidth,aHeight) then begin
 Label3.Caption:= Format('Width: %d Height: %d',[aWidth,aHeight]);
   end
   else Label3.Caption:= 'Failed to get Window Size';
   GetWindowRect(aHandle,aRect);
   Label3.Caption:= Label3.Caption + Format(' Rect: %d,%d',[
   aRect.Right-aRect.Left,
   aRect.Bottom-aRect.Top]);
   Label3.Visible:= True;
end;


As it is, it crashes with an AV in the GetWindowSize call. The failing 
call is in TQtWidget.GetWidget: it executes Result := 
QWidgetH(TheObject) where TheObject appears to have taken a bogus value.


If I remove the offending call, then the subsequent GetWindowRect() 
returns bogus values, sort of -32704 and -85984614 instead of 689 and 522.


Under GTK2 both calls work as expected.

Tested under Linux x86_64 (CentOs 6) with Lazarus 1.8 - QT45 - fpc 3.0.4

It doesn't appear to be a regression, because it does the same even with 
a very old Lazarus 1.2.6 , qt45 and fpc 2.6.4


Should I report a bug or is it a known issue?


It's bug in your code (range error). You're using aHandle: 
System.THandle (longint) instead of LCLIntf.THandle which is of ptruint 
type.
Best and correct usage would be to use HWND type which is what it needs 
to be on all platforms and widgetsets.
When aHandle type is corrected, or LCLType is included with it's THandle 
then everything works as expected.

Don't ask me my gtk2 works, in any case it's wrong on 64bit platform.

zeljko
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Note to new high-DPI icons

2017-12-10 Thread zeljko via Lazarus

On 10.12.2017 11:39, Werner Pamler via Lazarus wrote:

Ally has been mentioned in contributions.txt with his real name since 
his first contributions. Now I added "component icons" to his name in 
the same way as it is done for the translators. But I don't agree with 
AlexeyT that we should list "Graphic designers" separately. I don't know 
if FTurtle is already listed, I don't know his real name.


No way, in that case we must split Translators, Developers etc 
...there's simply no point to touch contributions.txt.


zeljko

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Why not to apply patch of TListView.CustomSort

2017-11-09 Thread Zeljko via Lazarus



On 11/09/2017 11:55 AM, Ondrej Pokorny via Lazarus wrote:

On 09.11.2017 11:25, Alexey via Lazarus wrote:

Patch is ready and tested


I hope Zeljko will look at it soon.


Yeah, I'll do that during weekend.

zeljko
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] "Ambiguous unit found" message

2017-11-06 Thread zeljko via Lazarus

On 06.11.2017 17:16, Ondrej Pokorny via Lazarus wrote:

On 06.11.2017 17:11, Sven Barth via Lazarus wrote:
Am 06.11.2017 13:48 schrieb "Ondrej Pokorny via Lazarus" 
>:


A secret insider tip: use Ctrl+C to copy the full text into clipboard.


Does this work on all widgetsets? I know that Windows and Qt support 
this by themselves, but not whether the others or the LCL itself do.


I remember I implemented it for emulated dialogs (if I am not mistaken 
all but win32 are emulated). So yes, it should work on all widgetsets. 
If not, fill a bug report.


Qt dialogs supports selection of dialog text and copying (QTextEdit is 
text control, so you can even use html text in Qt dialogs).


zeljko
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Converting all code to use UnicodeString

2017-09-26 Thread zeljko via Lazarus

On 26.09.2017 11:31, Juha Manninen via Lazarus wrote:


Maybe there still is a valid reason to use codepages but I don't know
what it is.


POS receipt printers :)

zeljko
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] LazReport - Issues 26971 and 30466

2017-09-13 Thread zeljko via Lazarus

On 09/13/2017 10:51 AM, Gabor Boros via Lazarus wrote:

Hi All,

https://bugs.freepascal.org/view.php?id=26971

~3 years later. Any idea?


No

zeljko
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] crDrag cursor is now 2x bigger

2017-09-07 Thread Zeljko via Lazarus



On 09/07/2017 08:42 AM, Alexey via Lazarus wrote:

with crNoDrop cursor. On Linux gtk2 I see cursor is 2x-3x bigger than I
seen it before, 2-3 months ago.



Maybe not related but this is my yesterday post to lazdevel list:

cursorimage.inc
TCursorImage.LoadFromResourceHandle()
Line 95

IconEntry.bWidth := DirEntry^.wWidth;
IconEntry.bHeight := DirEntry^.wHeight;

IconEntry members are byte, but DirEntry members are word, so range 
error occurs.


Note that range error does not occur with fpc-3.0.2 , but it happens 
with 3.0.4rc1.


So, maybe cast can fix your problem:
IconEntry.bWidth := Byte(DirEntry^.wWidth);
IconEntry.bHeight := Byte(DirEntry^.wHeight);

zeljko
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] LCL on Mac 64 bit

2017-06-15 Thread zeljko via Lazarus

On 06/15/2017 05:53 PM, Ondrej Pokorny via Lazarus wrote:

On 15.06.2017 17:19, Mattias Gaertner via Lazarus wrote:

On Thu, 15 Jun 2017 17:07:06 +0200
Andrea Mauri via Lazarus  wrote:


The Mac native 64bit API is Cocoa and it exists for the LCL.
It is missing some feature though. Maybe Felipe can tell more details.

Alternatively you can use qt, which is pretty complete, but requires
to install the qt libraries to run the application.

What about the sentence:

Mac OS X:
10.5 to 10.12, LCL only 32bit, non LCL apps can be 64bit.

I misunderstood something?

When the IDE runs on Cocoa we will change it. Was that your question?


What about OSX 64bit with Qt5? I don't want to pinpoint unnecessarily, I
am really interested - being in the same situation as Andrea.


Both qt4 and qt5 works as 64bit w/o problems. I'm using it for  our mac 
apps (complete lazarus build is qtlcl 64bit).



zeljko

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Order of events: TEdit / TListBox

2017-05-23 Thread zeljko via Lazarus

On 05/23/2017 04:15 AM, kapibara via Lazarus wrote:

Some more findings. Under Windows, the Edit.Exit event fires before both
SelectionChange and OnClick no matter what item you select.


It's normal. If you click onto listbox (OnMouseDown of listbox 
triggers), TEdit looses focus and triggers OnExit()



Plus under Windows, SelectionChange fires even though an item might
already be selected which it doesn't under Linux GTK2. Under both
environments, the Click event fires after SelectionChange..


OnClick() is passed after OnMouseDown() + OnMouseUp(), so it's normal.
When you press one item with mouse selection changes (click isn't 
triggered yet), releasing mouse triggers MouseUp and Click().


zeljko

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Patch for fixing the window resizes when switching components

2017-05-18 Thread zeljko via Lazarus

On 18.05.2017 20:24, Kostas Michalopoulos via Lazarus wrote:

Yes the new code works perfectly fine here and is a better solution. My
original thought was to use pure Gtk but i forgot about gdk_ and only
looked for something like gtk_window_get_state - which i couldn't find :-).


Thanks for feedback :)

zeljko

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Patch for fixing the window resizes when switching components

2017-05-18 Thread zeljko via Lazarus

On 18.05.2017 13:43, Mattias Gaertner via Lazarus wrote:

On Thu, 18 May 2017 13:20:52 +0200
zeljko via Lazarus <lazarus@lists.lazarus-ide.org> wrote:


[...]
if GDK_IS_WINDOW(PGtkWindow(OurWidget)^.window) and
(gdk_window_get_state(PGtkWindow(OurWidget)^.window) =
GDK_WINDOW_STATE_MAXIMIZED) then
   gtk_window_unmaximize() ...
Same for unfullscreen and other "un" routines which we use inside that
procedure.

What other devels think about this ? Should I correct that patch in this
way and fix future problems with eg gtk_window_unfullscreen() which
isn't covered by this patch atm ?


Your solution looks more correct. But since this issue can only be
reproduced on some systems, can you test it?


Mattias, please if you merge something (at least related to 
resolved/closed issues) add it to

http://wiki.freepascal.org/Lazarus_1.8_fixes_branch
(I've added r54958 to the merged revisions for RC2)

zeljko


--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Patch for fixing the window resizes when switching components

2017-05-18 Thread zeljko via Lazarus

On 18.05.2017 13:43, Mattias Gaertner via Lazarus wrote:

On Thu, 18 May 2017 13:20:52 +0200
zeljko via Lazarus <lazarus@lists.lazarus-ide.org> wrote:


[...]
if GDK_IS_WINDOW(PGtkWindow(OurWidget)^.window) and
(gdk_window_get_state(PGtkWindow(OurWidget)^.window) =
GDK_WINDOW_STATE_MAXIMIZED) then
   gtk_window_unmaximize() ...
Same for unfullscreen and other "un" routines which we use inside that
procedure.

What other devels think about this ? Should I correct that patch in this
way and fix future problems with eg gtk_window_unfullscreen() which
isn't covered by this patch atm ?


Your solution looks more correct. But since this issue can only be
reproduced on some systems, can you test it?


Pls, do not apply that patch yet. Must check what happens with 
GdkWindowState.


zeljko

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Patch for fixing the window resizes when switching components

2017-05-18 Thread zeljko via Lazarus

On 18.05.2017 13:38, Marc Weustink via Lazarus wrote:

zeljko via Lazarus wrote:

On 18.05.2017 01:43, Kostas Michalopoulos via Lazarus wrote:

if GDK_IS_WINDOW(PGtkWindow(OurWidget)^.window) and
(gdk_window_get_state(PGtkWindow(OurWidget)^.window) =
GDK_WINDOW_STATE_MAXIMIZED) then
  gtk_window_unmaximize() ...
Same for unfullscreen and other "un" routines which we use inside that
procedure.

What other devels think about this ? Should I correct that patch in this
way and fix future problems with eg gtk_window_unfullscreen() which
isn't covered by this patch atm ?


I prefer using the gtk/gdk functions and avoid getting (win)controls
from the widgetsets


I've attached new patch https://bugs.freepascal.org/view.php?id=31832 
...maybe we need one more check if GdkWindow is toplevel but that's all, 
approach is clear gtk2/gdk instead involving lcl in this part of code 
for no reason.


zeljko

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Patch for fixing the window resizes when switching components

2017-05-18 Thread zeljko via Lazarus

On 18.05.2017 01:43, Kostas Michalopoulos via Lazarus wrote:

I see the patch was added and Lazarus seems to work fine now, but the
check was altered a little. The current check assumes that the Control
will never be nil, but is this the case? I ask because i see in other
places in the same source code file that there are checks for that -
almost all calls to GetLCLObject either check for nil or use "if object
is something then use object" (with the "is" operator returning false
for nil, essentially making it an indirect test for nil).

This might be just an instance defensive programming, but i think it is
a good idea to bring this up.



Yes, this is clearly gtk2 bug, but maybe we can take another approach 
instead of getting LCL object and using "is". We should check if 
GdkWindow of widget is valid and then check it's state and in case it's 
= GDK_WINDOW_STATE_MAXIMIZED call gtk_window_unmaximize()



if GDK_IS_WINDOW(PGtkWindow(OurWidget)^.window) and 
(gdk_window_get_state(PGtkWindow(OurWidget)^.window) = 
GDK_WINDOW_STATE_MAXIMIZED) then

  gtk_window_unmaximize() ...
Same for unfullscreen and other "un" routines which we use inside that 
procedure.


What other devels think about this ? Should I correct that patch in this 
way and fix future problems with eg gtk_window_unfullscreen() which 
isn't covered by this patch atm ?


zeljko






--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazarus Release Candidate 1 of 1.8.0

2017-05-17 Thread zeljko via Lazarus

On 17.05.2017 20:16, Luca Olivetti via Lazarus wrote:


Meanwhile I see that in the plasma font setting I have the dpi forced to
96, a setting that apparently is respected both by qt4 and qt5 (as well
as gtk applications).


If it's forced than all qt based apps are using forced 96dpi.
Even if you set some other dpi in console session, qtlcl app uses forced 
96 dpi.


zeljko

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazarus Release Candidate 1 of 1.8.0

2017-05-17 Thread zeljko via Lazarus

On 17.05.2017 19:59, Luca Olivetti wrote:


It took me a while to see that the c bindings are included, the
README.txt in the lcl/interfaces/qt5 directory just says:

"To use them you also need to download and install
at appropriate place the libQt5Pas.so (linux)
or Qt5Pas.dll (ms windows) or Qt5Pas.framework (Darwin).

For more information see:
http://wiki.lazarus.freepascal.org/index.php/Qt_Interface;

So, after unsuccessfully compiling the beta version from
http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html I finally
found http://wiki.lazarus.freepascal.org/Qt5_Interface which says that
the bindings are included :-/
They're building now.


Thanks, I'll fix README.txt ... Jan stopped to support bindings for 
almost one year, so I've taken his latest Qt5 bindings an manually 
updated classes and everything and commited it into laz trunk..
You must build it at your own for now, but as soon as I stop update C 
part of bindings I'll build them for linux64,win32 and macosx qtcocoa 
64bit and put it somewhere so ppl can download. I don't have any plans 
to build linux32 or mac32 (carbon) Qt5 C bindings atm.


zeljko

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazarus Release Candidate 1 of 1.8.0

2017-05-17 Thread zeljko via Lazarus

On 17.05.2017 14:39, Mattias Gaertner via Lazarus wrote:


The Lazarus team is glad to announce the first release candidate of
Lazarus 1.8.

This release was built with FPC 3.0.2.
The previous release Lazarus 1.6.4 was built with FPC 3.0.2 too.
The Linux releases are built with FPC 3.0.3 r36152 due to bug
https://bugs.freepascal.org/view.php?id=31629

Here is the list of fixes for Lazarus 1.8.x:
http://wiki.freepascal.org/Lazarus_1.8_fixes_branch

Here is the list of changes for Lazarus and Free Pascal:
http://wiki.lazarus.freepascal.org/Lazarus_1.8.0_release_notes
http://wiki.lazarus.freepascal.org/User_Changes_3.0.2

The release is available for download on SourceForge:
http://sourceforge.net/projects/lazarus/files/

Choose your CPU, OS, distro and then the "Lazarus 1.8 RC1" directory.

Checksums for the SourceForge files:
http://www.lazarus-ide.org/index.php?page=checksums#1_8_0

Minimum requirements:

Windows:
  2k, XP, Vista, 7, 8, 8.1 and 10, 32 or 64bit.

FreeBSD/Linux:
  gtk 2.8 for gtk2, qt4.5 for qt, qt5.2 for qt5, 32 or 64bit.


Not good. Qt-5.6 is minimum required version (5.6.xx is LTS) not qt5.2 :)

zeljko

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Form resize to standard size in IDE.

2017-05-16 Thread zeljko via Lazarus

On 16.05.2017 21:26, Ondrej Pokorny via Lazarus wrote:

On 16.05.2017 21:08, Michael Van Canneyt via Lazarus wrote:

Surely, if the situation is that bad, then things would have been fixed a
long time ago, no ?


IIRC people complained about Gtk2 resizing their windows under some
window managers for several years. If I am not mistaken nobody really
tried to fix it.


Problem is not in fixing. When you fix eg this one which is Michael 
talking about, next year you'll have new one - as soon as new version of 
wm thinks that something can work in another way :)


zeljko

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


  1   2   >