Changeset 3199
- Timestamp:
- 06/22/07 10:00:34 (2 years ago)
- Files:
-
- trunk/dabo/__init__.py (modified) (9 diffs)
- trunk/dabo/dApp.py (modified) (66 diffs)
- trunk/dabo/dEvents.py (modified) (33 diffs)
- trunk/dabo/dObject.py (modified) (21 diffs)
- trunk/dabo/dPref.py (modified) (23 diffs)
- trunk/dabo/db/dBackend.py (modified) (8 diffs)
- trunk/dabo/db/dConnectInfo.py (modified) (14 diffs)
- trunk/dabo/db/dCursorMixin.py (modified) (109 diffs)
- trunk/dabo/db/dDataSet.py (modified) (2 diffs)
- trunk/dabo/db/dbFirebird.py (modified) (16 diffs)
- trunk/dabo/lib/EasyDialogBuilder.py (modified) (21 diffs)
- trunk/dabo/lib/datanav/Page.py (modified) (50 diffs)
- trunk/dabo/lib/eventMixin.py (modified) (18 diffs)
- trunk/dabo/ui/__init__.py (modified) (10 diffs)
- trunk/dabo/ui/dDataControlMixinBase.py (modified) (19 diffs)
- trunk/dabo/ui/uitk/__init__.py (modified) (5 diffs)
- trunk/dabo/ui/uitk/dFormMixin.py (modified) (19 diffs)
- trunk/dabo/ui/uitk/dPemMixin.py (modified) (30 diffs)
- trunk/dabo/ui/uitk/uiApp.py (modified) (14 diffs)
- trunk/dabo/ui/uiwx/__init__.py (modified) (65 diffs)
- trunk/dabo/ui/uiwx/dComboBox.py (modified) (10 diffs)
- trunk/dabo/ui/uiwx/dControlItemMixin.py (modified) (23 diffs)
- trunk/dabo/ui/uiwx/dDataControlMixin.py (modified) (6 diffs)
- trunk/dabo/ui/uiwx/dDateTextBox.py (modified) (30 diffs)
- trunk/dabo/ui/uiwx/dDockForm.py (modified) (27 diffs)
- trunk/dabo/ui/uiwx/dEditor.py (modified) (75 diffs)
- trunk/dabo/ui/uiwx/dFoldPanelBar.py (modified) (35 diffs)
- trunk/dabo/ui/uiwx/dFont.py (modified) (7 diffs)
- trunk/dabo/ui/uiwx/dForm.py (modified) (50 diffs)
- trunk/dabo/ui/uiwx/dFormMixin.py (modified) (52 diffs)
- trunk/dabo/ui/uiwx/dGrid.py (modified) (176 diffs)
- trunk/dabo/ui/uiwx/dGridSizer.py (modified) (30 diffs)
- trunk/dabo/ui/uiwx/dImage.py (modified) (21 diffs)
- trunk/dabo/ui/uiwx/dListControl.py (modified) (36 diffs)
- trunk/dabo/ui/uiwx/dPemMixin.py (modified) (171 diffs)
- trunk/dabo/ui/uiwx/dRadioList.py (modified) (29 diffs)
- trunk/dabo/ui/uiwx/dSizerMixin.py (modified) (55 diffs)
- trunk/dabo/ui/uiwx/masked/maskededit.py (modified) (13 diffs)
- trunk/dabo/ui/uiwx/uiApp.py (modified) (40 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dabo/__init__.py
r3198 r3199 4 4 Dabo is for developing multi-platform database business applications - 5 5 you know, applications that need to connect to a database server (MySQL, 6 Oracle, MS-SQL, whatever), get recordsets of data based on criteria 7 set by the user, provide easy ways to edit and commit changes to the 6 Oracle, MS-SQL, whatever), get recordsets of data based on criteria 7 set by the user, provide easy ways to edit and commit changes to the 8 8 data, and to report on the data. 9 9 10 For basic, easy use that hopefully satisfies 80% of your needs, you 10 For basic, easy use that hopefully satisfies 80% of your needs, you 11 11 simply create/edit data definition files that Dabo uses to dynamically 12 12 create things like menus, edit forms, data browsing grids, etc. 13 13 14 14 So, the basic idea is that you have a functional, working, albeit basic 15 application up and running very quickly, and you can then spend time 16 getting all the fancy bells and whistles implemented. Keep things as 17 simple as possible though, while still fulfilling your customer's 15 application up and running very quickly, and you can then spend time 16 getting all the fancy bells and whistles implemented. Keep things as 17 simple as possible though, while still fulfilling your customer's 18 18 specifications. Simplicity is the better part of elegance. 19 19 … … 36 36 The Dabo framework will have to be distributed to your client's machine(s), 37 37 along with your project-specific data definitions and (if applicable), your 38 subclasses of the Dabo classes and additional Python scripts, if any. There 39 are ways to do runtime deployment via installers that take the complexity 38 subclasses of the Dabo classes and additional Python scripts, if any. There 39 are ways to do runtime deployment via installers that take the complexity 40 40 out of this, but that is outside the scope of Dabo itself, and you'll use 41 41 a different method for each target platform. … … 49 49 db layer, or the db layer in conjunction with the biz 50 50 layer, with no ui at all.) 51 52 + SQLite3: this is used internally for managing preferences, as 51 52 + SQLite3: this is used internally for managing preferences, as 53 53 well as for cursor management. 54 55 + pysqlite2: The Python dbapi module for SQLite. (Not needed in 54 55 + pysqlite2: The Python dbapi module for SQLite. (Not needed in 56 56 Python 2.5 and higher) 57 57 … … 60 60 + Linux 2.4 with X11 running and Gtk2 61 61 62 + Access to some sort of database server, along with the 62 + Access to some sort of database server, along with the 63 63 appropriate Python driver(s) installed. For example, for 64 64 MySQL you'll need to have the MySQL client libraries … … 67 67 DB API coupled with the individual database drivers. This 68 68 is, at the same time, less flexible, tougher to get started 69 with, but more capable, more multi-platform, and better 69 with, but more capable, more multi-platform, and better 70 70 performing, than ODBC is.) (we recommend starting with MySQL 71 71 installed, because all of the demo code has the best support … … 74 74 How you get started is pretty much up to you. Look at the code in the 75 75 separate dabodemo project. Run the AppWizard in the separate daboide 76 project. Hand-edit the data definition files and Python code that the 76 project. Hand-edit the data definition files and Python code that the 77 77 AppWizard generates for you. 78 78 … … 98 98 print tb.Value 99 99 100 Have fun in your exploration of Dabo. 100 Have fun in your exploration of Dabo. 101 101 """ 102 102 … … 116 116 pysqlite2: http://initd.org/tracker/pysqlite 117 117 118 """ 118 """ 119 119 sys.exit(msg) 120 120 … … 131 131 errorLog.Caption = "Dabo Error Log" 132 132 errorLog.LogObject = sys.stderr 133 # This log is set to None by default. It must be manually activated 133 # This log is set to None by default. It must be manually activated 134 134 # via the Application object. 135 135 dbActivityLog = Log() 136 136 dbActivityLog.Caption = "Database Activity Log" 137 137 dbActivityLog.LogObject = None 138 139 def logInfo(msg, *args, **kwargs):140 infoLog.write(msg)141 def logError(msg, *args, **kwargs):142 errorLog.write(msg)143 def logDBActivity(msg, *args, **kwargs):144 dbActivityLog.write(msg)145 146 138 147 139 # Import global settings (do this first, as other imports may rely on it): trunk/dabo/dApp.py
r3194 r3199 28 28 """Add the object reference to the collection.""" 29 29 self.append(objRef) 30 30 31 31 32 32 def remove(self, objRef): … … 42 42 43 43 class TempFileHolder(object): 44 """Utility class to get temporary file names and to make sure they are 44 """Utility class to get temporary file names and to make sure they are 45 45 deleted when the Python session ends. 46 46 """ … … 51 51 def __del__(self): 52 52 self._eraseTempFiles() 53 54 53 54 55 55 def _eraseTempFiles(self): 56 56 # Try to erase all temp files created during life. … … 70 70 # In these rare cases, Python has already 'gone away', so just bail 71 71 pass 72 73 72 73 74 74 def release(self): 75 self._eraseTempFiles() 75 self._eraseTempFiles() 76 76 77 77 … … 117 117 and lives through the life of the application. 118 118 119 -- set up an empty data connections object which holds 120 -- connectInfo objects connected to pretty names. If there 119 -- set up an empty data connections object which holds 120 -- connectInfo objects connected to pretty names. If there 121 121 -- is a file named 'default.cnxml' present, it will import the 122 122 -- connection definitions contained in that. If no file of that 123 123 -- name exists, it will import any .cnxml file it finds. If there 124 124 -- are no such files, it will then revert to the old behavior 125 -- of importing a file in the current directory called 125 -- of importing a file in the current directory called 126 126 -- 'dbConnectionDefs.py', which contains connection 127 127 -- definitions in python code format instead of XML. … … 133 133 -- decide which ui to use (wx) and gets that ball rolling 134 134 135 -- look for a MainForm in an expected place, otherwise use default dabo 136 -- dMainForm, and instantiate that. 135 -- look for a MainForm in an expected place, otherwise use default dabo 136 -- dMainForm, and instantiate that. 137 137 138 138 -- maintain a forms collection and provide interfaces for … … 146 146 _call_beforeInit, _call_afterInit, _call_initProperties = False, False, True 147 147 # Behaviors which are normal in the framework may need to 148 # be modified when run as the Designer. This flag will 148 # be modified when run as the Designer. This flag will 149 149 # distinguish between the two states. 150 150 isDesigner = False 151 151 152 152 153 153 def __init__(self, selfStart=False, properties=None, *args, **kwargs): 154 154 self._uiAlreadySet = False … … 163 163 self.splashMaskColor = self._extractKey(kwargs, "splashMaskColor", None) 164 164 self.splashTimeout = self._extractKey(kwargs, "splashTimeout", 5000) 165 165 166 166 super(dApp, self).__init__(properties, *args, **kwargs) 167 167 # egl: added the option of keeping the main form hidden … … 179 179 180 180 # List of form classes to open on App Startup 181 self.formsToOpen = [] 181 self.formsToOpen = [] 182 182 # Form to open if no forms were passed as a parameter 183 183 self.default_form = None … … 192 192 self._afterInit() 193 193 self.autoBindEvents() 194 194 195 195 196 196 def __del__(self): 197 197 """Make sure that temp files are removed""" 198 198 self._tempFileHolder.release() 199 199 200 200 201 201 def setup(self, initUI=True): … … 204 204 if self.HomeDirectory not in sys.path: 205 205 sys.path.append(self.HomeDirectory) 206 206 207 207 def initAppInfo(item, default): 208 208 if not self.getAppInfo(item): … … 215 215 216 216 self._initDB() 217 217 218 218 if initUI: 219 219 self._initUI() … … 233 233 234 234 def startupForms(self): 235 """Open one or more of the defined forms. The default one is specified 236 in .default_form. If form names were passed on the command line, 235 """Open one or more of the defined forms. The default one is specified 236 in .default_form. If form names were passed on the command line, 237 237 they will be opened instead of the default one as long as they exist. 238 238 """ … … 249 249 250 250 def initUIApp(self): 251 """Callback from the initial app setup. Used to allow the 251 """Callback from the initial app setup. Used to allow the 252 252 splash screen, if any, to be shown quickly. 253 253 """ 254 254 self.uiApp.setup() 255 256 255 256 257 257 def start(self): 258 258 """Start the application event loop.""" … … 261 261 # call start() 262 262 self.setup() 263 263 264 264 if (not self.SecurityManager or not self.SecurityManager.RequireAppLogin 265 265 or self.SecurityManager.login()): 266 266 267 267 userName = self.getUserCaption() 268 268 if userName: … … 270 270 else: 271 271 userName = "" 272 272 273 273 self._retrieveMRUs() 274 274 self.uiApp.start(self) 275 275 self.finish() 276 277 276 277 278 278 def finish(self): 279 279 """Called when the application event loop has ended.""" … … 282 282 self.closeConnections() 283 283 self._tempFileHolder.release() 284 dabo. logInfo(_("Application finished."))284 dabo.infoLog.write(_("Application finished.")) 285 285 286 286 … … 288 288 """Return the user/password to dSecurityManager.login(). 289 289 290 The default is to display the standard login dialog, and return the 290 The default is to display the standard login dialog, and return the 291 291 user/password as entered by the user, but subclasses can override to get 292 292 the information from whereever is appropriate. … … 300 300 user, password = ld.user, ld.password 301 301 return user, password 302 303 302 303 304 304 def _persistMRU(self): 305 305 """Persist any MRU lists to disk.""" 306 306 base = "MRU.%s" % self.getAppInfo("appName") 307 self.deleteAllUserSettings(base) 307 self.deleteAllUserSettings(base) 308 308 for cap in self._persistentMRUs.keys(): 309 309 mruList = self.uiApp.getMRUListForMenu(cap) 310 310 setName = ".".join((base, cap)) 311 311 self.setUserSetting(setName, mruList) 312 313 312 313 314 314 def _retrieveMRUs(self): 315 315 """Retrieve any saved MRU lists.""" … … 321 321 for itm in itms: 322 322 self.uiApp.addToMRU(cap, itm, fcn) 323 323 324 324 325 325 def getAppInfo(self, item): … … 339 339 def getUserSettingKeys(self, spec): 340 340 """Return a list of all keys underneath <spec> in the user settings table. 341 341 342 342 For example, if spec is "appWizard.dbDefaults", and there are 343 343 userSettings entries for: … … 345 345 appWizard.dbDefaults.pkm.User 346 346 appWizard.dbDefaults.egl.Host 347 347 348 348 The return value would be ["pkm", "egl"] 349 349 """ … … 367 367 if usp: 368 368 usp.setUserSetting(item, value) 369 370 369 370 371 371 def setUserSettings(self, setDict): 372 372 """Convenience method for setting several settings with one … … 376 376 if usp: 377 377 usp.setUserSettings(setDict) 378 379 378 379 380 380 def deleteUserSetting(self, item): 381 381 """Removes the given item from the user settings file.""" … … 383 383 if usp: 384 384 usp.deleteUserSetting(item) 385 386 385 386 387 387 def deleteAllUserSettings(self, spec): 388 388 """Deletes all settings that begin with the supplied spec.""" … … 390 390 if usp: 391 391 usp.deleteAllUserSettings(spec) 392 393 392 393 394 394 def getUserCaption(self): 395 395 """ Return the full name of the currently logged-on user.""" … … 430 430 # to the Crypto object 431 431 def encrypt(self, val): 432 """Return the encrypted string value. The request is passed 432 """Return the encrypted string value. The request is passed 433 433 to the Crypto object for processing. 434 434 """ 435 435 return self.Crypto.encrypt(val) 436 436 437 437 438 438 def decrypt(self, val): 439 """Return decrypted string value. The request is passed to 439 """Return decrypted string value. The request is passed to 440 440 the Crypto object for processing. 441 441 """ 442 442 return self.Crypto.decrypt(val) 443 443 444 444 445 445 def getCharset(self): 446 446 """Returns one of 'unicode' or 'ascii'.""" 447 447 return self.uiApp.charset 448 449 448 449 450 450 def _initProperties(self): 451 451 """ Initialize the public properties of the app object.""" … … 467 467 super(dApp, self)._initProperties() 468 468 469 469 470 470 def _initDB(self): 471 """Set the available connection definitions for use by the app. 471 """Set the available connection definitions for use by the app. 472 472 473 473 First read in all .cnxml files. If no such XML definition files exist, … … 485 485 for kk in cn.keys(): 486 486 self.dbConnectionNameToFiles[kk] = f 487 487 488 488 # Import any python code connection definitions (the "old" way). 489 489 try: … … 495 495 except: 496 496 pass 497 498 # For each connection definition, add an entry to 499 # self.dbConnectionDefs that contains a key on the 497 498 # For each connection definition, add an entry to 499 # self.dbConnectionDefs that contains a key on the 500 500 # name, and a value of a dConnectInfo object. 501 501 for k,v in connDefs.items(): … … 504 504 self.dbConnectionDefs[k] = ci 505 505 506 dabo. logInfo(_("%s database connection definition(s) loaded.")506 dabo.infoLog.write(_("%s database connection definition(s) loaded.") 507 507 % (len(self.dbConnectionDefs))) 508 508 509 509 510 510 def _initUI(self): 511 """ Set the user-interface library for the application. Ignored 511 """ Set the user-interface library for the application. Ignored 512 512 if the UI was already explicitly set by user code. 513 513 """ … … 519 519 else: 520 520 # Custom app code or the dabo.ui module already set this: don't touch 521 dabo. logInfo(_("User interface already set to '%s', so dApp didn't touch it.")521 dabo.infoLog.write(_("User interface already set to '%s', so dApp didn't touch it.") 522 522 % self.UI) 523 523 … … 539 539 ret = None 540 540 return ret 541 542 541 542 543 543 def getConnectionNames(self): 544 544 """Returns a list of all defined connection names""" 545 545 return self.dbConnectionDefs.keys() 546 547 546 547 548 548 def closeConnections(self): 549 549 """Cleanup as the app is exiting.""" … … 553 553 except: 554 554 pass 555 556 555 556 557 557 def addConnectInfo(self, ci, name=None): 558 558 if name is None: … … 564 564 self.dbConnectionDefs[name] = ci 565 565 self.dbConnectionNameToFiles[name] = None 566 566 567 567 568 568 def addConnectFile(self, connFile): … … 583 583 if os.path.exists(connFile): 584 584 connDefs = importConnections(connFile) 585 # For each connection definition, add an entry to 586 # self.dbConnectionDefs that contains a key on the 585 # For each connection definition, add an entry to 586 # self.dbConnectionDefs that contains a key on the 587 587 # name, and a value of a dConnectInfo object. 588 588 for k,v in connDefs.items(): … … 591 591 self.dbConnectionDefs[k] = ci 592 592 self.dbConnectionNameToFiles[k] = connFile 593 593 594 594 def showCommandWindow(self, context=None): 595 595 """Shows a command window with a full Python interpreter. 596 596 597 597 This is great for debugging during development, but you should turn off 598 app.ShowCommandWindowMenu in production, perhaps leaving backdoor 598 app.ShowCommandWindowMenu in production, perhaps leaving backdoor 599 599 access to this function. 600 600 … … 657 657 def onMenuOpenMRU(self, menu): 658 658 self.uiApp.onMenuOpenMRU(menu) 659 ############################ 660 661 659 ############################ 660 661 662 662 def copyToClipboard(self, txt): 663 663 """Place the passed text onto the clipboard.""" 664 664 self.uiApp.copyToClipboard(txt) 665 665 666 666 667 667 def onHelpAbout(self, evt): … … 678 678 dlg = about(frm) 679 679 dlg.show() 680 681 680 681 682 682 def addToAbout(self): 683 683 """Adds additional app-specific information to the About form. 684 684 This is just a stub method; override in subclasses if needed.""" 685 685 pass 686 687 686 687 688 688 def clearActiveForm(self, frm): 689 689 """Called by the form when it is deactivated.""" … … 691 691 self.uiApp.ActiveForm = None 692 692 693 693 694 694 def _getAboutFormClass(self): 695 695 return getattr(self, "_aboutFormClass", None) … … 704 704 else: 705 705 return None 706 706 707 707 def _setActiveForm(self, frm): 708 708 if hasattr(self, "uiApp") and self.uiApp is not None: 709 709 self.uiApp._setActiveForm(frm) 710 710 else: 711 dabo. logError(_("Can't set ActiveForm: no uiApp."))712 711 dabo.errorLog.write(_("Can't set ActiveForm: no uiApp.")) 712 713 713 714 714 def _getBasePrefKey(self): … … 726 726 except: pass 727 727 if not ret: 728 dabo. logInfo(_("WARNING: No BasePrefKey has been set for this application."))728 dabo.infoLog.write(_("WARNING: No BasePrefKey has been set for this application.")) 729 729 try: 730 730 f = inspect.stack()[-1][1] … … 761 761 f = open(val, "a") 762 762 except: 763 dabo. logError(_("Could not open file: '%s'") % val)763 dabo.errorLog.write(_("Could not open file: '%s'") % val) 764 764 return 765 765 else: … … 770 770 def _getDrawSizerOutlines(self): 771 771 return self.uiApp.DrawSizerOutlines 772 772 773 773 def _setDrawSizerOutlines(self, val): 774 774 self.uiApp.DrawSizerOutlines = val 775 775 776 776 777 777 def _getEncoding(self): … … 780 780 ret = dabo.defaultEncoding 781 781 return ret 782 782 783 783 784 784 def _getHomeDirectory(self): … … 802 802 # but the containing directory (the directory where the exe lives) 803 803 hd = os.path.split(hd)[0] 804 self._homeDirectory = hd 804 self._homeDirectory = hd 805 805 return hd 806 806 807 807 def _setHomeDirectory(self, val): 808 808 if os.path.exists(val): … … 818 818 self._icon = val 819 819 820 820 821 821 def _getMainForm(self): 822 822 try: … … 826 826 self._mainForm = None 827 827 return frm 828 828 829 829 def _setMainForm(self, val): 830 830 self.uiApp.setMainForm(val) 831 831 self._mainForm = val 832 832 833 833 834 834 def _getMainFormClass(self): 835 835 try: … … 839 839 self._mainFormClass = cls 840 840 return cls 841 841 842 842 def _setMainFormClass(self, val): 843 843 self._mainFormClass = val 844 845 844 845 846 846 def _getNoneDisp(self): 847 847 v = self._noneDisplay = getattr(self, "_noneDisplay", _("< None >")) … … 851 851 assert isinstance(val, basestring) 852 852 self._noneDisplay = val 853 853 854 854 855 855 def _getPlatform(self): … … 869 869 except AttributeError: 870 870 ## I've found that a value of 300 isn't too fast nor too slow: 871 # egl: 2006-11-16 - based on feedback from others, I'm 871 # egl: 2006-11-16 - based on feedback from others, I'm 872 872 # lengthening this to 500 ms. 873 873 return 500 874 874 875 875 def _setSearchDelay(self, value): 876 self._searchDelay = int(value) 877 878 876 self._searchDelay = int(value) 877 878 879 879 def _getSecurityManager(self): 880 880 try: … … 882 882 except AttributeError: 883 883 return None 884 884 885 885 def _setSecurityManager(self, value): 886 886 if isinstance(value, dSecurityManager.dSecurityManager): … … 890 890 else: 891 891 raise TypeError, _("SecurityManager must descend from dSecurityManager.") 892 893 892 893 894 894 def _getShowCommandWindowMenu(self): 895 895 try: … … 898 898 v = self._showCommandWindowMenu = True 899 899 return v 900 900 901 901 def _setShowCommandWindowMenu(self, val): 902 902 self._showCommandWindowMenu = bool(val) 903 903 904 904 905 905 def _getShowSizerLinesMenu(self): … … 909 909 v = self._showSizerLinesMenu = True 910 910 return v 911 911 912 912 def _setShowSizerLinesMenu(self, val): 913 913 self._showSizerLinesMenu = bool(val) 914 914 915 915 916 916 def _getUI(self): 917 917 try: … … 919 919 except AttributeError: 920 920 return None 921 921 922 922 def _setUI(self, uiType): 923 923 # Load the appropriate ui module. dabo.ui will now contain … … 926 926 if uiType is None: 927 927 self._uiAlreadySet = True 928 dabo. logInfo(_("User interface set set to None."))928 dabo.infoLog.write(_("User interface set set to None.")) 929 929 elif dabo.ui.loadUI(uiType): 930 930 self._uiAlreadySet = True 931 dabo. logInfo(_("User interface set to '%s' by dApp.") % uiType)931 dabo.infoLog.write(_("User interface set to '%s' by dApp.") % uiType) 932 932 else: 933 dabo. logInfo(_("Tried to set UI to '%s', but it failed.") % uiType)933 dabo.infoLog.write(_("Tried to set UI to '%s', but it failed.") % uiType) 934 934 else: 935 935 raise RuntimeError, _("The UI cannot be reset once assigned.") 936 936 937 937 938 938 def _getUserSettingProvider(self): 939 939 try: … … 946 946 ret = self._userSettingProvider = None 947 947 return ret 948 948 949 949 def _setUserSettingProvider(self, val): 950 950 self._userSettingProvider = val … … 966 966 _("Specifies the form class to use for the application's About screen.")) 967 967 968 ActiveForm = property(_getActiveForm, _setActiveForm, None, 968 ActiveForm = property(_getActiveForm, _setActiveForm, None, 969 969 _("Returns the form that currently has focus, or None. (dForm)" ) ) 970 970 971 971 BasePrefKey = property(_getBasePrefKey, _setBasePrefKey, None, 972 972 _("""Base key used when saving/restoring preferences. This differs 973 from the default definition of this property in that if it is empty, it 973 from the default definition of this property in that if it is empty, it 974 974 will return the ActiveForm's BasePrefKey or the MainForm's BasePrefKey 975 975 in that order. (str)""")) 976 977 Crypto = property(_getCrypto, _setCrypto, None, 976 977 Crypto = property(_getCrypto, _setCrypto, None, 978 978 _("Reference to the object that provides cryptographic services. (varies)" ) ) 979 979 980 980 DatabaseActivityLog = property(_getDatabaseActivityLog, _setDatabaseActivityLog, None, 981 _("""Path to the file (or file-like object) to be used for logging all database 981 _("""Path to the file (or file-like object) to be used for logging all database 982 982 activity. Default=None, which means no log is kept. (file or str)""")) 983 983 984 984 DrawSizerOutlines = property(_getDrawSizerOutlines, _setDrawSizerOutlines, None, 985 985 _("Determines if sizer outlines are drawn on the ActiveForm. (bool)")) 986 986 987 987 Encoding = property(_getEncoding, None, None, 988 988 _("Name of encoding to use for unicode (str)") ) 989 989 990 990 HomeDirectory = property(_getHomeDirectory, _setHomeDirectory, None, 991 991 _("""Specifies the application's home directory. (string) 992 992 993 993 The HomeDirectory is the top-level directory for your application files, 994 the directory where your main script lives. You never know what the 994 the directory where your main script lives. You never know what the 995 995 current directory will be on a given system, but HomeDirectory will always 996 996 get you to your files.""")) 997 997 998 998 Icon = property(_getIcon, _setIcon, None, 999 999 _("""Specifies the icon to use on all forms and dialogs by default. … … 1008 1008 _("""The object reference to the main form of the application, or None. 1009 1009 1010 The MainForm gets instantiated automatically during application setup, 1010 The MainForm gets instantiated automatically during application setup, 1011 1011 based on the value of MainFormClass. If you want to swap in your own 1012 1012 MainForm instance, do it after setup() but before start(), as in: … … 1017 1017 >>> app.MainForm = myMainFormInstance 1018 1018 >>> app.start()""")) 1019 1019 1020 1020 MainFormClass = property(_getMainFormClass, _setMainFormClass, None, 1021 1021 _("""Specifies the class to instantiate for the main form. Can be a 1022 1022 class reference, or the path to a .cdxml file. 1023 1023 1024 Defaults to the dFormMain base class. Set to None if you don't want a 1024 Defaults to the dFormMain base class. Set to None if you don't want a 1025 1025 main form, or set to your own main form class. Do this before calling 1026 1026 dApp.start(), as in: … … 1031 1031 >>> app.start() 1032 1032 (dForm) """)) 1033 1034 NoneDisplay = property(_getNoneDisp, _setNoneDisp, None, 1033 1034 NoneDisplay = property(_getNoneDisp, _setNoneDisp, None, 1035 1035 _("Text to display for null (None) values. (str)") ) 1036 1036 1037 1037 Platform = property(_getPlatform, None, None, 1038 _("""Returns the platform we are running on. This will be 1038 _("""Returns the platform we are running on. This will be 1039 1039 one of 'Mac', 'Win' or 'GTK'. (str)""") ) 1040 1040 … … 1043 1043 1044 1044 As the user types, the search string is modified. If the time between 1045 keystrokes exceeds SearchDelay (milliseconds), the search will run and 1045 keystrokes exceeds SearchDelay (milliseconds), the search will run and 1046 1046 the search string will be cleared. 1047 1047 1048 1048 The value set here in the Application object will become the default for 1049 1049 all objects that provide incremental searching application-wide.""") ) 1050 1051 SecurityManager = property(_getSecurityManager, _setSecurityManager, None, 1052 _("""Specifies the Security Manager, if any. 1053 1054 You must subclass dSecurityManager, overriding the appropriate hooks 1055 and properties, and then set dApp.SecurityManager to an instance of your 1056 subclass. There is no security manager by default - you explicitly set 1050 1051 SecurityManager = property(_getSecurityManager, _setSecurityManager, None, 1052 _("""Specifies the Security Manager, if any. 1053 1054 You must subclass dSecurityManager, overriding the appropriate hooks 1055 and properties, and then set dApp.SecurityManager to an instance of your 1056 subclass. There is no security manager by default - you explicitly set 1057 1057 this to use Dabo security.""") ) 1058 1058 1059 1059 ShowCommandWindowMenu = property(_getShowCommandWindowMenu, 1060 _setShowCommandWindowMenu, None, 1060 _setShowCommandWindowMenu, None, 1061 1061 _("""Specifies whether the command window option is shown in the menu. 1062 1062 1063 1063 If True (the default), there will be a File|Command Window option 1064 available in the base menu. If False, your code can still start the 1064 available in the base menu. If False, your code can still start the 1065 1065 command window by calling app.showCommandWindow() directly.""") ) 1066 1066 1067 1067 ShowSizerLinesMenu = property(_getShowSizerLinesMenu, 1068 _setShowSizerLinesMenu, None, 1068 _setShowSizerLinesMenu, None, 1069 1069 _("""Specifies whether the "Show Sizer Lines" option is shown in the menu. 1070 1070 … … 1072 1072 available in the base menu.""") ) 1073 1073 1074 UI = property(_getUI, _setUI, None, 1074 UI = property(_getUI, _setUI, None, 1075 1075 _("""Specifies the user interface to load, or None. (str) 1076 1076 … … 1078 1078 'wx' is the only supported user interface library at this point.""")) 1079 1079 1080 UserSettingProvider = property(_getUserSettingProvider, 1080 UserSettingProvider = property(_getUserSettingProvider, 1081 1081 _setUserSettingProvider, None, 1082 1082 _("""Specifies the reference to the object providing user preference persistence. 1083 1083 1084 1084 The default UserSettingProvider will save user preferences inside the .dabo 1085 1085 directory inside the user's home directory.""")) … … 1088 1088 _setUserSettingProviderClass, None, 1089 1089 _("""Specifies the class to use for user preference persistence. 1090 1090 1091 1091 The default UserSettingProviderClass will save user preferences inside the .dabo 1092 1092 directory inside the user's home directory, and will be instantiated by Dabo trunk/dabo/dEvents.py
r3194 r3199 9 9 class dEvent(dObject): 10 10 """ Base class for Dabo events. 11 12 Event objects are instantiated in self.raiseEvent(), and passed to all 11 12 Event objects are instantiated in self.raiseEvent(), and passed to all 13 13 callbacks registered with self.bindEvent(). 14 15 User code can define custom events by simply subclassing Event and then 14 15 User code can define custom events by simply subclassing Event and then 16 16 using self.bindEvent() and self.raiseEvent() in your objects. 17 """ 17 """ 18 18 &n
