private void Init()
{
Int32 lStyle;
lStyle = (int) Eclectic.TextMode.TM_RICHTEXT | (int) Eclectic.TextMode.TM_MULTILEVELUNDO | (int) Eclectic.TextMode.TM_MULTICODEPAGE;
Eclectic.SendMessage(txtPage.Handle, Eclectic.EM_SETTEXTMODE, lStyle, 0);
Sync();
switch (Properties.Settings.Default.DataRecoveryMode)
{
case (int) Eclectic.DataRecoveryModes.BUFFER:
txtPage.Text = RecallCache();
break;
case (int) Eclectic.DataRecoveryModes.LAST_FILE:
OpenFile(Properties.Settings.Default.LastFileName);
break;
}
txtPage.Select(0, 0);
txtPage.ContextMenuStrip = contextMenuPage;
txtPage.DetectUrls = txtPage.FormattingEnabled;
txtPage.AutoIndent = Properties.Settings.Default.AutoIndent;
txtPage.TabsToSpaces = Properties.Settings.Default.TabToSpaces;
txtPage.ClearUndo();
txtPage.Modified = false;
dlgOpen.Filter = "Text Documents (*.txt)|*.txt|All files (*.*)|*.*";
dlgSave.Filter = "Text Documents (*.txt)|*.txt|All files (*.*)|*.*";
if (txtPage.FormattingEnabled)
{
dlgOpen.Filter = "Rich Text Format (*.rtf)|*.rtf|" + dlgOpen.Filter;
dlgSave.Filter = "Rich Text Format (*.rtf)|*.rft|" + dlgSave.Filter;
}
dlgSave.AddExtension = true;
preferencesToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+,";
statisticsToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+/";
}