Recent

Author Topic: [solved] Projects in C:\lazarus\examples  (Read 6070 times)

PeterX

  • Sr. Member
  • ****
  • Posts: 404
[solved] Projects in C:\lazarus\examples
« 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.
« Last Edit: May 15, 2017, 02:04:30 pm by PeterX »
usually using latest Lazarus release version with Windows 10

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: Projects in C:\lazarus\examples
« Reply #1 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.

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Re: Projects in C:\lazarus\examples
« Reply #2 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 ..
usually using latest Lazarus release version with Windows 10

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: Projects in C:\lazarus\examples
« Reply #3 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.

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: Projects in C:\lazarus\examples
« Reply #4 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...

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Re: Projects in C:\lazarus\examples
« Reply #5 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.
« Last Edit: May 10, 2017, 09:54:34 pm by PeterX »
usually using latest Lazarus release version with Windows 10

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: Projects in C:\lazarus\examples
« Reply #6 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.

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Re: Projects in C:\lazarus\examples
« Reply #7 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 ..  )

 :)
usually using latest Lazarus release version with Windows 10

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: Projects in C:\lazarus\examples
« Reply #8 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