Logo Search packages:      
Sourcecode: pythoncard version File versions  Download package

def textRouter::TextRouter::on_initialize (   self,
  event 
)

Startup

Definition at line 55 of file textRouter.py.

00055                                   :
        """Startup"""
        
        ## -- window configuration follows

        topSizer = wx.BoxSizer(wx.HORIZONTAL)
        mainSizer = wx.BoxSizer(wx.VERTICAL)
        buttonSizer = wx.BoxSizer(wx.VERTICAL)
        controlsSizer = wx.BoxSizer(wx.HORIZONTAL)
        
        comp = self.components

        ## -- handle the drop + drop of text
        # - myTextDropTarget = trTextDropTarget(self)
        # - comp.area1._delegate.SetDropTarget(myTextDropTarget)


        if wx.__version__ == "2.3.2b7" or wx.__version__ == "2.3.2":
            myURLDropTarget = trURLDropTarget(self)
            comp.area1.SetDropTarget(myURLDropTarget)
        
        # buttons, no vert. resize, border of 2 pixels round all edges
        buttonSizer.Add(comp.buttonClearIt, 0, wx.ALL, 2)
        buttonSizer.Add(comp.buttonClipIt, 0,  wx.ALL, 2)
        
        # top sizer.  this does the subject/title: label + text box.
        topSizer.Add(comp.lblSubject, 0, wx.ALL | wx.ALIGN_LEFT, 3)
        topSizer.Add(comp.area2, 1, wx.ALL | wx.ALIGN_LEFT, 0)


        # bottom controls panel, no horiz. resizing, borders round all edges of width 0 for buttons (they've
        # already got border) and 4 for the two radio choices.
        controlsSizer.Add(buttonSizer, 0, wx.ALL | wx.ALIGN_LEFT, 0)
        controlsSizer.Add(comp.nextInputActionMode, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 4)
        controlsSizer.Add(comp.nextOutputActionMode, 0, wx.ALL | wx.ALIGN_RIGHT, 4)
        
        # main sizer, the big text area can be resized vertically, others can't.  they can all be sized
        # horizontally (wx.EXPAND), plus statusLine StaticText control has a bit of padding round all edges
        mainSizer.Add(topSizer, 0, wx.EXPAND)
        mainSizer.Add(comp.area1, 1, wx.EXPAND)
        mainSizer.Add(controlsSizer, 0, wx.EXPAND)
        #mainSizer.Add(comp.statusLine._delegate, 0, wx.EXPAND | wx.ALL, 2)

        # we don't want this because it always resizes window to "shrink-wrap" the controls on startup,
        # which means you can't use GNOME or presumably some Windows toys to remember the size + position
        # - mainSizer.Fit(self)

        # put it in to action.
        self.panel.SetSizer(mainSizer)
        self.panel.SetAutoLayout(1)
        self.panel.Layout()
        self.panel.Refresh()
        wx.Yield()

        self.status("Loading...")
        
        ## -- data configuration follows

        # keep track of find parameters
00114         self.lastFind = {'searchText':'', 'wholeWordsOnly':0, 'caseSensitive':0}

        # the two main accounts
        self.theManilaAccounts = []
        self.theCurrentManilaAccount = -1
        
        self.theBloggerAccounts = []
        self.theCurrentBloggerAccount = -1
        
        # misc setup + settings
        self.configFile   = "textRouter.conf"

        self.undoStack = []
        self.undoStackPos = 0

        self.shortcuts = ShortcutsSet()

        # default preferences lists
        self.generalPrefs = {"defaultDirectory" : '.', "tmpFile" : "temp.txt", "externalEditor" : "notepad",\
                             "alwaysClear" : 'Yes', "autoSaveConfig" : 'Yes', \
                             "undoHistorySize" : 10, "autoLoadTextFile":'No', 'autoSaveTextFile':'No',
                             "mainFont" : "", "paragraphWidth" : 74,
                             "useProxy" : "No", "proxyServer" : "", "proxyPort" : 0}
        
        self.htmlPrefs = { "boldTag" : 'b', "italicTag" : 'i', 'centerTag' : 'div' }
        
        self.manilaPrefs = { "manilaAutoLogin" : 'No', 'manilaAutoGetHomepage' : 'No', \
                             'routeToManilaAction' : 'adds', 'autoRender' : 'Yes' }
        
        self.bloggerPrefs = { "bloggerAutoLogin" : 'No' } 

        self.utilitiesPrefs = { "externalEditor" : "notepad", "textScrollerDelay" : 0.2, \
                                "textScrollerWords" : 4, \
                                "textScrollerFont" : \
                                "{'style':'bold','faceName':'helvetica','family':'sansSerif','size': 24}",
                                "shortcutsFile" : "shortcuts.txt",
                                "autoSaveShortcuts" : "Yes",
                                "expandShortcuts" : "blogger" }

        self.emailPrefs   = {"serverName" : "", "serverPort" : 25, "name" : "", "email" : ""}
        self.emailRcpts   = []

        self.filters   = []
        
        self.stateSettings = {}

        self.loadInStrings()
        self.loadInConfig()
        self.loadInShortcuts()

        # load up the text file if the users pref says so, and if we have a last-load file to load
        if self.generalPrefs["autoLoadTextFile"] == "Yes" and \
               ("defaultFileLoad" in self.stateSettings):
            self.insertFile(self.stateSettings["defaultFileLoad"])

        self.saveState()
        self.components.area1.setFocus()

    def saveState(self):


Generated by  Doxygen 1.6.0   Back to index