Lazarus

Programming => General => Topic started by: alaa123456789 on February 28, 2021, 12:20:37 pm

Title: custom list control
Post by: alaa123456789 on February 28, 2021, 12:20:37 pm
hi, could we do this in Lazarus ? as per attached photo?

thanks
Title: Re: custom list control
Post by: Handoko on February 28, 2021, 01:29:10 pm
Short answer:
Yes.


Detailed answer:
Not easy. There are several ways to achieve the result. What I did is not exactly as what you showed but the basic concept is same. I wrote the component some years ago, its internally used TScrollBox. It's already supports checkbox, up/down button, text, mouse hovering effect and right-click popup menu on item. If I keep adding some new features, it can looks similar to what you showed us. Unfortunately, due to some reasons I abandoned the project.

Hey, instead of wasting my computer storage space, I think it would be better to share it here, maybe it can be useful for someone. Here you are, it's totally free, in CC0 Public Domain license:
Title: Re: custom list control
Post by: alaa123456789 on February 28, 2021, 02:13:34 pm
Detailed answer:
Not easy. There are several ways to achieve the result. What I did is not exactly as what you showed but the basic concept is same.

it is not important to be the same , but the concept then it can be a start point
Hey, instead of wasting my computer storage space, I think it would be better to share it here, maybe it can be useful for someone. Here you are, it's totally free, in CC0 Public Domain license:
thanks for sharing it , how to use it?

thanks
Title: Re: custom list control
Post by: Blaazen on February 28, 2021, 02:33:04 pm
Here I tried some straightforward solution for ~100 lines. It needs some tweaking (to keep Panel highlighted when controls on it are hovered). Also, you will most likely want to load icons from file or use ImageList (handy!).
Title: Re: custom list control
Post by: jamie on February 28, 2021, 02:52:39 pm
Looking at the photo its suggested 10M items..

You won't get that  many controls created at one time..

What needs to be done is just a class type stored in the definition of each item and when custom drawn they are created but only those that are in view

 So if you have a view able to show lets say 10, you can create 20 each time for a back and forward scroll.

If all of the buttons are the same class then all is needed is just the number of buttons initiated in the view but something tells me that isn't the case here, the list may have options for different controls per entry.
Title: Re: custom list control
Post by: Blaazen on February 28, 2021, 03:00:01 pm
10 000 000 lines. I didn't notice. Yes, it needs another strategy, TScrollBox is not suitable here.
Title: Re: custom list control
Post by: Handoko on February 28, 2021, 03:14:08 pm
thanks for sharing it , how to use it?

I had a demo project showing how to use the component, unfortunately it can't be found. Too bad. Explaining how to use it will be a bit too long. Sorry, I have some other things to do now, cannot help. Blaazen writes plenty of useful components, you should try his Blaazen's scrolldemo first. For your information you need Lazarus version > 2.0.10 to be able to open that project because that was saved using a newer version. Or there is a tool to convert it, but I forget where you can get it.

10 000 000 lines. I didn't notice. Yes, it needs another strategy, TScrollBox is not suitable here.

Wow, that is really too much. Maybe OP does not need so much.
Title: Re: custom list control
Post by: balazsszekely on February 28, 2021, 03:20:01 pm
Quote
10 000 000 lines. I didn't notice. Yes, it needs another strategy, TScrollBox is not suitable here.
Showing 10 000 000 lines is doable with VTV, however it makes no sense at all. No user can traverse 10 000 000 lines in a reasonable amount of time, except Data from Star Trek. OP needs a better pagination design.
Title: Re: custom list control
Post by: jamie on February 28, 2021, 03:27:33 pm
I wouldn't get your panties in a twist over this..

I was just looking at this in Delphi and its nothing more than a sales pitch if you ask me..

The TListControl can be don't with a TLIST/ Generics Tlist etc which is nothing more than a container of class object pointers..

These objects do not need to be alive, only the one's in view..

I've done code like this before using the ownerdraw TlistBox, a TimageList referenced from a Node tree of records...

Just my opinion really..
 
Title: Re: custom list control
Post by: Soner on February 28, 2021, 04:03:47 pm
ibcontrols-package from Tony Whyman has smiliar to this.
Last month I read here that someone made it usable without ibcontrols package, but I can't remember where is it.
Look in online package manager for ibcontrols.lpk.
Title: Re: custom list control
Post by: alaa123456789 on February 28, 2021, 04:39:28 pm
ibcontrols-package from Tony Whyman has smiliar to this.
Last month I read here that someone made it usable without ibcontrols package, but I can't remember where is it.
Look in online package manager for ibcontrols.lpk.
thanks but it seems only work with data base , i  have this attached in the design  , but how to fill it with items, how to control each row , or each button in the row

thanks
Title: Re: custom list control
Post by: alaa123456789 on February 28, 2021, 04:49:10 pm
Here I tried some straightforward solution for ~100 lines. It needs some tweaking (to keep Panel highlighted when controls on it are hovered). Also, you will most likely want to load icons from file or use ImageList (handy!).
thanks for reply , demo not open seem it made with lazarus trunk

thanks
Title: Re: custom list control
Post by: FTurtle on February 28, 2021, 05:56:25 pm
ibcontrols-package from Tony Whyman has smiliar to this.
Last month I read here that someone made it usable without ibcontrols package, but I can't remember where is it.
Look in online package manager for ibcontrols.lpk.

https://bugs.freepascal.org/view.php?id=38336
Title: Re: custom list control
Post by: alaa123456789 on February 28, 2021, 06:20:38 pm

https://bugs.freepascal.org/view.php?id=38336
i think this still not work on opm pls see attached
Title: Re: custom list control
Post by: jamie on February 28, 2021, 07:20:35 pm
You need to move the error dlg so you can see what it's having issues compiling ?
Title: Re: custom list control
Post by: alaa123456789 on February 28, 2021, 07:50:53 pm
You need to move the error dlg so you can see what it's having issues compiling ?
right  ,something wrong ,need to be fixed
(attachment)

thanks
Title: Re: custom list control
Post by: jamie on February 28, 2021, 07:55:19 pm
That looks like some script error..
FCL is a folder of items..

You need to edit the package properties and remove that requirement I would say.

Also that error message is a little twisted, even I don't fully understand it and I normally can read pig Latin !
Title: Re: custom list control
Post by: alaa123456789 on February 28, 2021, 08:08:02 pm
That looks like some script error..
FCL is a folder of items..

You need to edit the package properties and remove that requirement I would say.

Also that error message is a little twisted, even I don't fully understand it and I normally can read pig Latin !
i downloaded the package from gitgub, added requirements (FCL,LCL base)  no files was there , when i added *.pas ,*.lrs then i got the attached error ,that these units are clashing with ib controls ,please see attached
Title: Re: custom list control
Post by: Soner on February 28, 2021, 08:36:28 pm
ibcontrols-package from Tony Whyman has smiliar to this.
Last month I read here that someone made it usable without ibcontrols package, but I can't remember where is it.
Look in online package manager for ibcontrols.lpk.

https://bugs.freepascal.org/view.php?id=38336
Thanks there was it.




https://bugs.freepascal.org/view.php?id=38336
i think this still not work on opm pls see attached

Then look at QQPanel from CNVCL (http://www.cnpack.org/showmaster.php?id=48&lang=en). It is easy to convert because all code is in one unit and easy coded.

Title: Re: custom list control
Post by: jamie on February 28, 2021, 09:20:20 pm
That looks like some script error..
FCL is a folder of items..

You need to edit the package properties and remove that requirement I would say.

Also that error message is a little twisted, even I don't fully understand it and I normally can read pig Latin !
i downloaded the package from gitgub, added requirements (FCL,LCL base)  no files was there , when i added *.pas ,*.lrs then i got the attached error ,that these units are clashing with ib controls ,please see attached

I don't know what to tell you, packages work a little different than verses Delphi..

But by the looks of it I would say that you may already have some older files in there and may need to be removed!
Title: Re: custom list control
Post by: balazsszekely on February 28, 2021, 09:46:53 pm
@alaa123456789
I fixed the package in OPM.

Regarding the error message: the two package cannot be used at the same time, because both have a common unit named DBTreeView.pas.
Title: Re: custom list control
Post by: winni on February 28, 2021, 09:49:27 pm
Hi!

It seems that this is not only a DB error.

I had the same problem but nobody could give me an answer:

https://forum.lazarus.freepascal.org/index.php/topic,53286.msg394040.html#msg394040
 (https://forum.lazarus.freepascal.org/index.php/topic,53286.msg394040.html#msg394040)
Winni
Title: Re: custom list control
Post by: jamie on February 28, 2021, 09:59:41 pm
ah , most likely in the wrong place.

maybe the installer needs to look through all ?
Title: Re: custom list control
Post by: balazsszekely on February 28, 2021, 10:04:33 pm
@winni

Quote
It seems that this is not only a DB error.

I had the same problem but nobody could give me an answer:

https://forum.lazarus.freepascal.org/index.php/topic,53286.msg394040.html#msg394040

If you create a project/package with Lazarus trunk, then you try to open with 2.0.X you are in for a big surprise. The files/requirements are no longer available, the project basically is unusable. Since the vast majority of developers works with lazarus trunk, the above mentioned error happens a lot.
When developing with Lazarus trunk, you can try to minimize the damage using the check in project options(see attachment), but usually it does not help.

Your issue looks slightly different though, I'm not sure is caused by the same mechanism. Personally I never experienced anything similar with trunk.
Title: Re: custom list control
Post by: winni on February 28, 2021, 11:14:34 pm
@GetMem

Thanx for the answer.

No, I dont use the trunk.

It happened with fpc 3.04, Laz 2.0.10, Linux64 on gtk2.
After a clean.

Winni
Title: Re: custom list control
Post by: jamie on February 28, 2021, 11:35:30 pm
speaking of which, I wonder if anyone has successfully compiled the Trunk IDE using fpc 3.0.4  for windows ?

would be interesting. It would be a plus for me.

I suppose I could try that on my other PC, I have a copy of I think 2.0.8 Laz which is 3.0.4, maybe I could direct the compiler path to that, hmmm..

Title: Re: custom list control
Post by: trev on February 28, 2021, 11:43:36 pm
I have a copy of I think 2.0.8 Laz which is 3.0.4, maybe I could direct the compiler path to that, hmmm..

You can if you change the compiler from plain fpc to the relevant ppc* version (Tools > Options > Files - Compiler executable (https://wiki.lazarus.freepascal.org/IDE_Window:_IDE_Options_Dialog)). I have Lazarus 2.0.6/8/10/12/trunk installed with FPC 3.04/3.20/trunk on macOS (where I compile Windows executables) and it works perfectly.
Title: Re: custom list control
Post by: jamie on February 28, 2021, 11:46:26 pm
that's good to know, I will give that a try later on tonight, first I need to walk the dog.. ::)

Thanks
Title: Re: custom list control
Post by: dsiders on March 01, 2021, 04:59:25 am
speaking of which, I wonder if anyone has successfully compiled the Trunk IDE using fpc 3.0.4  for windows ?

Yes. I built SVN r64643 with 3.0.4, which was just a few days ago.
Title: Re: custom list control
Post by: alaa123456789 on March 01, 2021, 03:06:51 pm
Then look at QQPanel from CNVCL (http://www.cnpack.org/showmaster.php?id=48&lang=en). It is easy to convert because all code is in one unit and easy coded.
i downloaded , it couldn't be converted to Lazarus always showing errors , i have tried many times

thanks
Title: Re: custom list control
Post by: Soner on March 03, 2021, 08:51:28 pm
Then look at QQPanel from CNVCL (http://www.cnpack.org/showmaster.php?id=48&lang=en). It is easy to convert because all code is in one unit and easy coded.
i downloaded , it couldn't be converted to Lazarus always showing errors , i have tried many times

thanks
You don't need to convert entire cnvcl package.
Look I upload qqpanel for lazarus with example application.
Title: Re: custom list control
Post by: alaa123456789 on March 03, 2021, 09:15:30 pm
You don't need to convert entire cnvcl package.
Look I upload qqpanel for lazarus with example application.
we dont need lPK file , i comlied the example it works fine but when i try to open form it said that we need lpk, and there is no lpk package there

thanks
Title: Re: custom list control
Post by: alaa123456789 on March 04, 2021, 09:42:39 am

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

i use dbcntrlgrid , and i had two issues :
1- in 1.gif when i load the records it shows only one record untill i scroll mouse it load the balance
2- in 2.gif when i press on play button on {flow panel item ) and when i scroll down or up other flow panels get affected like track bar progress , label text change ,how to avoid these issues

thanks
TinyPortal © 2005-2018