ANN: RibbonBar for wxPython

545 views
Skip to first unread message

Andrea Gavana

unread,
Oct 16, 2009, 5:50:22 AM10/16/09
to wxPython-users
Hi All,

I am happy to announce the release of my latest child, RibbonBar.
This is a pure-Python translation of the very nice (and very nicely
written, in a C++ perspective) wxRibbon from Peter Cawley and his
Google Summer of Code 2009.

As many of you know, the RibbonBar library is a set of classes for
writing a ribbon user interface. At the most generic level, this is a
combination of a tab control with a toolbar. At a more functional
level, it is similar to the user interface present in recent versions
of Microsoft Office.

========
= NOTE =
========

The Python version of the RibbonBar has still a problem in correctly
resizing when used in a *VERTICAL* mode. I wasn't able to crash this
bug, and you can see it by comparing the RibbonBar Python demo (in a
vertical mode) with the nice screenshots on Peter's blog here:

http://www.corsix.org/content/ribbon-summer-code

Any help in fixing this issue would be more than welcome.

=========
END NOTE
=========

Now, source code, demo and other screenshots are on my website:

http://xoomer.virgilio.it/infinity77/main/freeware.html#ribbonbar

Or:

http://xoomer.alice.it/infinity77/main/freeware.html#ribbonbar


If you find a bug, please do make and effort and try to create a patch
for it. I tested it only on Windows, and I have absolutely no idea if
it works on GTK or Mac. Any help in fixing bugs appearing on these 2
platforms is more than welcome.

Enjoy, wxPython rules :-D

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
http://thedoomedcity.blogspot.com/

Nitro

unread,
Oct 19, 2009, 9:51:51 AM10/19/09
to wxpytho...@googlegroups.com
Am 16.10.2009, 11:50 Uhr, schrieb Andrea Gavana <andrea...@gmail.com>:

> Hi All,
>
> I am happy to announce the release of my latest child, RibbonBar.
> This is a pure-Python translation of the very nice (and very nicely
> written, in a C++ perspective) wxRibbon from Peter Cawley and his
> Google Summer of Code 2009.

Thanks for this widget, it's incredible what you are pulling off!

I'm in the process of integrating it into my own application (which by now
looks more like wxAGW than wxPython :D). My old toolbar was always too
big, so RibbonBar is a perfect replacement. The old toolbar had tooltips
which popped up when you moved the cursor over a button. When adding a
button to the new RibbonBar I can specify the tooltip string, but a
tooltip never pops up. I've looked into the source and there doesn't seem
to be any code to handle tooltips. I've also looked at the tooltips in ms
word and they look very much like your SuperToolTip widget.

My question is now how do I go best about adding tooltips to RibbonBar?
Should it raise some kind of "show tooltip" event which the user can
handle (e.g. by using a SuperToolTip)? Or is there a better way? I'm also
afraid to desync your version of RibbonBar from the C++ version, what's
your policy regarding that?

-Matthias

Andrea Gavana

unread,
Oct 19, 2009, 10:31:38 AM10/19/09
to wxpytho...@googlegroups.com
Hi Matthias,

2009/10/19 Nitro:


>
> Am 16.10.2009, 11:50 Uhr, schrieb Andrea Gavana <andrea...@gmail.com>:
>
>> Hi All,
>>
>>     I am happy to announce the release of my latest child, RibbonBar.
>> This is a pure-Python translation of the very nice (and very nicely
>> written, in a C++ perspective) wxRibbon from Peter Cawley and his
>> Google Summer of Code 2009.
>
> Thanks for this widget, it's incredible what you are pulling off!

It's just my personal way to say "thank you" to wxPython itself. Much
of the praises I had in the last 4 years in my job are mostly due to
the power of wxPython, and secondarily to my still limited skills. The
trouble is, I haven't got any new ideas for new widgets. I am actually
playing with a pure-Python version of a Mac-like Dock (or BubbleBar,
or FishEye menu or whatever you like), but it's just an eye-catching
small thing. I am always open to suggestions :-D

> I'm in the process of integrating it into my own application (which by now
> looks more like wxAGW than wxPython :D). My old toolbar was always too
> big, so RibbonBar is a perfect replacement. The old toolbar had tooltips
> which popped up when you moved the cursor over a button. When adding a
> button to the new RibbonBar I can specify the tooltip string, but a
> tooltip never pops up. I've looked into the source and there doesn't seem
> to be any code to handle tooltips. I've also looked at the tooltips in ms
> word and they look very much like your SuperToolTip widget.
>
> My question is now how do I go best about adding tooltips to RibbonBar?
> Should it raise some kind of "show tooltip" event which the user can
> handle (e.g. by using a SuperToolTip)? Or is there a better way? I'm also
> afraid to desync your version of RibbonBar from the C++ version, what's
> your policy regarding that?

As it stands, the Ribbon is missing 4 or 5 important features (in my
opinion), in this order of importance:

1) Buttons can be normal buttons, dropdown or hybrid: there is still
no way to make them behave as check or radio buttons (the Office
RibbonBar has this feature);
2) Toolbar buttons have no ability to behave as check or radio buttons;
3) There is no way to add a control inside a RibbonBar (like a
checkbox or a small listbox);
4) The RibbonBar in vertical mode is still buggy;
5) There is no "Orb" at the top left of the Ribbon.

To answer your question, I don't think we should worry about desyncing
the Python version from the C++ one: I believe that, if the Python
version is used and maintained and developed, it will probably end up
inside wx.lib.agw (as AUI did) and it will live its own independent
life. We may add features as much as we want without waiting for the
C++ guys to approve them.
So there might be a couple of ways to do what you propose:

1) Implement a simple self.SetTooltipString("help_string") when the
mouse is over a button in buttonbar.py;
2) Send a EVT_RIBBONBUTTONBAR_TOOLTIP when the mouse is over a button
in buttonbar.py (including the button rect in the event) and then it's
up to the developer to catch the event and display whatever tooltip
he/she likes. I developed SuperToolTip because it looked so much like
the Ribbon tooltip that I imagined sooner or later we would have
needed it.

Please feel free to hack the source: if you come up with a patch,
please contribute it back and I will update the RibbonBar version on
my website. I do have a couple of questions though:

1) You mentioned that:

"""
I'm in the process of integrating it into my own application (which by now
looks more like wxAGW than wxPython :D)
"""

Would it be possible for you to send me a screenshot of your app? I am
just curious.

2) Have you tested the Ribbon on other platforms than MSW? Does it work there?

Don Dwiggins

unread,
Oct 20, 2009, 1:40:54 PM10/20/09
to wxpytho...@lists.wxwidgets.org
Andrea Gavana wrote:
> It's just my personal way to say "thank you" to wxPython itself. Much
> of the praises I had in the last 4 years in my job are mostly due to
> the power of wxPython, and secondarily to my still limited skills. The
> trouble is, I haven't got any new ideas for new widgets. I am actually
> playing with a pure-Python version of a Mac-like Dock (or BubbleBar,
> or FishEye menu or whatever you like), but it's just an eye-catching
> small thing. I am always open to suggestions :-D

Something that comes to mind is pie menus: http://www.piemenus.com/. (I
once had a chance to play with them under Sun's NeWS back in the '80s,
and I have easyGestures installed on Firefox.)

--
Don Dwiggins
Advanced Publishing Technology

samyak jain

unread,
Jan 26, 2014, 7:14:55 PM1/26/14
to wxpytho...@googlegroups.com, wxPython-users
Hi Andrea,

You have done a great job by writing a ribbon widget for wxpython. I am using your ribbon in my app and I am having a problem. I am a newbie to python and wxwidget both. I have created a Ribbon with some pages and each page has got some panels and each panels have got some button. I am trying to add a right click popupmenu for user of my app, which will have options to either delete a button, or panel or an entire page. I looked into the codes and I am not able to find any function that deletes page or panel. It would be a great help if you could give me an idea on how to do the deleting part.

Thanks a lot in advance.
Samyak

Metallicow

unread,
Jan 27, 2014, 7:18:57 AM1/27/14
to wxpytho...@googlegroups.com, wxPython-users


On Sunday, January 26, 2014 6:14:55 PM UTC-6, samyak jain wrote:
I am trying to add a right click popupmenu for user of my app, which will have options to either delete a button, or panel or an entire page. I looked into the codes and I am not able to find any function that deletes page or panel. It would be a great help if you could give me an idea on how to do the deleting part.
 
You are probably wanting to Bind wx.EVT_RIGHT_UP or wx.EVT_CONTEXT_MENU to the specific widgets/windows....
... so Look at the wxPython Demo or wxPyWiki examples for this basic binding stuff.

Your widgets should take care or cleanup themselves upon closing/deletion, else you can use the del python syntax.

When posting on this mailing list/thread, making and attaching a 'small' basic "sample app"(one that shows the problem/issue at hand) of your code always helps with beginners.

samyak jain

unread,
Jan 27, 2014, 9:10:38 AM1/27/14
to wxpytho...@googlegroups.com, wxPython-users
Dear Metallicow,

Thanks a lot for your reply and sorry for not attaching the code. I have successfully bounded the wx.EVT_RIGHT_UP and wx.EVT_CONTEXT_MENU without any problem. The problem I have is when user clicks on "Remove Tab" in wxpython, I have to remove that Ribbon Page which user wants to remove from being displayed. I have attached a major portion of my code and the place where I am having problem is the definition of 2 functions, namely :  "RemoveTab(self,event)" and "RemoveGroupBox(self, event)" where GroupBox is the panel in any ribbon page. 

Thanks a lot for your help.
Samyak



# Main Class that creates the complete Interface with ribbon, OCC Display, Python Console and Tree
class Interface(wx.Frame):

    def __init__(self, parent, id=wx.ID_ANY, title="", pos=wx.DefaultPosition,
                 size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE):

        wx.Frame.__init__(self, parent, id, title, pos, size, style)
        self._bitmap_creation_dc = wx.MemoryDC()
        #self._colour_data = wx.ColourData()

        ######## RIBBON STARTS FROM THIS POINT #######################

        self._ribbon = RB.RibbonBar(self, id = wx.ID_ANY)
        self._ribbon.Bind(wx.EVT_RIGHT_UP,self.RightClickRibbonTabBar,id=wx.ID_ANY)

        # Workpiece Ribbon Page (Default Page - Hard Coded))
        workpiece = RB.RibbonPage(self._ribbon, WORKPIECE, "Workpiece", Bitmap("eye.xpm"))

        label_font = wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_LIGHT)
        self._bitmap_creation_dc.SetFont(label_font)

        # Necessary to display the Ribbon
        self._ribbon.Realize()

        layout = wx.BoxSizer(wx.VERTICAL)
        layout.Add(self._ribbon, 1, wx.EXPAND)
        self.SetSizer(layout)

        ####### Hard Coded part of Ribbon Ends ######

        # Functions for binding events
        self.BindRibbonEvent()
        self.DynammicBindingForIncreasingRibbon()

        #workpiece.Bind(wx.EVT_RIGHT_UP, self.AddGroupBox, id=wx.ID_ANY)
        #Important For each page #Samyak

    def DynammicBindingForIncreasingRibbon(self):
        for i in xrange(len(self._ribbon._pages)):
            page = self._ribbon._pages[i].page
            page.Bind(wx.EVT_RIGHT_UP, self.RightClickRibbonPage, id=wx.ID_ANY)


    # Binds All Ribbon Related Events
    def BindRibbonEvent(self):
        self.Bind(RB.EVT_RIBBONBAR_TAB_RIGHT_DOWN, self.RightClickRibbonTabs, id = wx.ID_ANY )  #trial

    # Connects Right Click on any ribbon tab
    def RightClickRibbonTabs(self,event):
        pos = wx.GetMousePosition()
        x, y = pos.x, pos.y
        pos = self.ScreenToClient(pos)
        self.popupmenu = wx.Menu()
        AddTab = self.popupmenu.Append(-1, "Add Tab")
        RemoveTab = self.popupmenu.Append(-1, "Remove Tab")
        self.Bind(wx.EVT_MENU, self.AddTab, AddTab)
        self.Bind(wx.EVT_MENU, self.RemoveTab, RemoveTab)
        pos = wx.GetMousePosition()
        x, y = pos.x, pos.y
        pos = self.ScreenToClient(pos)
        self.PopupMenu(self.popupmenu, pos)

    def RightClickRibbonPageBox(self, event, newpanel):
        self.popupmenu = wx.Menu()
        AddGroupBox = self.popupmenu.Append(-1, "Add Box")
        RemoveGroupBox = self.popupmenu.Append(-1, "Remove Box")
        self.Bind(wx.EVT_MENU, self.AddGroupBox, AddGroupBox)
        self.Bind(wx.EVT_MENU, self.RemoveGroupBox, RemoveGroupBox)
        pos = wx.GetMousePosition()
        pos = self.ScreenToClient(pos)
        self.PopupMenu(self.popupmenu, pos)


    #Adds new Ribbon Page on Clicking AddTab(on Popup Menu that appears right clicking on Tab)
    def AddTab(self, event):
        text = wx.TextEntryDialog(None, "Name of the Tab :", "New Tab", "NewTab" )
        text.CenterOnParent()
        answer = text.ShowModal()
        text.Destroy()
        if answer == wx.ID_OK:
            name = text.GetValue()
            newtab = RB.RibbonPage(self._ribbon, wx.ID_NEW, name, Bitmap("empty.xpm"))
            self._ribbon.SetActivePage(newtab)
            self.DynammicBindingForIncreasingRibbon()
            self._ribbon.Realize()
            #newtab.Bind(wx.EVT_RIGHT_UP, self.AddGroupBox, id=wx.ID_ANY)
        else:
            pass

    # Close the current selected Tab in Ribbon
    def RemoveTab(self, event):
        n = self._ribbon.GetActivePage()
        page = self._ribbon._pages[n].page
        activepage = self._ribbon._pages[n-1].page
        self._ribbon.SetActivePage(activepage)
        self._ribbon.RemoveChild(page)
        self._ribbon.Realize()

    # Add a new group box in the new Ribbon Page
    def AddGroupBox(self, event):
        n = self._ribbon.GetActivePage()
        currentSelectedPage = self._ribbon._pages[n].page
        newpanel = RB.RibbonPanel(currentSelectedPage, wx.ID_ANY, "New Panel", Bitmap("selection_panel.xpm"),  wx.DefaultPosition, wx.DefaultSize,RB.RIBBON_PANEL_EXT_BUTTON)
        newpanel.Bind(wx.EVT_RIGHT_UP, lambda event: self.RightClickRibbonPageBox(event, newpanel))
        self._ribbon.Realize()

    def RemoveGroupBox(self,event):
        pass


if __name__ == "__main__":

    app = wx.App(False)
    frame = Interface(None, -1, "ZEEKO CAD Interface", size=(1280, 200))
    frame.CenterOnScreen()
    frame.Show()
    app.MainLoop()

 
Ribbon.py

Metallicow

unread,
Jan 29, 2014, 8:40:18 AM1/29/14
to wxpytho...@googlegroups.com, wxPython-users


On Monday, January 27, 2014 8:10:38 AM UTC-6, samyak jain wrote:

Dear Metallicow,

Thanks a lot for your reply and sorry for not attaching the code. I have successfully bounded the wx.EVT_RIGHT_UP and wx.EVT_CONTEXT_MENU without any problem. The problem I have is when user clicks on "Remove Tab" in wxpython, I have to remove that Ribbon Page which user wants to remove from being displayed. I have attached a major portion of my code and the place where I am having problem is the definition of 2 functions, namely :  "RemoveTab(self,event)" and "RemoveGroupBox(self, event)" where GroupBox is the panel in any ribbon page. 

Thanks a lot for your help.
Samyak

I have chopped most everything you hardcoded out an left just the menu defs to test with.
Strange as it is, this seams to be unimplemented or still needs more work. Adding is working just fine. RemoveChild does nothing.
No matter what I try isn't working also...
I can manage to force delete the page, but then app crashes.

@ Andrea: Can you look into adding or fixing a RibbonBar.RemovePage(page) or RibbonBar.DeletePage(page) function?
Thanks.

@ Samyak: Your only other option at this point would be to delete the RibbonBar completely and recreate it every time... Which would be rather Hackish and a pain. Hope for a quick fix is the better option here.

samyak jain

unread,
Feb 6, 2014, 7:46:05 AM2/6/14
to wxpytho...@googlegroups.com, wxPython-users



Dear Metallicow,

I was successful in implementing the above without any problem. I have attached my code if anyone need that. 
Actually, I needed another help from Andrea or you regarding wxribbon. I am trying to implement an 'Orb', dropdown button on the top left corner of ribbon near the first tab just like in MS Office. But, I have no idea how to implement that. If would be really helpful if anyone could give me any idea on how to do it. Thanks a lot.


    # Close the current selected Tab in Ribbon
    def RemoveTab(self, event, index, page):
        if len(self._ribbon._pages) > 1 and index != 0:
            #page = self._ribbon._pages[n].page
            if index > 0 :
                activepage = self._ribbon._pages[index-1].page
                self._ribbon.SetActivePage(activepage)
            else:
                activepage = self._ribbon._pages[len(self._ribbon._pages) - 1].page
                self._ribbon.SetActivePage(activepage)
            for child in page.GetChildren():
                page.RemoveChild(child)
            self._ribbon._pages.pop(index)
            self._ribbon.Realize()
        else :
            wx.MessageBox('This tab must be opened.', 'Info', wx.OK | wx.ICON_INFORMATION)



 

Metallicow

unread,
Feb 7, 2014, 1:03:33 PM2/7/14
to wxpytho...@googlegroups.com, wxPython-users


On Thursday, February 6, 2014 6:46:05 AM UTC-6, samyak jain wrote:

Dear Metallicow,

I was successful in implementing the above without any problem. I have attached my code if anyone need that. 
Actually, I needed another help from Andrea or you regarding wxribbon. I am trying to implement an 'Orb', dropdown button on the top left corner of ribbon near the first tab just like in MS Office. But, I have no idea how to implement that. If would be really helpful if anyone could give me any idea on how to do it. Thanks a lot.

    # Close the current selected Tab in Ribbon
    def RemoveTab(self, event, index, page):
        if len(self._ribbon._pages) > 1 and index != 0:
            #page = self._ribbon._pages[n].page
            if index > 0 :
                activepage = self._ribbon._pages[index-1].page
                self._ribbon.SetActivePage(activepage)
            else:
                activepage = self._ribbon._pages[len(self._ribbon._pages) - 1].page
                self._ribbon.SetActivePage(activepage)
            for child in page.GetChildren():
                page.RemoveChild(child)
            self._ribbon._pages.pop(index)
            self._ribbon.Realize()
        else :
            wx.MessageBox('This tab must be opened.', 'Info', wx.OK | wx.ICON_INFORMATION)


Ok. Good find/fix. This code works fine. OnRemoveTab PopupMenu event def collects the infos and sends it to the actual removing DoRemoveTab def.
event isn't needed for the removing def. This could happen before or after depending on how you want the trail of actions to occur. 
I/Andrea should check the wxPython Ribbon demo and add this modded similar code bit as is a bit confusing as how to do this exactly since there is no example of it.

    # PopupMenu Event
    def OnRemoveTab(self, event):
        actPageIdx = self._ribbon.GetActivePage()
        print('actPageIdx', actPageIdx)
        pg = self._ribbon._pages[actPageIdx].page
        print('page', pg)
        self.DoRemoveTab(index=actPageIdx, page=pg)



    # Close the current selected Tab in Ribbon
    def DoRemoveTab(self, index, page):

        if len(self._ribbon._pages) > 1 and index != 0:
            #page = self._ribbon._pages[n].page
            if index > 0 :
                activepage = self._ribbon._pages[index-1].page
                self._ribbon.SetActivePage(activepage)
            else:
                activepage = self._ribbon._pages[len(self._ribbon._pages) - 1].page
                self._ribbon.SetActivePage(activepage)
            for child in page.GetChildren():
                page.RemoveChild(child)
            self._ribbon._pages.pop(index)
            self._ribbon.Realize()
        else :
            wx.MessageBox('This tab must be opened.', 'Info', wx.OK | wx.ICON_INFORMATION)
        self._ribbon.SendSizeEvent() # Force Update/Refresh

Ok, so you want the Orb huh... hmmm...
Many ways this could be done. Not sure how important something like that is to your project, but it will require hacking the ribbon code depending on what you want. Especially if you want it to look similar to MSW glass ball.
1. I have a new widget(Not released yet) ShapedBitmapButton that would probably work best for this. But it is still in it's first final stages of testing ATM, so this might be an option depending on if you need something *RIGHT now*
2. There is another widget call RoundButton by Eddie Sitarski, I have been working with for adding/fixing to phoenix(also not in standard lib) The classic wx code can be found here.
http://code.activestate.com/recipes/577951-wxpython-dramatic-shaded-3-d-buttons-that-look-lik/
If choosing to go this route then you will want to cut the DC drawing code out, basically draw what you need, make a region modification if you truely want it to be round and position the region("Button") where you need it.
This dc drawing algorithm(completely in code) for this one looks exceptionally nice, but is missing the extra features that other options have as buttons in general.
3. You could use agw Round Button. This one scales and may not be exactly what you are looking for. 1 & 2 would be much nicer looking for an "Orb-look".
4. You could just hack space for a BitmapButton into the DC draw code and call it a day. This would be the easiest of the 4, but wouldn't have a lot of the nicer touches, that which the Microsoft RibbonBar design has.

Personally I don't use the RibbonBar much because I don't really like the style for most project designs, but every once and a while it really is the best widget also, so there are always users end preference.
The Orb is basically the most interesting part of their design in my opinion. If I where to create a modded GUI I would add the "Orb" with the notebook parts and cut the ribbon bar out to a seperate optional addin.
But then again... This would basically be making a new/modded widget for specific purposes.

Hope this helps.

samyak jain

unread,
Feb 13, 2014, 3:02:41 AM2/13/14
to wxpytho...@googlegroups.com, wxPython-users


Dear Metallicow,


Thanks a lot for your reply. I am able to make a dropdown button on left of the first tab without any problem by making the button a child of wxribbon and giving it a fixed position on the GUI.
What I am trying to achieve now is to allow users to be able to drag panels on a page to reorder them according to their need. I am a newbie and I have no idea how to do it. I just need some as guidance as to how to do this. Any help would be great. Thanks. I have attached a simple ribbon code with panels.


self._ribbon = RB.RibbonBar(self, wx.ID_ANY, size = (1368,350), style = RB.RIBBON_BAR_DEFAULT_STYLE | RB.RIBBON_BAR_ALWAYS_SHOW_TABS)

workpiece = RB.RibbonPage(self._ribbon, WORKPIECE, "Workpiece", Bitmap("eye.xpm"))
panel1 = RB.RibbonPanel(workpiece,wx.ID_ANY,"New Block",Bitmap("selection_panel.xpm"))
panel2 = RB.RibbonPanel(workpiece,wx.ID_ANY,"New Block",Bitmap("selection_panel.xpm"))
panel3 = RB.RibbonPanel(workpiece,wx.ID_ANY,"New Block",Bitmap("selection_panel.xpm"))


 

Metallicow

unread,
Feb 13, 2014, 3:02:27 PM2/13/14
to wxpytho...@googlegroups.com, wxPython-users


On Thursday, February 13, 2014 2:02:41 AM UTC-6, samyak jain wrote:

Dear Metallicow,


Thanks a lot for your reply. I am able to make a dropdown button on left of the first tab without any problem by making the button a child of wxribbon and giving it a fixed position on the GUI.
What I am trying to achieve now is to allow users to be able to drag panels on a page to reorder them according to their need. I am a newbie and I have no idea how to do it. I just need some as guidance as to how to do this. Any help would be great. Thanks. I have attached a simple ribbon code with panels.


self._ribbon = RB.RibbonBar(self, wx.ID_ANY, size = (1368,350), style = RB.RIBBON_BAR_DEFAULT_STYLE | RB.RIBBON_BAR_ALWAYS_SHOW_TABS)

workpiece = RB.RibbonPage(self._ribbon, WORKPIECE, "Workpiece", Bitmap("eye.xpm"))
panel1 = RB.RibbonPanel(workpiece,wx.ID_ANY,"New Block",Bitmap("selection_panel.xpm"))
panel2 = RB.RibbonPanel(workpiece,wx.ID_ANY,"New Block",Bitmap("selection_panel.xpm"))
panel3 = RB.RibbonPanel(workpiece,wx.ID_ANY,"New Block",Bitmap("selection_panel.xpm"))


I'm not sure if dragging functionality is built-in with the Ribbon stuff, NotebookTabs or Panels, right at the moment.
Anyway. Look thought the Ribbon Docs and/or the Ribbon source to get a better idea if this can be done without writing any extra custom code.

If the functionality doesn't exist, then you will be looking at writing some custom mouse capture code.
Basically it would be something along these lines.
... CaptureMouse() on the wx.EVT_LEFT_DOWN event for the widget you want to move...
... In the wx.EVT_MOTION event handler you will want to calculate how much the mouse has changed since the left down event...
... then in the wx.EVT_LEFT_UP event handler you will want to ReleaseMouse() and send the widget to the calculated position where you want the panel/notebook tab/whatever to end up as an end result.
Note: This may be past you ability if you are still relatively new to writing custom wx code, but feel free to ask Andrea/Request new features/functionality you want If you find out that they are missing or non-existant.

Hope this helps.
Reply all
Reply to author
Forward
0 new messages