#Boa:FramePanel:panel
# -*- coding: utf-8 -*-
#
# hylaPEx, an hylafax client written in python
#
# www.unipex.it/hylapex/
#
# License:
# GNU General Public License (GPL)
# For more info see LICENSE.txt and LICENSE-GPL.txt
#
# Copyright (C) 2004-2006 Unipex s.r.l., All Rights Reserved.
# Via Vittorio Veneto 83/A
# 33050 Gonars (UD) - Italy
# phone 0039 0432 931511 - fax 0039 0432 931378
# www.unipex.it - michele.petrazzo@unipex.it
import wx
[wxID_PANEL, wxID_PANELBOX_FILTER, wxID_PANELBOX_OTHER, wxID_PANELBT_ALL_VIEW,
wxID_PANELCHK_FILTER_DONE, wxID_PANELCHK_FILTER_RECEIVE,
wxID_PANELCHK_FILTER_SEND, wxID_PANELCHK_LOCAL_TIME_ZONE,
wxID_PANELCHK_NEW_FAX, wxID_PANELCHK_PB_THREAD, wxID_PANELCHK_SEND_MESSAGE,
wxID_PANELCHK_VIEW_RECEIVE, wxID_PANELCHO_STATE_CONTROL,
wxID_PANELLBL_CONTROL_STATE_SEND, wxID_PANELLBL_DAYS,
wxID_PANELLBL_FILTER_DONE, wxID_PANELLBL_FILTER_NUMBER,
wxID_PANELLBL_FILTER_RECEIVE, wxID_PANELLBL_FILTER_SEND,
wxID_PANELLBL_FILTER_THIS_VIEW, wxID_PANELLBL_NEW_FAX,
wxID_PANELLBL_PB_THREAD, wxID_PANELLBL_TIME_ZONE, wxID_PANELLBL_VIEW_RECEIVE,
wxID_PANELTXT_FILTER_DAYS, wxID_PANELTXT_FILTER_NUMBER,
] = [wx.NewId() for _init_ctrls in range(26)]
class panel(wx.Panel):
def _init_ctrls(self, prnt):
# generated method, don't edit
wx.Panel.__init__(self, id=wxID_PANEL, name='panel', parent=prnt,
pos=wx.Point(349, 380), size=wx.Size(450, 239),
style=wx.TAB_TRAVERSAL)
self.SetClientSize(wx.Size(442, 212))
self.SetToolTipString('')
self.Enable(True)
self.lbl_control_state_send = wx.StaticText(id=wxID_PANELLBL_CONTROL_STATE_SEND,
label='State control of send fax', name='lbl_control_state_send',
parent=self, pos=wx.Point(80, 139), size=wx.Size(115, 13),
style=0)
self.lbl_control_state_send.SetToolTipString('')
self.lbl_control_state_send.Bind(wx.EVT_LEFT_DOWN,
self.OnLbl_control_state_sendLeftDown)
self.lbl_filter_number = wx.StaticText(id=wxID_PANELLBL_FILTER_NUMBER,
label='Number', name='lbl_filter_number', parent=self,
pos=wx.Point(32, 32), size=wx.Size(48, 13), style=0)
self.lbl_filter_number.SetToolTipString('')
self.lbl_days = wx.StaticText(id=wxID_PANELLBL_DAYS, label='Days',
name='lbl_days', parent=self, pos=wx.Point(32, 56),
size=wx.Size(24, 13), style=0)
self.chk_filter_send = wx.CheckBox(id=wxID_PANELCHK_FILTER_SEND,
label='', name='chk_filter_send', parent=self, pos=wx.Point(336,
32), size=wx.Size(16, 13), style=0)
self.chk_filter_send.SetValue(False)
self.chk_filter_send.SetBackgroundColour(wx.Colour(225, 225, 225))
self.chk_filter_send.SetToolTipString('')
self.chk_filter_receive = wx.CheckBox(id=wxID_PANELCHK_FILTER_RECEIVE,
label='', name='chk_filter_receive', parent=self,
pos=wx.Point(336, 48), size=wx.Size(16, 13), style=0)
self.chk_filter_receive.SetValue(False)
self.chk_filter_receive.SetBackgroundColour(wx.Colour(225, 225, 225))
self.chk_filter_receive.SetToolTipString('')
self.chk_filter_done = wx.CheckBox(id=wxID_PANELCHK_FILTER_DONE,
label='', name='chk_filter_done', parent=self, pos=wx.Point(336,
64), size=wx.Size(16, 13), style=0)
self.chk_filter_done.SetValue(False)
self.chk_filter_done.SetBackgroundColour(wx.Colour(225, 225, 225))
self.chk_filter_done.SetToolTipString('')
self.lbl_filter_this_view = wx.StaticText(id=wxID_PANELLBL_FILTER_THIS_VIEW,
label='Filter this view', name='lbl_filter_this_view',
parent=self, pos=wx.Point(216, 48), size=wx.Size(66, 13),
style=0)
self.lbl_new_fax = wx.StaticText(id=wxID_PANELLBL_NEW_FAX,
label='New fax receive control', name='lbl_new_fax', parent=self,
pos=wx.Point(80, 112), size=wx.Size(112, 13), style=0)
self.lbl_new_fax.SetToolTipString('')
self.lbl_new_fax.Bind(wx.EVT_LEFT_DOWN, self.OnLbl_new_faxLeftDown)
self.lbl_filter_send = wx.StaticText(id=wxID_PANELLBL_FILTER_SEND,
label='Send view', name='lbl_filter_send', parent=self,
pos=wx.Point(360, 32), size=wx.Size(50, 13), style=0)
self.lbl_filter_send.Bind(wx.EVT_LEFT_DOWN,
self.OnLbl_filter_sendLeftDown)
self.lbl_filter_receive = wx.StaticText(id=wxID_PANELLBL_FILTER_RECEIVE,
label='Receive view', name='lbl_filter_receive', parent=self,
pos=wx.Point(360, 48), size=wx.Size(65, 13), style=0)
self.lbl_filter_receive.Bind(wx.EVT_LEFT_DOWN,
self.OnLbl_filter_receiveLeftDown)
self.lbl_filter_done = wx.StaticText(id=wxID_PANELLBL_FILTER_DONE,
label='Done view', name='lbl_filter_done', parent=self,
pos=wx.Point(360, 64), size=wx.Size(51, 13), style=0)
self.lbl_filter_done.Bind(wx.EVT_LEFT_DOWN,
self.OnLbl_filter_doneLeftDown)
self.txt_filter_number = wx.TextCtrl(id=wxID_PANELTXT_FILTER_NUMBER,
name='txt_filter_number', parent=self, pos=wx.Point(80, 32),
size=wx.Size(100, 21), style=0, value='')
self.txt_filter_days = wx.TextCtrl(id=wxID_PANELTXT_FILTER_DAYS,
name='txt_filter_days', parent=self, pos=wx.Point(80, 56),
size=wx.Size(100, 21), style=0, value='')
self.box_other = wx.StaticBox(id=wxID_PANELBOX_OTHER, label='Other',
name='box_other', parent=self, pos=wx.Point(8, 96),
size=wx.Size(424, 112), style=0)
self.box_other.SetToolTipString('')
self.box_filter = wx.StaticBox(id=wxID_PANELBOX_FILTER,
label='Show only - filter number of fax', name='box_filter',
parent=self, pos=wx.Point(8, 8), size=wx.Size(424, 80), style=0)
self.box_filter.SetToolTipString('')
self.bt_all_view = wx.Button(id=wxID_PANELBT_ALL_VIEW,
label='All fax view', name='bt_all_view', parent=self,
pos=wx.Point(264, 108), size=wx.Size(75, 23), style=0)
self.bt_all_view.SetToolTipString('')
self.bt_all_view.Bind(wx.EVT_BUTTON, self.OnBt_all_viewButton,
id=wxID_PANELBT_ALL_VIEW)
self.chk_send_message = wx.CheckBox(id=wxID_PANELCHK_SEND_MESSAGE,
label='', name='chk_send_message', parent=self, pos=wx.Point(48,
140), size=wx.Size(16, 13), style=0)
self.chk_send_message.SetValue(False)
self.chk_send_message.SetToolTipString('')
self.chk_send_message.Bind(wx.EVT_CHECKBOX,
self.OnChk_send_messageCheckbox, id=wxID_PANELCHK_SEND_MESSAGE)
self.chk_new_fax = wx.CheckBox(id=wxID_PANELCHK_NEW_FAX, label='',
name='chk_new_fax', parent=self, pos=wx.Point(48, 112),
size=wx.Size(16, 13), style=0)
self.chk_new_fax.SetBackgroundColour(wx.Colour(225, 225, 225))
self.chk_new_fax.SetValue(False)
self.chk_new_fax.SetToolTipString('')
self.cho_state_control = wx.Choice(choices=[],
id=wxID_PANELCHO_STATE_CONTROL, name='cho_state_control',
parent=self, pos=wx.Point(248, 136), size=wx.Size(96, 21),
style=0)
self.cho_state_control.SetToolTipString('')
self.cho_state_control.Enable(False)
self.chk_view_receive = wx.CheckBox(id=wxID_PANELCHK_VIEW_RECEIVE,
label='', name='chk_view_receive', parent=self, pos=wx.Point(48,
165), size=wx.Size(16, 13), style=0)
self.chk_view_receive.SetValue(False)
self.lbl_view_receive = wx.StaticText(id=wxID_PANELLBL_VIEW_RECEIVE,
label='Disable view fax received', name='lbl_view_receive',
parent=self, pos=wx.Point(82, 165), size=wx.Size(121, 13),
style=0)
self.lbl_view_receive.Bind(wx.EVT_LEFT_DOWN,
self.OnLbl_view_receiveLeftDown)
self.chk_pb_thread = wx.CheckBox(id=wxID_PANELCHK_PB_THREAD, label='',
name='chk_pb_thread', parent=self, pos=wx.Point(48, 189),
size=wx.Size(16, 13), style=0)
self.chk_pb_thread.SetValue(False)
self.chk_pb_thread.SetToolTipString('')
self.lbl_pb_thread = wx.StaticText(id=wxID_PANELLBL_PB_THREAD,
label='Phonebook thread', name='lbl_pb_thread', parent=self,
pos=wx.Point(80, 188), size=wx.Size(88, 13), style=0)
self.chk_local_time_zone = wx.CheckBox(id=wxID_PANELCHK_LOCAL_TIME_ZONE,
label=u'', name=u'chk_local_time_zone', parent=self,
pos=wx.Point(248, 189), size=wx.Size(16, 13), style=0)
self.chk_local_time_zone.SetValue(False)
self.chk_local_time_zone.SetToolTipString(u'')
self.lbl_time_zone = wx.StaticText(id=wxID_PANELLBL_TIME_ZONE,
label=u'Use local Time zone', name=u'lbl_time_zone', parent=self,
pos=wx.Point(272, 188), size=wx.Size(120, 13), style=0)
self.lbl_time_zone.SetToolTipString(u'')
def __init__(self, parent, val_pass, all_fax_view):
self._init_ctrls(parent)
self.paths, self.ren, self.opt_cls = val_pass
self.all_fax_view = all_fax_view
def ctrlWidgetsStatus(self):
#Enable or disable the controls
self.cho_state_control.Enable(
self.opt_cls.getint('chk_send_message'))
def OnLbl_new_faxLeftDown(self, event):
if self.chk_new_fax.GetValue():
self.chk_new_fax.SetValue(False)
else:
self.chk_new_fax.SetValue(True)
def OnLbl_filter_sendLeftDown(self, event):
if self.chk_filter_send.GetValue():
self.chk_filter_send.SetValue(False)
else:
self.chk_filter_send.SetValue(True)
def OnLbl_filter_receiveLeftDown(self, event):
if self.chk_filter_receive.GetValue():
self.chk_filter_receive.SetValue(False)
else:
self.chk_filter_receive.SetValue(True)
def OnLbl_filter_doneLeftDown(self, event):
if self.chk_filter_done.GetValue():
self.chk_filter_done.SetValue(False)
else:
self.chk_filter_done.SetValue(True)
def OnBt_all_viewButton(self, event):
if self.chk_new_fax.GetValue():
self.all_fax_view()
event.Skip()
def OnChk_send_messageCheckbox(self, event):
if not event.IsChecked():
self.cho_state_control.Enable(False)
else:
self.cho_state_control.Enable(True)
def OnLbl_control_state_sendLeftDown(self, event):
if self.chk_send_message.GetValue():
self.chk_send_message.SetValue(0)
self.cho_state_control.Enable(False)
else:
self.chk_send_message.SetValue(1)
self.cho_state_control.Enable(True)
def OnLbl_view_receiveLeftDown(self, event):
print 1
if self.chk_view_receive.GetValue():
self.chk_view_receive.SetValue(0)
else:
self.chk_view_receive.SetValue(1)
|