Re: [Lazarus] Smooth scrolling label (marquee)
On 2015-11-11 09:16, Luca Olivetti wrote: > Try the attached project. LCL inconsistency strikes again. WindowState:=wsMaximized; The above line of code has no affect under FreeBSD with LCL-GTK2. I see a small borderless window with a button on it. Anyway, I tested your project under FreeBSD LCL-GTK2 and Windows 2000. Scrolling was smooth (with one exception) and CPU load was idle (< 1%). Under Win2000 the application was full-screen, under FreeBSD it wasn't. Having the modal quit dialog open did not affect the scrolling speed. I also couldn't see any visible change in speed while moving the mouse. The exception I mentioned was when I run the test project under Win2000 with the --debug option. There was visible flicker the whole time while the application was running. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Smooth scrolling label (marquee)
El 11/11/15 a les 10:28, Graeme Geldenhuys ha escrit: On 2015-11-11 09:16, Luca Olivetti wrote: Try the attached project. LCL inconsistency strikes again. WindowState:=wsMaximized; The above line of code has no affect under FreeBSD with LCL-GTK2. I see a small borderless window with a button on it. Thank you for testing. Yes, but that's not relevant. I put it there just to do the same the real app is doing. It also behaves differently with linux-gtk (it maximizes) and linux-qt (it doesn't). :-( Also, on linux-gtk2 I tried up to size 300 and more, while linux-qt starts becoming slow at 49. Anyway, I tested your project under FreeBSD LCL-GTK2 and Windows 2000. Scrolling was smooth (with one exception) and CPU load was idle (< 1%). Under Win2000 the application was full-screen, under FreeBSD it wasn't. OK, windows 2000 probably behaves like windows xp. Having the modal quit dialog open did not affect the scrolling speed. I also couldn't see any visible change in speed while moving the mouse. Yes, that's normal, I'm using a timer. The visible change in speed was when I was using a thread with synchronize. The exception I mentioned was when I run the test project under Win2000 with the --debug option. There was visible flicker the whole time while the application was running. Strangely (or not) enough, it depends on the theme. With XP I see the flickering if I use the classic theme, no flickering with the teletubbies one. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Smooth scrolling label (marquee)
El 11/11/15 a les 01:21, Luca Olivetti ha escrit: El 10/11/15 a les 23:37, Graeme Geldenhuys ha escrit: On 2015-11-10 21:09, Luca Olivetti wrote: But in the end I have to render it on the LCL canvas Via a single BitBlt which should be more than fast enough for what you described. Unless LCL is seriously broken. I don't know if it's broken, but, AFAIK, there are two ways to animate something 1) with a timer (constrained by the windows resolution) 2) with a thread+synchronize (only the main thread can access the gui, and the constraint here is the rate the application loop calls CheckSynchronize) But what really puzzles me is the different behavior between xp and 7 (maybe it's aero, I could try disabling it). The fact that it's a font of size 100 with a bitmap below it doesn't help, but it should be possible. Well, I just found out that in a virtual machine (be it xp or 7) the timer resolution is 10ms, while in real hardware is 16ms (no matter if I use a timer or a thread+synchronize). That at least explains the timing differences (but not the unresponsiveness of the full screen application under windows 7) Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Smooth scrolling label (marquee)
Michael Schnell wrote: On 11/10/2015 12:30 PM, Luca Olivetti wrote: - it is very cpu intensive (I have to put it over a picture, so the invalidate will also force the repainting of the bitmap I guess) The only cure for this is using the graphic processor: only once create a wide pixel array from the text and then use Direct X (Open GL or similar API) to display part of the text "behind" in a rectangle. Using OpenGL etc. risks breaking the program for anybody accessing it over remote X (including SSH) or VNC etc. (either for routine use or remote support). I believe there are ways that OpenGL can be mapped over a LAN, but in practice it would- at present at least- be safest to assume that these aren't reliable and at the very least provide a user option to make sure the program doesn't attempt to use it for anything that is basically cosmetic. -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Smooth scrolling label (marquee)
On 11/11/2015 10:08 AM, Mark Morgan Lloyd wrote: Michael Schnell wrote: On 11/10/2015 12:30 PM, Luca Olivetti wrote: - it is very cpu intensive (I have to put it over a picture, so the invalidate will also force the repainting of the bitmap I guess) The only cure for this is using the graphic processor: only once create a wide pixel array from the text and then use Direct X (Open GL or similar API) to display part of the text "behind" in a rectangle. Using OpenGL etc. risks breaking the program for anybody accessing it over remote X (including SSH) or VNC etc. Yep. But scrolling text via VNC will not work decently, anyway. -Michael -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Smooth scrolling label (marquee)
El 11/11/15 a les 10:26, Luca Olivetti ha escrit: El 11/11/15 a les 10:16, Luca Olivetti ha escrit: El 11/11/15 a les 09:28, Luca Olivetti ha escrit: That at least explains the timing differences (but not the unresponsiveness of the full screen application under windows 7) TextRect! Try the attached project. Under windows XP the TextRect takes an unmeasurable amount of time (using GetTickCount). Under windows 7 it takes 160ms here when in full screen (1920 pixels wide) or 60-70ms when using the --debug option (320 pixels wide). That was on virtual hardware, BTW. On real hardware instead of 160 it takes 40-60. It's still a lot of time compared to a virtualized windows xp. More testing: I added a spinedit to change the size of the text. Under windows xp I can go until 124, then it starts becoming as slow as windows 7. Under windows 7 the maximum value is 83, at 84 is slow. Any idea on what could be the cause? Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] "lcl: less with-blocks for FPC 3.1.1"
Hi, Many changes using this comment (in the subject) was made in LCL SVN, changing the 'with' sintaxe to use a variable instead... why? Please, I would like to know if something will change in the new compiler version using the 'with' sintaxe. http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/lcl/interfaces/carbon/carbonthemes.pas?root=lazarus=50303=50302=50303 Thanks, Marcos Douglas -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] "lcl: less with-blocks for FPC 3.1.1"
On Wed, 11 Nov 2015, Marcos Douglas wrote: Hi, Many changes using this comment (in the subject) was made in LCL SVN, changing the 'with' sintaxe to use a variable instead... why? Please, I would like to know if something will change in the new compiler version using the 'with' sintaxe. Nothing will change for with. But TRect may receive methods, and this may lead to hard-to-catch errors. Mattias did this for safety. Michael. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] "lcl: less with-blocks for FPC 3.1.1"
On Wed, Nov 11, 2015 at 4:01 PM, Michael Van Canneytwrote: > Nothing will change for with. But TRect may receive methods, and this may > lead to hard-to-catch errors. > > Mattias did this for safety. Thank you, Michael. Marcos Douglas -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] How to hide class names in a property grid?
Hi All, I use a property grid in my application and don't want to advertise my class names to the users. For example (TSizeConstraints) displayed next to Contraints. Any idea how to hide class names or override at object(TPersistent) level? Gabor -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Extending TRect breaks Lazarus
On Sat, 7 Nov 2015 00:21:09 +0100 Marco van de Voortwrote: >[...] > Anyway, I hunted down one case by raise tobject.create, and running in the > debugger, and I committed a fix. The Win32 lazarus now seems to function > normally at first glance. I replaced many endangered with-blocks in the LCL. ToDo: check the rest of the Lazarus sources. Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Smooth scrolling label (marquee)
El 11/11/15 a les 10:16, Luca Olivetti ha escrit: El 11/11/15 a les 09:28, Luca Olivetti ha escrit: That at least explains the timing differences (but not the unresponsiveness of the full screen application under windows 7) TextRect! Try the attached project. Under windows XP the TextRect takes an unmeasurable amount of time (using GetTickCount). Under windows 7 it takes 160ms here when in full screen (1920 pixels wide) or 60-70ms when using the --debug option (320 pixels wide). That was on virtual hardware, BTW. On real hardware instead of 160 it takes 40-60. It's still a lot of time compared to a virtualized windows xp. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] MySQL auto commit
mirce.vladimirov point me to commitretaining so I test it It helps to not getting "Operation can't be performed on active transaction" error but still Im searching for a better way for a auto commit way. Regards, Ara -- http://www.fastmail.com - Faster than the air-speed velocity of an unladen european swallow -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] MySQL auto commit
Thanks to I checked project with trunk version and it works if I set Transaction.Options:=[stoUseImplicit]; But there is a problem it just work with MySQLConnection and not with TSQLConnector even if you set ConnectorType to MySQL. So it seems TSQLConnector have a bug.can any one test it confirm it? Regards, Ara -- http://www.fastmail.com - Or how I learned to stop worrying and love email again -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] MySQL auto commit
[Cross posted on forum so if you want answer there : http://forum.lazarus.freepascal.org/index.php/topic,30343.0.html[http://forum.lazarus.freepascal.org/index.php/topic,30097.0.html]] Is there any support for automatically commit changes for MySQL? I test it and it seems there isnt any and I should commit every time I execute a query. Here is a test version for you : SQL code for test db : > DROP TABLE IF EXISTS `testtable`; CREATE TABLE `testtable` ( `ID` > int(11) NOT NULL, `Title` varchar(255) DEFAULT NULL, PRIMARY KEY > (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; > > > INSERT INTO `testtable` VALUES ('1', null); INSERT INTO `testtable` > VALUES ('2', null); INSERT INTO `testtable` VALUES ('3', null); INSERT > INTO `testtable` VALUES ('4', null); INSERT INTO `testtable` VALUES > ('5', null); INSERT INTO `testtable` VALUES ('6', null); INSERT INTO > `testtable` VALUES ('7', null); INSERT INTO `testtable` VALUES ('8', > null); INSERT INTO `testtable` VALUES ('9', null); Code: > unit Unit1; > > {$mode objfpc}{$H+} > > interface > > uses Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, > sqldb, mysql55conn; > > type > > { TForm1 } > > TForm1 = class(TForm) procedure FormCreate(Sender: TObject); > private { private declarations } public end; > > var Form1: TForm1; > > implementation > > {$R *.lfm} > > { TForm1 } > > procedure TForm1.FormCreate(Sender: TObject); var Connector: > TSQLConnector; Transaction: TSQLTransaction; Query: TSQLQuery; begin > Connector := TSQLConnector.Create(nil); with Connector do begin > ConnectorType := 'MySQL 5.5'; HostName := 'localhost'; UserName > := 'root'; Password := ''; DatabaseName := 'test'; CharSet := > 'utf8'; end; Transaction := TSQLTransaction.Create(nil); > Transaction.DataBase := Connector; Query := TSQLQuery.Create(nil); > Query.DataBase := Connector; Connector.Connected := True; > Query.SQL.Text := 'SELECT * FROM testtable'; Query.Open; while not > Query.EOF do begin Connector.ExecuteDirect(Format('UPDATE > testtable SET Title="Test" WHERE > ID=%d;',[Query.FieldByName('ID').AsInteger])); > Connector.Transaction.Commit;//problem! Query.Next; end; end; > > end. If I dont do "Connector.Transaction.Commit;" changes will not save (and I want to every changes save excatly when thay post not after all changes done) and if I do "Connector.Transaction.Commit;" then Next line will give error "Operation can't be performed on active transaction". Please someone let me know what is the problem. Regards, Ara -- http://www.fastmail.com - A no graphics, no pop-ups email service -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Extending TRect breaks Lazarus
My solution is to define my own TRectI type which can implicitly convert between TRectI <-> TRect. Also I use a TRectF which does the same thing, but with floats as the dimenions ... MyRectInt := TRectI(MyRectFloat); ... There is also TPointI and TPointF ... { TRectI } TRectI = record private function GetEmpty: Boolean; procedure SetTop(Value: Integer); procedure SetLeft(Value: Integer); function GetRight: Integer; procedure SetRight(Value: Integer); function GetBottom: Integer; procedure SetBottom(Value: Integer); function GetSize: TPointI; function GetTopLeft: TPointI; function GetBottomLeft: TPointI; function GetBottomRight: TPointI; function GetTopRight: TPointI; function GetMidPoint: TPointI; public X, Y, Width, Height: Integer; class operator Implicit(const Value: TRectI): TRect; class operator Implicit(const Value: TRect): TRectI; class operator Equal(const A, B: TRectI): Boolean; class operator NotEqual(const A, B: TRectI): Boolean; class function Create: TRectI; overload; static; class function Create(Size: TPointI): TRectI; overload; static; class function Create(W, H: Integer): TRectI; overload; static; class function Create(X, Y, W, H: Integer): TRectI; overload; static; function Equals(const Value: TRectI): Boolean; function Contains(X, Y: Integer): Boolean; overload; function Contains(const P: TPointI): Boolean; overload; procedure Center(X, Y: Integer); overload; procedure Center(const P: TPointI); overload; procedure Inflate(X, Y: Integer); overload; procedure Inflate(const P: TPointI); overload; procedure Offset(X, Y: Integer); overload; procedure Offset(const P: TPointI); overload; property Empty: Boolean read GetEmpty; property Left: Integer read X write SetLeft; property Top: Integer read Y write SetTop; property Right: Integer read GetRight write SetRight; property Bottom: Integer read GetBottom write SetBottom; property Size: TPointI read GetSize; property TopLeft: TPointI read GetTopLeft; property BottomLeft: TPointI read GetBottomLeft; property BottomRight: TPointI read GetBottomRight; property TopRight: TPointI read GetTopRight; property MidPoint: TPointI read GetMidPoint; end; PRectI = ^TRectI; -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] "lcl: less with-blocks for FPC 3.1.1"
Am 11.11.2015 18:58 schrieb "Marcos Douglas": > > Hi, > > Many changes using this comment (in the subject) was made in LCL SVN, > changing the 'with' sintaxe to use a variable instead... why? > > Please, I would like to know if something will change in the new > compiler version using the 'with' sintaxe. > > http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/lcl/interfaces/carbon/carbonthemes.pas?root=lazarus=50303=50302=50303 For more details see the "Extending TRect breaks Lazarus" thread :) Regards, Sven -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How to hide class names in a property grid?
On Wed, 11 Nov 2015 18:45:52 +0100 Gabor Boroswrote: > Hi All, > > I use a property grid in my application and don't want to advertise my > class names to the users. For example (TSizeConstraints) displayed next > to Contraints. Any idea how to hide class names or override at > object(TPersistent) level? You cannot decrease visibility in Free Pascal. You can hide properties in the Object inspector. For example RegisterPropertyEditor(TypeInfo(TAnchorSide), TControl, 'AnchorSideLeft', THiddenPropertyEditor); Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Extending TRect breaks Lazarus
On Wed, Nov 11, 2015 at 04:39:55PM +0100, Mattias Gaertner wrote: > >[...] > > Anyway, I hunted down one case by raise tobject.create, and running in the > > debugger, and I committed a fix. The Win32 lazarus now seems to function > > normally at first glance. > > I replaced many endangered with-blocks in the LCL. > ToDo: check the rest of the Lazarus sources. Ok, I plan finalizing and committing the trect stuff in the coming week. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] "lcl: less with-blocks for FPC 3.1.1"
On Wed, Nov 11, 2015 at 5:03 PM, Sven Barthwrote: > Am 11.11.2015 18:58 schrieb "Marcos Douglas" : >> >> Hi, >> >> Many changes using this comment (in the subject) was made in LCL SVN, >> changing the 'with' sintaxe to use a variable instead... why? >> >> Please, I would like to know if something will change in the new >> compiler version using the 'with' sintaxe. >> >> >> http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/lcl/interfaces/carbon/carbonthemes.pas?root=lazarus=50303=50302=50303 > > For more details see the "Extending TRect breaks Lazarus" thread :) :P Yeah, I saw later. :) Thanks, Marcos Douglas -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Extending TRect breaks Lazarus
On 11/11/15, Marco van de Voortwrote: > Ok, I plan finalizing and committing the trect stuff in the coming week. Should these be merged to 1.4 fixes branch? Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Extending TRect breaks Lazarus
On Wednesday, November 11, 2015, Bartwrote: > > Should these be merged to 1.4 fixes branch? > No, Lazarus 1.4 dot versions are released with FPC 2.6.4. The TRect changes will happen in FPC trunk only. Juha -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus