Пример #1
0
  def __init__ (self, *args, **kwargs):
    Panel.__init__ (self, *args, **kwargs)
    self.parent = args[0]

    self.sizer = wx.BoxSizer (wx.VERTICAL)

    # TODO verfügbarer Zeitraum sollte validiert werden. Vll.t Lädt man auch einfach alles zu einer Station herunter?!
    self.label = wx.StaticBox (self, -1, "Zeitraum:")
    self.daterange_sizer = wx.StaticBoxSizer (self.label)

    # TODO year validator
    self.txtFrom = wx.TextCtrl (self, -1, "1929")
    self.txtTo = wx.TextCtrl (self, -1, str (CURRENTYEAR))

    self.daterange_sizer.Add (self.txtFrom)
    self.daterange_sizer.Add (self.txtTo)
    self.sizer.Add (self.daterange_sizer)

    self.downloadButton = wx.Button (self, -1, "Daten herunterladen..")
    self.sizer.Add (self.downloadButton)

    self.SetSizer (self.sizer)
    self.sizer.Fit (self)
    self.Bind (wx.EVT_BUTTON, self["Download"], self.downloadButton)
    self.Layout()
Пример #2
0
  def __init__ (self, *args, **kwargs):
    Panel.__init__ (self, *args, **kwargs)
    self.static = wx.StaticBox (self, -1, "Plot")
    self.sizer = wx.StaticBoxSizer (self.static)
    self.parent = args[0]

    self.lctChooseData = dlb.DataListBox (self, COLUMNS)

    sizer_main = wx.StaticBoxSizer(self.static, wx.VERTICAL)
    sizer_main.Add(self.lctChooseData, 3, wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)

    self.SetSizer(sizer_main)
    self.Layout()

    self.searchComplete = False
Пример #3
0
  def __init__ (self, *args, **kwargs):
    Panel.__init__ (self, *args, **kwargs)
    self.parent = args[0]

    self.sizer = wx.BoxSizer (wx.VERTICAL)

    self.noaa = dao.NOAA.getInstance ()

    self.exportButton = wx.Button (self, -1, "Stationen exportieren..")
    self.sizer.Add (self.exportButton)

    self.SetSizer (self.sizer)
    self.sizer.Fit (self)
    self.Bind (wx.EVT_BUTTON, self["Export"], self.exportButton)
    self.Layout()
Пример #4
0
 def __init__(self, *args, **kwargs):
   Panel.__init__ (self, *args, **kwargs)   
   
   # List
   listSizer = wx.BoxSizer(wx.VERTICAL)
   self.list = wx.ListBox(choices=[], parent=self, size=wx.Size(150, 200), validator=NotEmptyListBoxValidator("Please select a plugin."))
   self.list.Bind(wx.EVT_LISTBOX, self["ListSelection"])
   
   listSizer.Add(wx.StaticText(self, -1, "Select Plugin:"), 0, wx.EXPAND, 0)
   listSizer.Add(self.list, 0, wx.EXPAND, 0)
   # Infobox
   info = wx.StaticBox(self, -1, "Plugin Info", size=wx.Size(400,100))
   labelSizer = wx.GridSizer(4, 2, 2, 1)
   
   labelSizer.Add(wx.StaticText(self, -1, "Name: "))
   self.lblName = wx.StaticText(self, -1, "")
   labelSizer.Add(self.lblName)
   
   labelSizer.Add(wx.StaticText(self, -1, "Version: "))
   self.lblVersion = wx.StaticText(self, -1, "")
   labelSizer.Add(self.lblVersion)
   
   labelSizer.Add(wx.StaticText(self, -1, "Author: "))
   self.lblAuthor = wx.StaticText(self, -1, "")
   labelSizer.Add(self.lblAuthor)
   
   labelSizer.Add(wx.StaticText(self, -1, "Description: "))
   self.lblDescription = wx.StaticText(self, -1, "")
   labelSizer.Add(self.lblDescription)
   
   infoSizer = wx.StaticBoxSizer(info, wx.VERTICAL)
   infoSizer.Add(labelSizer, 0, wx.EXPAND, 0)
   
   # put all together
   mainSizer = wx.BoxSizer(wx.HORIZONTAL)
   mainSizer.Add(listSizer, 0, wx.EXPAND, 0)
   mainSizer.Add(infoSizer, 0, wx.EXPAND, 0)
   
   # VerticalSize for btn
   btnSelect = wx.Button (self, -1, "use Plugin")
   btnSelect.Bind(wx.EVT_BUTTON, self["Continue"])
   
   btnSizer = wx.BoxSizer(wx.VERTICAL)
   btnSizer.Add(mainSizer, 0, wx.EXPAND, 0)
   btnSizer.Add(btnSelect, 0, wx.EXPAND, 0)
   
   self.SetSizerAndFit(btnSizer)
Пример #5
0
  def __init__ (self, *args, **kwargs):
    Panel.__init__ (self, *args, **kwargs)
    self.parent = args[0]

    self.static = wx.StaticBox (self, -1, "Plot")
    self.sizer = wx.StaticBoxSizer (self.static)

    # button - plot
    self.plotButton = wx.Button (self, -1, label="Plot")

    self.sizer.Add (self.plotButton, -1)

    self.SetSizer (self.sizer)
    self.parent.Layout ()

    # events
    self.Bind (wx.EVT_BUTTON, self["Plot"], self.plotButton)
Пример #6
0
  def __init__ (self, *args, **kwargs):
    Panel.__init__ (self, *args, **kwargs)
    self.parent = args[0]
    self.results = []

    self.title = wx.StaticBox(self, -1, u"Station wählen")
    self.lctChooseStation = dlb.DataListBox (self, COLUMNS)

    # clear button
    self.clearButton = wx.Button (self, -1, u"Suchergebnisse löschen")
    self.Bind (wx.EVT_BUTTON, self["Clear"], self.clearButton)

    sizer_main = wx.StaticBoxSizer(self.title, wx.VERTICAL)
    sizer_main.Add(self.lctChooseStation, 3, wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
    sizer_main.Add (self.clearButton, 0)

    self.SetSizer(sizer_main)
    self.Layout()

    self.searchComplete = False
Пример #7
0
  def __init__(self, *args, **kwargs):
    Panel.__init__ (self, *args, **kwargs)
    self.noaa = dao.NOAA.getInstance ()

    self.stbSearchBox = wx.StaticBox(self, -1, "Suche")

    # station name
    self.lblStationName = wx.StaticText (self, -1, "Stationsname:")
    # TODO text validator
    self.txtStationName = wx.TextCtrl (self, -1, "")

    # StationNumber
    self.lblStationNumber = wx.StaticText(self, -1, "Stationsnummer:")    
    self.txtStationNumber = wx.TextCtrl(self, -1, "", validator = IntegerValidator())
    
    # id type
    self.selectIDType = wx.RadioBox(self, -1, "USAF", choices=["USAF", "WBAN"], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
    self.lblRegion = wx.StaticText(self, -1, "Region")

    # region
    # TODO die sortierung stimmt noch nicht.
    self.lsbRegion = wx.ComboBox(self, -1, choices=[""], 
        style=wx.CB_DROPDOWN|wx.CB_READONLY|wx.CB_SORT)

    # fill combobox with countries available at NOAA
    # TODO sortieren!
    # TODO sollte das nicht der COntroller machen?
    for item in self.noaa.getCountryList ():
      # we associate each item with the given country code
      self.lsbRegion.Append (' '.join (item)[:COMBOBOX_LIMIT], item[0])

    # latitude/longitude
    self.lblLatLon1 = wx.StaticText(self, -1, "Lat/Lon")
    self.txtLat1 = wx.TextCtrl(self, -1, "", validator = NumberValidator((-90,90)))
    self.txtLon1 = wx.TextCtrl(self, -1, "", validator = NumberValidator((-180,180)))
    self.lblLatLon2 = wx.StaticText(self, -1, "Lat/Lon")
    self.txtLat2 = wx.TextCtrl(self, -1, "", validator = NumberValidator((-90,90)))
    self.txtLon2 = wx.TextCtrl(self, -1, "", validator = NumberValidator((-180,180)))

    # sizer for StationName
    stationNameSizer = wx.BoxSizer (wx.HORIZONTAL)
    stationNameSizer.Add (self.lblStationName, 0,wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) 
    stationNameSizer.Add(self.txtStationName, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0)

    # sizer for StationNumber
    stationNrSizer = wx.BoxSizer(wx.HORIZONTAL)
    stationNrSizer.Add(self.lblStationNumber, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0)
    stationNrSizer.Add(self.txtStationNumber, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0)
    stationNrSizer.Add(self.selectIDType, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0)
    
    # sizer for Region
    regionSizer = wx.BoxSizer(wx.HORIZONTAL)
    regionSizer.Add(self.lblRegion, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 8)
    regionSizer.Add(self.lsbRegion, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
    
    # sizer for coord
    coordSizer = wx.BoxSizer(wx.HORIZONTAL)
    coordSizer.Add(self.lblLatLon1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0)
    coordSizer.Add(self.txtLat1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0)
    coordSizer.Add(self.txtLon1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0)
    coordSizer.Add(self.lblLatLon2, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0)
    coordSizer.Add(self.txtLat2, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0)
    coordSizer.Add(self.txtLon2, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0)

    # combine all
    mainSizer = wx.StaticBoxSizer(self.stbSearchBox, wx.VERTICAL)
    mainSizer.Add (stationNameSizer, 0, wx.EXPAND, 0)
    mainSizer.Add(stationNrSizer, 0, wx.EXPAND, 0)
    mainSizer.Add(regionSizer, 0, wx.EXPAND, 0)
    mainSizer.Add(coordSizer, 0, wx.EXPAND, 0)
    
    self.SetSizer(mainSizer)
    self.Layout()