If you open the document in the existing window, this is not very elegant, because you will have to ask the user if he wants to change the existing document. Now, the open document is more complex.Instead, you will launch another instance of your program.īe sure that the user does not rename the application. When you create a new document, do not open a new window instance, because it will not have the menubar with it.You need to put a separator between the menu bar and the document window.When you decide for SDI, then you have to change some code. However, you can have multiple instances of the application. In SDI, there can only be one document window at one time, with its menu. If you do MDI, there is a mother window with the menus which does hold the document windows. You have to decide if you want to make a single document interface (SDI) or a multiple document interface (MDI).
Preferences fileĪs there is no preferences folder, I use a textfilter.ini file in the applications folder.This makes some changes in the readpreferences and the writepreferences method of the application class.As the rest of the code is not platform-specific, i create a global getpreferencesfolderitem method Function GetPreferenceFolderItem() as FolderItemį = PreferencesFolder.child("TextFilter Preferences")
The global method is still better than using conditional compiling with the same code on two places. Sometimes, it is even more complex, so you will write a global method (see the Preferences File example). You can, however, also define global properties in a module and assign values to them in an Init method. It is sometimes a little bit difficult to copy special characters in the constants-definitions. This avoids too much conditional compiling.
Use constants whenever possible for the most platform-dependent strings. #if targetmacos thenīut on repeating code, it is even better to use Constants or Small platform dependent methods as below. Conditional compilingĪvoid splitting the project in two versions, you will not be able to maintain the code. Select the new file extension in the list.Ĭlick Change, then Other to select yourapplication.exe as the connected application.ĭrop me a mail to if you know a better solution (like a shell command which could be executed on installation).Click New and add a file extension "TFP".
The first extension is the one that will be used for saving files. Filetypesīe sure to use the order of file extensions you want for the filetypes. It uses HTML-entities for special characters, binhex-style encoding for binary data and is human-readable as textfile, which is great for debugging. The last option works great for small data like TextFilter projects.
This works well for pictures where you can rely on QuickTime Use a public format with the limitations of this format and the necessity to read documents in this format written by foreign applications.If you are going to provide a cross-platform application, your documents should be cross-platform, too. Avoid the situation having clients complaining about bugs on configurations you cannot test. They should work on 95,98,NT and XP as well, but i will not be able to test them. I only have access to Windows 2000 systems, so I will only support them. Platformĭecide what platform you are going to support. I want to explain some of the adaptations so you can use them for your application. REALbasic does a great job in porting the code, so I needed only some adaptations to have a working application in Windows 2000. I recently ported Belle Nuit Textfilter from Macintosh to Windows 2000 using the latest version of REALbasic 4.