Recent

Author Topic: Make common controls' scrollbars replaceable  (Read 1861 times)

Alextp

  • Hero Member
  • *****
  • Posts: 879
    • UVviewsoft
Make common controls' scrollbars replaceable
« on: August 16, 2014, 07:47:01 pm »
I have component TATScrollbar (see forum), and it's good if Laz can enable me to replace OS scrollbars (of TTreeview, TListview, TMemo, TListbox) with my bars. Now I need to hack into unit of LCL which creates OS bars.
it's bad, hard to.
and changes will be lost on Laz update.
Is it ok idea?

taazz

  • Hero Member
  • *****
  • Posts: 5363
Re: Make common controls' scrollbars replaceable
« Reply #1 on: August 16, 2014, 08:14:22 pm »
No its not. The Tscrollbar and their inherited items are not used and probably will never be used from any control. The reason is that the TScrollbar has its own window and it is a control it self while the Scroll bar that the controls are using is virtual and uses the control's window for everything. So you have to inherit all the controls you want to change and replace their scroll bars.
 
On top of that you should create a minimalistic diff that will allow your inherited controls to replace the scroll bars. You have 2 options 1) make the scrollbar variables accessible for inherited items or 2) introduce a method that will create a scroll bar that you can override.

hope it helps
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Alextp

  • Hero Member
  • *****
  • Posts: 879
    • UVviewsoft
Re: Make common controls' scrollbars replaceable
« Reply #2 on: August 16, 2014, 08:30:08 pm »
Ur answer is weird. I don't see why LCL "option" to replace "virtual" or what ever scrollbars, is bad. it's needed. when? when app needs to be painted with custom colors.

U only tell me what to do now. I do know it. i suggest other thing. "Option" to replace bars with my bars.

taazz

  • Hero Member
  • *****
  • Posts: 5363
Re: Make common controls' scrollbars replaceable
« Reply #3 on: August 16, 2014, 08:34:56 pm »
Ur answer is weird. I don't see why LCL "option" to replace "virtual" or what ever scrollbars, is bad. it's needed. when? when app needs to be painted with custom colors.

U only tell me what to do now. I do know it. i suggest other thing. "Option" to replace bars with my bars.

In that case just do what you know is required then go to the bug tracker and post the patch to allow for the controls to have their own scroll bars. There is no reason for the team to decline the patch.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Alextp

  • Hero Member
  • *****
  • Posts: 879
    • UVviewsoft
Re: Make common controls' scrollbars replaceable
« Reply #4 on: August 16, 2014, 08:43:03 pm »
Gut, it's an option for me. If I make such a patch. Tks