Recent

Author Topic: custom list control  (Read 4852 times)

alaa123456789

  • Sr. Member
  • ****
  • Posts: 258
  • Try your Best to learn & help others
    • youtube:
custom list control
« on: February 28, 2021, 12:20:37 pm »
hi, could we do this in Lazarus ? as per attached photo?

thanks

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: custom list control
« Reply #1 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:

alaa123456789

  • Sr. Member
  • ****
  • Posts: 258
  • Try your Best to learn & help others
    • youtube:
Re: custom list control
« Reply #2 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

Blaazen

  • Hero Member
  • *****
  • Posts: 3237
  • POKE 54296,15
    • Eye-Candy Controls
Re: custom list control
« Reply #3 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!).
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

jamie

  • Hero Member
  • *****
  • Posts: 6077
Re: custom list control
« Reply #4 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.
The only true wisdom is knowing you know nothing

Blaazen

  • Hero Member
  • *****
  • Posts: 3237
  • POKE 54296,15
    • Eye-Candy Controls
Re: custom list control
« Reply #5 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.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: custom list control
« Reply #6 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.

balazsszekely

  • Guest
Re: custom list control
« Reply #7 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.

jamie

  • Hero Member
  • *****
  • Posts: 6077
Re: custom list control
« Reply #8 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..
 
The only true wisdom is knowing you know nothing

Soner

  • Sr. Member
  • ****
  • Posts: 305
Re: custom list control
« Reply #9 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.

alaa123456789

  • Sr. Member
  • ****
  • Posts: 258
  • Try your Best to learn & help others
    • youtube:
Re: custom list control
« Reply #10 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

alaa123456789

  • Sr. Member
  • ****
  • Posts: 258
  • Try your Best to learn & help others
    • youtube:
Re: custom list control
« Reply #11 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

FTurtle

  • Sr. Member
  • ****
  • Posts: 292
Re: custom list control
« Reply #12 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

alaa123456789

  • Sr. Member
  • ****
  • Posts: 258
  • Try your Best to learn & help others
    • youtube:
Re: custom list control
« Reply #13 on: February 28, 2021, 06:20:38 pm »

jamie

  • Hero Member
  • *****
  • Posts: 6077
Re: custom list control
« Reply #14 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 ?
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018