AGW Logo

svn SVN Revision 68881 For foldpanelbar

This file contains the SVN revision history for foldpanelbar, at revision 68881.

Available information include commit date, the name of the committer, the file size, the SVN log messages and a diff from the previous version (if available).


file_info File Information

  • Commit Date: 28-Apr-2009 03:17:40 UTC
  • Committer: AG
  • File Size: 77017 byte(s)

svn_log Log Messages

The following log message was entered by the committer:

  • AGW: General overhaul of the documentation, much improved. All the widgets have their own sample usage in the docs as well;

  • FlatNotebook: Added the FNB_NAV_BUTTONS_WHEN_NEEDED style, which hides the navigation left/right arrows if all tabs fit;

  • RibbonBar: - Added the EVT_RIBBONBAR_TAB_LEFT_DCLICK event, which generates a special event

    when a ribbon bar tab is double-clicked;

    • Added support for toggle buttons;
    • Improved support for ribbon panel sizers: panels with sizers should now automatically minimise at small sizes, and behave properly when popping up from a minimised state;
    • Added tooltips via SetToolTip for those buttons which have the help_string attribute set.
  • XLSGrid: a new widget was added to AGW, termed XLSGrid. It’s based on wx.grid.Grid and can be used to faithfully reproduce the appearance of a Microsoft Excel spreadsheets.


svn_diff Diff To Previous Version (68362)

Version SVN diff:

--- wxPython/3rdParty/AGW/agw/foldpanelbar.py       2011/07/24 21:36:47     68362
+++ wxPython/3rdParty/AGW/agw/foldpanelbar.py       2011/08/25 16:40:17     68881
@@ -3,7 +3,7 @@
# Ported From Jorgen Bodde & Julian Smart (Extended Demo) C++ Code By:
#
# Andrea Gavana, @ 23 Mar 2005
-# Latest Revision: 14 Nov 2010, 12.00 GMT
+# Latest Revision: 17 Aug 2011, 15.00 GMT
#
#
# TODO List
@@ -59,18 +59,18 @@


"""
-FoldPanelBar is a control that contains multiple panels, which can be expanded
+L{FoldPanelBar} is a control that contains multiple panels, which can be expanded
or collapsed.


Description
===========

-The FoldPanelBar is a control that contains multiple panels (of type
+The L{FoldPanelBar} is a control that contains multiple panels (of type
L{FoldPanelItem}) that can be expanded or collapsed. The captionbar of
-the FoldPanelBar can be customized by setting it to a horizontal gradient
+the L{FoldPanelBar} can be customized by setting it to a horizontal gradient
style, vertical gradient style, a single colour, a rectangle or filled
-rectangle. The FoldPanel items can be collapsed in place or to the
+rectangle. The `FoldPanel` items can be collapsed in place or to the
bottom of the control. `wx.Window` derived controls can be added
dynamically, and separated by separator lines.

@@ -78,15 +78,15 @@
How does it work
----------------

-The internals of the FoldPanelBar is a list of L{FoldPanelItem} objects. Through
+The internals of the L{FoldPanelBar} is a list of L{FoldPanelItem} objects. Through
the reference of `FoldPanel` these panels can be controlled by adding new controls
-to a FoldPanel or adding new FoldPanels to the FoldPanelBar.
+to a FoldPanel or adding new FoldPanels to the L{FoldPanelBar}.

The L{CaptionBar} fires events to the parent (container of all panel items) when a
sub-panel needs resizing (either folding or expanding). The fold or expand process
is simply a resize of the panel so it looks like all controls on it are gone. All
controls are still child of the `FoldPanel` they are located on. If they don't
-handle the event (and they won't) then the owner of the FoldPanelBar gets the
+handle the event (and they won't) then the owner of the L{FoldPanelBar} gets the
events.

This is what you need to handle the controls. There isn't much to it just
@@ -111,14 +111,55 @@
* Dragging and dropping the panels;
* Re-ordering the panels (not yet).

+
+Usage
+=====
+
+Usage example::
+
+    import wx
+    import wx.lib.agw.foldpanelbar as fpb
+
+    class MyFrame(wx.Frame):
+
+        def __init__(self, parent):
+
+            wx.Frame.__init__(self, parent, -1, "FoldPanelBar Demo")
+
+            text_ctrl = wx.TextCtrl(self, -1, size=(400, 100), style=wx.TE_MULTILINE)
+
+            panel_bar = fpb.FoldPanelBar(self, -1, agwStyle=fpb.FPB_HORIZONTAL|fpb.FPB_DEFAULT_STYLE)
+
+            fold_panel = panel_bar.AddFoldPanel("Thing")
+            thing = wx.TextCtrl(fold_panel, -1, size=(400, -1), style=wx.TE_MULTILINE)
+
+            panel_bar.AddFoldPanelWindow(fold_panel, thing)
+
+            main_sizer = wx.BoxSizer(wx.HORIZONTAL)
+            main_sizer.Add(text_ctrl, 1, wx.EXPAND)
+            main_sizer.Add(panel_bar, 0, wx.EXPAND)
+            self.SetSizer(main_sizer)
+
+
+    # our normal wxApp-derived class, as usual
+
+    app = wx.PySimpleApp()
+
+    frame = MyFrame(None)
+    app.SetTopWindow(frame)
+    frame.Show()
+
+    app.MainLoop()
+
+

Supported Platforms
===================

-FoldPanelBar is supported on the following platforms:
+L{FoldPanelBar} is supported on the following platforms:
* Windows (Verified on Windows XP, 2000)
* Linux/Unix (GTK2) (Thanks to Toni Brkic and Robin Dunn)
-  * Mac OSX (Thanks to Robin Dunn for the CaptionBar size patch)
+  * Mac OSX (Thanks to Robin Dunn for the L{CaptionBar} size patch)


Window Styles
@@ -129,11 +170,11 @@
========================== =========== ==================================================
Window Styles              Hex Value   Description
========================== =========== ==================================================
-``FPB_SINGLE_FOLD``                0x1 Single fold forces other panels to close when they are open, and only opens the current panel. This will allow the open panel to gain the full size left in the client area. This is an extra style.
-``FPB_COLLAPSE_TO_BOTTOM``         0x2 All panels are stacked to the bottom. When they are expanded again they show up at the top. This is an extra style.
-``FPB_EXCLUSIVE_FOLD``             0x4 ``FPB_SINGLE_FOLD`` style plus the panels will be stacked at the bottom.  This is an extra style.
-``FPB_HORIZONTAL``                 0x8 `FoldPanelBar` will be horizontal.
-``FPB_VERTICAL``                  0x10 `FoldPanelBar` will be vertical.
+``FPB_SINGLE_FOLD``                0x1 Single fold forces other panels to close when they are open, and only opens the current panel. This will allow the open panel to gain the full size left in the client area.
+``FPB_COLLAPSE_TO_BOTTOM``         0x2 All panels are stacked to the bottom. When they are expanded again they show up at the top.
+``FPB_EXCLUSIVE_FOLD``             0x4 ``FPB_SINGLE_FOLD`` style plus the panels will be stacked at the bottom.
+``FPB_HORIZONTAL``                 0x8 L{FoldPanelBar} will be horizontal.
+``FPB_VERTICAL``                  0x10 L{FoldPanelBar} will be vertical.
========================== =========== ==================================================


@@ -145,16 +186,16 @@
================== ==================================================
Event Name         Description
================== ==================================================
-``EVT_CAPTIONBAR`` The user has pressed the caption bar: `FoldPanelBar` will either expand or collapse the underlying panel.
+``EVT_CAPTIONBAR`` The user has pressed the caption bar: L{FoldPanelBar} will either expand or collapse the underlying panel.
================== ==================================================


License And Version
===================

-FoldPanelBar is distributed under the wxPython license.
+L{FoldPanelBar} is distributed under the wxPython license.

-Latest Revision: Andrea Gavana @ 27 Nov 2009, 15.00 GMT
+Latest Revision: Andrea Gavana @ 17 Aug 2011, 15.00 GMT

Version 0.5

@@ -209,25 +250,24 @@
FPB_SINGLE_FOLD = 0x0001
""" Single fold forces other panels to close when they are open, and only opens""" \
""" the current panel. This will allow the open panel to gain the full size left""" \
-""" in the client area. This is an extra style. """
+""" in the client area."""

# All panels are stacked to the bottom. When they are expanded again they
# show up at the top
FPB_COLLAPSE_TO_BOTTOM = 0x0002
""" All panels are stacked to the bottom. When they are expanded again they show""" \
-""" up at the top. This is an extra style. """
+""" up at the top. """

# Now supported! Single fold plus panels
# will be stacked at the bottom
FPB_EXCLUSIVE_FOLD = 0x0004
-""" ``FPB_SINGLE_FOLD`` style plus the panels will be stacked at the bottom. """ \
-""" This is an extra style. """
+""" ``FPB_SINGLE_FOLD`` style plus the panels will be stacked at the bottom. """

# Orientation Flag
FPB_HORIZONTAL = 0x0008
-""" `FoldPanelBar` will be horizontal. """
+""" L{FoldPanelBar} will be horizontal. """
FPB_VERTICAL = 0x0010
-""" `FoldPanelBar` will be vertical. """
+""" L{FoldPanelBar} will be vertical. """

# FoldPanelItem default settings
FPB_ALIGN_LEFT = 0
@@ -465,7 +505,7 @@
#-----------------------------------#
wxEVT_CAPTIONBAR = wx.NewEventType()
EVT_CAPTIONBAR = wx.PyEventBinder(wxEVT_CAPTIONBAR, 0)
-""" The user has pressed the caption bar: `FoldPanelBar` will either expand or""" \
+""" The user has pressed the caption bar: L{FoldPanelBar} will either expand or""" \
""" collapse the underlying panel. """

# Define Empty CaptionBar Style
@@ -544,7 +584,7 @@
This class is a graphical caption component that consists of a
caption and a clickable arrow.

-    The CaptionBar fires an event ``EVT_CAPTIONBAR`` which is a
+    The L{CaptionBar} fires an event ``EVT_CAPTIONBAR`` which is a
L{CaptionBarEvent}. This event can be caught and the parent window
can act upon the collapsed or expanded state of the bar (which is
actually just the icon which changed). The parent panel can
@@ -916,6 +956,8 @@
"""
Returns the best size for this panel, based upon the font
assigned to this window, and the caption string.
+
+        :note: Overridden from `wx.Window`.
"""

if self.IsVertical():
@@ -1130,7 +1172,7 @@

class FoldPanelBar(wx.Panel):
"""
-    The FoldPanelBar is a class which can maintain a list of
+    The L{FoldPanelBar} is a class which can maintain a list of
collapsible panels. Once a panel is collapsed, only it's caption
bar is visible to the user. This will provide more space for the
other panels, or allow the user to close panels which are not used
@@ -1277,7 +1319,7 @@

:note: Make the window be a child of the fold panel!

-         The following example adds a FoldPanel to the FoldPanelBar and
+         The following example adds a FoldPanel to the L{FoldPanelBar} and
adds two `wx.Window` derived controls to the FoldPanel::

# Create the FoldPanelBar
Tree