#!/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 network db
"""
def __init__(self, parent):
""" create the db configuration panel for postgres and mysql dbs
"""
super(panel, self).__init__(parent)
parent = self
# ctrls creation
lbl_host = wx.StaticText(parent, -1, _("fac_lbl_host"))
tctrl_host = wx.TextCtrl(parent)
lbl_table = wx.StaticText(parent, -1, _("fac_lbl_table"))
tctrl_table = wx.TextCtrl(parent)
lbl_user = wx.StaticText(parent, -1, _("fac_lbl_user"))
tctrl_user = wx.TextCtrl(parent)
lbl_passwd = wx.StaticText(parent, -1, _("fac_lbl_passwd"))
tctrl_passwd = wx.TextCtrl(parent, style=wx.TE_PASSWORD)
# ctrls layout
sz_net = wx.GridBagSizer()
flg = wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.ALL
sz_net.Add(lbl_host, (0,0), (1,1), flg, 5)
sz_net.Add(tctrl_host, (0,1), (1,1), flg, 5)
sz_net.Add(lbl_table, (0,2), (1,1), flg, 5)
sz_net.Add(tctrl_table, (0,3), (1,1), flg, 5)
sz_net.Add(lbl_user, (1,0), (1,1), flg, 5)
sz_net.Add(tctrl_user, (1,1), (1,1), flg, 5)
sz_net.Add(lbl_passwd, (1,2), (1,1), flg, 5)
sz_net.Add(tctrl_passwd, (1,3), (1,1), flg, 5)
self.SetSizerAndFit(sz_net)
self._lst_widgetd = (tctrl_host, tctrl_table, tctrl_user, tctrl_passwd)
|