#!/usr/bin/env python
# -*- coding: utf-8 -*-
import wx
from library import i18n
from pnl_common import CommonPanel
_ = i18n.i18n()
class panel(CommonPanel):
""" Panel that represent a file db
"""
def __init__(self, parent):
"""create the db configuration panel for local dbs
"""
super(panel, self).__init__(parent)
parent = self
# ctrls creation
lbl_path = wx.StaticText(parent, -1, _("fac_lbl_path"))
self._tctrl_path = wx.TextCtrl(parent, size=(150, -1))
bt_path = wx.Button(parent, -1, _("search"))
bt_path.Bind(wx.EVT_BUTTON, self._onPath)
# ctrls layout
sz_file = wx.BoxSizer()
flg = wx.ALIGN_CENTER | wx.ALL
sz_file.Add(lbl_path, 0, flg, 5)
sz_file.Add(self._tctrl_path, 0, flg, 5)
sz_file.Add(bt_path, 0, flg, 5)
self.SetSizerAndFit(sz_file)
self._lst_widgetd = (self._tctrl_path,)
def _onPath(self, evt):
"""
"""
dlg = wx.FileDialog(self)
if dlg.ShowModal() == wx.ID_OK:
self._tctrl_path.SetValue( dlg.GetPath() )
dlg.Destroy()
|