def __init__(self, parent, txts, lbls, flds, grids): wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.Size(500, 700), style=wx.TAB_TRAVERSAL) self.inum = adad.Adaad(1, '') Main = wx.BoxSizer(wx.VERTICAL) self.txts = txts self.lbls = lbls self.flds = flds self.grids = grids if 1: self.buffer = wx.EmptyBitmap(500, 700) dc = wx.BufferedDC(None, self.buffer) dc.SetBackground(wx.Brush(self.GetBackgroundColour())) dc.Clear() self.DoDrawing(dc) self.SetSizer(Main) self.Layout() #self.SetLayoutDirection(2) self.Bind(wx.EVT_PAINT, self.OnPaint)
def __init__(self, parent, data): wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.Size(252, 436), style=wx.TAB_TRAVERSAL) self.SetFont(wx.Font(11, 74, 90, 92, False, FONT_TYPE)) self.inum = adad.Adaad(1, '') Vsz1 = wx.BoxSizer(wx.VERTICAL) Hsz1 = wx.BoxSizer(wx.VERTICAL) self.txt1 = wx.StaticText(self, wx.ID_ANY, u"لیست مشتریان", wx.DefaultPosition, wx.DefaultSize, 0) self.txt1.Wrap(-1) Hsz1.Add(self.txt1, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 5) Vsz1.Add(Hsz1, 0, wx.EXPAND, 5) Hsz2 = wx.BoxSizer(wx.VERTICAL) self.DVLC1 = wx.dataview.DataViewListCtrl( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.dataview.DV_HORIZ_RULES | wx.dataview.DV_ROW_LINES | wx.dataview.DV_VERT_RULES) self.Col1 = self.DVLC1.AppendTextColumn(u"کد") self.Col2 = self.DVLC1.AppendTextColumn(u"نام مشتری") self.Col3 = self.DVLC1.AppendTextColumn(u"تلفن ") Hsz2.Add(self.DVLC1, 1, wx.ALL | wx.EXPAND, 5) Vsz1.Add(Hsz2, 1, wx.EXPAND, 5) Hsz3 = wx.BoxSizer(wx.VERTICAL) self.btn = wx.Button(self, wx.ID_ANY, u"انتخاب", wx.DefaultPosition, wx.DefaultSize, 0) Hsz3.Add(self.btn, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 5) Vsz1.Add(Hsz3, 0, wx.EXPAND, 5) #for itemvalues in data: # self.DVLC1.AppendItem(itemvalues) for d in data: d = (self.inum.e2f2(d[0]), d[1], self.inum.e2f2(d[2])) self.DVLC1.AppendItem(d) self.idata = data for c in self.DVLC1.Columns: c.Sortable = True c.Reorderable = True self.SetSizer(Vsz1) self.Layout() # Connect Events self.Bind(wx.dataview.EVT_DATAVIEW_ITEM_ACTIVATED, self.getacc, id=wx.ID_ANY) self.btn.Bind(wx.EVT_BUTTON, self.selct)
def __init__(self, parent): wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.Size(860, 503), style=wx.TAB_TRAVERSAL) self.iMolk = DG.GetData(u'', u'') self.inum = adad.Adaad(1, '') self.SetFont(wx.Font(FONT_SIZE, 70, 90, 92, False, FONT_TYPE)) Vsz1 = wx.BoxSizer(wx.VERTICAL) Vsz2 = wx.BoxSizer(wx.HORIZONTAL) self.srcbtn = wx.Button(self, wx.ID_ANY, u"جستجو", wx.DefaultPosition, wx.DefaultSize, 0) Vsz2.Add(self.srcbtn, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) self.txt1 = wx.StaticText(self, wx.ID_ANY, u"دفتر املاک", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTRE) self.txt1.Wrap(-1) self.txt1.SetFont(wx.Font(19, 70, 90, 90, False, wx.EmptyString)) Vsz2.Add( self.txt1, 1, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 5) self.clsbtn = wx.Button(self, wx.ID_ANY, u"بستن", wx.DefaultPosition, wx.DefaultSize, 0) Vsz2.Add(self.clsbtn, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) Vsz1.Add(Vsz2, 0, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 5) Vsz3 = wx.BoxSizer(wx.VERTICAL) chs1Choices = [u"فروش", u"رهن", u"رهن اجاره"] self.chs1 = wx.Choice(self, wx.ID_ANY, wx.DefaultPosition, wx.Size(95, -1), chs1Choices, 0) self.chs1.SetSelection(0) Vsz3.Add(self.chs1, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 5) #chs2Choices = [ u"آپارتمان", u"ویلائی", u"مغازه", u"زمین" ] chs2Choices = [] imtype = self.iMolk.gMltype() for t in imtype: chs2Choices.append(t[1]) self.chs2 = wx.Choice(self, wx.ID_ANY, wx.DefaultPosition, wx.Size(95, -1), chs2Choices, 0) self.chs2.SetSelection(0) Vsz3.Add(self.chs2, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 5) Vsz1.Add(Vsz3, 0, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 5) self.pnl1 = wx.Panel(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.RAISED_BORDER) Hsz3 = wx.BoxSizer(wx.HORIZONTAL) Vsz30 = wx.BoxSizer(wx.VERTICAL) self.fld9 = wx.TextCtrl(self.pnl1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(92, -1), wx.TE_RIGHT) self.fld9.SetLayoutDirection(2) Vsz30.Add(self.fld9, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) self.fld8 = wx.TextCtrl(self.pnl1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(92, -1), wx.TE_RIGHT) self.fld8.SetLayoutDirection(2) Vsz30.Add(self.fld8, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) Hsz3.Add(Vsz30, 0, wx.EXPAND, 5) Vsz31 = wx.BoxSizer(wx.VERTICAL) self.txt9 = wx.StaticText(self.pnl1, wx.ID_ANY, u"مبلغ کل از", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTRE) self.txt9.Wrap(-1) Vsz31.Add(self.txt9, 1, wx.ALL | wx.EXPAND, 5) self.txt8 = wx.StaticText(self.pnl1, wx.ID_ANY, u"تا", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_LEFT) self.txt8.Wrap(-1) Vsz31.Add( self.txt8, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 5) Hsz3.Add(Vsz31, 0, wx.EXPAND, 5) Vsz32 = wx.BoxSizer(wx.VERTICAL) self.fld7 = wx.TextCtrl(self.pnl1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(92, -1), wx.TE_RIGHT) self.fld7.SetLayoutDirection(2) Vsz32.Add(self.fld7, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) self.fld6 = wx.TextCtrl(self.pnl1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(92, -1), wx.TE_RIGHT) self.fld6.SetLayoutDirection(2) Vsz32.Add(self.fld6, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) Hsz3.Add(Vsz32, 0, wx.EXPAND, 5) Vsz33 = wx.BoxSizer(wx.VERTICAL) self.txt7 = wx.StaticText(self.pnl1, wx.ID_ANY, u"متري از", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTRE) self.txt7.Wrap(-1) Vsz33.Add(self.txt7, 1, wx.ALL | wx.EXPAND, 5) self.txt6 = wx.StaticText(self.pnl1, wx.ID_ANY, u"تا", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_LEFT) self.txt6.Wrap(-1) Vsz33.Add( self.txt6, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 5) Hsz3.Add(Vsz33, 0, wx.EXPAND, 5) Vsz34 = wx.BoxSizer(wx.VERTICAL) self.fld5 = wx.TextCtrl(self.pnl1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(80, -1), wx.TE_RIGHT) self.fld5.SetLayoutDirection(2) Vsz34.Add(self.fld5, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 5) self.fld4 = wx.TextCtrl(self.pnl1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(80, -1), wx.TE_RIGHT) self.fld4.SetLayoutDirection(2) Vsz34.Add(self.fld4, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 5) Hsz3.Add(Vsz34, 0, wx.EXPAND, 5) Vsz35 = wx.BoxSizer(wx.VERTICAL) self.txt5 = wx.StaticText(self.pnl1, wx.ID_ANY, u"متراژ از", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTRE) self.txt5.Wrap(-1) Vsz35.Add( self.txt5, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_CENTER_HORIZONTAL | wx.EXPAND, 5) self.txt4 = wx.StaticText(self.pnl1, wx.ID_ANY, u"تا", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_LEFT) self.txt4.Wrap(-1) Vsz35.Add(self.txt4, 1, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL | wx.EXPAND, 5) Hsz3.Add(Vsz35, 0, wx.EXPAND, 5) Vsz36 = wx.BoxSizer(wx.VERTICAL) self.fld3 = wx.TextCtrl(self.pnl1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(80, -1), 0) Vsz36.Add(self.fld3, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 5) self.fld2 = wx.TextCtrl(self.pnl1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(80, -1), wx.TE_RIGHT) self.fld2.SetLayoutDirection(2) Vsz36.Add(self.fld2, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 5) Hsz3.Add(Vsz36, 1, wx.EXPAND, 5) Vsz37 = wx.BoxSizer(wx.VERTICAL) self.txt3 = wx.StaticText(self.pnl1, wx.ID_ANY, u"تعداد خواب", wx.DefaultPosition, wx.DefaultSize, 0) self.txt3.Wrap(-1) Vsz37.Add(self.txt3, 1, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL | wx.EXPAND, 5) self.txt2 = wx.StaticText(self.pnl1, wx.ID_ANY, u"قدمت", wx.DefaultPosition, wx.DefaultSize, 0) self.txt2.Wrap(-1) Vsz37.Add(self.txt2, 1, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL | wx.EXPAND, 5) Hsz3.Add(Vsz37, 1, wx.EXPAND, 5) Hsz3.AddSpacer((0, 0), 1, wx.EXPAND, 5) Box1Choices = [u"همه"] imantgh = self.iMolk.gMntgh() for m in imantgh: Box1Choices.append(m[1]) self.Box1 = wx.ComboBox(self.pnl1, wx.ID_ANY, u"همه", wx.DefaultPosition, wx.Size(90, -1), Box1Choices, 0) self.Box1.SetSelection(0) Hsz3.Add(self.Box1, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) self.txt1 = wx.StaticText(self.pnl1, wx.ID_ANY, u"نام منطقه", wx.DefaultPosition, wx.DefaultSize, 0) self.txt1.Wrap(-1) Hsz3.Add(self.txt1, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) self.pnl1.SetSizer(Hsz3) self.pnl1.Layout() Hsz3.Fit(self.pnl1) Vsz1.Add(self.pnl1, 0, wx.EXPAND | wx.ALL, 5) Vsz4 = wx.BoxSizer(wx.VERTICAL) self.DVLC1 = wx.dataview.DataViewListCtrl( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.dataview.DV_HORIZ_RULES | wx.dataview.DV_ROW_LINES | wx.dataview.DV_VERT_RULES | wx.STATIC_BORDER) self.Column1 = self.DVLC1.AppendTextColumn(u"قيمت", width=92, align=wx.ALIGN_LEFT) self.Column2 = self.DVLC1.AppendTextColumn(u"متري", width=92, align=wx.ALIGN_LEFT) self.Column3 = self.DVLC1.AppendTextColumn(u"تعداد خواب", width=72, align=wx.ALIGN_LEFT) self.Column4 = self.DVLC1.AppendTextColumn(u"قدمت", width=42, align=wx.ALIGN_LEFT) self.Column5 = self.DVLC1.AppendTextColumn(u"مفید", width=52, align=wx.ALIGN_LEFT) self.Column6 = self.DVLC1.AppendTextColumn(u"متراژ", width=52, align=wx.ALIGN_LEFT) self.Column7 = self.DVLC1.AppendTextColumn(u"آدرس", width=220, align=wx.ALIGN_RIGHT) self.Column8 = self.DVLC1.AppendTextColumn(u"منطقه", width=70, align=wx.ALIGN_RIGHT) self.Column9 = self.DVLC1.AppendTextColumn(u"نام ملک", width=80, align=wx.ALIGN_RIGHT) self.Column10 = self.DVLC1.AppendTextColumn(u"کد ملک", width=60) Vsz4.Add(self.DVLC1, 1, wx.ALL | wx.EXPAND, 5) Vsz1.Add(Vsz4, 1, wx.EXPAND, 5) self.sql1 = u" where Molks.Res = 1 " self.sql2 = u" and Molks.Mtype = 0 " self.loadata() for c in self.DVLC1.Columns: c.Sortable = True c.Reorderable = True self.Column1.Sortable = False self.Column2.Sortable = False #self.Column3.Sortable = False #self.Column4.Sortable = False self.SetSizer(Vsz1) self.Layout() # Connect Events self.srcbtn.Bind(wx.EVT_BUTTON, self.srchit) self.clsbtn.Bind(wx.EVT_BUTTON, self.retit) self.chs1.Bind(wx.EVT_CHOICE, self.resit) self.chs2.Bind(wx.EVT_CHOICE, self.typit) self.fld9.Bind(wx.EVT_TEXT, self.mbl1) self.fld8.Bind(wx.EVT_TEXT, self.mbl2) self.fld7.Bind(wx.EVT_TEXT, self.mbl1) self.fld6.Bind(wx.EVT_TEXT, self.mbl2) self.fld5.Bind(wx.EVT_TEXT, self.mtr1) self.fld4.Bind(wx.EVT_TEXT, self.mtr2) self.fld3.Bind(wx.EVT_TEXT, self.inroom) self.fld2.Bind(wx.EVT_TEXT, self.inbuld) self.Box1.Bind(wx.EVT_COMBOBOX, self.areas) self.Bind(wx.dataview.EVT_DATAVIEW_COLUMN_REORDERED, self.ordr, id=wx.ID_ANY) self.Bind(wx.dataview.EVT_DATAVIEW_COLUMN_SORTED, self.Sort, id=wx.ID_ANY) self.Bind(wx.dataview.EVT_DATAVIEW_ITEM_ACTIVATED, self.Rmolk, id=wx.ID_ANY)
def __init__( self, parent, lbl ,lst , txt ): wx.Panel.__init__ ( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 523,305 ), style = wx.TAB_TRAVERSAL ) self.SetLayoutDirection(2) self.nmbr = adad.Adaad(1,u'') self.iCash = DG.GetData(u'',u'') self.jCash = DG.SetData(u'',u'') Vsz1 = wx.BoxSizer( wx.VERTICAL ) Hsz1 = wx.BoxSizer( wx.HORIZONTAL ) self.labl1 = wx.StaticText( self, wx.ID_ANY, lbl[0], wx.DefaultPosition, wx.DefaultSize, 0 ) self.labl1.Wrap( -1 ) self.labl1.SetFont( wx.Font( 16, 70, 90, 90, False, wx.EmptyString ) ) Hsz1.Add( self.labl1, 0, wx.ALIGN_CENTER|wx.ALL, 5 ) self.labl2 = wx.StaticText( self, wx.ID_ANY, lbl[1], wx.DefaultPosition, wx.DefaultSize, 0 ) self.labl2.Wrap( -1 ) self.labl2.SetFont( wx.Font( 16, 70, 90, 90, False, wx.EmptyString ) ) Hsz1.Add( self.labl2, 0, wx.ALIGN_CENTER|wx.ALL, 5 ) self.Hbtn = wx.BitmapButton( self, wx.ID_ANY, wx.NullBitmap, wx.DefaultPosition, wx.DefaultSize, wx.BU_AUTODRAW ) Hsz1.Add( self.Hbtn, 1, wx.ALIGN_RIGHT|wx.ALL|wx.SHAPED, 5 ) Vsz1.Add( Hsz1, 1, wx.EXPAND, 5 ) Hsz2 = wx.BoxSizer( wx.HORIZONTAL ) self.labl3 = wx.StaticText( self, wx.ID_ANY, lbl[2], wx.DefaultPosition, wx.DefaultSize, 0 ) self.labl3.Wrap( -1 ) Hsz2.Add( self.labl3, 0, wx.ALIGN_CENTER|wx.ALL, 5 ) self.fld1 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) Hsz2.Add( self.fld1, 0, wx.ALIGN_CENTER, 5 ) self.Cbtn = wx.BitmapButton( self, wx.ID_ANY, wx.Bitmap( UTILITY_PATH+u"calculator.bmp", wx.BITMAP_TYPE_ANY ), wx.DefaultPosition, wx.DefaultSize, wx.BU_AUTODRAW ) Hsz2.Add( self.Cbtn, 0, wx.ALIGN_CENTER_VERTICAL|wx.TOP|wx.BOTTOM, 5 ) choice1Choices = lst self.choice1 = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, choice1Choices, 0 ) self.choice1.SetSelection( 0 ) Hsz2.Add( self.choice1, 0, wx.ALIGN_CENTER, 5 ) self.labl4 = wx.StaticText( self, wx.ID_ANY, lbl[3], wx.DefaultPosition, wx.DefaultSize, 0 ) self.labl4.Wrap( -1 ) Hsz2.Add( self.labl4, 0, wx.ALIGN_CENTER|wx.ALL, 5 ) self.fld2 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) Hsz2.Add( self.fld2, 1, wx.ALIGN_CENTER|wx.ALL, 5 ) Vsz1.Add( Hsz2, 1, wx.EXPAND, 5 ) Hsz3 = wx.BoxSizer( wx.HORIZONTAL ) self.labl5 = wx.StaticText( self, wx.ID_ANY, lbl[4], wx.DefaultPosition, wx.DefaultSize, 0 ) self.labl5.Wrap( -1 ) Hsz3.Add( self.labl5, 0, wx.ALIGN_CENTER|wx.ALL, 5 ) self.idate = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) Hsz3.Add( self.idate, 0, wx.ALIGN_CENTER_VERTICAL|wx.TOP|wx.BOTTOM|wx.LEFT, 5 ) self.dbtn = wx.BitmapButton( self, wx.ID_ANY, wx.ArtProvider.GetBitmap( wx.ART_GO_DOWN, wx.ART_BUTTON ), wx.DefaultPosition, wx.DefaultSize, wx.BU_AUTODRAW ) Hsz3.Add( self.dbtn, 0, wx.ALIGN_CENTER_VERTICAL|wx.TOP|wx.BOTTOM, 5 ) self.labl6 = wx.StaticText( self, wx.ID_ANY, lbl[5], wx.DefaultPosition, wx.DefaultSize, 0 ) self.labl6.Wrap( -1 ) Hsz3.Add( self.labl6, 0, wx.ALIGN_CENTER|wx.ALL, 5 ) self.fld3 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) Hsz3.Add( self.fld3, 1, wx.ALIGN_CENTER, 5 ) self.btn1 = wx.Button( self, wx.ID_ANY, u"...", wx.DefaultPosition, wx.Size( 25,25 ), 0 ) Hsz3.Add( self.btn1, 0, wx.ALIGN_CENTER|wx.ALL, 1 ) Vsz1.Add( Hsz3, 1, wx.EXPAND, 5 ) Hsz4 = wx.BoxSizer( wx.HORIZONTAL ) self.labl7 = wx.StaticText( self, wx.ID_ANY, lbl[6], wx.DefaultPosition, wx.DefaultSize, 0 ) self.labl7.Wrap( -1 ) Hsz4.Add( self.labl7, 0, wx.ALIGN_CENTER|wx.ALL, 5 ) self.fld4 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) Hsz4.Add( self.fld4, 1, wx.ALIGN_CENTER|wx.ALL, 5 ) self.labl8 = wx.StaticText( self, wx.ID_ANY, lbl[7], wx.DefaultPosition, wx.DefaultSize, 0 ) self.labl8.Wrap( -1 ) Hsz4.Add( self.labl8, 0, wx.ALIGN_CENTER|wx.ALL, 5 ) self.fld5 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) Hsz4.Add( self.fld5, 0, wx.ALIGN_CENTER|wx.ALL, 5 ) Vsz1.Add( Hsz4, 1, wx.EXPAND, 5 ) Hsz5 = wx.BoxSizer( wx.HORIZONTAL ) self.labl11 = wx.CheckBox( self, wx.ID_ANY, txt[2], wx.DefaultPosition, wx.DefaultSize, 0 ) Hsz5.Add( self.labl11, 1, wx.ALIGN_CENTER|wx.ALL, 5 ) self.labl12 = wx.CheckBox( self, wx.ID_ANY, txt[3], wx.DefaultPosition, wx.DefaultSize, 0 ) Hsz5.Add( self.labl12, 1, wx.ALIGN_CENTER|wx.ALL, 5 ) self.btn2 = wx.Button( self, wx.ID_ANY, txt[1], wx.DefaultPosition, wx.DefaultSize, 0 ) Hsz5.Add( self.btn2, 0, wx.ALIGN_CENTER|wx.ALL, 5 ) self.btn3 = wx.Button( self, wx.ID_ANY, txt[0], wx.DefaultPosition, wx.DefaultSize, 0 ) Hsz5.Add( self.btn3, 0, wx.ALIGN_CENTER|wx.ALL, 5 ) Vsz1.Add( Hsz5, 1, wx.EXPAND, 5 ) self.SetSizer( Vsz1 ) self.Layout() # Initial Panel And Prameter self.Pcal1 = wx.PopupTransientWindow(self.GetTopLevelParent(),wx.SIMPLE_BORDER) self.pnl = calfar01.MyPanel2(self.Pcal1,-1,-1) self.pnl.Bind(wx.EVT_BUTTON,self.Onbind,source=None) self.cur = 0 self.txtcur = u'ريال' self.isnd = 0 # Connect Events self.fld1.Bind( wx.EVT_TEXT, self.amont ) self.Cbtn.Bind( wx.EVT_BUTTON, self.calcu ) self.choice1.Bind( wx.EVT_CHOICE, self.curncy ) self.idate.Bind( wx.EVT_TEXT, self.chgdate ) self.dbtn.Bind( wx.EVT_BUTTON, self.dat ) self.btn1.Bind( wx.EVT_BUTTON, self.acsrch ) self.labl11.Bind( wx.EVT_CHECKBOX, self.prn ) self.labl12.Bind( wx.EVT_CHECKBOX, self.insnd ) self.btn2.Bind( wx.EVT_BUTTON, self.cancl ) self.btn3.Bind( wx.EVT_BUTTON, self.takit )
def __init__( self, parent, titr,txts,cods,lstmlk ): wx.Panel.__init__ ( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 660,315 ), style = wx.TAB_TRAVERSAL ) self.iMolk = DG.GetData(u'',u'') #self.jMolk = DG.SetData(u'',u'') self.inumr = adad.Adaad(1,'') self.titr = titr self.txts = txts self.lstmlk = lstmlk self.mcod = cods[2] TB = self.MRcods( cods ) #print titr, txts, TB Vsz1 = wx.BoxSizer( wx.VERTICAL ) self.SetFont( wx.Font( 11, 74, 90, 92, False, FONT_TYPE ) ) ################################################### Vsz2 = wx.BoxSizer( wx.VERTICAL ) self.P1 = MyPanel3(self,titr,TB) Vsz2.Add( self.P1, 0,wx.EXPAND |wx.ALL, 5) Vsz1.Add( Vsz2, 0, wx.EXPAND, 5 ) ################################################## Vsz3 = wx.BoxSizer( wx.HORIZONTAL ) self.lbl1 = u'امکانات' self.lbl2 = u'امکانات ملک' self.cpStyle = wx.CP_NO_TLW_RESIZE self.cp = cp = PCP.PyCollapsiblePane(self, label=self.lbl1, agwStyle=self.cpStyle) self.Bind(wx.EVT_COLLAPSIBLEPANE_CHANGED, self.OnPaneChanged, cp) Vsz3.Add( self.cp, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.cp.SetLayoutDirection(2) self.MakePaneContent(cp.GetPane()) Vsz1.Add( Vsz3, 1, wx.EXPAND, 5 ) ################################################## Vsz4 = wx.BoxSizer( wx.VERTICAL ) self.P4 = MyPanel4(self,txts) Vsz4.Add( self.P4, 0, wx.EXPAND|wx.ALL, 5) Vsz1.Add( Vsz4, 0, wx.EXPAND, 5 ) Hsz4 = wx.BoxSizer( wx.HORIZONTAL ) self.btn1 = wx.Button( self, wx.ID_ANY, u"برگشت", wx.DefaultPosition, wx.DefaultSize, 0 ) self.btn1.SetFont( wx.Font( 12, 74, 90, 92, False, FONT_TYPE ) ) Hsz4.Add( self.btn1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) #self.btn2 = wx.Button( self, wx.ID_ANY, u"انصراف", wx.DefaultPosition, wx.DefaultSize, 0 ) #self.btn2.SetFont( wx.Font( 12, 74, 90, 92, False, FONT_TYPE ) ) #Hsz4.Add( self.btn2, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) Hsz4.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) self.bkbtn = wx.BitmapButton( self, wx.ID_ANY, wx.ArtProvider.GetBitmap( wx.ART_GO_BACK, wx.ART_BUTTON ), wx.DefaultPosition, wx.DefaultSize, wx.BU_AUTODRAW ) Hsz4.Add( self.bkbtn, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.frbtn = wx.BitmapButton( self, wx.ID_ANY, wx.ArtProvider.GetBitmap( wx.ART_GO_FORWARD, wx.ART_BUTTON ), wx.DefaultPosition, wx.DefaultSize, wx.BU_AUTODRAW ) Hsz4.Add( self.frbtn, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) Vsz1.Add( Hsz4, 0, wx.EXPAND, 5 ) self.setdata(self.mcod) self.SetSizer( Vsz1 ) self.Layout() # Connect Events self.btn1.Bind( wx.EVT_BUTTON, self.savit ) #self.btn2.Bind( wx.EVT_BUTTON, self.cancl ) self.bkbtn.Bind( wx.EVT_BUTTON, self.bkmlk ) self.frbtn.Bind( wx.EVT_BUTTON, self.frmlk )
def __init__( self, parent,lbls,TB ): wx.Panel.__init__ ( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 470,175 ), style = wx.RAISED_BORDER ) self.iMolk = DG.GetData(u'',u'') self.jMolk = DG.SetData(u'',u'') self.inumr = adad.Adaad(1,'') self.lbls = lbls self.TB = TB Vsz2 = wx.BoxSizer( wx.VERTICAL ) Hsz1 = wx.BoxSizer( wx.HORIZONTAL ) self.srch = wx.Button( self, wx.ID_ANY, u"...", wx.DefaultPosition, wx.DefaultSize, wx.BU_EXACTFIT ) Hsz1.Add( self.srch, 0, wx.ALIGN_CENTER_VERTICAL|wx.TOP|wx.BOTTOM|wx.LEFT, 5 ) self.srch.Hide() self.iacc = wx.TextCtrl( self, 302, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_PROCESS_ENTER|wx.TE_RIGHT|wx.STATIC_BORDER ) #self.iacc.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), 70, 90, 90, False, wx.EmptyString ) ) Hsz1.Add( self.iacc, 0, wx.ALIGN_CENTER_VERTICAL|wx.TOP|wx.BOTTOM|wx.RIGHT, 5 ) self.txt2 = wx.StaticText( self, wx.ID_ANY, lbls[1], wx.DefaultPosition, wx.DefaultSize, 0 ) self.txt2.Wrap( -1 ) #self.txt2.SetFont( wx.Font( 12, 70, 90, 92, False, "Arial" ) ) Hsz1.Add( self.txt2, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) Hsz1.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) self.don = wx.BitmapButton( self, wx.ID_ANY, wx.ArtProvider.GetBitmap( wx.ART_GO_DOWN, wx.ART_BUTTON ), wx.DefaultPosition, wx.DefaultSize, wx.BU_AUTODRAW ) Hsz1.Add( self.don, 0, wx.ALIGN_CENTER_VERTICAL|wx.TOP|wx.BOTTOM|wx.LEFT, 5 ) self.don.Hide() self.idate = wx.TextCtrl( self, 301, NOW, wx.DefaultPosition, wx.Size( 95,-1 ), 0|wx.STATIC_BORDER ) Hsz1.Add( self.idate, 0, wx.ALIGN_CENTER_VERTICAL|wx.TOP|wx.BOTTOM|wx.RIGHT, 5 ) self.txt1 = wx.StaticText( self, wx.ID_ANY, lbls[0], wx.DefaultPosition, wx.Size( 40,-1 ), 0 ) self.txt1.Wrap( -1 ) #self.txt1.SetFont( wx.Font( 12, 70, 90, 92, False, "Arial" ) ) Hsz1.Add( self.txt1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) Vsz2.Add( Hsz1, 1, wx.EXPAND, 5 ) Hsz2 = wx.BoxSizer( wx.HORIZONTAL ) self.fld2 = wx.TextCtrl( self, 305, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_PROCESS_ENTER|wx.TE_RIGHT|wx.STATIC_BORDER ) self.fld2.SetToolTipString( u"بلوار-خیابان-کوچه-پلاک" ) Hsz2.Add( self.fld2, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) #fld1Choices = [] self.fld1Chs = self.GetAreaList() self.fld1 = wx.ComboBox( self, 304, u"منطقه", wx.DefaultPosition, wx.DefaultSize, self.fld1Chs, wx.CB_DROPDOWN|wx.CB_READONLY|wx.CB_SORT|wx.TE_PROCESS_ENTER ) Hsz2.Add( self.fld1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.txt4 = wx.StaticText( self, wx.ID_ANY, lbls[3], wx.DefaultPosition, wx.Size( 40,-1 ), 0 ) self.txt4.Wrap( -1 ) #self.txt4.SetFont( wx.Font( 12, 70, 90, 92, False, "Arial" ) ) Hsz2.Add( self.txt4, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) Vsz2.Add( Hsz2, 1, wx.EXPAND, 5 ) Hsz3 = wx.BoxSizer( wx.HORIZONTAL ) self.iphon = wx.TextCtrl( self, 303, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_PROCESS_ENTER|wx.TE_RIGHT |wx.STATIC_BORDER) Hsz3.Add( self.iphon, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.iphon.SetLayoutDirection(2) self.txt3 = wx.StaticText( self, wx.ID_ANY, lbls[2], wx.DefaultPosition, wx.DefaultSize, 0 ) self.txt3.Wrap( -1 ) #self.txt3.SetFont( wx.Font( 12, 70, 90, 92, False, "Arial" ) ) Hsz3.Add( self.txt3, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.fld5 = wx.TextCtrl( self, 308, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_PROCESS_ENTER|wx.TE_RIGHT |wx.STATIC_BORDER) Hsz3.Add( self.fld5, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.txt5 = wx.StaticText( self, wx.ID_ANY, lbls[4], wx.DefaultPosition, wx.DefaultSize, 0 ) self.txt5.Wrap( -1 ) #self.txt5.SetFont( wx.Font( 12, 70, 90, 92, False, "Arial" ) ) Hsz3.Add( self.txt5, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) Vsz2.Add( Hsz3, 1, wx.EXPAND, 5 ) Hsz4 = wx.BoxSizer( wx.HORIZONTAL ) self.calcu = wx.BitmapButton( self, wx.ID_ANY, wx.Bitmap(UTILITY_PATH+u"calculator.bmp", wx.BITMAP_TYPE_ANY ), wx.DefaultPosition, wx.DefaultSize, wx.BU_AUTODRAW ) Hsz4.Add( self.calcu, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) Hsz4.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) self.fld9 = wx.TextCtrl( self, 312, wx.EmptyString, wx.DefaultPosition, wx.Size( 45,-1 ), wx.TE_LEFT|wx.TE_PROCESS_ENTER|wx.STATIC_BORDER ) Hsz4.Add( self.fld9, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.fld9.SetLayoutDirection(2) self.txt9 = wx.StaticText( self, wx.ID_ANY, lbls[8], wx.DefaultPosition, wx.DefaultSize, 0 ) self.txt9.Wrap( -1 ) #self.txt9.SetFont( wx.Font( 12, 70, 90, 92, False, "Arial" ) ) Hsz4.Add( self.txt9, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.fld8 = wx.TextCtrl( self, 311, wx.EmptyString, wx.DefaultPosition, wx.Size( 45,-1 ), wx.TE_LEFT|wx.TE_PROCESS_ENTER|wx.STATIC_BORDER ) Hsz4.Add( self.fld8, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.fld8.SetLayoutDirection(2) self.txt8 = wx.StaticText( self, wx.ID_ANY, u"طبقات", wx.DefaultPosition, wx.DefaultSize, 0 ) self.txt8.Wrap( -1 ) #self.txt8.SetFont( wx.Font( 12, 70, 90, 92, False, "Arial" ) ) Hsz4.Add( self.txt8, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.fld7 = wx.TextCtrl( self, 310, wx.EmptyString, wx.DefaultPosition, wx.Size( 45,-1 ), wx.TE_LEFT|wx.TE_PROCESS_ENTER|wx.STATIC_BORDER ) Hsz4.Add( self.fld7, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.fld7.SetLayoutDirection(2) self.txt7 = wx.StaticText( self, wx.ID_ANY, lbls[6], wx.DefaultPosition, wx.DefaultSize, 0 ) self.txt7.Wrap( -1 ) #self.txt7.SetFont( wx.Font( 12, 70, 90, 92, False, "Arial" ) ) Hsz4.Add( self.txt7, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.fld6 = wx.TextCtrl( self, 309, wx.EmptyString, wx.DefaultPosition, wx.Size( 45,-1 ), wx.TE_LEFT|wx.TE_PROCESS_ENTER|wx.STATIC_BORDER ) Hsz4.Add( self.fld6, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.fld6.SetLayoutDirection(2) self.txt6 = wx.StaticText( self, wx.ID_ANY, lbls[5], wx.DefaultPosition, wx.DefaultSize, 0 ) self.txt6.Wrap( -1 ) #self.txt6.SetFont( wx.Font( 12, 70, 90, 92, False, "Arial" ) ) Hsz4.Add( self.txt6, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) Vsz2.Add( Hsz4, 1, wx.EXPAND, 5 ) # Initial Panel And Prameter self.Pcal1 = wx.PopupTransientWindow(self.GetTopLevelParent(),wx.SIMPLE_BORDER) self.pnl = calfar.MyPanel2(self.Pcal1,-1,-1) self.pnl.Bind(wx.EVT_BUTTON,self.Onbind,source=None) self.Initpn() #Show Hide item if TB[0] != u'' : self.txt8.Hide() self.fld8.Hide() self.SetSizer( Vsz2 ) self.Layout() # Connect Events self.srch.Bind( wx.EVT_BUTTON, self.scracc ) self.iacc.Bind( wx.EVT_CHAR, self.nxtfld ) self.iacc.Bind( wx.EVT_TEXT, self.inacc ) self.don.Bind( wx.EVT_BUTTON, self.Down ) self.idate.Bind( wx.EVT_TEXT, self.chgdate ) self.fld2.Bind( wx.EVT_CHAR, self.nxtfld ) self.fld2.Bind( wx.EVT_TEXT, self.inaddr ) self.fld1.Bind( wx.EVT_CHAR, self.nxtfld ) self.fld1.Bind( wx.EVT_COMBOBOX, self.nware ) self.fld1.Bind( wx.EVT_TEXT, self.inare ) self.iphon.Bind( wx.EVT_CHAR, self.nxtfld ) self.iphon.Bind( wx.EVT_TEXT, self.inphn ) self.fld5.Bind( wx.EVT_CHAR, self.nxtfld ) self.fld5.Bind( wx.EVT_TEXT, self.mlknam ) self.calcu.Bind( wx.EVT_BUTTON, self.calc1 ) self.fld9.Bind( wx.EVT_CHAR, self.nxtfld ) self.fld9.Bind( wx.EVT_TEXT, self.inyer ) self.fld7.Bind( wx.EVT_CHAR, self.nxtfld ) self.fld7.Bind( wx.EVT_TEXT, self.inmfd ) self.fld6.Bind( wx.EVT_CHAR, self.nxtfld ) self.fld6.Bind( wx.EVT_TEXT, self.inmtr ) if self.TB[0] == u'': self.fld8.Bind( wx.EVT_CHAR, self.nxtfld )
def __init__(self, parent, accod): wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.Size(819, 300), style=wx.TAB_TRAVERSAL) self.SetFont(wx.Font(12, 70, 90, 92, False, "Arial")) self.iMolk = DG.GetData(u'', u'') self.jMolk = DG.SetData(u'', u'') self.inum = adad.Adaad(1, '') Vsz4 = wx.BoxSizer(wx.VERTICAL) bSizer30 = wx.BoxSizer(wx.VERTICAL) self.m_staticText14 = wx.StaticText(self, wx.ID_ANY, u"لیست ملکهای این مشتری", wx.DefaultPosition, wx.DefaultSize, 0) self.m_staticText14.Wrap(-1) self.m_staticText14.SetFont(wx.Font(18, 70, 90, 92, False, "Arial")) bSizer30.Add(self.m_staticText14, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 5) Vsz4.Add(bSizer30, 0, wx.EXPAND, 5) bSizer29 = wx.BoxSizer(wx.VERTICAL) self.DVLC1 = wx.dataview.DataViewListCtrl( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.dataview.DV_HORIZ_RULES | wx.dataview.DV_ROW_LINES | wx.dataview.DV_VERT_RULES | wx.STATIC_BORDER) self.Column1 = self.DVLC1.AppendTextColumn(u"قيمت") self.Column2 = self.DVLC1.AppendTextColumn(u"متري") self.Column3 = self.DVLC1.AppendTextColumn(u"تعداد خواب") self.Column4 = self.DVLC1.AppendTextColumn(u"قدمت") self.Column5 = self.DVLC1.AppendTextColumn(u"مفید") self.Column6 = self.DVLC1.AppendTextColumn(u"متراژ") self.Column7 = self.DVLC1.AppendTextColumn(u"آدرس") self.Column8 = self.DVLC1.AppendTextColumn(u"منطقه") self.Column9 = self.DVLC1.AppendTextColumn(u"نام ملک") self.Column10 = self.DVLC1.AppendTextColumn(u"کد ملک") bSizer29.Add(self.DVLC1, 1, wx.ALL | wx.EXPAND, 5) Vsz4.Add(bSizer29, 1, wx.EXPAND, 5) for c in self.DVLC1.Columns: c.Sortable = True c.Reorderable = True self.Column1.Sortable = False self.Column2.Sortable = False self.myact = '' self.SetSizer(Vsz4) self.Layout() self.loadata(accod)
def __init__(self, parent): wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.Size(366, 430), style=wx.TAB_TRAVERSAL) self.iMolk = DG.GetData(u'', u'') self.inum = adad.Adaad(1, '') data = self.iMolk.ShwAcc2() Vsz1 = wx.BoxSizer(wx.VERTICAL) Vsz2 = wx.BoxSizer(wx.VERTICAL) self.titr1 = wx.StaticText(self, wx.ID_ANY, u"لیست مشتریان", wx.DefaultPosition, wx.DefaultSize, 0) self.titr1.Wrap(-1) Vsz2.Add(self.titr1, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 5) Vsz1.Add(Vsz2, 0, wx.EXPAND, 5) Vsz3 = wx.BoxSizer(wx.VERTICAL) self.DVLC2 = wx.dataview.DataViewListCtrl(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0) self.Col0 = self.DVLC2.AppendTextColumn(u"درخواست") self.Col1 = self.DVLC2.AppendTextColumn(u"تلفن") self.Col2 = self.DVLC2.AppendTextColumn(u"نام حساب") self.Col3 = self.DVLC2.AppendTextColumn(u"کد حساب") #self.Col0 = self.DVLC2.AppendTextColumn( u"کد حساب" ) #self.Col1 = self.DVLC2.AppendTextColumn( u"نام حساب" ) #self.Col2 = self.DVLC2.AppendTextColumn( u"تلفن" ) #self.Col3 = self.DVLC2.AppendTextColumn( u"درخواست" ) Vsz3.Add(self.DVLC2, 1, wx.ALL | wx.EXPAND, 5) Vsz1.Add(Vsz3, 1, wx.EXPAND, 5) Vsz4 = wx.BoxSizer(wx.VERTICAL) #self.btn = wx.Button( self, wx.ID_ANY, u"برگشت", wx.DefaultPosition, wx.DefaultSize, 0 ) #Vsz4.Add( self.btn, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.btn2 = wx.Button(self, wx.ID_ANY, u"انتخاب", wx.DefaultPosition, wx.DefaultSize, 0) Vsz4.Add(self.btn2, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 5) self.btn1 = wx.Button(self, wx.ID_ANY, u"انصراف", wx.DefaultPosition, wx.DefaultSize, 0) Vsz4.Add(self.btn1, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 5) Vsz1.Add(Vsz4, 0, wx.EXPAND, 5) for d in data: d = (d[3], self.inum.e2f2(d[2]), d[1], self.inum.e2f(d[0])) #print d self.DVLC2.AppendItem(d) #for itemvalues in data: # self.DVLC2.AppendItem(itemvalues[::-1]) for c in self.DVLC2.Columns: c.Sortable = True c.Reorderable = True self.SetSizer(Vsz1) self.Layout() # Connect Events #self.btn.Bind( wx.EVT_BUTTON, self.retit ) self.Bind(wx.dataview.EVT_DATAVIEW_ITEM_ACTIVATED, self.selcit, id=wx.ID_ANY) self.btn2.Bind(wx.EVT_BUTTON, self.selcit) self.btn1.Bind(wx.EVT_BUTTON, self.cancl)
def __init__(self, parent, acod, data): wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.Size(430, 170), style=wx.TAB_TRAVERSAL) self.iMolk = DG.GetData(u'', u'') self.jMolk = DG.SetData(u'', u'') self.inumr = adad.Adaad(1, '') self.iacod = self.inumr.f2e(acod) self.iname = data[0] self.iphon = data[1] Vsz1 = wx.BoxSizer(wx.VERTICAL) Hsz1 = wx.BoxSizer(wx.HORIZONTAL) self.fld1 = wx.TextCtrl(self, 51, self.iname, wx.DefaultPosition, wx.DefaultSize, wx.TE_PROCESS_ENTER | wx.TE_RIGHT) Hsz1.Add(self.fld1, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) self.fld1.SetLayoutDirection(2) self.txt1 = wx.StaticText(self, wx.ID_ANY, u"نام مشتری", wx.DefaultPosition, wx.DefaultSize, 0) self.txt1.Wrap(-1) self.txt1.SetFont(wx.Font(14, 70, 90, 90, False, "B Zar")) Hsz1.Add(self.txt1, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) self.btns = wx.Button(self, wx.ID_ANY, u"...", wx.DefaultPosition, wx.DefaultSize, wx.BU_EXACTFIT) Hsz1.Add(self.btns, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) self.fld0 = wx.TextCtrl(self, 50, self.iacod, wx.DefaultPosition, wx.Size(50, -1), wx.TE_PROCESS_ENTER) Hsz1.Add(self.fld0, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) self.txt0 = wx.StaticText(self, wx.ID_ANY, u"کد مشتری", wx.DefaultPosition, wx.DefaultSize, 0) self.txt0.Wrap(-1) self.txt0.SetFont(wx.Font(14, 70, 90, 90, False, "B Zar")) Hsz1.Add(self.txt0, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) Vsz1.Add(Hsz1, 1, wx.EXPAND, 5) Hsz2 = wx.BoxSizer(wx.HORIZONTAL) self.fld2 = wx.TextCtrl(self, 52, self.iphon, wx.DefaultPosition, wx.DefaultSize, wx.TE_PROCESS_ENTER) Hsz2.Add(self.fld2, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) self.fld2.SetLayoutDirection(2) self.txt2 = wx.StaticText(self, wx.ID_ANY, u"تلفن تماس", wx.DefaultPosition, wx.DefaultSize, 0) self.txt2.Wrap(-1) self.txt2.SetFont(wx.Font(14, 70, 90, 90, False, "B Zar")) Hsz2.Add(self.txt2, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) Vsz1.Add(Hsz2, 1, wx.EXPAND, 5) Hsz3 = wx.BoxSizer(wx.HORIZONTAL) self.btn1 = wx.Button(self, wx.ID_ANY, u"حذف شود", wx.DefaultPosition, wx.DefaultSize, 0) Hsz3.Add(self.btn1, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) self.btn2 = wx.Button(self, wx.ID_ANY, u"انصراف", wx.DefaultPosition, wx.DefaultSize, 0) Hsz3.Add(self.btn2, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) Hsz3.AddSpacer((0, 0), 1, wx.EXPAND, 5) self.btn3 = wx.Button(self, wx.ID_ANY, u"...مشخصات ", wx.DefaultPosition, wx.DefaultSize, 0) Hsz3.Add(self.btn3, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) Vsz1.Add(Hsz3, 1, wx.EXPAND, 5) self.nwacc = False self.SetSizer(Vsz1) self.Layout() # Connect Events self.fld1.Bind(wx.EVT_CHAR, self.nxtfld) self.btns.Bind(wx.EVT_BUTTON, self.accsrch) self.fld0.Bind(wx.EVT_CHAR, self.nxtfld) self.fld2.Bind(wx.EVT_CHAR, self.nxtfld) self.btn1.Bind(wx.EVT_BUTTON, self.savit) self.btn2.Bind(wx.EVT_BUTTON, self.cancl) self.btn3.Bind(wx.EVT_BUTTON, self.spcacc)
def __init__( self, parent ): wx.Panel.__init__ ( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 514,171 ), style = wx.TAB_TRAVERSAL ) self.iMolk = DG.GetData(u'',u'') self.jMolk = DG.SetData(u'',u'') self.inumr = adad.Adaad(1,'') self.SetFont( wx.Font( 12, 70, 90, 92, False, "Arial" ) ) if self.iMolk.gCmpny() != []: data = self.iMolk.gCmpny() icomp = data[0][1] rata = self.iMolk.gReven() irev = rata[0][1] self.nwb = False else: icomp = '' irev = '' self.nwb = True Vsz1 = wx.BoxSizer( wx.VERTICAL ) self.pnl1 = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.STATIC_BORDER|wx.TAB_TRAVERSAL ) Hsz1 = wx.BoxSizer( wx.HORIZONTAL ) self.fld2 = wx.TextCtrl( self.pnl1, wx.ID_ANY, irev, wx.DefaultPosition, wx.DefaultSize, wx.TE_RIGHT ) Hsz1.Add( self.fld2, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.txt2 = wx.StaticText( self.pnl1, wx.ID_ANY, u"نام عملکرد", wx.DefaultPosition, wx.DefaultSize, 0 ) self.txt2.Wrap( -1 ) Hsz1.Add( self.txt2, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.btn1 = wx.Button( self.pnl1, wx.ID_ANY, u"....مشخصات بنگاه ", wx.DefaultPosition, wx.DefaultSize, 0 ) Hsz1.Add( self.btn1, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.fld1 = wx.TextCtrl( self.pnl1, wx.ID_ANY, icomp, wx.DefaultPosition, wx.DefaultSize, wx.TE_RIGHT ) Hsz1.Add( self.fld1, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.txt1 = wx.StaticText( self.pnl1, wx.ID_ANY, u"نام بنگاه", wx.DefaultPosition, wx.DefaultSize, 0 ) self.txt1.Wrap( -1 ) Hsz1.Add( self.txt1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.pnl1.SetSizer( Hsz1 ) self.pnl1.Layout() Hsz1.Fit( self.pnl1 ) Vsz1.Add( self.pnl1, 0, wx.EXPAND |wx.ALL, 5 ) self.pnl2 = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.STATIC_BORDER ) Vsz2 = wx.BoxSizer( wx.VERTICAL ) Hsz21 = wx.BoxSizer( wx.HORIZONTAL ) self.btn2 = wx.Button( self.pnl2, wx.ID_ANY, u"مناطق", wx.DefaultPosition, wx.DefaultSize, 0 ) Hsz21.Add( self.btn2, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.btn3 = wx.Button( self.pnl2, wx.ID_ANY, u"نوع ملک", wx.DefaultPosition, wx.DefaultSize, 0 ) Hsz21.Add( self.btn3, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.btn4 = wx.Button( self.pnl2, wx.ID_ANY, u"نوع درخواست", wx.DefaultPosition, wx.DefaultSize, 0 ) Hsz21.Add( self.btn4, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) Vsz2.Add( Hsz21, 1, wx.EXPAND, 5 ) self.pnl2.SetSizer( Vsz2 ) self.pnl2.Layout() Vsz2.Fit( self.pnl2 ) Vsz1.Add( self.pnl2, 1, wx.EXPAND |wx.ALL, 5 ) self.pnl3 = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.STATIC_BORDER|wx.TAB_TRAVERSAL ) Hsz3 = wx.BoxSizer( wx.HORIZONTAL ) self.btn5 = wx.Button( self.pnl3, wx.ID_ANY, u"تعریف شود", wx.DefaultPosition, wx.DefaultSize, 0 ) Hsz3.Add( self.btn5, 0, wx.ALL, 5 ) self.btn6 = wx.Button( self.pnl3, wx.ID_ANY, u"انصراف", wx.DefaultPosition, wx.DefaultSize, 0 ) Hsz3.Add( self.btn6, 0, wx.ALL, 5 ) self.pnl3.SetSizer( Hsz3 ) self.pnl3.Layout() Hsz3.Fit( self.pnl3 ) Vsz1.Add( self.pnl3, 0, wx.EXPAND |wx.ALL, 5 ) self.SetSizer( Vsz1 ) self.Layout() # Connect Events self.btn1.Bind( wx.EVT_BUTTON, self.bspc ) self.btn2.Bind( wx.EVT_BUTTON, self.inarea ) self.btn3.Bind( wx.EVT_BUTTON, self.inmktyp ) self.btn4.Bind( wx.EVT_BUTTON, self.inres ) self.btn5.Bind( wx.EVT_BUTTON, self.defin ) self.btn6.Bind( wx.EVT_BUTTON, self.cancl )
def __init__( self, parent ): wx.Panel.__init__ ( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 816,427 ), style = wx.TAB_TRAVERSAL ) self.iMolk = DG.GetData(u'',u'') self.inum = adad.Adaad(1,'') data = self.iMolk.Amlak2(u" where Molks.Res = 1 ") self.SetFont( wx.Font( FONT_SIZE, 70, 90, 92, False, FONT_TYPE ) ) Vsz1 = wx.BoxSizer( wx.VERTICAL ) Vsz2 = wx.BoxSizer( wx.VERTICAL ) self.txt1 = wx.StaticText( self, wx.ID_ANY, u"دفتر املاک", wx.DefaultPosition, wx.DefaultSize, 0 ) self.txt1.Wrap( -1 ) self.txt1.SetFont( wx.Font( 18, 70, 90, 90, False, wx.EmptyString ) ) Vsz2.Add( self.txt1, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) Hsz = wx.BoxSizer( wx.HORIZONTAL ) chs2Choices = [ u"همه", u"آپارتمان", u"ویلائی", u"مغازه", u"زمین" ] self.chs2 = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, chs2Choices, 0 ) self.chs2.SetSelection( 0 ) Hsz.Add( self.chs2, 0, wx.ALL, 5 ) chs1Choices = [ u"فروش", u"رهن", u"رهن اجاره" ] self.chs1 = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, chs1Choices, 0 ) self.chs1.SetSelection( 0 ) Hsz.Add( self.chs1, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) Vsz2.Add( Hsz, 0, wx.ALIGN_CENTER_HORIZONTAL, 5 ) Vsz1.Add( Vsz2, 0, wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL, 5 ) Vsz3 = wx.BoxSizer( wx.VERTICAL ) self.DVLC1 = wx.dataview.DataViewListCtrl( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.dataview.DV_HORIZ_RULES|wx.dataview.DV_ROW_LINES|wx.dataview.DV_VERT_RULES|wx.STATIC_BORDER ) self.Column1 = self.DVLC1.AppendTextColumn( u"قیمت",width = 92 ) self.Column2 = self.DVLC1.AppendTextColumn( u"قدمت",width = 72 ) self.Column3 = self.DVLC1.AppendTextColumn( u"تعدادخواب",width = 92,align=wx.ALIGN_RIGHT ) self.Column4 = self.DVLC1.AppendTextColumn( u"متراژ",width = 42 ) self.Column5 = self.DVLC1.AppendTextColumn( u"آدرس" ,width = 212,align=wx.ALIGN_RIGHT ) self.Column6 = self.DVLC1.AppendTextColumn( u"منطقه" ,width = 82,align=wx.ALIGN_RIGHT) self.Column7 = self.DVLC1.AppendTextColumn( u"نام ملک",width = 82 ,align=wx.ALIGN_RIGHT) self.Column8 = self.DVLC1.AppendTextColumn( u"نوع ملک" ,width = 62,align=wx.ALIGN_RIGHT) self.Column9 = self.DVLC1.AppendTextColumn( u"کد ملک" ,width = 52) Vsz3.Add( self.DVLC1, 1, wx.ALL|wx.EXPAND, 5 ) Vsz1.Add( Vsz3, 1, wx.EXPAND, 5 ) Vsz4 = wx.BoxSizer( wx.VERTICAL ) self.btn1 = wx.Button( self, wx.ID_ANY, u"بستن", wx.DefaultPosition, wx.DefaultSize, 0 ) Vsz4.Add( self.btn1, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) Vsz1.Add( Vsz4, 0, wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.lstrow = [] for d in data: if d[2] == u'0': DD = u'سه خوابه' elif d[2] == u'1': DD = u'دو خوابه' elif d[2] == u'2': DD = u'يک خوابه' else: DD = u'مغازه' d = (self.inum.Digigrop(d[0],','),self.inum.e2f(d[1]) ,DD,self.inum.e2f(d[3]),d[4],d[5],d[6],d[7],self.inum.e2f(d[8]) ) self.DVLC1.AppendItem(d) self.lstrow.append( self.inum.f2e(d[8]) ) for c in self.DVLC1.Columns: c.Sortable = True c.Reorderable = True self.Column1.Sortable = False #self.Column2.Sortable = False #self.Column3.Sortable = False #self.Column4.Sortable = False self.SetSizer( Vsz1 ) self.Layout() self.sql1 = u"" self.sql2 = u"" # Connect Events self.chs2.Bind( wx.EVT_CHOICE, self.chtyp ) self.chs1.Bind( wx.EVT_CHOICE, self.chres ) self.Bind( wx.dataview.EVT_DATAVIEW_COLUMN_REORDERED, self.ordr, id = wx.ID_ANY ) self.Bind( wx.dataview.EVT_DATAVIEW_COLUMN_SORTED, self.Sort, id = wx.ID_ANY ) self.Bind( wx.dataview.EVT_DATAVIEW_ITEM_ACTIVATED, self.selct, id = wx.ID_ANY ) self.btn1.Bind( wx.EVT_BUTTON, self.retrn )