~ubuntu-branches/ubuntu/raring/wxwidgets2.8/raring

« back to all changes in this revision

Viewing changes to .pc/remove-refs-to-FPB_DEFAULT_STYLE.patch/wxPython/wx/tools/XRCed/plugins/xh_wxlib.py

  • Committer: Package Import Robot
  • Author(s): Benjamin Drung
  • Date: 2012-05-27 17:32:13 UTC
  • mfrom: (5.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20120527173213-e0dcxtnrefaa1if5
Tags: 2.8.12.1-9ubuntu1
* Merge from Debian unstable. Remaining changes:
  - debian/rules: re-enable mediactrl. This allows libwx_gtk2u_media-2.8 to be
    built, as this is required by some applications (LP: #632984)
  - debian/control:
    - Build-dep on libxt-dev, libgstreamer-plugins-base0.10-dev,
      and libgconf2-dev for mediactrl.
    - Add conflict on python-wxgtk2.8 (<< 2.8.12.1-6ubuntu1~) to
      python-wxversion to guarantee upgrade ordering when moving from
      pycentral to dh_python2.
  - Patches
    + fix-bashism-in-example.patch
* Backport patch to fix calling SetMenuBar() twice causes the menubar to not
  resize correctly in GTK. (LP: #996407)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Name:         wxlib.py
 
2
# Purpose:      XML handlers for wx.lib classes
 
3
# Author:       Roman Rolinsky <rolinsky@femagsoft.com>
 
4
# Created:      05.09.2007
 
5
# RCS-ID:       $Id$
 
6
 
 
7
import wx
 
8
import wx.xrc as xrc
 
9
import wx.lib.foldpanelbar as fpb
 
10
from wx.lib.ticker_xrc import wxTickerXmlHandler
 
11
 
 
12
from wx.tools.XRCed.globals import TRACE
 
13
 
 
14
class FoldPanelBarXmlHandler(xrc.XmlResourceHandler):
 
15
    def __init__(self):
 
16
        xrc.XmlResourceHandler.__init__(self)
 
17
        # Standard styles
 
18
        self.AddWindowStyles()
 
19
        # Custom styles
 
20
        self.AddStyle('FPB_DEFAULT_STYLE', fpb.FPB_DEFAULT_STYLE)
 
21
        self.AddStyle('FPB_SINGLE_FOLD', fpb.FPB_SINGLE_FOLD)
 
22
        self.AddStyle('FPB_COLLAPSE_TO_BOTTOM', fpb.FPB_COLLAPSE_TO_BOTTOM)
 
23
        self.AddStyle('FPB_EXCLUSIVE_FOLD', fpb.FPB_EXCLUSIVE_FOLD)
 
24
        self.AddStyle('FPB_HORIZONTAL', fpb.FPB_HORIZONTAL)
 
25
        self.AddStyle('FPB_VERTICAL', fpb.FPB_VERTICAL)
 
26
        self._isInside = False
 
27
        
 
28
    def CanHandle(self,node):
 
29
        return not self._isInside and self.IsOfClass(node, 'wx.lib.foldpanelbar.FoldPanelBar') or \
 
30
               self._isInside and self.IsOfClass(node, 'foldpanel')
 
31
 
 
32
    # Process XML parameters and create the object
 
33
    def DoCreateResource(self):
 
34
        TRACE('DoCreateResource: %s', self.GetClass())
 
35
        if self.GetClass() == 'foldpanel':
 
36
            n = self.GetParamNode('object')
 
37
            if n:
 
38
                old_ins = self._isInside
 
39
                self._isInside = False
 
40
                bar = self._w
 
41
                item = self.CreateResFromNode(n, bar, None)
 
42
                self._isInside = old_ins
 
43
                wnd = item
 
44
                if wnd:
 
45
                    item = bar.AddFoldPanel(self.GetText('label'),
 
46
                                            collapsed=self.GetBool('collapsed'))
 
47
                    bar.AddFoldPanelWindow(item, wnd)
 
48
            return wnd
 
49
        else:
 
50
            w = fpb.FoldPanelBar(self.GetParentAsWindow(),
 
51
                                 self.GetID(),
 
52
                                 self.GetPosition(),
 
53
                                 self.GetSize(),
 
54
                                 self.GetStyle(),
 
55
                                 self.GetStyle('exstyle'))
 
56
            self.SetupWindow(w)
 
57
            self._w = w
 
58
            old_ins = self._isInside
 
59
            self._isInside = True
 
60
            self.CreateChildren(w, True)
 
61
            self._isInside = old_ins
 
62
            return w
 
63