Menu

[r197]: / drplugins / RunTab1.py  Maximize  Restore  History

Download this file

48 lines (39 with data), 1.5 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Programmer: Antonio Barbosa
# E-mail: ab@jn.pt
# Note: Initial Release 22 Fev 2006
#
#Plugin
#RunTab1
import wx
import drScrolledMessageDialog
from drSourceBrowser import drSourceBrowserPanel
def OnAbout(DrFrame):
Version = "0.0.1"
NameAndVersion = "Runs first page: " + Version + "\n"
AboutString = NameAndVersion + "By Antonio Barbosa"
drScrolledMessageDialog.ShowMessage(DrFrame, AboutString, "About")
def OnHelp(DrFrame):
HelpString = "Runs allways the first script.\n It is suposed to be the main one...\n"
HelpString += "\n\nWhat does this plugin:\n"
HelpString += "\t Saves Actual Document\n"
HelpString += "\t Selects First Page\n"
HelpString += "\t Runs First Page script\n"
HelpString += "\t And finally, restores the previous working page\n"
drScrolledMessageDialog.ShowMessage(DrFrame, HelpString, "Help")
def OnPreferences(DrFrame):
DrFrame.ShowMessage("Nothing to configure ... ;)", "PREFS")
def Plugin(DrFrame):
def OnRunTab1 (event):
# First Save Actual Document
DrFrame.OnSave(None)
# Keep actual page
_actualpage=DrFrame.documentnotebook.GetSelection ()
# Select First Page
DrFrame.documentnotebook.SetSelection (0)
DrFrame.documentnotebook.SetTab()
# Run First Page script
DrFrame.OnRun(None)
# And finally, restore previous page
DrFrame.documentnotebook.SetSelection (_actualpage)
DrFrame.documentnotebook.SetTab()
DrFrame.AddPluginFunction("RunTab1", "Run Tab1", OnRunTab1)