# DraggableTabbedComponent

**URL:** <https://forum.juce.com/t/draggabletabbedcomponent/13265>\
**Category:** General JUCE discussion\
**Created:** [July 29, 2014, 2:16pm UTC](https://forum.juce.com/t/draggabletabbedcomponent/13265 "2014-07-29T14:16:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![justgook](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/justgook/32/218_2.png) [@justgook](https://forum.juce.com/u/justgook)\
**Post date:** [July 29, 2014, 2:16pm UTC](https://forum.juce.com/t/draggabletabbedcomponent/13265/1 "2014-07-29T14:16:57Z")

</div>

im working on crearte new type of component (when it will be done ill post code somewhere there or create "pull-request")  
so main problem is that i found is that i can not extend&nbsp;TabbedComponent::ButtonBar becouse it is private class.&nbsp;

i just wont&nbsp;know reason of that decision - why it was done like that?&nbsp;

suggestion would be update it and create protected - to be posible extend it - becouse for me there is need to add to it DragAndDropTarget behavior.

&nbsp;

or maybe there is some othere solution for that?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [July 29, 2014, 3:25pm UTC](https://forum.juce.com/t/draggabletabbedcomponent/13265/2 "2014-07-29T15:25:15Z")

</div>

We use a&nbsp;TabbedButtonBar in tracktion, where we have fully draggable/detachable panels, so it can certainly be done.

And the reason that&nbsp;implementations like this&nbsp;are kept&nbsp;private is to stop people doing what you're asking for here! If&nbsp;people&nbsp;could write code that is tightly-coupled to&nbsp;the precise way that&nbsp;these&nbsp;classes work&nbsp;internally, then its internal implementation could never be changed without breaking user code.

---

<div class="post-metadata">

**Author:** ![justgook](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/justgook/32/218_2.png) [@justgook](https://forum.juce.com/u/justgook)\
**Post date:** [July 30, 2014, 7:39am UTC](https://forum.juce.com/t/draggabletabbedcomponent/13265/3 "2014-07-30T07:39:00Z")

</div>

how you detect when you have dropped / draggigngover TabbedButtonBar and not to&nbsp;TabbedComponent?  
  
BTW: im not expert in C++, it is just hobby-for-fun, main job is UI/UX engineer, and working for webApps.

based on that - maybe i dont see some basic solution..&nbsp;

---

<div class="post-metadata">

**Author:** ![justgook](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/justgook/32/218_2.png) [@justgook](https://forum.juce.com/u/justgook)\
**Post date:** [July 30, 2014, 7:52am UTC](https://forum.juce.com/t/draggabletabbedcomponent/13265/4 "2014-07-30T07:52:18Z")

</div>

so idea is create something like default behavior &nbsp;in all "tabbed" apps (google chrome, sublime text...) when you drag over TabBar - tabs just change &nbsp;"index", and dragImage moves only by x-point, and add some space between tabs, when you bove mouse cursor out - then fires some custom event, and tab is deatached, and can be dropped somewhere (other tabbed&nbsp;component)

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [July 30, 2014, 7:58am UTC](https://forum.juce.com/t/draggabletabbedcomponent/13265/5 "2014-07-30T07:58:02Z")

</div>

You can create a subclass of TabbedButtonBar which is also a&nbsp;DragAndDropTarget. And you can create custom tab buttons which allow themselves to be dragged.

---

<div class="post-metadata">

**Author:** ![justgook](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/justgook/32/218_2.png) [@justgook](https://forum.juce.com/u/justgook)\
**Post date:** [July 30, 2014, 8:04am UTC](https://forum.juce.com/t/draggabletabbedcomponent/13265/6 "2014-07-30T08:04:04Z")

</div>

based on that, i need to recreate TabbedComponent, where i will use my custom tabbedButtonBar, and reimplement (copy/paste)&nbsp;all behaviors from TabbedComponent
