Lazarus

Programming => General => Topic started by: PeterX on May 10, 2017, 11:36:14 am

Title: [solved] Projects in C:\lazarus\examples
Post by: PeterX on May 10, 2017, 11:36:14 am
Hi,

I just installed the actual 1.6.4 on my PC on the job,
playing around with Projects in C:\lazarus\examples


What's up with "designnonlcl" ?

I don't catch the sense of it as there is nothing in begin .. end :

Code: Pascal  [Select][+][-]
  1. program NonLCL1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. uses
  6.   {$IFDEF UNIX}{$IFDEF UseCThreads}
  7.   cthreads,
  8.   {$ENDIF}{$ENDIF}
  9.   Classes, NotLCLDesigner, Interfaces, Unit1;
  10.  
  11. begin
  12. end.
Title: Re: Projects in C:\lazarus\examples
Post by: Handoko on May 10, 2017, 11:53:00 am
Maybe the example just wants to show us the units need to be included in the uses clause for a non-lcl application.
Title: Re: Projects in C:\lazarus\examples
Post by: PeterX on May 10, 2017, 04:42:19 pm
In folder "easter",
project "holyday",
unit "Main.pas"

please remove

Code: Pascal  [Select][+][-]
  1.     procedure Listbox1DrawItem(Control: TWinControl; Index: Integer;
  2.       ARect: TRect; State: TOwnerDrawState);
  3.  

Actually Listbox1 draws twice ..
Title: Re: Projects in C:\lazarus\examples
Post by: wp on May 10, 2017, 05:06:38 pm
Twice? I don't know - but the listbox does not erase the background of the items. Fixed in current trunk. And to let this OwnerDraw method do something "meaningful" I modified it to center the items in the listbox.
Title: Re: Projects in C:\lazarus\examples
Post by: wp on May 10, 2017, 05:13:12 pm
What's up with "designnonlcl" ?

I don't catch the sense of it as there is nothing in begin .. end :

I did not check out this example, but there is a readme.txt which explains a lot...
Title: Re: Projects in C:\lazarus\examples
Post by: PeterX on May 10, 2017, 09:52:03 pm
Twice? I don't know ..
Simply press the calculate button more than once
with the original code - looks interesting on my screen.
Title: Re: Projects in C:\lazarus\examples
Post by: wp on May 11, 2017, 09:30:07 am
Twice? I don't know ..
Simply press the calculate button more than once
with the original code - looks interesting on my screen.
If I set a breakpoint on Listbox1DrawItem the program stops exactly 6 times for each click on the Calculate button - once per listbox item. The changes in appearance due to painting are caused because the old code did not erase the background of each list item.
Title: Re: Projects in C:\lazarus\examples
Post by: PeterX on May 11, 2017, 12:42:14 pm
The changes in appearance due to painting are caused because the old code did not erase the background of each list item.
Thanks for improving !

These examples are not a big thing. But I didn't even know they where there.
Just found them because I wanted to play around with the new 1.6.4, while on the job.
So for beginners a good starting point (when working properly ..  )

 :)
Title: Re: Projects in C:\lazarus\examples
Post by: wp on May 11, 2017, 10:52:02 pm
Sample projects and demos don't have the highest priority with the developers and are only rarely checked for their functionality. Therefore, you are doing a great job when you look through the demos and report issues - thank you.
TinyPortal © 2005-2018