Recent

Author Topic: TCoolBar  (Read 49100 times)

Ocye

  • Hero Member
  • *****
  • Posts: 518
    • Scrabble3D
Re: TCoolBar
« Reply #15 on: January 11, 2013, 04:47:06 pm »
Isn't user driven configuration (add/remove functions, aka actions, to the bar)  inherent part of a TCoolBar? AFAIR, there opens a dialog on right-click... Or in other words: it would be great to have those stuff. I'm wondering if it works with themes under Linux since coolbars might not have been defined by Gtk/Qt and Cocoa as well.
Lazarus 1.7 (SVN) FPC 3.0.0

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: TCoolBar
« Reply #16 on: January 11, 2013, 08:06:30 pm »
Isn't user driven configuration (add/remove functions, aka actions, to the bar)  inherent part of a TCoolBar? AFAIR, there opens a dialog on right-click...

No, there is no default action at run-time when right-clicking. Just testing with Delphi 7.
The user can move and reorder the bands with drag-and-drop but that is all.
You may have seen an derived component with added pop-up support.

Quote
Or in other words: it would be great to have those stuff. I'm wondering if it works with themes under Linux since coolbars might not have been defined by Gtk/Qt and Cocoa as well.

It must be built from other GUI components (TPanel etc.). It could also use bindings and implement a native COM Control on Windows, but I don't see any benefit doing that. The CoolBar in Delphi 7 already behaves strange, I guess because of the COM Control itself.
So, this will be a pure LCL component, no bindings.

Delphi already has TControlBar which is a pure VCL component and behaves better. I am thinking how the same code could be used for both TCoolBar and TControlBar. Maybe implement TControlBar first and then implement TCoolBar as a wrapper on top of it.

In any case, the first versions will be ugly and primitive. Don't hold your breath.

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

Chronos

  • Full Member
  • ***
  • Posts: 240
    • PascalClassLibrary
Re: TCoolBar
« Reply #17 on: January 11, 2013, 09:11:02 pm »
Be or not to be compatible with Delphi and VCL? That's the ultimate question.
It is hard to decide it exactly. It is easier to mimic existed VCL library than create completely new from scratch. And if LCL would be only nearly 1:1 interface compatible then it cannot be better than VCL in any aspect. Then halfway solution would be: basically be compatible and differ only in some cases where change could bring new feature as multiplatform support. But some characteristics of VCL components come from win32 api so it should be modified, replaced, even removed.

But what about FireMonkey compatibility? Will be lazarus converter able to translate such code to LCL? Should be LCL enhanced to new abilities of FMX?
 
Back to topic: TCoolBar seems to me is better component than TControlBar. Both may not exists in other widgedsets but for windows apps it would be definitely good to have it.

Question is what features it should have?
Completely same as VCL variant?
Hard part is drag and drop feature. Who tried to implement custom docking system knows how complicated it could be. And TCoolBar is basically "super toolbar" with draggable horizontal or vertical autoarranged subtoolbars or better to say bands as container for other TWinControl descendants.

I would like to contribute with own code but both Lazarus and FPC is not well organized project. It has bugtracker, forum, wiki but all is rather unperfect and everything is moving very slowly. I have three bug reports opened for few months some even with submitted patch but nobody cares. There are no human resources. There are other priorities. Core programmers work only in spare time. Am I idealist or something is wrong? Some significant example how things could work? Look at LibreOffice or some linux distributions.

Maybe I am willing to update czech localization but need access to repository just to language files. I dont want to bother anyone with every file update to be merged. Look at Launchpad and other projects how it can work easily.

Many things could be better. TCoolBar is just only one pease which wont save whole project. It is for another long offtopic discussion

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: TCoolBar
« Reply #18 on: January 11, 2013, 10:26:01 pm »
Be or not to be compatible with Delphi and VCL? That's the ultimate question.
...

There are 2 different things : _change_ the interface and _extend_ the interface.
Extending it does not break compatibility with existing Delphi apps. And yes, then LCL can be better than VLC.

Quote
But what about FireMonkey compatibility? Will be lazarus converter able to translate such code to LCL? Should be LCL enhanced to new abilities of FMX?

No. At least I have no plans to do that. If someone has big enough "itch" for it, then he will implement such converter.
But, I doubt it will happen any time soon, knowing the limited amount of contributors and their available time.

Quote
Back to topic: TCoolBar seems to me is better component than TControlBar. Both may not exists in other widgedsets but for windows apps it would be definitely good to have it.

Did you test TCoolBar with Delphi. In my tests it behaved wrong sometimes, hiding the bands and moving to wrong place. At design-time I could move the attached control away from the band. It was a mess. TControlBar behaved better for me.
There will not be a specific widgedset binding for these components. So, there will not be TWSCoolBar or TWSControlBar. They will be built from basic LCL components, like TPanel, which obviously have a widgedset binding.

Quote
Question is what features it should have? Completely same as VCL variant?
Hard part is drag and drop feature. Who tried to implement custom docking system knows how complicated it could be. And TCoolBar is basically "super toolbar" with draggable horizontal or vertical autoarranged subtoolbars or better to say bands as container for other TWinControl descendants.

The interface defined by Borland must be identical, more or less. "Interface" here means everything in protected, public and published sections.
Yes, let's see how drag and drop goes. It will be another exercise.

Quote
I would like to contribute with own code but both Lazarus and FPC is not well organized project. It has bugtracker, forum, wiki but all is rather unperfect and everything is moving very slowly. I have three bug reports opened for few months some even with submitted patch but nobody cares. There are no human resources. There are other priorities. Core programmers work only in spare time. Am I idealist or something is wrong? Some significant example how things could work? Look at LibreOffice or some linux distributions.

I saw you have 2 open issues, both with patches. I try to look at them soon (Paul Ishenin seems to be busy).
I am sorry on behalf of Lazarus developers. Bug reports with patches should not be ignored. It is bad.
Otherwise I don't see such big problems in the development process or tools. I also don't believe that other projects can do it significantly better. All big projects have thousands of open tickets. It is not unusual.

Quote
Maybe I am willing to update czech localization but need access to repository just to language files. I dont want to bother anyone with every file update to be merged. Look at Launchpad and other projects how it can work easily.

Many things could be better. TCoolBar is just only one pease which wont save whole project. It is for another long offtopic discussion

Maxim seems to apply translations happily. Why is it a problem?
But yes, let's not make it off-topic. Please open a new topic, especially if you have specific ideas how to improve things.

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

Chronos

  • Full Member
  • ***
  • Posts: 240
    • PascalClassLibrary
Re: TCoolBar
« Reply #19 on: January 12, 2013, 11:38:07 am »
This is mostly matter of work organization and priorities. Lazarus/FPC is classic pure open source project where work depends on contributors which have probably their daily job and contribute to project only occasionally. Then no expectation could be made about any deadline and requested features. And sure this have advantages and disadvantages. Main disadvantage is that community suffer because many problems take years to solve and nothing is certain.

TCoolBar or TControlBar is only on of many missing and "late" features which should be done years ago.
What about Gtk3, windows 8 and metro compatibility, docked IDE, native networking components, audio components, gestures, multi-touch support, and so on. Yes, these are big expectations from small project without active full time job development but people are coming here and get some false impression.

Yes, coolbar in delphi have their own problems but if I remember correctly it is simpler and more intuitive for use then TControlBar. Drag & drop is core part of it. Docking is not really necessary but there are some examples of advanced application which allow to dock toolbars to form sides or just have all of them in single top section or all toolbars could be floated as tool window. I thing Adobe Photoshop and Paint Shop Pro use such behaviour.

There is some documentation about drag & drop with LCL http://wiki.freepascal.org/LCL_Drag_Drop
But docking part is much harder because docking LCL is still not completed and look like mess (also thanks to VCL compatibility and some different concept).

What about visual style of grab handle? Does multi-platform theme manager know something like this? This apply for docking too.

There are lot of work to be done before coolbar could be completed and ready to use. I will look forward to your results. It will be definitely bonus for all advanced GUI designers.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: TCoolBar
« Reply #20 on: January 17, 2013, 09:58:10 am »
Chronos: BTW, I applied your patch from issue #23251 some days ago. Now I had to revert it. See the issue report for details.
[Edit:] The problem is apparently not caused by your patch but I will hold it back until things work with GTK2.

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

timppl

  • Jr. Member
  • **
  • Posts: 80
Re: TCoolBar
« Reply #21 on: January 18, 2013, 07:29:15 am »
I don't know if it would be of interest, but I have an implementation of TControlBar I have made. It does not have full functionality ( at least I am fairly sure it does not. I have not got a copy of delphi and have never seen the full delphi one working ). I would be happy to contribute it if it is wanted ( although I would have to reveiw it and get rid of some of my worst mistakes  ;) ).
Regards

Tim
Mageia 8 Linux on x86

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: TCoolBar
« Reply #22 on: January 18, 2013, 09:17:07 am »
Sure, I would be happy to look at your code and maybe use it as a starting point.
I promise not to be too critical about it, if you have some experimental stuff there.

I looked at the Delphi's TControlBar component. I was planning to use its ideas in a reverse-engineered manner.
However, the code is really strange, obfuscated and overly complex. We can do better.
I have ideas how to implement the layout alignment for TControlBar and TCoolBar (using LCL's anchors) but nothing is tested yet.
I hope I can use time for this during weekend.


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

timppl

  • Jr. Member
  • **
  • Posts: 80
Re: TCoolBar
« Reply #23 on: January 22, 2013, 07:38:51 am »
Here is my ( incomplete but working ) implementation of TControlBar. Not it registers to my own tab in Lazarus.

regards

Tim
Mageia 8 Linux on x86

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: TCoolBar
« Reply #24 on: January 24, 2013, 01:14:51 am »
Here is my ( incomplete but working ) implementation of TControlBar. Not it registers to my own tab in Lazarus.

Thanks.
Based on my first looks it does not do much yet. There is no alignment algorithm nor dragging nor other TControlBar features.
There is basically just what TCustomControl provides by default.
But it is a starting point, yes.

I will take a better look when I have time.

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

timppl

  • Jr. Member
  • **
  • Posts: 80
Re: TCoolBar
« Reply #25 on: January 24, 2013, 07:21:17 am »
Hi Juha

Yes I only needed a minimal implementation to work in the application I am portin to lazarus/fpc. Improving it ( and other components I have put together ) are on the todo list when I have got the applications working adequately.

Tim
Mageia 8 Linux on x86

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: TCoolBar
« Reply #26 on: January 28, 2013, 01:26:04 am »
Hi

I finally implemented TCoolbar and it even works (somehow).
Next I will try how the DeleD 3-D app looks when ported to use it.

The component is still rudimentary and basic. Many things are missing:
- Dragging the bands by user is not possible yet. There will be a small dragging area on the left. Actually I am looking for examples how to do it. Anybody has good examples? As you can see I don't have much experience writing these components.
- A control associated with a band can be moved at design-time away from the band. Actually it behaves as poorly as the original Delphi's COM-based component, but I want to make this one more polished.
- Bitmaps can be created and assigned but they are not shown yet.
- A new band is not automatically created when a new component is dropped onto a CoolBar. It should be.

Yet, you can already add and remove bands in a collection editor, select an associated control from a drop-down list and use the associated control. It is usable already.
On a positive side, it is fully cross-platform. It is a pure LCL component, built using the more primitive LCL components as construction blocks.

I also added a skeleton version of TControlBar. It does not do much more than what a TPanel already does. It will require lots of work before it is good.

May I ask help? I know here are many graphically talented people.
I would need icons for the component toolbar for both TCoolBar and TControlBar.
Now there are just "placeholder" icons copied from TToolBar.

And yes, patches are of course welcome to improve TCoolBar. It should be rather easy to improve now that the basic functionality is there.
If somebody wants to take TControlBar as a challenge, please do, but it is a more difficult beast than TCoolBar.

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

wjackson153

  • Sr. Member
  • ****
  • Posts: 267
Re: TCoolBar
« Reply #27 on: January 28, 2013, 06:08:45 am »
What kind of icons art work are you looking for?
could you provide more details , im pretty fluent in
gimp :)

Lazarus 1.1 r39490 CT FPC 2.7.1 i386-linux KDE
Linux Mint 14 KDE 4

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: TCoolBar
« Reply #28 on: January 28, 2013, 09:40:16 am »
What kind of icons art work are you looking for?

They can be similar than in Delphi, but not necessarily.
You can improvise if you like.

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

Avishai

  • Hero Member
  • *****
  • Posts: 1021
Re: TCoolBar
« Reply #29 on: January 30, 2013, 02:28:18 pm »
TCoolBar generates an Access Violation on startup if the component is made RightToLeft using RightToLeftLayout on MSWindows.

procedure RTLCtrl(ACtrl: TObject);
{ Make TWinControl RightToLeft - Windows ONLY! }
const
  RightToLeftLayout = $400000; 
  NoInheritLayout = $00100000;
begin
{$IfDef Windows}
  if ACtrl is TWinControl then
    with TWinControl(ACtrl) do begin
      SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE)
        or RightToLeftLayout or NoInheritLayout);
  end;
{$EndIf}
end;

Edit: My apologies.  It wasn't making the control RightToLeft that caused the access violation.  It failed when my code tried to add Bands to TCoolBar.  I tried adding Bands to a LeftToRight TCoolBar and still got the Access Violation so it doesn't seem to be related to RightToLeft.
« Last Edit: January 30, 2013, 03:04:59 pm by Avishai »
Lazarus Trunk / fpc 2.6.2 / Win32

 

TinyPortal © 2005-2018