Recent

Author Topic: TCoolBar  (Read 43339 times)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3939
  • I like bugs.
TCoolBar
« on: January 10, 2013, 01:41:54 pm »
Hi

I would like to add the TCoolBar component to LCL and to Lazarus component palette.

Question: Has someone made such component?
If not, would someone like to make a basic rudimentary version of it?

I have not used TCoolBar myself and I have not yet studied its properties well.
My motivation now is to convert more Delphi programs automatically. TCoolBar is used in many of them.

The same problem was with TValueListEditor. I made a very rudimentary version already few years ago. Recently Bart and myself have improved it. yesterday I got the PickList feature working. Now it supports all features that my test-case app (DeleD) uses.
DeleD is a big 3-D design application. I have almost all pieces together to port it for Lazarus.
 http://delgine.com/

Juha
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Blaazen

  • Hero Member
  • *****
  • Posts: 3011
  • POKE 54296,15
    • Eye-Candy Controls
Re: TCoolBar
« Reply #1 on: January 10, 2013, 02:35:02 pm »
Lazarus 2.1.0 r64115 FPC 3.3.1 r40507 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/

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3939
  • I like bugs.
Re: TCoolBar
« Reply #2 on: January 10, 2013, 03:18:56 pm »
I add one link about TCoolBar: http://delphi.about.com/od/vclusing/a/tcoolbar.htm

It says that TControlBar is similar with TCoolBar in features.
It is also missing from LCL but it would maybe be enough to implement it and then convert TCoolBar -> TControlBar by the Delphi converter.
Then it is only a naming issue.
So, would someone like to make a TControlBar?

Juha
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Hydexon

  • Full Member
  • ***
  • Posts: 166
Re: TCoolBar
« Reply #3 on: January 10, 2013, 04:21:33 pm »
I find a attempt of a TCoolBar here (i don't tested yet) but i see has only basic functionality.

http://svn.zdechov.net/svn/PascalClassLibrary/CoolBar/

I add one link about TCoolBar: http://delphi.about.com/od/vclusing/a/tcoolbar.htm

It says that TControlBar is similar with TCoolBar in features.
It is also missing from LCL but it would maybe be enough to implement it and then convert TCoolBar -> TControlBar by the Delphi converter.
Then it is only a naming issue.
So, would someone like to make a TControlBar?

Juha


This thing not are a Win32 exclusive control ? (i mean an COMCTRL32.dll control)
Lazarus 1.0.4 Stable - FPC 2.6.0 - gtk2 | Linux Mint 14 Nadia | GNOME Shell 3.6.2 - Awesome | Intel x86 | HP Mini 1020-LA Netbook (old)
Lazarus 2.0.2 Stable - FPC 3.0.2 - Windows | Lenovo IdeaPad Y

howardpc

  • Hero Member
  • *****
  • Posts: 3614
Re: TCoolBar
« Reply #4 on: January 10, 2013, 05:29:28 pm »
I find a attempt of a TCoolBar here (i don't tested yet) but i see has only basic functionality.
Extremely basic functionality, and not really Delphi-compatible, since the only property added that is the same as TControlBar is RowSize, and instead he has the non-Delphi properties Bands and BandIndex.
To be compatible with TControlBar you would need (just in terms of newly implemented properties on top of TCustomControl) the following 30 properties:
AutoDock
AutoDrag
BevelEdges
BevelInner
BevelKind
BevelKind
BevelOuter
BevelWidth
Canvas
CornerEdge
DrawingStyle
GradientDirection;
GradientEndColor;
GradientStartColor;
OnBandDrag;
OnBandInfo;
OnBandMove;
OnBandPaint;
OnBeginBandMove;
OnCanResize
OnEndBandMove;
OnGesture
OnMouseActivate
OnPaint
ParentBackground
ParentCtl3D
Picture
RowSize
RowSnap
Touch

I list these just to show that this is not a trivial component to be dashed off in a hurry. Well, 29 new properties are needed really since ParentCtl3D is not applicable in Lazarus and would be a property to skip.
Of course you would also need to implement all the supporting methods as well, which I have not bothered to list since the property list suffices to show it is a non-trivial task.
I'm not trying to put anyone off, but I think it's better to start with a realistic vision of the scope of the task ahead.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3939
  • I like bugs.
Re: TCoolBar
« Reply #5 on: January 10, 2013, 07:45:54 pm »
Extremely basic functionality, and not really Delphi-compatible, since the only property added that is the same as TControlBar is RowSize, and instead he has the non-Delphi properties Bands and BandIndex.

I checked Delphi 7 and those 2 components don't look the same at all. I don't know why the page wrote so. Maybe you can do the same things with both but in different ways and using different properties.
For example TCoolBar has "Bands" and "Bitmap" but TControlBar not. TControlBar has "Bevel..." properties but TCoolBar not.
Now first I would need TCoolBar, not TControlBar.
I am planning to write to the author (Chronos) and ask about using the component as a base. I found this in the sources:

Template generics
=================
Tutorial and basic information:
  http://wiki.freepascal.org/Templates
Version: 0.3
Release date: 2011-01-01
Author: Chronos
Email: robie@centrum.cz
Main subversion repository:
http://svn.zdechov.net/svn/PascalClassLibrary/Generics/TemplateGenerics

This template generics lib is used in CoolBar. Lots of effort has been put to it, although I think that real generics in recent FPC versions can do the same thing in a more elegant way.


Quote
To be compatible with TControlBar you would need (just in terms of newly implemented properties on top of TCustomControl) the following 30 properties:
AutoDock
AutoDrag
BevelEdges
BevelInner
BevelKind
BevelKind
BevelOuter
BevelWidth
Canvas
CornerEdge
DrawingStyle
GradientDirection;
GradientEndColor;
GradientStartColor;
OnBandDrag;
OnBandInfo;
OnBandMove;
OnBandPaint;
OnBeginBandMove;
OnCanResize
OnEndBandMove;
OnGesture
OnMouseActivate
OnPaint
ParentBackground
ParentCtl3D
Picture
RowSize
RowSnap
Touch

I list these just to show that this is not a trivial component to be dashed off in a hurry. Well, 29 new properties are needed really since ParentCtl3D is not applicable in Lazarus and would be a property to skip.
Of course you would also need to implement all the supporting methods as well, which I have not bothered to list since the property list suffices to show it is a non-trivial task.
I'm not trying to put anyone off, but I think it's better to start with a realistic vision of the scope of the task ahead.

It does not look so bad. For example all the "Bevel..." stuff comes directly from TPanel if you inherit it from TPanel.
A "realistic vision" is to make a simple version first where the interface (public and published propertied/methods) is ready but only the important things work.
That is what we did with TValueListEditor. The first version was very basic. After some gradual improvements it is quite good already.

Anyway, I have an urge to port this DeleD thing because I feel I am so close already. I get "kicks" from such a challenge.
I try to make some kind of version of TCoolBar.


Regards,
Juha
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Blaazen

  • Hero Member
  • *****
  • Posts: 3011
  • POKE 54296,15
    • Eye-Candy Controls
Re: TCoolBar
« Reply #6 on: January 10, 2013, 08:07:09 pm »
svn co http://svn.zdechov.net/svn/PascalClassLibrary/Generics/TemplateGenerics/ TemplateGenerics

I found it too (it is required package) but I cannot compile with FPC trunk.

Chronos is member of this forum, you can try PM.
Lazarus 2.1.0 r64115 FPC 3.3.1 r40507 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/

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3939
  • I like bugs.
Re: TCoolBar
« Reply #7 on: January 10, 2013, 08:37:57 pm »
I find a attempt of a TCoolBar here (i don't tested yet) but i see has only basic functionality.
http://svn.zdechov.net/svn/PascalClassLibrary/CoolBar/

Thanks for the link.

Quote
This thing not are a Win32 exclusive control ? (i mean an COMCTRL32.dll control)

The LCL component must be cross-platform.
Fortunately the COMCTRL32.dll dependency in the original Delphi's CoolBar component does not really show in the programming interface.
Borland has made a good job to hide the Windows specific stuff.


I found it too (it is required package) but I cannot compile with FPC trunk.

I would replace the template generics with ObjectList in fgl unit in any case. No big deal.

Juha
« Last Edit: January 10, 2013, 08:48:34 pm by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Chronos

  • Full Member
  • ***
  • Posts: 214
    • PascalClassLibrary
Re: TCoolBar
« Reply #8 on: January 10, 2013, 09:43:12 pm »
Generics in recent stable FPC is not capable of handling the same as I tried implement in generics library using old way with templates and macros. And fgl implements only very limited part of all generics staff. So for the record I had tried to to implement such library using fpc generics for past years but there was various compilation and implementation problems even with trunk version. I called this package as NativeGenerics https://app.zdechov.net/PascalClassLibrary/browser/Generics/NativeGenerics

In mentioned CoolBar component implementation my task was not to create Delphi compatible component and I think LCL should not be try to be as much compatible as it can be. But rather go in own way and do multiplatform stuff much more generic and multiplatform than original win32 based Delphi LCL. Then there is no need to be compatible. Rather take all good from original VCL and make it better. It is work for VCL to LCL converter to do the job.

And my implementation is very basic and is used as multiple toolbars arranged side by side. Aim was to have "main big toolbar" with multiple little toolbars (bands) where every band can have visible flag turned on/off which can be toggled from menu by user and stored in registry as persistent.

Then somebody with heavy knowledge of VCL and LCL who have spare time should create TCoolBar from scratch to fit LCL.
« Last Edit: December 18, 2018, 11:43:53 pm by Chronos »

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3939
  • I like bugs.
Re: TCoolBar
« Reply #9 on: January 11, 2013, 01:24:38 am »
Generics in recent stable FPC is not capable of handling the same as I tried implement in generics library using old way with templates and macros. And fgl implements only very limited part of all generics staff. So for the record I had tried to to implement such library using fpc generics for past years but there was various compilation and implementation problems even with trunk version. I called this package as NativeGenerics http://svn.zdechov.net/trac/PascalClassLibrary/browser/Generics/NativeGenerics

I looked at your NativeGenerics. Looks good. You have clearly put lots of energy for it. I have understood that FPC's generic support is improving all the time so maybe the problems are gone.
I am only thinking that it may become duplicate and obsolete work when FPC's standard generics library gets improved.
Yes, fgl is limited but there is another effort for a standard generics library. I know nothing much about it, except that the design is good but there are currently no people working on it. Pity! A proper generics container library is sorely missing. This is one reason why Pascal is loosing popularity and not taken seriously by many people.
As you have skills and motivation for the library, you could maybe help with the FPC's library... (just an idea).


Quote
In mentioned CoolBar component implementation my task was not to create Delphi compatible component and I think LCL should not be try to be as much compatible as it can be. But rather go in own way and do multiplatform stuff much more generic and multiplatform than original win32 based Delphi LCL. Then there is no need to be compatible. Rather take all good from original VCL and make it better. It is work for VCL to LCL converter to do the job.

I agree that LCL must be more than a copy of VCL but Delphi compatibility is also important.
VCL compatibility is kind of the first step. The second step is to extend the existing components and create new ones.
LCL has improved some things beyond VCL already but some components are still completely missing, like this CoolBar.
My converter experiments prove that the "first step" is not completed yet.

What should the VCL to LCL converter do when there is no similar component in LCL? Should it create the component for you using some artificial intelligence methods?

However I think compatibility for one direction is enough, meaning that old Delphi programs should be possible to convert but new LCL features can happily break the compatibility. Otherwise it would restrict the design and development too much.

Quote
And my implementation is very basic and is used as multiple toolbars arranged side by side. Aim was to have "main big toolbar" with multiple little toolbars (bands) where every band can have visible flag turned on/off which can be toggled from menu by user and stored in registry as persistent.

Then somebody with heavy knowledge of VCL and LCL who have spare time should create TCoolBar from scratch to fit LCL.

Thanks for the permission to use your code which you gave in a mail. I am still thinking how to implement TCoolbar.
Now it looks better to inherit from TToolWindow, and Bands must be a TCollection because it must show in Object Inspector.  Etc...

Regards,
Juha
« Last Edit: January 11, 2013, 01:28:20 am by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8294
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: TCoolBar
« Reply #10 on: January 11, 2013, 03:59:54 am »
Quote
Yes, fgl is limited but there is another effort for a standard generics library. I know nothing much about it, except that the design is good but there are currently no people working on it. Pity! A proper generics container library is sorely missing. This is one reason why Pascal is loosing popularity and not taken seriously by many people.
No one is working on fcl-stl? I wonder who did those commits then...

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3939
  • I like bugs.
Re: TCoolBar
« Reply #11 on: January 11, 2013, 10:32:54 am »
No one is working on fcl-stl? I wonder who did those commits then...

Yes, the name is fcl-stl. It is on my ToDo-list to look at it more closely.
My knowledge is only from reading some discussions in FPC mailing list. More specifically, "Ask" (the TAChart author) wanted to have a precision math lib included in FPC and then there was talk about generics. The FPC devels themselves wrote that nobody is actively developing it. I can look for the mail thread.

What I understood, fcl-stl is not ready yet to compete with generics libs in other languages.

[Edit:] This is the thread : http://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg27531.html
However I did not find the mention of fcl-stl quality. Maybe it was another thread...
Must ask from the mailing list.


Juha
« Last Edit: January 11, 2013, 11:05:27 am by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8294
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: TCoolBar
« Reply #12 on: January 11, 2013, 12:35:11 pm »
Quote
What I understood, fcl-stl is not ready yet to compete with generics libs in other languages.
Don't worry, it will eventually if we work on it. I'm planning on adding some data structures, esp. those not found in other languages, e.g.: prefix tree, suffix tree, binary tree, k-ary tree (the backend for gset which in turn used by gmap is a red black tree, but the tree itself can't be used standalone AFAICS). Some simple methods like HasNext for iterator is also missing, so I'll add it as well.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3939
  • I like bugs.
Re: TCoolBar
« Reply #13 on: January 11, 2013, 01:14:05 pm »
Don't worry, it will eventually if we work on it. I'm planning on adding some data structures, esp. those not found in other languages, e.g.: prefix tree, suffix tree, binary tree, k-ary tree (the backend for gset which in turn used by gmap is a red black tree, but the tree itself can't be used standalone AFAICS). Some simple methods like HasNext for iterator is also missing, so I'll add it as well.

Ok, thanks for the info. Good to know it is improving.

BTW, reply to my question in the mailing list says: Patches are definitely welcome for that library. :)

(Chronos, hint...)


Regards,
Juha
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8294
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: TCoolBar
« Reply #14 on: January 11, 2013, 01:24:54 pm »
Quote
BTW, reply to my question in the mailing list says: Patches are definitely welcome for that library.
Yeah I read that as well. Hope I can make it, I have some free time for (I hope) quite a long time.

 

TinyPortal © 2005-2018