Commit 64fd8aeb authored by Keegi's avatar Keegi

make macro editor a Dialog, not a Frame so it does not get lost behind the main window

parent 0af50050
...@@ -946,11 +946,11 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -946,11 +946,11 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self.printbtn.SetLabel("Print") self.printbtn.SetLabel("Print")
self.paused=0 self.paused=0
class macroed(wx.Frame): class macroed(wx.Dialog):
"""Really simple editor to edit macro definitions""" """Really simple editor to edit macro definitions"""
def __init__(self,macro_name,definition,callback): def __init__(self,macro_name,definition,callback):
self.indent_chars = " " self.indent_chars = " "
wx.Frame.__init__(self,None,title="macro %s" % macro_name) wx.Dialog.__init__(self,None,title="macro %s" % macro_name)
self.callback = callback self.callback = callback
self.panel=wx.Panel(self,-1) self.panel=wx.Panel(self,-1)
titlesizer=wx.BoxSizer(wx.HORIZONTAL) titlesizer=wx.BoxSizer(wx.HORIZONTAL)
...@@ -974,10 +974,10 @@ class macroed(wx.Frame): ...@@ -974,10 +974,10 @@ class macroed(wx.Frame):
self.Show() self.Show()
self.e.SetFocus() self.e.SetFocus()
def save(self,ev): def save(self,ev):
self.Close() self.Destroy()
self.callback(self.reindent(self.e.GetValue())) self.callback(self.reindent(self.e.GetValue()))
def close(self,ev): def close(self,ev):
self.Close() self.Destroy()
def unindent(self,text): def unindent(self,text):
import re import re
self.indent_chars = text[:len(text)-len(text.lstrip())] self.indent_chars = text[:len(text)-len(text.lstrip())]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment