Recent

Author Topic: Multiple buttons in TStringrid was not easy  (Read 5089 times)

Fantablup

  • Full Member
  • ***
  • Posts: 170
Multiple buttons in TStringrid was not easy
« on: June 20, 2021, 06:30:01 pm »
Maybe this can be at help for someone.

I wanted to add multiple buttons in a cell in TStringGrid, But Objects could just hold one.
So, i started to search.
After hours i found out that with Objects it is impossible.

So, i tried with TBitBitn, and added three buttons with rect position for the sell.
It worked, but after a while i saw that when scrolling, and the mouse became over a button, the scrolling went mad.
I used days of trying to fix it, but i couldn't solve it.

So, i tried to create buttons as TImage instead.
This works good. The scrolling problem disappeared.

TImage is not a TWinControl. But TBitBitn is.

So, TWinControl was the thing that was the problem.

I used three whole days trying to fix it, but only using none TWinControl fixed it.

I don't know why. Maybe anyone knows the fix.

« Last Edit: June 20, 2021, 06:49:58 pm by Fantablup »

Fantablup

  • Full Member
  • ***
  • Posts: 170
Re: Multiple buttons in TStringrid was not easy
« Reply #1 on: June 20, 2021, 11:51:00 pm »
Thanks for explanation Jamie :)

The strange thing is that when scrolling to the bottom, and the buttons are there, and the mose comes over it, the grid goes to top and scrolls down again and again, and again.


egsuh

  • Hero Member
  • *****
  • Posts: 1273
Re: Multiple buttons in TStringrid was not easy
« Reply #2 on: June 21, 2021, 07:41:54 am »
How can you do this pretty design?  :o

Fantablup

  • Full Member
  • ***
  • Posts: 170
Re: Multiple buttons in TStringrid was not easy
« Reply #3 on: June 21, 2021, 01:46:12 pm »
I dont use any mouse events. So, that can not be it.

Nice design? I think so too ;D
It's about thinking and trying, and failing until you get it right. It is allot of work to get any design to look good.

I see that allot of Delphi and Lazarus put components on forms and make it work. But it often look like no design at all. But it works.

I think design is half of the application, when thinking of users that will use it.

I have worked many years with web design, and guess i work on design a little more in Lazarus because of this.

Only one design in this type of application is any good. FlameRobin for Firebird. He has done it right. FlameRobin also had several people working on it.

 

TinyPortal © 2005-2018