Changeset 274
- Timestamp:
- 02/26/08 01:04:11 (11 months ago)
- Author:
- bob
- Message:
-
Code cleaning, unused files removed
- Location:
- artub
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r268
|
r274
|
|
| 1 | | |
| 2 | 1 | import keyword |
| 3 | | |
| 4 | 2 | import wx |
| 5 | 3 | import 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 | | |
| 20 | 4 | |
| 21 | 5 | if wx.Platform == '__WXMSW__': |
| … |
… |
|
| 186 | 170 | self.SetCaretForeground("BLUE") |
| 187 | 171 | |
| 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 | | |
| 194 | 172 | self.cut_paste = False |
| 195 | 173 | self.backspace = False |
| … |
… |
|
| 211 | 189 | # Code completion |
| 212 | 190 | 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 | | |
| 220 | 191 | kw = keyword.kwlist[:] |
| 221 | 192 | kw.append("zzzzzz?2") |
| 222 | | kw.append("aaaaa?2") |
| 223 | | kw.append("__init__?3") |
| 224 | | kw.append("zzaaaaa?2") |
| 225 | | kw.append("zzbaaaa?2") |
| 226 | 193 | kw.append("this_is_a_longer_value") |
| 227 | | #kw.append("this_is_a_much_much_much_much_much_much_much_longer_value") |
| 228 | 194 | |
| 229 | 195 | kw.sort() # Python sorts are case sensitive |
| … |
… |
|
| 372 | 338 | |
| 373 | 339 | 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 | | |
-
|
r179
|
r274
|
|
| 1 | | |
| 2 | 1 | from glumolresource import VirtualGlumolResource, CGlumolResource |
| 3 | 2 | from script import CScript |
-
|
r268
|
r274
|
|
| 66 | 66 | |
| 67 | 67 | class 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 !!! |
| 69 | 69 | wx.TR_HAS_VARIABLE_ROW_HEIGHT | |
| 70 | 70 | wx.TR_LINES_AT_ROOT | |
| … |
… |
|
| 406 | 406 | |
| 407 | 407 | class 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 | |
| 408 | 412 | def __init__(self, parent, id, title, config): |
| 409 | 413 | CEditorManager.__init__(self) |
| … |
… |
|
| 441 | 445 | self.log = wx.TextCtrl(frame, -1, |
| 442 | 446 | 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) |
| 446 | 448 | frame.Show(True) |
| 447 | 449 | |
| … |
… |
|
| 475 | 477 | |
| 476 | 478 | 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) |
| 481 | 483 | |
| 482 | 484 | self.Centre(wx.BOTH) |
| … |
… |
|
| 509 | 511 | Caption(_("Notebook")).CenterPane()) |
| 510 | 512 | |
| 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) |
| 512 | 514 | |
| 513 | 515 | # Startup page |
| … |
… |
|
| 532 | 534 | self._mgr.Update() |
| 533 | 535 | self._mgr.HideHint() |
| 534 | | #import psyco |
| 535 | | #psyco.profile() |
| 536 | 536 | |
| 537 | 537 | def CloseWindow(self, event): |
| … |
… |
|
| 564 | 564 | this.Bind(wx.EVT_TOOL, self.on_save, id=12) |
| 565 | 565 | 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) |
| 567 | 566 | 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) |
| 569 | 567 | 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) |
| 571 | 568 | this.AddSimpleTool(self.undoID, self.bitmaps['undo.xpm'], _("Undo last change"), _("Undo last change")) |
| 572 | 569 | this.Bind(wx.EVT_TOOL, self.undo, id=self.undoID) |
| … |
… |
|
| 574 | 571 | this.Bind(wx.EVT_TOOL, self.undo, id=self.redoID) |
| 575 | 572 | |
| 576 | | # wx.EVT_UPDATE_UI_RANGE(self, 10, 15, self.on_update_ui) |
| 577 | | |
| 578 | 573 | this.Realize() |
| 579 | 574 | |
| 580 | | self.maintoolbar = self.toolbar_manager.create_toolbar(MainToolBar,#, introText="Welcome to the Glumol debugger") |
| | 575 | self.maintoolbar = self.toolbar_manager.create_toolbar(MainToolBar, |
| 581 | 576 | infos = PyAUI.AuiPaneInfo().Name(_("Main toolbar")). |
| 582 | 577 | Caption(_("Main toolbar")). |
| … |
… |
|
| 596 | 591 | |
| 597 | 592 | def create_menus(self): |
| 598 | | # Make a File menu |
| 599 | 593 | self.mainmenu = wx.MenuBar() |
| 600 | 594 | menu = wx.Menu() |
| … |
… |
|
| 761 | 755 | self.edit_resource(resource, self.get_editor('akiki')) |
| 762 | 756 | |
| 763 | | resource_icons = { CDialogue : 1, CAnimation : 0, CGlumolObject : 2, |
| 764 | | CProject : 4, CScript : 3, VirtualGlumolObject : 2, |
| 765 | | CGlumolFont : 5, VirtualAnimation : 0 } |
| 766 | | |
| 767 | 757 | def add_member_class(self, name, cl2, resource, newid, recurse = True): |
| 768 | 758 | if cl2.__name__ != name: return |
| … |
… |
|
| 1198 | 1188 | """ |
| 1199 | 1189 | |
| 1200 | | def OnIdle(self, event): |
| | 1190 | def on_idle(self, event): |
| 1201 | 1191 | if self.todos: |
| 1202 | 1192 | todo = self.todos[0] |
| … |
… |
|
| 1211 | 1201 | schedule() |
| 1212 | 1202 | |
| 1213 | | def OnFileHistory(self, evt): |
| | 1203 | def on_file_history(self, evt): |
| 1214 | 1204 | filenum = evt.GetId() - wx.ID_FILE1 |
| 1215 | 1205 | path = self.filehistory.GetHistoryFile(filenum) |
| 1216 | 1206 | self.open_project(path) |
| 1217 | 1207 | |
| 1218 | | def OnCloseWindow(self, event): |
| | 1208 | def on_close_window(self, event): |
| 1219 | 1209 | self.on_exit(event) |
| 1220 | 1210 | |
| 1221 | | def OnIconfiy(self, evt): |
| | 1211 | def on_iconify(self, evt): |
| 1222 | 1212 | evt.Skip() |
| 1223 | 1213 | |
| 1224 | | def OnMaximize(self, evt): |
| | 1214 | def on_maximize(self, evt): |
| 1225 | 1215 | evt.Skip() |
| 1226 | 1216 | |
| … |
… |
|
| 1265 | 1255 | dlg.ShowModal() |
| 1266 | 1256 | 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 | | """ |
| 1276 | 1257 | else: |
| 1277 | 1258 | dlg = wx.MessageDialog(self, |
| … |
… |
|
| 1281 | 1262 | dlg.ShowModal() |
| 1282 | 1263 | 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 | | """ |
| 1292 | 1264 | except: |
| 1293 | 1265 | sys.stdout = oldstdout |
| … |
… |
|
| 1306 | 1278 | from wx.lib.wordwrap import wordwrap |
| 1307 | 1279 | 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.") |
| 1311 | 1283 | info.Description = wordwrap( |
| 1312 | | "Artub is the Glumol's graphical interface " \ |
| | 1284 | _("Artub is the Glumol's graphical interface " \ |
| 1313 | 1285 | "that allows you to easily create adventure games.\n\n" \ |
| 1314 | 1286 | "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."), |
| 1316 | 1288 | 350, wx.ClientDC(self)) |
| 1317 | | info.WebSite = ("http://www.glumol.com", "The Glumol Homepage") |
| | 1289 | info.WebSite = ("http://www.glumol.com", _("The Glumol Homepage")) |
| 1318 | 1290 | info.Developers = [ "Sylvain Baubeau", |
| 1319 | 1291 | "Alexis Contour" ] |
| 1320 | 1292 | |
| 1321 | | # Render is horrible |
| | 1293 | # Render looks terrible |
| 1322 | 1294 | #info.License = wordwrap(open(os.path.join(wx.GetApp().artub_path, "COPYING")).read(), |
| 1323 | 1295 | # 350, wx.ClientDC(self)) |
| … |
… |
|
| 1416 | 1388 | self.Destroy() |
| 1417 | 1389 | 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 | |
| 1422 | 1398 | def on_debug_run(self, evt): |
| 1423 | 1399 | self.sync() |
-
|
r204
|
r274
|
|
| 1 | 1 | import wx |
| 2 | 2 | from depplatform import get_image_path |
| 3 | | import notebookctrl |
| 4 | 3 | import wx.lib.flatnotebook as fnb |
| 5 | 4 | |
-
|
r260
|
r274
|
|
| 18 | 18 | sizer2 = wx.BoxSizer(wx.HORIZONTAL) |
| 19 | 19 | |
| 20 | | self.text = wx.StaticText(self, -1, "Name") |
| | 20 | self.text = wx.StaticText(self, -1, _("Name")) |
| 21 | 21 | sizer2.Add(self.text, 0, wx.ALIGN_CENTRE | wx.ALL, 5) |
| 22 | 22 | |
| … |
… |
|
| 44 | 44 | self.unique = unique |
| 45 | 45 | |
| 46 | | wx.EVT_BUTTON(self, wx.ID_OK, self.OnOK) |
| | 46 | wx.EVT_BUTTON(self, wx.ID_OK, self.on_ok) |
| 47 | 47 | |
| 48 | | def OnOK(self, evt): |
| | 48 | def on_ok(self, evt): |
| 49 | 49 | if self.unique and wx.GetApp().gns.getattr(get_full_name(self.name.GetValue()), None): |
| 50 | 50 | 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) |
| 52 | 52 | dlg.ShowModal() |
| 53 | 53 | evt.Cancel = True |
-
|
r3
|
r274
|
|
| 1 | 1 | import wx |
| | 2 | from log import log |
| 2 | 3 | |
| 3 | 4 | class ConfigManager: |
| 4 | 5 | def __init__(self): |
| 5 | | print "Loading configuration" |
| | 6 | log("Loading configuration") |
| 6 | 7 | self.config = wx.FileConfig("artub", "bnc", "artub.conf") |
| 7 | 8 | |
-
|
r258
|
r274
|
|
| 3 | 3 | from depplatform import get_image_path |
| 4 | 4 | |
| | 5 | STEP_ID, NEXT_ID, RETURN_ID, CONTINUE_ID, GO_TO_CURSOR_ID, DEBUG_STOP_ID = range(11, 17) |
| | 6 | |
| 5 | 7 | class DebugBar(wx.ToolBar): |
| 6 | 8 | 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): |
| 13 | 13 | |
| 14 | 14 | wx.ToolBar.__init__(self, parent, id, pos, size, style) |
| … |
… |
|
| 22 | 22 | self.EnableTool(self.artub.runprojectID, False) |
| 23 | 23 | bmp = wx.Bitmap(get_image_path("step.xpm")) |
| 24 | | self.AddSimpleTool(11, bmp, _("Step"), _("Step")) |
| | 24 | self.AddSimpleTool(STEP_ID, bmp, _("Step"), _("Step")) |
| 25 | 25 | bmp = wx.Bitmap(get_image_path("next.xpm")) |
| 26 | | self.AddSimpleTool(12, bmp, _("Next"), _("Next")) |
| | 26 | self.AddSimpleTool(NEXT_ID, bmp, _("Next"), _("Next")) |
| 27 | 27 | 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")) |
| 30 | 30 | 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")) |
| 32 | 32 | # bmp = wx.Bitmap(get_image_path("pause.png")) |
| 33 | | # self.AddSimpleTool(16, bmp, _("Pause"), _("Pause")) |
| | 33 | # self.AddSimpleTool(PAUSE_ID, bmp, _("Pause"), _("Pause")) |
| 34 | 34 | bmp = wx.Bitmap(get_image_path("debugstop.xpm")) |
| 35 | | self.AddSimpleTool(17, bmp, _("Stop"), _("Stop")) |
| | 35 | self.AddSimpleTool(DEBUG_STOP_ID, bmp, _("Stop"), _("Stop")) |
| 36 | 36 | self.Bind(wx.EVT_TOOL, self.on_toggle_breakpoint, id=self.artub.breakID) |
| 37 | 37 | 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) |
| 45 | 45 | |
| 46 | 46 | self.set_debugging(self.artub.debugging) |
| … |
… |
|
| 50 | 50 | def set_debug_running(self): |
| 51 | 51 | 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) |
| 56 | 56 | 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") |
| 58 | 58 | 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) |
| 62 | 62 | |
| 63 | 63 | 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) |
| 68 | 68 | 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") |
| 70 | 70 | 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) |
| 74 | 74 | |
| 75 | 75 | def on_update_ui(self, evt): |
-
|
r204
|
r274
|
|
| 1 | | import desc |
| 2 | | |
| 3 | 1 | class CGlumolResource(object): |
| 4 | 2 | __xmlexclude__ = ["treeitem","ast","_ast","parent"] |
-
|
r88
|
r274
|
|
| 6 | 6 | |
| 7 | 7 | class ArtubLog(wx.PyLog): |
| 8 | | def __init__(self, textCtrl, logTime=0): |
| | 8 | def __init__(self, textCtrl=None, logTime=0): |
| 9 | 9 | wx.PyLog.__init__(self) |
| 10 | 10 | self.tc = textCtrl |
| … |
… |
|
| 15 | 15 | def DoLogString(self, message, timeStamp): |
| 16 | 16 | if self.logTime: |
| 17 | | message = time.strftime("%Xl", time.localtime(timeStamp)) + \ |
| 18 | | ": " + message |
| | 17 | message = time.strftime("%Xl", |
| | 18 | time.localtime(timeStamp)) + ": " + message |
| 19 | 19 | if self.tc: |
| 20 | | self.tc.AppendText(message)# + '\n') |
| | 20 | self.tc.AppendText(message) |
| 21 | 21 | |
| 22 | 22 | def write(self, message): |
| 23 | | wx.LogMessage(message) |
| | 23 | print message # wx.LogMessage(message) |
| 24 | 24 | |
| 25 | 25 | def redirect_outputs(self): |
| … |
… |
|
| 30 | 30 | sys.stdout = self.oldstdout |
| 31 | 31 | |
| | 32 | _log = ArtubLog() |
| | 33 | wx.Log_SetActiveTarget(_log) |
| | 34 | |
| | 35 | def set_text_ctrl(self, textCtrl): |
| | 36 | _log.tc = textCtrl |
| | 37 | _log.redirect_outputs() |
| | 38 | |
| 32 | 39 | def log(*args): |
| 33 | | return |
| 34 | 40 | global _log |
| 35 | 41 | s = "" |
| … |
… |
|
| 38 | 44 | _log.write(s) |
| 39 | 45 | |
| 40 | | def output(*args): |
| 41 | | global _log |
| 42 | | s = "" |
| 43 | | for i in args: |
| 44 | | s = s + str(i) + ' ' |
| 45 | | _log.write(s) |
| | 46 | output = log |
| 46 | 47 | |
| 47 | | |
-
|
r204
|
r274
|
|
| 4 | 4 | class NewAnimationDialog(wx.Dialog): |
| 5 | 5 | 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, |
| 7 | 7 | style=wx.DEFAULT_DIALOG_STYLE | wx.STAY_ON_TOP): |
| 8 | 8 | |
| … |
… |
|
| 31 | 31 | sizer2 = wx.BoxSizer(wx.HORIZONTAL) |
| 32 | 32 | |
| 33 | | self.ok = wx.Button(self, wx.ID_OK, "Ok") |
| | 33 | self.ok = wx.Button(self, wx.ID_OK, _("Ok")) |
| 34 | 34 | sizer2.Add(self.ok, 0, wx.ALIGN_CENTRE | wx.ALL, 5) |
| 35 | 35 | |
| 36 | | self.cancel = wx.Button(self, wx.ID_CANCEL, "Cancel") |
| | 36 | self.cancel = wx.Button(self, wx.ID_CANCEL, _("Cancel")) |
| 37 | 37 | sizer2.Add(self.cancel, 1, wx.ALIGN_CENTRE | wx.ALL, 5) |
| 38 | 38 | |
-
|
r266
|
r274
|
|
| 12 | 12 | class NewProject: |
| 13 | 13 | 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) |
| 15 | 15 | win.CenterOnScreen() |
| 16 | 16 | val = win | |