Recent

Author Topic: Lazarus Release Candidate 2 of 1.4  (Read 78155 times)

flywire

  • Jr. Member
  • **
  • Posts: 85
Re: Lazarus Release Candidate 2 of 1.4 - Screen Update Bug
« Reply #45 on: March 14, 2015, 12:12:29 pm »
I changed my mind - I am going to call it a bug because I am sure this doesn't happen in the previous version.

In Object Inspector select an option on the Right Hand Side of the properties window so that the property and option are both selected. Then scroll up or down and the RHS of the window is filled with horizontal lines from the open property selection box. It settles down. Apparently something to do with screen updating, maybe my graphics card and driver.

Running lazarus-1.4RC2-fpc-2.6.4-win32 on Win7 Core Duo
« Last Edit: March 14, 2015, 12:58:49 pm by flywire »

Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Lazarus Release Candidate 2 of 1.4
« Reply #46 on: March 16, 2015, 10:05:43 pm »
I found a Bug in SynEdit with setting CaretX, CaretY, TopLine, LeftChar.

if i create more than one instance of TSynEdit in OnShow of an TForm and set its parent to newly createy Tabsheets of an PageControl and then set CaretX, CaretY, TopLine and LeftChar, from the second SynEdit on it behaves strange:
LeftChar and sometime TopLine are not set correctly.

See attached simple sample Project.
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

mattias

  • Administrator
  • Full Member
  • *
  • Posts: 184
    • http://www.lazarus.freepascal.org
Re: Lazarus Release Candidate 2 of 1.4
« Reply #47 on: March 16, 2015, 10:51:04 pm »
I found a Bug in SynEdit

Please create a bug report in our bug tracker: http://bugs.freepascal.org/.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9754
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus Release Candidate 2 of 1.4
« Reply #48 on: March 16, 2015, 11:29:09 pm »
And please mention the OS/ widgetset

Edit:

You can fix this by adding
  e.parent := ts;  // your code
  e.HandleNeeded;  // new code


The reason for the behaviour is that before the handle is created, SynEdit does not know what Size, its client area will be.

That is, even if you set it to a fixed size (width/Heigh properties), it will assume it does not know. And it in many cases does not know , as the size of scrollbars in unknown, and need to be deducted.)
For simplicity it assume
 no handle => final size not known.


Next part of the reason:
When you set the caret, SynEdit updates the topline, to make it visible

Now I know:
Code: [Select]
  e.CaretY := 37;
  e.CaretX := 44;
  e.TopLine := 30;

You update the topline afterwards.

But SynEdit had no handle, so it could not yet enforce the caret visible. It remembers, and will do when the handle is created.

But it does not know then, that you set the topline later.
So that is why it overrides your topline.

SynEdit does intentionally not ask for a handle when you set the caret, because in an app with many SynEdit on many tabs, this would cause a lot of extra work.

(Just to say, because SynEdit defers work, you can open a project with 100 tabs in the editor, and you do not have to wait 5 minutes for it (yes there was a time it took that long)

I will look at improving it, but create a bug so it wont be forgotten.
« Last Edit: March 16, 2015, 11:57:14 pm by Martin_fr »

Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Lazarus Release Candidate 2 of 1.4
« Reply #49 on: March 17, 2015, 09:12:40 am »
Martin,

your solution partly works. But if i do no set LeftChar, LeftChar has a Value other than 1. But it never get changed by me.
In my "real" application your solution with HandleNeeded has no effect. Also the position of setting TopLine makes no difference.
I've randomly seen this behaviour also in the IDE (after starting). What makes me wonder is that it works as intended for the first created SynEdit. If i put the SynEdits on different panels everyhing works okay.

Regards Pascal
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Lazarus Release Candidate 2 of 1.4
« Reply #50 on: March 17, 2015, 09:18:23 am »
Martin,

i found the problem: The problem is the inactive TTabSheet. (The first created one is by default the active one, this is why the first SynEdit worked)

If i add
Code: [Select]
PageControl1.ActivePage := ts;
before setting the Topline and Caret everything works as expected as now the SynEdit is on the active page.

Pascal
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9754
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus Release Candidate 2 of 1.4
« Reply #51 on: March 17, 2015, 01:25:44 pm »
your solution partly works.
Quote
I've already done a fix in 1.5 that does not need the Handle. I might merge it to 1.4.

But if i do no set LeftChar, LeftChar has a Value other than 1. But it never get changed by me. In my "real" application your solution with HandleNeeded has no effect. Also the position of setting TopLine makes no difference.
I've randomly seen this behaviour also in the IDE (after starting). What makes me wonder is that it works as intended for the first created SynEdit. If i put the SynEdits on different panels everyhing works okay.

If you do not set LeftChar this may be intended behaviour. may be ....

Here is what happens:

* CaretXY := ...
same for just CaretX, or CaretY, or anything that moves the caret (CaretXY := does not need to move the caret it always acts)

This will scroll SynEdit, so the caret is visible. So if you do not set LeftChar, then SynEdit may get scrolled.


* The first verses the other SynEdits.

The first is immediately visible, it has its Handle, and it gets its final Size. That is the difference.

As I explained; No Handle => SynEdit does not know its Size (Not a problem in SynEdit, Depending on a variety of things this can happen to any component)

Therefore SynEdit defers the scroll to when it gets a Handle.

-----------------------------------------------------
Now the question is:

At the time, you make any of the 2ndary SynEdits visible, can the caret be visible without scrolling.

If SynEdit Scrolls, even though the caret could have been seen on the screen without the scroll => then there is a bug.

-----------------------
Again I need OS and widgetset.

It Might be that for some reason the widgetset, defers the setting of the correct size. Then SynEdit will act on the wrong size.





Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9754
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus Release Candidate 2 of 1.4
« Reply #52 on: March 17, 2015, 01:26:28 pm »
Please create a bug report, and answer there. (Unless there is no bug to fix, and it all behaves as explained)

I will NOT be able to track this on the forum.
« Last Edit: March 17, 2015, 01:28:18 pm by Martin_fr »

Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Lazarus Release Candidate 2 of 1.4
« Reply #53 on: March 18, 2015, 07:53:14 am »
Martin, no Bug, as it behaves as intended when tabscheet is active page.
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

Headless

  • Newbie
  • Posts: 2
Re: Lazarus Release Candidate 2 of 1.4
« Reply #54 on: March 19, 2015, 06:13:41 pm »
Hi all,

Is it correct that Lazarus 1.2.6 is not upwards compatible with Lazarus 1.4?
If I make a project with 1.4 (just a simple form with 1 button), I can not open it with 1.2.6.
I have Linux Mint 13.4 with several instances of Lazarus (of course each with their own configuration directory).

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4458
  • I like bugs.
Re: Lazarus Release Candidate 2 of 1.4
« Reply #55 on: March 19, 2015, 06:43:43 pm »
Is it correct that Lazarus 1.2.6 is not upwards compatible with Lazarus 1.4?
If I make a project with 1.4 (just a simple form with 1 button), I can not open it with 1.2.6.

Not true. Besides, you can test it easily yourself if you want.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: Lazarus Release Candidate 2 of 1.4
« Reply #56 on: March 19, 2015, 08:39:57 pm »
http://bugs.freepascal.org/view.php?id=27696

I installed the last RC on Linux 64bit and I noticed that the tlistview is not showing text if you assign a image index to the
item. 
I recompiled my install of lazarus for QT.

I verified it does not happen on win32/64

for example:

procedure TMainDatamod.addmsg(themsg:string;icon:TmsgIconType);
var
   datestr:string;
   aitem:TListItem;
begin
      datestr:=formatdatetime('mm/dd/yyyy HH:MM:SS AM/PM',now);
      aitem:= mainform.messages_lv.Items.Add;
      aitem.ImageIndex:=integer(icon);
      aitem.Caption:=format('%-32s %s',[datestr,themsg]);
      mainform.messages_lv.Items.Item[mainform.messages_lv.Items.Count-1].MakeVisible(false);
end;

Only the icon is shown in the listview.

I will have to verify if it's doing it just on QT or GTK2 as well.

***UPDATE***

It's only happening when IDE is built for QT.



« Last Edit: March 19, 2015, 11:09:54 pm by snorkel »
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: Lazarus Release Candidate 2 of 1.4
« Reply #57 on: March 19, 2015, 09:09:23 pm »
IDE compiled with GTK2 on KDE 4.x

Does anyone know why the IDE when compiled as GTK2 does not show the menu icons under KDE?

My compiled GTK2 apps show menu icons fine when run on KDE.

Right now I am using NetRunner Rolling with KDE 4.x
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: Lazarus Release Candidate 2 of 1.4
« Reply #58 on: March 19, 2015, 09:19:25 pm »
http://bugs.freepascal.org/view.php?id=27695

GTK 2 StatusBar Owner draw not working properly:

When I compile my app to use GTK2 the status bar looks messed up like it's writing the
plain text as well.  See Attachment.

This is on latest RC on Linux 64bit

It does not happen on QT or windows widget sets.

« Last Edit: March 19, 2015, 11:10:22 pm by snorkel »
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

zeljko

  • Hero Member
  • *****
  • Posts: 1591
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Lazarus Release Candidate 2 of 1.4
« Reply #59 on: March 19, 2015, 09:41:27 pm »
GTK 2 StatusBar Owner draw not working properly:

When I compile my app to use GTK2 the status bar looks messed up like it's writing the
plain text as well.  See Attachment.

This is on latest RC on Linux 64bit

It does not happen on QT or windows widget sets.

Without code which paints in owner draw nobody can help you here.

 

TinyPortal © 2005-2018