~ubuntu-branches/ubuntu/precise/gnuradio/precise

« back to all changes in this revision

Viewing changes to grc/grc_gnuradio/wxgui/panel.py

  • Committer: Bazaar Package Importer
  • Author(s): Kamal Mostafa
  • Date: 2010-03-13 07:46:01 UTC
  • mfrom: (2.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20100313074601-zjsa893a87bozyh7
Tags: 3.2.2.dfsg-1ubuntu1
* Fix build for Ubuntu lucid (LP: #260406)
  - add binary package dep for libusrp0, libusrp2-0: adduser
  - debian/rules clean: remove pre-built Qt moc files

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2009 Free Software Foundation, Inc.
 
2
#
 
3
# This file is part of GNU Radio
 
4
#
 
5
# GNU Radio is free software; you can redistribute it and/or modify
 
6
# it under the terms of the GNU General Public License as published by
 
7
# the Free Software Foundation; either version 3, or (at your option)
 
8
# any later version.
 
9
#
 
10
# GNU Radio is distributed in the hope that it will be useful,
 
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
# GNU General Public License for more details.
 
14
#
 
15
# You should have received a copy of the GNU General Public License
 
16
# along with GNU Radio; see the file COPYING.  If not, write to
 
17
# the Free Software Foundation, Inc., 51 Franklin Street,
 
18
# Boston, MA 02110-1301, USA.
 
19
#
 
20
 
 
21
import wx
 
22
 
 
23
class Panel(wx.Panel):
 
24
        def __init__(self, parent, orient=wx.VERTICAL):
 
25
                wx.Panel.__init__(self, parent)
 
26
                self._box = wx.BoxSizer(orient)
 
27
                self._grid = wx.GridBagSizer(5, 5)
 
28
                self.Add(self._grid)
 
29
                self.SetSizer(self._box)
 
30
 
 
31
        def GetWin(self): return self
 
32
 
 
33
        def Add(self, win):
 
34
                """
 
35
                Add a window to the wx vbox.
 
36
                @param win the wx window
 
37
                """
 
38
                self._box.Add(win, 0, wx.EXPAND)
 
39
 
 
40
        def GridAdd(self, win, row, col, row_span=1, col_span=1):
 
41
                """
 
42
                Add a window to the wx grid at the given position.
 
43
                @param win the wx window
 
44
                @param row the row specification (integer >= 0)
 
45
                @param col the column specification (integer >= 0)
 
46
                @param row_span the row span specification (integer >= 1)
 
47
                @param col_span the column span specification (integer >= 1)
 
48
                """
 
49
                self._grid.Add(win, wx.GBPosition(row, col), wx.GBSpan(row_span, col_span), wx.EXPAND)