def _createFields(self): frame = self.clientArea MyLabel(frame, 'Name: ', 0, 0, "nw", None, 3, (10, 3)) self._teName = TextEntry(frame, 1, 0, "nwe", 3, (10, 3)) MyLabel(frame, 'Password: ', 0, 1, "nw", None, 3, (3, 10)) self._tePwd = TextEntry(frame, 1, 1, "nwe", 3, (3, 10)) self._tePwd.config(show="*")
def _createTags(self, parent, row, col, padx, pady): Label(parent, text="Tags: ").grid(row=row, column=col, sticky='nw', padx=padx, pady=pady) col += 1 tags = TextEntry(parent) tags.grid(row=row, column=col, sticky='nwe', padx=padx, pady=pady) tags.bind('<Control-s>', self._onCtrlS) ToolTip(tags, "Enter as many comma-separated tags as you want") return tags
def _createTitle(self, parent, row, col, padx, pady) -> TextEntry: Label(parent, text="Caption: ").grid(row=row, column=col, sticky='nw', padx=padx, pady=pady) col += 1 title = TextEntry(parent) title.grid(row=row, column=col, sticky='nwe', padx=padx, pady=pady) title.bind('<Control-s>', self._onCtrlS) ToolTip(title, "This caption will be used to display this note in the tree") return title
def _createMietvertragFrame(self, row, xmargins: int, topmargin: int, bottommargin: int): padx = xmargins pady = (topmargin, bottommargin) lf = ttk.Labelframe(self, text='Mietvertrag', style='my.TLabelframe') lf.grid(column=0, row=row, sticky='nswe', padx=padx, pady=pady) padx = (5, 6) pady = (5, 5) ######### Vermietung ab col = row = 0 MyLabel(lf, 'Vermietung ab:', col, row, 'nswe', 'w', padx, pady) col += 1 de = DateEntry(lf) de.registerModifyCallback(self._onModified) de.grid(column=col, row=row, sticky='nswe', padx=padx, pady=pady) de.setWidth(10) self._deVermietetAb = de ######### Vermietung befristet bis col += 1 MyLabel(lf, 'befristet bis:', col, row, 'nswe', 'w', padx, pady) col += 1 de = DateEntry(lf) de.registerModifyCallback(self._onModified) de.grid(column=col, row=row, sticky='nsw', padx=padx, pady=pady) de.setWidth(10) self._deVermietetBis = de ######## Kaution row += 1 col = 0 MyLabel(lf, 'Kaution:', col, row, 'nswe', 'w', padx, pady) col += 1 ie = IntEntry(lf) ie.registerModifyCallback(self._onModified) ie.grid(column=col, row=row, sticky='nswe', padx=padx, pady=pady) ie.setWidth(5) self._ieKaution = ie ######### bei welcher Bank col += 1 MyLabel(lf, 'hinterlegt bei:', col, row, 'nswe', 'w', padx, pady) col += 1 te = TextEntry(lf, col, row, 'nswe', padx, pady) te.registerModifyCallback(self._onModified) self._teAngelegtBei = te
def createGroupBoxContent(self) -> None: AddressGroup.createGroupBoxContent(self) box = self.getGroupBoxFrame() padx = pady = 3 l = MyLabel(box, text='Steuernummer:', column=0, row=5, sticky='nw', padx=padx, pady=pady) self._teSteuernummer = TextEntry(box, column=1, row=5, sticky='nwe', padx=padx, pady=(pady, pady + 3)) self._teSteuernummer.grid(columnspan=3)
def _createWohnungLabelFrame(self, padx: int, pady: int) -> ttk.Labelframe: lf = ttk.Labelframe(self, text='Wohnung') lbl = MyLabel(lf, 'Angeschafft am: ', 0, 0, 'nsw', 'w', padx, pady) de = DateEntry(lf) de.setBackground('Whg.TEntry', 'lightyellow') de.setUseCalendar(False) de['width'] = 10 de.registerModifyCallback(self._onWhgModified) de.grid(column=1, row=0, sticky='nsw', padx=padx, pady=pady) self._angeschafft_am = de MyLabel(lf, 'Einh.wert-Az: ', 2, 0, 'nswe', 'e', padx, pady) te = TextEntry(lf, 3, 0, 'nsw', padx, pady) te.grid_configure(columnspan=2) te.setBackground('Whg.TEntry', 'lightyellow') te.registerModifyCallback(self._onWhgModified) self._einhwert_az = te lbl = MyLabel( lf, 'Steuerl. Überschuss/Verlust zurechnen auf Ehemann/Ehefrau (%):', 0, 1, 'nsw', 'w', padx, pady) lbl.grid_configure(columnspan=3) self._zurechng_ehemann = IntEntry(lf) ie = self._zurechng_ehemann ie.grid(column=3, row=1, sticky='nse', padx=padx, pady=pady) ie.setWidth(4) ie.setBackground('Whg.TEntry', 'lightyellow') ie.setValue(100) ie.registerModifyCallback(self._onWhgModified) self._zurechng_ehefrau = IntEntry(lf) ie2 = self._zurechng_ehefrau ie2.grid(column=4, row=1, sticky='nsw', padx=padx, pady=pady) ie2.setWidth(4) ie2.setBackground('Whg.TEntry', 'lightyellow') ie2.setValue(0) ie2.registerModifyCallback(self._onWhgModified) return lf
def _createInseratText(self, row, xmargins: int, topmargin: int, bottommargin: int): padx = xmargins pady = (topmargin, bottommargin) lf = ttk.LabelFrame(self, text='Inserat', style='my.TLabelframe') lf.grid(column=0, row=row, sticky='nswe', padx=padx, pady=pady) lf.columnconfigure(1, weight=1) lf.columnconfigure(3, weight=1) row = col = 0 MyLabel(lf, 'Text:', col, row, 'nw', 'w', padx, pady) col += 1 txt = MyText(lf) txt['height'] = 6 txt['width'] = 50 txt.registerModifyCallback(self._onModified) txt.grid(column=col, row=row, sticky='nswe', padx=padx, pady=pady) self._txtInseratText = txt col += 1 MyLabel(lf, 'inseriert bei:', col, row, 'nw', 'w', padx, pady) col += 1 te = TextEntry(lf, col, row, 'nwe', padx, pady) te.registerModifyCallback(self._onModified) self._teInseriertBei = te
def _createUI(self): padx = pady = 5 self.columnconfigure(1, weight=1) MyLabel(self, 'Firma: ', 0, 0, 'nswe', 'e', padx, pady) self._teFirma = TextEntry(self, 1, 0, 'nswe', padx, pady) self._teFirma.setBackground('My.TEntry', 'lightyellow') self._teFirma.registerModifyCallback(self._onVerwalterModified) MyLabel(self, 'Straße: ', 0, 1, 'nswe', 'e', padx, pady) self._teStrasse = TextEntry(self, 1, 1, 'nswe', padx, pady) self._teStrasse.setWidth(30) self._teStrasse.registerModifyCallback(self._onVerwalterModified) MyLabel(self, 'PLZ/Ort: ', 0, 2, 'nswe', 'e', padx, pady) f = ttk.Frame(self) f.columnconfigure(1, weight=1) self._tePlz = TextEntry(f, 0, 0, 'nsw', padx=(0, 3)) self._tePlz['width'] = 6 self._tePlz.registerModifyCallback(self._onVerwalterModified) self._teOrt = TextEntry(f, 1, 0, 'nswe') self._teOrt.setWidth(30) self._teOrt.registerModifyCallback(self._onVerwalterModified) f.grid(column=1, row=2, sticky='nswe', padx=padx, pady=pady) MyLabel(self, 'Telefon: ', 0, 3, 'nswe', 'e', padx, pady) self._teTelefon = TextEntry(self, 1, 3, 'nswe', padx, pady) self._teTelefon.registerModifyCallback(self._onVerwalterModified) MyLabel(self, 'Mail-Adresse: ', 0, 4, 'nswe', 'e', padx, pady) self._teEmail = TextEntry(self, 1, 4, 'nswe', padx, pady) self._teEmail.registerModifyCallback(self._onVerwalterModified) f:ttk.Frame = self._createSaveCancelButtons() f.grid(column=1, row=5, sticky='se', padx=padx, pady=pady)
def _createUI(self): padx = pady = 5 self.columnconfigure(1, weight=1) MyLabel(self, 'Straße: ', 0, 0, 'nswe', 'e', padx, pady) self._teStrasse = TextEntry(self, 1, 0, 'nswe', padx, pady) self._teStrasse.setBackground('My.TEntry', 'lightyellow') self._teStrasse.setWidth(30) self._teStrasse.registerModifyCallback(self._onWohnungModified) MyLabel(self, 'PLZ/Ort: ', 0, 1, 'nswe', 'e', padx, pady) f = ttk.Frame(self) f.columnconfigure(1, weight=1) self._tePlz = TextEntry(f, 0, 0, 'nsw', padx=(0, 3)) self._tePlz['width'] = 6 self._tePlz.setBackground('My.TEntry', 'lightyellow') self._tePlz.registerModifyCallback(self._onWohnungModified) self._teOrt = TextEntry(f, 1, 0, 'nswe') self._teOrt.setBackground('My.TEntry', 'lightyellow') self._teOrt.setWidth(30) self._teOrt.registerModifyCallback(self._onWohnungModified) f.grid(column=1, row=1, sticky='nswe', padx=padx, pady=pady) MyLabel(self, 'Whg.-Bez.: ', 0, 2, 'nswe', 'e', padx, pady) self._teWhg_bez = TextEntry(self, 1, 2, 'nswe', padx, pady) self._teWhg_bez.setBackground('My.TEntry', 'lightyellow') self._teWhg_bez.registerModifyCallback(self._onWohnungModified) MyLabel(self, 'Angeschafft am: ', 0, 3, 'nswe', 'e', padx, pady) de = DateEntry(self) de.setUseCalendar(False) de['width'] = 10 de.grid(column=1, row=3, sticky='nw', padx=padx, pady=pady) self._deAngeschafft_am = de self._deAngeschafft_am.registerModifyCallback(self._onWohnungModified) MyLabel(self, 'Einhts.wert-Az: ', 0, 4, 'nswe', 'e', padx, pady) self._teEinhwert_az = TextEntry(self, 1, 4, 'nswe', padx, pady) #self._teEinhwert_az.grid(columnspan=2) self._teEinhwert_az.registerModifyCallback(self._onWohnungModified) MyLabel(self, 'Vermieter:', column=0, row=5, sticky='nse', anchor='e', padx=padx, pady=pady) cbo = MyCombobox(self) cbo.setReadonly(True) cbo.registerModifyCallback(self._onWohnungModified) cbo.grid(column=1, row=5, sticky='we', padx=padx, pady=pady) self._cboVermieter = cbo btn = ButtonFactory.getNewButton( self, 'Neuen Vermieter anlegen', partial(self._onAction, StammdatenAction.new_vermieter)) btn.grid(column=2, row=5, sticky='swe', padx=(0, 0), pady=pady) btnEdit = ButtonFactory.getEditButton( self, 'Vermieterdaten ändern', partial(self._onAction, StammdatenAction.edit_vermieter)) btnEdit.grid(column=3, row=5, sticky='swe', padx=(0, 0), pady=pady) MyLabel(self, 'Verwalter:', column=0, row=6, sticky='nse', padx=padx, pady=pady) cbo = MyCombobox(self) cbo.setReadonly(True) cbo.registerModifyCallback(self._onWohnungModified) cbo.grid(column=1, row=6, sticky='we', padx=padx, pady=pady) self._cboVerwalter = cbo btn2 = ButtonFactory.getNewButton( self, 'Neuen Verwalter anlegen', partial(self._onAction, StammdatenAction.new_verwalter)) btn2.grid(column=2, row=6, sticky='swe', padx=(0, 0), pady=pady) btnEdit2 = ButtonFactory.getEditButton( self, 'Verwalterdaten ändern', partial(self._onAction, StammdatenAction.edit_verwalter)) btnEdit2.grid(column=3, row=6, sticky='swe', padx=(0, 0), pady=pady) f: ttk.Frame = self._createSaveCancelButtons() f.grid(column=1, columnspan=3, sticky='e', padx=padx, pady=pady)
def createGroupBoxContent(self) -> None: box = self.getGroupBoxFrame() padx = pady = 3 topy = 12 row = 0 v = IntVar() self._rbFrau = ttk.Radiobutton(box, text='Frau', variable=v, value=1) self._rbFrau.grid(column=1, row=row, sticky='nsw', padx=padx, pady=(topy, pady)) self._rbHerr = ttk.Radiobutton(box, text='Herr', variable=v, value=2) self._rbHerr.grid(column=2, row=row, sticky='nsw', padx=padx, pady=(topy, pady)) self._rbFirma = ttk.Radiobutton(box, text='Firma', variable=v, value=3) self._rbFirma.grid(column=3, row=row, sticky='nsw', padx=padx, pady=(topy, pady)) row += 1 l = MyLabel(box, text='Name:', column=0, row=row, sticky='ne', padx=padx, pady=pady, align='e') self._teName = TextEntry(box, column=1, row=row, sticky='nwe', padx=padx, pady=pady) self._teName.grid(columnspan=3) row += 1 MyLabel(box, text='ggf. Vorname:', column=0, row=row, sticky='ne', padx=padx, pady=pady, align='e') self._teVorname = TextEntry(box, column=1, row=row, sticky='nwe', padx=padx, pady=pady) self._teVorname.grid(columnspan=3) row += 1 l = MyLabel(box, text='Straße:', column=0, row=row, sticky='ne', padx=padx, pady=pady, align='e') self._teStrasse = TextEntry(box, column=1, row=row, sticky='nwe', padx=padx, pady=pady) self._teStrasse.setWidth(35) self._teStrasse.grid(columnspan=3) row += 1 #PLZ/Ort l = MyLabel(box, text='PLZ / Ort:', column=0, row=row, sticky='ne', padx=padx, pady=pady, align='e') f = ttk.Frame(box) self._tePlz = TextEntry(f, column=0, row=0, sticky='nw', padx=padx, pady=pady) self._tePlz.setWidth(6) self._teOrt = TextEntry(f, column=1, row=0, sticky='ne', padx=padx, pady=pady) f.grid(column=1, columnspan=3, row=row, sticky='nswe', padx=0, pady=0) self._teOrt.setWidth(30)
def _createMieterFrame(self, row, xmargins: int, topmargin: int, bottommargin: int): padx = xmargins pady = (topmargin, bottommargin) lf = ttk.Labelframe(self, text='Mieter', style='my.TLabelframe') lf.grid(column=0, row=row, sticky='nswe', padx=padx, pady=pady) padx = (5, 6) pady = (5, 5) col = row = 0 ######### Anrede MyLabel(lf, 'Anrede:', col, row, 'nswe', 'w', padx, pady) col += 1 cbo = MyCombobox(lf) cbo.setItems(('Frau', 'Herr')) cbo.setWidth(4) cbo.registerModifyCallback(self._onModified) cbo.grid(column=col, row=row, sticky='nsw', padx=padx, pady=pady) self._cboAnrede = cbo ######### Name col += 1 MyLabel(lf, 'Name:', col, row, 'nswe', 'w', padx, pady) col += 1 te = TextEntry(lf, col, row, 'nswe', padx, pady) te.registerModifyCallback(self._onModified) self._teName = te ######### Vorname col += 1 MyLabel(lf, 'Vorname:', col, row, 'nswe', 'w', padx, pady) col += 1 te = TextEntry(lf, col, row, 'nswe', padx, pady) te.registerModifyCallback(self._onModified) self._teVorname = te ######### Geburtstag row += 1 col = 0 MyLabel(lf, 'Geburtstag:', col, row, 'nswe', 'w', padx, pady) col += 1 te = TextEntry(lf, col, row, 'nswe', padx, pady) te.registerModifyCallback(self._onModified) self._teGeboren_am = te ######### Perso-Nr. col += 1 MyLabel(lf, 'Personalausweis-Nr.:', col, row, 'nswe', 'w', padx, pady) col += 1 te = TextEntry(lf, col, row, 'nswe', padx, pady) te.grid(columnspan=2) te.registerModifyCallback(self._onModified) self._teAusweisId = te ######## Telefon row += 1 col = 0 MyLabel(lf, 'Telefon:', col, row, 'nswe', 'w', padx, pady) col += 1 te = TextEntry(lf, col, row, 'nswe', padx, pady) te.registerModifyCallback(self._onModified) self._teTelefon = te ######### mailto col += 1 MyLabel(lf, 'Mailto:', col, row, 'nswe', 'w', padx, pady) col += 1 te = TextEntry(lf, col, row, 'nswe', padx, pady) te.grid(columnspan=2) te.registerModifyCallback(self._onModified) self._teMailto = te ######## Bankverbindung row += 1 col = 0 MyLabel(lf, 'IBAN:', col, row, 'nswe', 'w', padx, pady) col += 1 te = TextEntry(lf, col, row, 'nswe', padx, pady) te.registerModifyCallback(self._onModified) te.grid(columnspan=2) self._teIban = te
def _createAllgemeinFrame(self, row, padx, pady): lf = ttk.Labelframe(self, text='Allgemeine Daten', style='my.TLabelframe') lf.grid(column=0, row=row, sticky='nswe', padx=padx, pady=(pady + 8, pady)) ### Combo und Label für Etage col = 0 cbo = MyCombobox(lf) cbo.setItems((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)) cbo.setWidth(3) cbo.registerModifyCallback(self._onModified) cbo.grid(column=col, row=0, sticky='nswe', padx=padx, pady=pady) col += 1 self._cboEtage = cbo MyLabel(lf, '. Etage', col, 0, 'nswe', 'w', (0, padx), pady) #### Entry und Label für qm col += 1 ie = IntEntry(lf) ie.setWidth(3) ie.registerModifyCallback(self._onModified) ie.grid(column=col, row=0, sticky='nswe', padx=padx, pady=pady) self._ieQm = ie col += 1 lbl = MyLabel(lf, 'qm', col, 0, 'nswe', 'w', (0, padx), pady) ### Combo und Label für Zimmer col += 1 cbo = MyCombobox(lf) cbo.setItems((1, 1.5, 2, 2.5, 3, 3.5, 4, 5)) cbo.setIndex(2) cbo.setWidth(3) cbo.registerModifyCallback(self._onModified) cbo.grid(column=col, row=0, sticky='nswe', padx=padx, pady=pady) self._cboZimmer = cbo col += 1 MyLabel(lf, 'Zimmer', col, 0, 'nswe', 'w', (0, padx), pady) ### Entry und Label für Anteile col += 1 ie = IntEntry(lf) ie.setWidth(3) ie.grid(column=col, row=0, sticky='nswe', padx=padx, pady=pady) ie.registerModifyCallback(self._onModified) self._ieAnteil = ie col += 1 MyLabel(lf, 'Anteile am Gesamtobjekt', col, 0, 'nswe', 'w', (0, padx), pady) ### neue Zeile ### Checkbutton für Aufzug col = 0 cb = ttk.Checkbutton(lf, text='Aufzug im Haus', variable=self._ivarAufzug) cb.grid(column=col, row=1, columnspan=2, sticky='nswe', padx=padx, pady=pady) self._cbAufzug = cb ### neue Zeile ### Label und Entry für IBAN col = 0 lbl = MyLabel(lf, 'IBAN der WEG ', 0, 2, 'nswe', 'w', padx, pady) lbl.grid(columnspan=2) col += 2 te = TextEntry(lf, col, 2, 'nswe', (padx), pady) te.registerModifyCallback(self._onModified) te.grid(columnspan=5) self._teIbanWEG = te