1 # Copyright 2009 Free Software Foundation, Inc.
3 # This file is part of GNU Radio
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)
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.
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.
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)
29 self.SetSizer(self._box)
31 def GetWin(self): return self
35 Add a window to the wx vbox.
36 @param win the wx window
38 self._box.Add(win, 0, wx.EXPAND)
40 def GridAdd(self, win, row, col, row_span=1, col_span=1):
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)
49 self._grid.Add(win, wx.GBPosition(row, col), wx.GBSpan(row_span, col_span), wx.EXPAND)