Changeset 274

Show
Ignore:
Timestamp:
02/26/08 01:04:11 (11 months ago)
Author:
bob
Message:

Code cleaning, unused files removed

Location:
artub
Files:
3 removed
17 modified

Legend:

Unmodified
Added
Removed
  • artub/StyledTextCtrl_2.py

    r268 r274  
    1  
    21import  keyword 
    3  
    42import  wx 
    53import  wx.stc  as  stc 
    6  
    7 import  images 
    8  
    9 #---------------------------------------------------------------------- 
    10  
    11 demoText = """\ 
    12 ## This version of the editor has been set up to edit Python source 
    13 ## code.  Here is a copy of wxPython/demo/Main.py to play with. 
    14  
    15  
    16 """ 
    17  
    18 #---------------------------------------------------------------------- 
    19  
    204 
    215if wx.Platform == '__WXMSW__': 
     
    186170        self.SetCaretForeground("BLUE") 
    187171 
    188  
    189         # register some images for use in the AutoComplete box. 
    190         self.RegisterImage(1, images.getSmilesBitmap()) 
    191         self.RegisterImage(2, images.getFile1Bitmap()) 
    192         self.RegisterImage(3, images.getCopy2Bitmap()) 
    193  
    194172        self.cut_paste = False 
    195173        self.backspace = False 
     
    211189            # Code completion 
    212190            else: 
    213                 #lst = [] 
    214                 #for x in range(50000): 
    215                 #    lst.append('%05d' % x) 
    216                 #st = " ".join(lst) 
    217                 #print len(st) 
    218                 #self.AutoCompShow(0, st) 
    219  
    220191                kw = keyword.kwlist[:] 
    221192                kw.append("zzzzzz?2") 
    222                 kw.append("aaaaa?2") 
    223                 kw.append("__init__?3") 
    224                 kw.append("zzaaaaa?2") 
    225                 kw.append("zzbaaaa?2") 
    226193                kw.append("this_is_a_longer_value") 
    227                 #kw.append("this_is_a_much_much_much_much_much_much_much_longer_value") 
    228194 
    229195                kw.sort()  # Python sorts are case sensitive 
     
    372338 
    373339        return line 
    374  
    375  
    376 #---------------------------------------------------------------------- 
    377  
    378 _USE_PANEL = 1 
    379  
    380 def runTest(frame, nb, log): 
    381     if not _USE_PANEL: 
    382         ed = p = PythonSTC(nb, -1) 
    383     else: 
    384         p = wx.Panel(nb, -1, style = wx.NO_FULL_REPAINT_ON_RESIZE) 
    385         ed = PythonSTC(p, -1) 
    386         s = wx.BoxSizer(wx.HORIZONTAL) 
    387         s.Add(ed, 1, wx.EXPAND) 
    388         p.SetSizer(s) 
    389         p.SetAutoLayout(True) 
    390  
    391  
    392     ed.SetText(demoText + open('Main.py').read()) 
    393     ed.EmptyUndoBuffer() 
    394     ed.Colourise(0, -1) 
    395  
    396     # line numbers in the margin 
    397     ed.SetMarginType(1, stc.STC_MARGIN_NUMBER) 
    398     ed.SetMarginWidth(1, 25) 
    399  
    400     return p 
    401  
    402  
    403  
    404 #---------------------------------------------------------------------- 
    405  
    406  
    407 overview = """\ 
    408 <html><body> 
    409 Once again, no docs yet.  <b>Sorry.</b>  But <a href="data/stc.h.html">this</a> 
    410 and <a href="http://www.scintilla.org/ScintillaDoc.html">this</a> should 
    411 be helpful. 
    412 </body><html> 
    413 """ 
    414  
    415  
    416 if __name__ == '__main__': 
    417     import sys,os 
    418     import run 
    419     run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:]) 
    420  
    421  
    422  
    423  
    424  
    425 #---------------------------------------------------------------------- 
    426 #---------------------------------------------------------------------- 
    427  
  • artub/animation.py

    r179 r274  
    1  
    21from glumolresource import VirtualGlumolResource, CGlumolResource 
    32from script import CScript 
  • artub/artub.py

    r268 r274  
    6666 
    6767class ArtubTree(wx.TreeCtrl): 
    68     def __init__(self, parent, artub, style = wx.TR_HAS_BUTTONS | wx.TR_EDIT_LABELS | #Crash on Windows !!! 
     68    def __init__(self, parent, artub, style = wx.TR_HAS_BUTTONS | wx.TR_EDIT_LABELS | # Crash on Windows !!! 
    6969                                              wx.TR_HAS_VARIABLE_ROW_HEIGHT | 
    7070                                              wx.TR_LINES_AT_ROOT | 
     
    406406 
    407407class ArtubFrame(wx.Frame, CEditorManager): 
     408    resource_icons = { CDialogue : 1, CAnimation : 0, CGlumolObject : 2, 
     409                       CProject : 4, CScript : 3, VirtualGlumolObject : 2, 
     410                       CGlumolFont : 5, VirtualAnimation : 0 } 
     411 
    408412    def __init__(self, parent, id, title, config): 
    409413        CEditorManager.__init__(self) 
     
    441445            self.log = wx.TextCtrl(frame, -1, 
    442446                                   style = wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL) 
    443             artublog = log.ArtubLog(self.log) 
    444             artublog.redirect_outputs() 
    445             wx.Log_SetActiveTarget(artublog) 
     447            log.set_text_ctrl(self.log) 
    446448            frame.Show(True) 
    447449             
     
    475477 
    476478        self.otherWin = None 
    477         wx.EVT_IDLE(self, self.OnIdle) 
    478         wx.EVT_CLOSE(self, self.OnCloseWindow) 
    479         wx.EVT_ICONIZE(self, self.OnIconfiy) 
    480         wx.EVT_MAXIMIZE(self, self.OnMaximize) 
     479        wx.EVT_IDLE(self, self.on_idle) 
     480        wx.EVT_CLOSE(self, self.on_close_window) 
     481        wx.EVT_ICONIZE(self, self.on_iconify) 
     482        wx.EVT_MAXIMIZE(self, self.on_maximize) 
    481483 
    482484        self.Centre(wx.BOTH) 
     
    509511                                   Caption(_("Notebook")).CenterPane()) 
    510512 
    511         wx.EVT_MENU_RANGE(self, wx.ID_FILE1, wx.ID_FILE9, self.OnFileHistory) 
     513        wx.EVT_MENU_RANGE(self, wx.ID_FILE1, wx.ID_FILE9, self.on_file_history) 
    512514 
    513515        # Startup page 
     
    532534        self._mgr.Update() 
    533535        self._mgr.HideHint() 
    534         #import psyco 
    535         #psyco.profile() 
    536536 
    537537    def CloseWindow(self, event): 
     
    564564                this.Bind(wx.EVT_TOOL, self.on_save, id=12) 
    565565                this.AddSimpleTool(13, self.bitmaps['cut.xpm'], _("Cut to the clipboard"), _("Cut to the clipboard")) 
    566                 #this.Bind(wx.EVT_TOOL, self.on_cut, id=13) 
    567566                this.AddSimpleTool(14, self.bitmaps['copy.xpm'], _("Copy to the clipboard"), _("Copy to the clipboard")) 
    568                 #this.Bind(wx.EVT_TOOL, self.on_copy, id=14) 
    569567                this.AddSimpleTool(15, self.bitmaps['paste.xpm'], _("Paste from the clipboard"), _("Paste from the clipboard")) 
    570                 #this.Bind(wx.EVT_TOOL, self.on_paste, id=15) 
    571568                this.AddSimpleTool(self.undoID, self.bitmaps['undo.xpm'], _("Undo last change"), _("Undo last change")) 
    572569                this.Bind(wx.EVT_TOOL, self.undo, id=self.undoID) 
     
    574571                this.Bind(wx.EVT_TOOL, self.undo, id=self.redoID) 
    575572                 
    576                 # wx.EVT_UPDATE_UI_RANGE(self, 10, 15, self.on_update_ui) 
    577                  
    578573                this.Realize() 
    579574 
    580         self.maintoolbar = self.toolbar_manager.create_toolbar(MainToolBar,#, introText="Welcome to the Glumol debugger") 
     575        self.maintoolbar = self.toolbar_manager.create_toolbar(MainToolBar, 
    581576                           infos = PyAUI.AuiPaneInfo().Name(_("Main toolbar")). 
    582577                           Caption(_("Main toolbar")). 
     
    596591         
    597592    def create_menus(self): 
    598         # Make a File menu 
    599593        self.mainmenu = wx.MenuBar() 
    600594        menu = wx.Menu() 
     
    761755        self.edit_resource(resource, self.get_editor('akiki')) 
    762756     
    763     resource_icons = { CDialogue : 1, CAnimation : 0, CGlumolObject : 2, 
    764                        CProject : 4, CScript : 3, VirtualGlumolObject : 2, 
    765                        CGlumolFont : 5, VirtualAnimation : 0 } 
    766  
    767757    def add_member_class(self, name, cl2, resource, newid, recurse = True): 
    768758        if cl2.__name__ != name: return 
     
    11981188    """ 
    11991189     
    1200     def OnIdle(self, event): 
     1190    def on_idle(self, event): 
    12011191        if self.todos: 
    12021192            todo = self.todos[0] 
     
    12111201        schedule() 
    12121202 
    1213     def OnFileHistory(self, evt): 
     1203    def on_file_history(self, evt): 
    12141204        filenum = evt.GetId() - wx.ID_FILE1 
    12151205        path = self.filehistory.GetHistoryFile(filenum) 
    12161206        self.open_project(path) 
    12171207     
    1218     def OnCloseWindow(self, event): 
     1208    def on_close_window(self, event): 
    12191209        self.on_exit(event) 
    12201210         
    1221     def OnIconfiy(self, evt): 
     1211    def on_iconify(self, evt): 
    12221212        evt.Skip() 
    12231213 
    1224     def OnMaximize(self, evt): 
     1214    def on_maximize(self, evt): 
    12251215        evt.Skip() 
    12261216         
     
    12651255                dlg.ShowModal() 
    12661256                dlg.Destroy() 
    1267                 """ 
    1268                 dlg = wx.MessageDialog(self, _('Artub has been successfully updated to version ') + str(version), 
    1269                                              _('Update successfull'), 
    1270                                              wx.OK | wx.ICON_INFORMATION 
    1271                                              #wx.YES_NO | wx.NO_DEFAULT | wx.CANCEL | wx.ICON_INFORMATION 
    1272                                       ) 
    1273                 dlg.ShowModal() 
    1274                 dlg.Destroy() 
    1275                 """ 
    12761257            else: 
    12771258                dlg = wx.MessageDialog(self, 
     
    12811262                dlg.ShowModal() 
    12821263                dlg.Destroy() 
    1283                 """ 
    1284                 dlg = wx.MessageDialog(self, _('You are already running the lastest version'), 
    1285                                              _('No update available'), 
    1286                                              wx.OK | wx.ICON_INFORMATION 
    1287                                              #wx.YES_NO | wx.NO_DEFAULT | wx.CANCEL | wx.ICON_INFORMATION 
    1288                                       ) 
    1289                 dlg.ShowModal() 
    1290                 dlg.Destroy() 
    1291                 """ 
    12921264        except: 
    12931265            sys.stdout = oldstdout 
     
    13061278        from wx.lib.wordwrap import wordwrap 
    13071279        info = wx.AboutDialogInfo() 
    1308         info.Name = "Artub" 
    1309         info.Version = "0.99" 
    1310         info.Copyright = "(C) 2006 B&c International Software Inc." 
     1280        info.Name = _("Artub") 
     1281        info.Version = _("0.99") 
     1282        info.Copyright = _("(C) 2006 B&c International Software Inc.") 
    13111283        info.Description = wordwrap( 
    1312             "Artub is the Glumol's graphical interface " \ 
     1284            _("Artub is the Glumol's graphical interface " \ 
    13131285            "that allows you to easily create adventure games.\n\n" \ 
    13141286            "This software is released under the GNU licence v2, " \ 
    1315             "see COPYING in the Glumol main folder.", 
     1287            "see COPYING in the Glumol main folder."), 
    13161288            350, wx.ClientDC(self)) 
    1317         info.WebSite = ("http://www.glumol.com", "The Glumol Homepage") 
     1289        info.WebSite = ("http://www.glumol.com", _("The Glumol Homepage")) 
    13181290        info.Developers = [ "Sylvain Baubeau", 
    13191291                            "Alexis Contour" ] 
    13201292 
    1321         # Render is horrible 
     1293        # Render looks terrible 
    13221294        #info.License = wordwrap(open(os.path.join(wx.GetApp().artub_path, "COPYING")).read(), 
    13231295        #                        350, wx.ClientDC(self)) 
     
    14161388        self.Destroy() 
    14171389        self._mgr.UnInit() 
    1418         #if os.name != 'nt': 
    1419         #    import signal 
    1420         #    os.kill(os.getpid(), signal.SIGKILL) 
    1421          
     1390        if os.name != 'nt': 
     1391            self.seppuku() 
     1392 
     1393    def seppuku(self): 
     1394        import threading 
     1395        import signal 
     1396        os.kill(os.getpid(), signal.SIGKILL) 
     1397 
    14221398    def on_debug_run(self, evt): 
    14231399        self.sync() 
  • artub/artubnotebook.py

    r204 r274  
    11import wx 
    22from depplatform import get_image_path 
    3 import notebookctrl 
    43import wx.lib.flatnotebook as fnb 
    54 
  • artub/choosename.py

    r260 r274  
    1818        sizer2 = wx.BoxSizer(wx.HORIZONTAL) 
    1919         
    20         self.text = wx.StaticText(self, -1, "Name") 
     20        self.text = wx.StaticText(self, -1, _("Name")) 
    2121        sizer2.Add(self.text, 0, wx.ALIGN_CENTRE | wx.ALL, 5) 
    2222         
     
    4444        self.unique = unique 
    4545                 
    46         wx.EVT_BUTTON(self, wx.ID_OK, self.OnOK) 
     46        wx.EVT_BUTTON(self, wx.ID_OK, self.on_ok) 
    4747         
    48     def OnOK(self, evt): 
     48    def on_ok(self, evt): 
    4949        if self.unique and wx.GetApp().gns.getattr(get_full_name(self.name.GetValue()), None): 
    5050            dlg = wx.MessageDialog(self, _("An object (") + get_full_name(self.name.GetValue()) + _(") already has this name"), 
    51                              _("Please choose an other name"), wx.OK | wx.ICON_ERROR) 
     51            _("Please choose an other name"), wx.OK | wx.ICON_ERROR) 
    5252            dlg.ShowModal() 
    5353            evt.Cancel = True 
  • artub/configmanager.py

    r3 r274  
    11import wx 
     2from log import log 
    23 
    34class ConfigManager: 
    45    def __init__(self): 
    5         print "Loading configuration" 
     6        log("Loading configuration") 
    67        self.config = wx.FileConfig("artub", "bnc", "artub.conf") 
    78         
  • artub/debugbar.py

    r258 r274  
    33from depplatform import get_image_path 
    44 
     5STEP_ID, NEXT_ID, RETURN_ID, CONTINUE_ID, GO_TO_CURSOR_ID, DEBUG_STOP_ID = range(11, 17) 
     6 
    57class DebugBar(wx.ToolBar): 
    68    name = _('Debug bar') 
    7     def __init__( 
    8         self, parent=None, id=-1, title = _("Debug"), 
    9         pos = wx.DefaultPosition, size = wx.DefaultSize, 
    10         style = wx.TB_FLAT | wx.TB_NODIVIDER | wx.TB_HORIZONTAL, 
    11         name = "debugbar", 
    12         value = None): 
     9    def __init__(self, parent=None, id=-1, title = _("Debug"), 
     10                 pos = wx.DefaultPosition, size = wx.DefaultSize, 
     11                 style = wx.TB_FLAT | wx.TB_NODIVIDER | wx.TB_HORIZONTAL, 
     12                 name = "debugbar", value = None): 
    1313         
    1414        wx.ToolBar.__init__(self, parent, id, pos, size, style) 
     
    2222        self.EnableTool(self.artub.runprojectID, False) 
    2323        bmp = wx.Bitmap(get_image_path("step.xpm")) 
    24         self.AddSimpleTool(11, bmp, _("Step"), _("Step")) 
     24        self.AddSimpleTool(STEP_ID, bmp, _("Step"), _("Step")) 
    2525        bmp = wx.Bitmap(get_image_path("next.xpm")) 
    26         self.AddSimpleTool(12, bmp, _("Next"), _("Next")) 
     26        self.AddSimpleTool(NEXT_ID, bmp, _("Next"), _("Next")) 
    2727        bmp = wx.Bitmap(get_image_path("return.xpm")) 
    28         self.AddSimpleTool(13, bmp, _("Return"), _("Return")) 
    29         self.AddSimpleTool(14, bmp, _("Continue"), _("Continue")) 
     28        self.AddSimpleTool(RETURN_ID, bmp, _("Return"), _("Return")) 
     29        self.AddSimpleTool(CONTINUE_ID, bmp, _("Continue"), _("Continue")) 
    3030        bmp = wx.Bitmap(get_image_path("gotocursor.xpm")) 
    31         self.AddSimpleTool(15, bmp, _("Go to cursor"), _("Go to cursor")) 
     31        self.AddSimpleTool(GO_TO_CURSOR_ID, bmp, _("Go to cursor"), _("Go to cursor")) 
    3232        # bmp = wx.Bitmap(get_image_path("pause.png")) 
    33         # self.AddSimpleTool(16, bmp, _("Pause"), _("Pause")) 
     33        # self.AddSimpleTool(PAUSE_ID, bmp, _("Pause"), _("Pause")) 
    3434        bmp = wx.Bitmap(get_image_path("debugstop.xpm")) 
    35         self.AddSimpleTool(17, bmp, _("Stop"), _("Stop")) 
     35        self.AddSimpleTool(DEBUG_STOP_ID, bmp, _("Stop"), _("Stop")) 
    3636        self.Bind(wx.EVT_TOOL, self.on_toggle_breakpoint, id=self.artub.breakID) 
    3737        self.Bind(wx.EVT_TOOL, self.artub.on_debug_run, id=self.artub.runprojectID) 
    38         self.Bind(wx.EVT_TOOL, self.on_step, id=11) 
    39         self.Bind(wx.EVT_TOOL, self.on_next, id=12) 
    40         self.Bind(wx.EVT_TOOL, self.on_return, id=13) 
    41         self.Bind(wx.EVT_TOOL, self.on_continue, id=14) 
    42         self.Bind(wx.EVT_TOOL, self.on_go_to_cursor, id=15) 
    43         # self.Bind(wx.EVT_TOOL, self.on_pause, id=16) 
    44         self.Bind(wx.EVT_TOOL, self.on_stop, id=17) 
     38        self.Bind(wx.EVT_TOOL, self.on_step, id=STEP_ID) 
     39        self.Bind(wx.EVT_TOOL, self.on_next, id=NEXT_ID) 
     40        self.Bind(wx.EVT_TOOL, self.on_return, id=RETURN_ID) 
     41        self.Bind(wx.EVT_TOOL, self.on_continue, id=CONTINUE_ID) 
     42        self.Bind(wx.EVT_TOOL, self.on_go_to_cursor, id=GO_TO_CURSOR_ID) 
     43        # self.Bind(wx.EVT_TOOL, self.on_pause, id=PAUSE_ID) 
     44        self.Bind(wx.EVT_TOOL, self.on_stop, id=DEBUG_STOP_ID) 
    4545         
    4646        self.set_debugging(self.artub.debugging) 
     
    5050    def set_debug_running(self): 
    5151        self.EnableTool(9, False) 
    52         self.EnableTool(11, False) 
    53         self.EnableTool(12, False) 
    54         self.EnableTool(13, False) 
    55         self.EnableTool(14, False) 
     52        self.EnableTool(STEP_ID, False) 
     53        self.EnableTool(NEXT_ID, False) 
     54        self.EnableTool(RETURN_ID, False) 
     55        self.EnableTool(CONTINUE_ID, False) 
    5656        if self.artub.active_editor: 
    57             self.EnableTool(15, self.artub.active_editor.name == "akiki") 
     57            self.EnableTool(GO_TO_CURSOR_ID, self.artub.active_editor.name == "akiki") 
    5858        else: 
    59             self.EnableTool(15, False) 
    60         # self.EnableTool(16, False) 
    61         self.EnableTool(17, True) 
     59            self.EnableTool(GO_TO_CURSOR_ID, False) 
     60        # self.EnableTool(PAUSE_ID, False) 
     61        self.EnableTool(DEBUG_STOP_ID, True) 
    6262 
    6363    def set_debugging(self, state): 
    64         self.EnableTool(11, state) 
    65         self.EnableTool(12, state) 
    66         self.EnableTool(13, state) 
    67         self.EnableTool(14, state) 
     64        self.EnableTool(STEP_ID, state) 
     65        self.EnableTool(NEXT_ID, state) 
     66        self.EnableTool(RETURN_ID, state) 
     67        self.EnableTool(CONTINUE_ID, state) 
    6868        if self.artub.active_editor: 
    69             self.EnableTool(15, self.artub.active_editor.name == "akiki") 
     69            self.EnableTool(GO_TO_CURSOR_ID, self.artub.active_editor.name == "akiki") 
    7070        else: 
    71             self.EnableTool(15, False) 
    72         # self.EnableTool(16, state) 
    73         self.EnableTool(17, state) 
     71            self.EnableTool(GO_TO_CURSOR_ID, False) 
     72        # self.EnableTool(PAUSE_ID, state) 
     73        self.EnableTool(DEBUG_STOP_ID, state) 
    7474             
    7575    def on_update_ui(self, evt): 
  • artub/glumolresource.py

    r204 r274  
    1 import desc 
    2  
    31class CGlumolResource(object): 
    42   __xmlexclude__ = ["treeitem","ast","_ast","parent"] 
  • artub/log.py

    r88 r274  
    66 
    77class ArtubLog(wx.PyLog): 
    8     def __init__(self, textCtrl, logTime=0): 
     8    def __init__(self, textCtrl=None, logTime=0): 
    99        wx.PyLog.__init__(self) 
    1010        self.tc = textCtrl 
     
    1515    def DoLogString(self, message, timeStamp): 
    1616        if self.logTime: 
    17             message = time.strftime("%Xl", time.localtime(timeStamp)) + \ 
    18                       ": " + message 
     17            message = time.strftime("%Xl", 
     18                                    time.localtime(timeStamp)) + ": " + message 
    1919        if self.tc: 
    20             self.tc.AppendText(message)# + '\n') 
     20            self.tc.AppendText(message) 
    2121 
    2222    def write(self, message): 
    23         wx.LogMessage(message) 
     23        print message # wx.LogMessage(message) 
    2424 
    2525    def redirect_outputs(self): 
     
    3030        sys.stdout = self.oldstdout 
    3131 
     32_log = ArtubLog() 
     33wx.Log_SetActiveTarget(_log) 
     34 
     35def set_text_ctrl(self, textCtrl): 
     36    _log.tc = textCtrl 
     37    _log.redirect_outputs() 
     38 
    3239def log(*args): 
    33     return 
    3440    global _log 
    3541    s = "" 
     
    3844    _log.write(s) 
    3945 
    40 def output(*args): 
    41     global _log 
    42     s = "" 
    43     for i in args: 
    44         s = s + str(i) + ' ' 
    45     _log.write(s) 
     46output = log 
    4647 
    47  
  • artub/newanimation.py

    r204 r274  
    44class NewAnimationDialog(wx.Dialog): 
    55    def __init__( 
    6             self, parent, ID=-1, title="New animation", size=wx.DefaultSize, pos=wx.DefaultPosition,  
     6            self, parent, ID=-1, title=_("New animation"), size=wx.DefaultSize, pos=wx.DefaultPosition,  
    77            style=wx.DEFAULT_DIALOG_STYLE | wx.STAY_ON_TOP): 
    88 
     
    3131        sizer2 = wx.BoxSizer(wx.HORIZONTAL) 
    3232         
    33         self.ok = wx.Button(self, wx.ID_OK, "Ok") 
     33        self.ok = wx.Button(self, wx.ID_OK, _("Ok")) 
    3434        sizer2.Add(self.ok, 0, wx.ALIGN_CENTRE | wx.ALL, 5) 
    3535         
    36         self.cancel = wx.Button(self, wx.ID_CANCEL, "Cancel") 
     36        self.cancel = wx.Button(self, wx.ID_CANCEL, _("Cancel")) 
    3737        sizer2.Add(self.cancel, 1,  wx.ALIGN_CENTRE | wx.ALL, 5) 
    3838         
  • artub/newproject.py

    r266 r274  
    1212class NewProject: 
    1313    def new_project(self, parent): 
    14         win = NewDialog(wx.GetApp().frame, -1, "New", size=(350, 200), style = wx.DEFAULT_DIALOG_STYLE) 
     14        win = NewDialog(wx.GetApp().frame, -1, _("New"), size=(350, 200), style = wx.DEFAULT_DIALOG_STYLE) 
    1515        win.CenterOnScreen() 
    1616        val = win