def OnLineSpacingDouble(self, evt): attr = rt.RichTextAttr() attr.SetFlags(wx.TEXT_ATTR_LINE_SPACING) ip = self.ctrl_editeur.GetInsertionPoint() if self.ctrl_editeur.GetStyle(ip, attr): r = rt.RichTextRange(ip, ip) if self.ctrl_editeur.HasSelection(): r = self.ctrl_editeur.GetSelectionRange() attr.SetFlags(wx.TEXT_ATTR_LINE_SPACING) attr.SetLineSpacing(20) self.ctrl_editeur.SetStyle(r, attr)
def OnParagraphSpacingMore(self, evt): attr = rt.RichTextAttr() attr.SetFlags(wx.TEXT_ATTR_PARA_SPACING_AFTER) ip = self.ctrl_editeur.GetInsertionPoint() if self.ctrl_editeur.GetStyle(ip, attr): r = rt.RichTextRange(ip, ip) if self.ctrl_editeur.HasSelection(): r = self.ctrl_editeur.GetSelectionRange() attr.SetParagraphSpacingAfter(attr.GetParagraphSpacingAfter() + 20); attr.SetFlags(wx.TEXT_ATTR_PARA_SPACING_AFTER) self.ctrl_editeur.SetStyle(r, attr)
def OnIndentMore(self, evt): attr = rt.RichTextAttr() attr.SetFlags(wx.TEXT_ATTR_LEFT_INDENT) ip = self.ctrl_editeur.GetInsertionPoint() if self.ctrl_editeur.GetStyle(ip, attr): r = rt.RichTextRange(ip, ip) if self.ctrl_editeur.HasSelection(): r = self.ctrl_editeur.GetSelectionRange() attr.SetLeftIndent(attr.GetLeftIndent() + 100) attr.SetFlags(wx.TEXT_ATTR_LEFT_INDENT) self.ctrl_editeur.SetStyle(r, attr)
def OnLineSpacingHalf(self, evt): attr = rt.TextAttrEx() attr.SetFlags(rt.TEXT_ATTR_LINE_SPACING) ip = self.rtc.GetInsertionPoint() if self.rtc.GetStyle(ip, attr): r = rt.RichTextRange(ip, ip) if self.rtc.HasSelection(): r = self.rtc.GetSelectionRange() attr.SetFlags(rt.TEXT_ATTR_LINE_SPACING) attr.SetLineSpacing(15) self.rtc.SetStyle(r, attr)
def OnParagraphSpacingLess(self, evt): attr = wx.TextAttr() attr.SetFlags(wx.TEXT_ATTR_PARA_SPACING_AFTER) ip = self.rtc.GetInsertionPoint() if self.rtc.GetStyle(ip, attr): r = rt.RichTextRange(ip, ip) if self.rtc.HasSelection(): r = self.rtc.GetSelectionRange() if attr.GetParagraphSpacingAfter() >= 20: attr.SetParagraphSpacingAfter(attr.GetParagraphSpacingAfter() - 20); attr.SetFlags(wx.TEXT_ATTR_PARA_SPACING_AFTER) self.rtc.SetStyle(r, attr)
def OnIndentLess(self, evt): attr = wx.TextAttr() attr.SetFlags(wx.TEXT_ATTR_LEFT_INDENT) ip = self.rtc.GetInsertionPoint() if self.rtc.GetStyle(ip, attr): r = rt.RichTextRange(ip, ip) if self.rtc.HasSelection(): r = self.rtc.GetSelectionRange() if attr.GetLeftIndent() >= 100: attr.SetLeftIndent(attr.GetLeftIndent() - 100) attr.SetFlags(wx.TEXT_ATTR_LEFT_INDENT) self.rtc.SetStyle(r, attr)
def indent_less(self, evt): "alinea minder ver laten inspringen" attr = rt.RichTextAttr() attr.SetFlags(wx.TEXT_ATTR_LEFT_INDENT) ip = self.GetInsertionPoint() if self.GetStyle(ip, attr): range = rt.RichTextRange(ip, ip) if self.HasSelection(): range = self.GetSelectionRange() if attr.GetLeftIndent() >= 100: attr.SetLeftIndent(attr.GetLeftIndent() - 100) attr.SetFlags(wx.TEXT_ATTR_LEFT_INDENT) self.SetStyle(range, attr)
def decrease_parspacing_less(self, evt): "ruimte tussen alinea's verkleinen" attr = rt.RichTextAttr() attr.SetFlags(wx.TEXT_ATTR_PARA_SPACING_AFTER) ip = self.GetInsertionPoint() if self.GetStyle(ip, attr): range = rt.RichTextRange(ip, ip) if self.HasSelection(): range = self.GetSelectionRange() if attr.GetParagraphSpacingAfter() >= 20: attr.SetParagraphSpacingAfter(attr.GetParagraphSpacingAfter() - 20) attr.SetFlags(wx.TEXT_ATTR_PARA_SPACING_AFTER) self.SetStyle(range, attr)