Modern Dock System

Hi,

A little come-back with old classes I want to share with you. I don’t know if it’s the best way to do this thing. But I hope some tips & tricks will be useful for someone.

Dock
DockManager
Is the main class that manage a one central space with 4 direction panels.
You just need to put the Manager as child of your main component of your application. (or directly as main component)
Add your panel component by : void setPanelComponent (const int position, Component *component);
where position can be the predefined : TOP, BOTTOM, LEFT, RIGHT & CENTER values.
That’s all.
DockPanel & DockHolder are internal base for embbed your personnal component automaticaly.

Example

addAndMakeVisible (manager = new DockManager ()); manager->setPanelComponent (CENTER, new CenterPanel); manager->setPanelComponent (TOP, new HeaderPanel); manager->setPanelComponent (BOTTOM, new BottomPanel); manager->setPanelComponent (LEFT, new LeftPanel); manager->setPanelComponent (RIGHT, new RightPanel);

Each panel can be fixed or auto-hide. Some parameters are defines in DockButtons.h like the FADEOUTMS by default at 180 ms.

Stack
StackManager
This classe are designed to work together with the Left and Right Panels of the Dock.
You can add one Fixed sub-panel on top or bottom of the stack.
You can add unlimited Stacked sub-panels that will be managed automatically in a viewport.
For each panel, The component name will be use as Panel Title and you can add a Toolbar for each sub-panel.

A StackManager need to be initialized with a indication about the Scrollbar position (at Left or at Right of the Stack)

StackManager (const bool scrollBarAtLeft);

The two methods are :

void StackManager::setFixedComponent (Component *component, - [i]Your personnal fixed Panel component.[/i] ToolbarItemFactory *factory, - [i]Optional Toolbar (0 for no toolbar)[/i] bool onTop, - [i]The component will be fixed onTop (true) or onBottom (false) of the stack[/i] bool isOpen, - [i]Initial state - Open (true) Closed (false)[/i] const int height) - [i]Wanted height for the panel component[/i]

void StackManager::setStackedComponent (Component *component, - [i]Your personnal fixed Panel component.[/i] ToolbarItemFactory *factory, - [i]Optional Toolbar (0 for no toolbar)[/i] bool isOpen, - [i]Initial state - Open (true) Closed (false)[/i] const int height) - [i]Wanted height for the panel component[/i]

Ofcourse, all of that is not designed for a ready-to-use framework because this is part of a personnal app. But I think that can be a good starting point to a more useful and extensible project.

Regards.
Max

Ah great! I just made something like this in a non-juce based project!
Can these panels be placed one inside another ad infinitum? E.g. one panel with a top docked inside it that has another left docked inside it that has…
Keep up the good work, Max!

Hi ! I think yes but it’s not designed for. I’ve code theses classes some years ago and now when i’m reading the code, I see all the limitations :slight_smile:

Keep in mind Adobe System has patents on a lot of elements in your system.

Hi TheVinn - Are you’re sure ? Because a center + 4 panels is used in main frameworks ? no ?

Hi TheVinn - Are you’re sure ? Because a center + 4 panels is used in main frameworks ? no ?[/quote]

You have to check their patent filings. I know that the idea of dockable / tearoff tabs (like having multiple tabs in one floating palette) was patented. It might have expired. But US companies tend to re-file them with slight variations.

Regardless, I would never run around comparing my source code to an “Adobe-Like” Dock System. Because those posts could be used in court to prove intentional infringement.

Disclaimer: I am not a lawyer.

[quote=“TheVinn”]Regardless, I would never run around comparing my source code to an “Adobe-Like” Dock System. Because those posts could be used in court to prove intentional infringement.

Disclaimer: I am not a lawyer.[/quote]

You’re right, although I do not think that my code could be any violation of this major. I’ve rename the topic and will change the file later, i’m not on my computer.

Sorry I didn’t want to bust anyone’s bubble. Legal issues aside, nice system you developed!

And I hate the United States patent system!

Thanks, I’ve seen on differents topics you’re a REAL guru ! Respect.

Me too !

[quote=“TheVinn”]
And I hate the United States patent system![/quote]

Putting aside the general question of allowing patents for software, the most stupid aspect of the US system is that you’re often better off doing no patent searches and releasing blind than performing a thorough search and missing something. The first is just infringement, the second is willful.

Imagine if we applied that logic to driving: “Witnesses report that you appeared to look around before pulling onto your driveway. Surely then you would have seen the victim who was obscured behind a parked vehicle? Is it not clear then that, far from a simple case of driving without due care and attention as the defense would have us believe, this is a obvious case of attempted vehicular homicide?”

Just to add, there have been several rulings in the past stating that user interfaces cannot be copyright protected on their own;
at least that’s the situation in Germany, but usually our courts don’t stray too far from international practice, so it might be worth checking that out for the U.S.
Reason for this is that there usually is no artistic value in user interface design, but that it’s a necessary component of software in general.
A company filing lawsuits against this would have to claim that the user interface is a form of artistic expression, which should be pretty hard to uphold in court.