Class TfrmYourPasEdit (unit YrPasEdit)

Inherits from

TForm

Constructors



Functions

procedure AppIdle(Sender: TObject; var Done: Boolean);


procedure CheckStatus(Sender: TObject);

The INS/OVR is somewhat inaccurate, it will often show OVR when the mode is clearly in INS mode, and show INS when the mode is clearly in OVR.

procedure FindDialog1Find(Sender: TObject);

I think this came from a Neil Rubenking example

procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);


procedure FormCreate(Sender: TObject);

creates a NewRichEdit and setsthe NewTabSheet as the parent

procedure FormDestroy(Sender: TObject);

This is used in the Start With New option

procedure FormKeyDown(Sender: TObject; var KEY: Word; Shift: TShiftState);


procedure FormShow(Sender: TObject);

This puts Alt F4 on the menu

procedure mmAboutClick(Sender: TObject);

Opens the Printer Setup dialog

procedure mmCloseAllClick(Sender: TObject);

Checks if RichEdit has been Modified before closing

procedure mmCopyClick(Sender: TObject);


procedure mmCutClick(Sender: TObject);


procedure mmEditClick(Sender: TObject);

Hmm, I wonder what this does?:-

procedure mmExitClick(Sender: TObject);

This also displays the file path when the cursor is in the RichEdit

procedure mmFileClick(Sender: TObject);

Shows the AboutBox

procedure mmFindAgainClick(Sender: TObject);

I would like to have a message popup saying that no other instances of the chosen word was found, but it seems to cause some functions to fail, like ReplaceAll

procedure mmFindClick(Sender: TObject);

Closes and Frees the ActivePage

procedure mmMultiLineClick(Sender: TObject);

OPTIONS

procedure mmNewClick(Sender: TObject);


procedure mmOpenClick(Sender: TObject);

Set the NewRichEdit Properties

procedure mmPasteClick(Sender: TObject);


procedure mmPrintClick(Sender: TObject);


procedure mmPrinterSetupClick(Sender: TObject);

Performs the basic RichEdit printing

procedure mmReplaceClick(Sender: TObject);


procedure mmSaveAllClick(Sender: TObject);

Close All pages

procedure mmSaveAsClick(Sender: TObject);

if it is a DFM or ~DF file, it gets saved as a DFM

procedure mmSaveClick(Sender: TObject);

Enables the Save MenuItem if RichEdit is Modified

procedure mmSelectAllClick(Sender: TObject);

These are the Edit MenuItems

procedure mmStatusBarClick(Sender: TObject);

display the TabSheets in a MultiLine

procedure mmUndoClick(Sender: TObject);


procedure NewRichEditChange(Sender: TObject);

Save All modified RichEdits

procedure NewRichEditSelectionChange(Sender: TObject);

This is where Closing pages causes the Access Violation

procedure pmaClosePageClick(Sender: TObject);

File Open procedure

procedure ReplaceDialog1Replace(Sender: TObject);


procedure CheckCapslock;

Sets NewRichEdit properties for mmNewClick and StartNew

procedure DisplayHint(Sender: TObject);

Toggle StatusBar visible

procedure LoadFile(FName: string);


procedure LoadFileDFM(FName: string);

Loads the file as plain text, used so plain text files can be loaded without going through the PasToRtf unit

procedure LoadFilePT(FName: string);

sends file through the PasToRtf conversion unit} {if a Delphi file, containing too much uncommented text is opened, an Invalid String error occurs

procedure NewRichEditSetup(NewRE: TRichEdit);

Enables menu controls, based on the existence of an ActivePage, funny things happened if there was no ActivePage and RichEdit and you tried to do a Find or something

procedure OpenFile(FName: string);


procedure SaveFileToDFM(Filename: string);

This uses Delphi's built in ObjectResourceToText procedure to convert the Delphi Form file to a plain text format and then opens the file in a new TabSheet/RichEdit

procedure StartNew;

ObjectTextToResource(TMemoryStream, TFileStream);

procedure UpdateControls;

otherwise load it as a plain text file

procedure DefaultHandler(var message);


procedure WMNotExists(var Msg: TMessage);


procedure WMRestoreApp(var Msg: TMessage);

The basic code contained in the next three procedures, which works with the DPR code to allow file association and open doubleclicked file in the running instance of app was written by Andrius Adamonis

Properties

Events

Variables

FindDialog1 : TFindDialog;


mmAbout : TMenuItem;


mmClose : TMenuItem;


mmCloseAll : TMenuItem;


mmCopy : TMenuItem;


mmCut : TMenuItem;


mmEdit : TMenuItem;


mmExit : TMenuItem;


mmFile : TMenuItem;


mmFind : TMenuItem;


mmFindAgain : TMenuItem;


mmHelp : TMenuItem;


mmMainMenu : TMainMenu;


mmMultiLine : TMenuItem;


mmNew : TMenuItem;


mmOpen : TMenuItem;


mmPaste : TMenuItem;


mmPrint : TMenuItem;


mmPrinterSetup : TMenuItem;


mmReplace : TMenuItem;


mmSave : TMenuItem;


mmSaveAll : TMenuItem;


mmSaveAs : TMenuItem;


mmSearch : TMenuItem;


mmSelectAll : TMenuItem;


mmStatusBar : TMenuItem;


mmUndo : TMenuItem;


mmView : TMenuItem;


N1 : TMenuItem;


N2 : TMenuItem;


N3 : TMenuItem;


N4 : TMenuItem;


N5 : TMenuItem;


N6 : TMenuItem;


N7 : TMenuItem;


N8 : TMenuItem;


N9 : TMenuItem;


OpenDialog1 : TOpenDialog;


PageControl1 : TPageControl;


pmaCloseAllPages : TMenuItem;


pmaClosePage : TMenuItem;


pmActivePage : TPopupMenu;


pmaExit : TMenuItem;


pmaFind : TMenuItem;


pmaNew : TMenuItem;


pmaOpen : TMenuItem;


pmaReplace : TMenuItem;


pmaSave : TMenuItem;


pmaSaveAll : TMenuItem;


pmaSaveAs : TMenuItem;


PrintDialog : TPrintDialog;


PrinterSetupDialog : TPrinterSetupDialog;


ReplaceDialog1 : TReplaceDialog;


SaveDialog1 : TSaveDialog;


StatusBar : TStatusBar;


Margins : TRect;

Public declarations

NewRichEdit : TRichEdit;


NewTabSheet : TTabSheet;


PasCon : TPasConversion;


Untitleds : Integer;


FFileName : string;

Private declarations


Constructors


Functions


procedure AppIdle(Sender: TObject; var Done: Boolean);


procedure CheckStatus(Sender: TObject);

The INS/OVR is somewhat inaccurate, it will often show OVR when the mode is clearly in INS mode, and show INS when the mode is clearly in OVR. If you figure out a way of accurately showing the state, please let us know. This slightly modified example comes from Marco Cantu's Mastering Delphi 3 book


procedure FindDialog1Find(Sender: TObject);

I think this came from a Neil Rubenking example


procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);


procedure FormCreate(Sender: TObject);

creates a NewRichEdit and setsthe NewTabSheet as the parent


procedure FormDestroy(Sender: TObject);

This is used in the Start With New option


procedure FormKeyDown(Sender: TObject; var KEY: Word; Shift: TShiftState);


procedure FormShow(Sender: TObject);

This puts Alt F4 on the menu


procedure mmAboutClick(Sender: TObject);

Opens the Printer Setup dialog


procedure mmCloseAllClick(Sender: TObject);

Checks if RichEdit has been Modified before closing


procedure mmCopyClick(Sender: TObject);


procedure mmCutClick(Sender: TObject);


procedure mmEditClick(Sender: TObject);

Hmm, I wonder what this does?:-


procedure mmExitClick(Sender: TObject);

This also displays the file path when the cursor is in the RichEdit


procedure mmFileClick(Sender: TObject);

Shows the AboutBox


procedure mmFindAgainClick(Sender: TObject);

I would like to have a message popup saying that no other instances of the chosen word was found, but it seems to cause some functions to fail, like ReplaceAll


procedure mmFindClick(Sender: TObject);

Closes and Frees the ActivePage


procedure mmMultiLineClick(Sender: TObject);

OPTIONS


procedure mmNewClick(Sender: TObject);


procedure mmOpenClick(Sender: TObject);

Set the NewRichEdit Properties


procedure mmPasteClick(Sender: TObject);


procedure mmPrintClick(Sender: TObject);


procedure mmPrinterSetupClick(Sender: TObject);

Performs the basic RichEdit printing


procedure mmReplaceClick(Sender: TObject);


procedure mmSaveAllClick(Sender: TObject);

Close All pages


procedure mmSaveAsClick(Sender: TObject);

if it is a DFM or ~DF file, it gets saved as a DFM


procedure mmSaveClick(Sender: TObject);

Enables the Save MenuItem if RichEdit is Modified


procedure mmSelectAllClick(Sender: TObject);

These are the Edit MenuItems


procedure mmStatusBarClick(Sender: TObject);

display the TabSheets in a MultiLine


procedure mmUndoClick(Sender: TObject);


procedure NewRichEditChange(Sender: TObject);

Save All modified RichEdits


procedure NewRichEditSelectionChange(Sender: TObject);

This is where Closing pages causes the Access Violation


procedure pmaClosePageClick(Sender: TObject);

File Open procedure


procedure ReplaceDialog1Replace(Sender: TObject);


procedure CheckCapslock;

Sets NewRichEdit properties for mmNewClick and StartNew


procedure DisplayHint(Sender: TObject);

Toggle StatusBar visible


procedure LoadFile(FName: string);


procedure LoadFileDFM(FName: string);

Loads the file as plain text, used so plain text files can be loaded without going through the PasToRtf unit


procedure LoadFilePT(FName: string);

sends file through the PasToRtf conversion unit} {if a Delphi file, containing too much uncommented text is opened, an Invalid String error occurs


procedure NewRichEditSetup(NewRE: TRichEdit);

Enables menu controls, based on the existence of an ActivePage, funny things happened if there was no ActivePage and RichEdit and you tried to do a Find or something


procedure OpenFile(FName: string);


procedure SaveFileToDFM(Filename: string);

This uses Delphi's built in ObjectResourceToText procedure to convert the Delphi Form file to a plain text format and then opens the file in a new TabSheet/RichEdit


procedure StartNew;

ObjectTextToResource(TMemoryStream, TFileStream);


procedure UpdateControls;

otherwise load it as a plain text file


procedure DefaultHandler(var message);


procedure WMNotExists(var Msg: TMessage);


procedure WMRestoreApp(var Msg: TMessage);

The basic code contained in the next three procedures, which works with the DPR code to allow file association and open doubleclicked file in the running instance of app was written by Andrius Adamonis


Properties


Events


Variables


FindDialog1 : TFindDialog;


mmAbout : TMenuItem;


mmClose : TMenuItem;


mmCloseAll : TMenuItem;


mmCopy : TMenuItem;


mmCut : TMenuItem;


mmEdit : TMenuItem;


mmExit : TMenuItem;


mmFile : TMenuItem;


mmFind : TMenuItem;


mmFindAgain : TMenuItem;


mmHelp : TMenuItem;


mmMainMenu : TMainMenu;


mmMultiLine : TMenuItem;


mmNew : TMenuItem;


mmOpen : TMenuItem;


mmPaste : TMenuItem;


mmPrint : TMenuItem;


mmPrinterSetup : TMenuItem;


mmReplace : TMenuItem;


mmSave : TMenuItem;


mmSaveAll : TMenuItem;


mmSaveAs : TMenuItem;


mmSearch : TMenuItem;


mmSelectAll : TMenuItem;


mmStatusBar : TMenuItem;


mmUndo : TMenuItem;


mmView : TMenuItem;


N1 : TMenuItem;


N2 : TMenuItem;


N3 : TMenuItem;


N4 : TMenuItem;


N5 : TMenuItem;


N6 : TMenuItem;


N7 : TMenuItem;


N8 : TMenuItem;


N9 : TMenuItem;


OpenDialog1 : TOpenDialog;


PageControl1 : TPageControl;


pmaCloseAllPages : TMenuItem;


pmaClosePage : TMenuItem;


pmActivePage : TPopupMenu;


pmaExit : TMenuItem;


pmaFind : TMenuItem;


pmaNew : TMenuItem;


pmaOpen : TMenuItem;


pmaReplace : TMenuItem;


pmaSave : TMenuItem;


pmaSaveAll : TMenuItem;


pmaSaveAs : TMenuItem;


PrintDialog : TPrintDialog;


PrinterSetupDialog : TPrinterSetupDialog;


ReplaceDialog1 : TReplaceDialog;


SaveDialog1 : TSaveDialog;


StatusBar : TStatusBar;


Margins : TRect;

Public declarations


NewRichEdit : TRichEdit;


NewTabSheet : TTabSheet;


PasCon : TPasConversion;


Untitleds : Integer;


FFileName : string;

Private declarations