"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "app/formmain.pas" between
CudaText-1.92.0.tar.gz and CudaText-1.93.0.tar.gz

About: CudaText is a cross-platform text editor (written in Lazarus).

formmain.pas  (CudaText-1.92.0):formmain.pas  (CudaText-1.93.0)
skipping to change at line 157 skipping to change at line 157
cMenuTabsizeMin = 1; cMenuTabsizeMin = 1;
cMenuTabsizeMax = 10; cMenuTabsizeMax = 10;
type type
{ TfmMain } { TfmMain }
TfmMain = class(TForm) TfmMain = class(TForm)
AppProps: TApplicationProperties; AppProps: TApplicationProperties;
ButtonCancel: TATButton; ButtonCancel: TATButton;
mnuOpThemes: TMenuItem; mnuOpThemes: TMenuItem;
mnuOpLangs: TMenuItem; mnuOpLangs: TMenuItem;
mnuTabsizeSep: TMenuItem;
mnuTabsizeConvTabs: TMenuItem;
mnuTabsizeConvSpaces: TMenuItem;
mnuViewSidebar: TMenuItem; mnuViewSidebar: TMenuItem;
mnuTabCopyName: TMenuItem; mnuTabCopyName: TMenuItem;
mnuTabCopyDir: TMenuItem; mnuTabCopyDir: TMenuItem;
mnuTabCopyFullPath: TMenuItem; mnuTabCopyFullPath: TMenuItem;
mnuTabCopySub: TMenuItem; mnuTabCopySub: TMenuItem;
mnuGr6H: TMenuItem; mnuGr6H: TMenuItem;
mnuGr6V: TMenuItem; mnuGr6V: TMenuItem;
mnuTabMoveF2: TMenuItem; mnuTabMoveF2: TMenuItem;
mnuTabMoveF3: TMenuItem; mnuTabMoveF3: TMenuItem;
mnuSepT2: TMenuItem; mnuSepT2: TMenuItem;
mnuViewFloatSide: TMenuItem; mnuViewFloatSide: TMenuItem;
mnuViewFloatBottom: TMenuItem; mnuViewFloatBottom: TMenuItem;
mnuOpDefaultUser: TMenuItem; mnuOpDefaultUser: TMenuItem;
TimerStatusBusy: TTimer; TimerStatusWork: TTimer;
TimerAppIdle: TIdleTimer; TimerAppIdle: TIdleTimer;
ImageListTabs: TImageList; ImageListTabs: TImageList;
ImageListToolbar: TImageList; ImageListToolbar: TImageList;
MenuItem5: TMenuItem; MenuItem5: TMenuItem;
mnuSelExtWord: TMenuItem; mnuSelExtWord: TMenuItem;
mnuViewOnTop: TMenuItem; mnuViewOnTop: TMenuItem;
mnuOpPlugins: TMenuItem; mnuOpPlugins: TMenuItem;
mnuTreeSep1: TMenuItem;
mnuTreeSorted: TMenuItem;
mnuViewUnpriSpacesTail: TMenuItem; mnuViewUnpriSpacesTail: TMenuItem;
mnuViewMicromap: TMenuItem; mnuViewMicromap: TMenuItem;
mnuHelpCheckUpd: TMenuItem; mnuHelpCheckUpd: TMenuItem;
PopupPicScale: TPopupMenu;
StatusProgress: TATGauge; StatusProgress: TATGauge;
LabelSideTitle: TLabel; LabelSideTitle: TLabel;
MenuItem4: TMenuItem; MenuItem4: TMenuItem;
mnuViewDistFree: TMenuItem; mnuViewDistFree: TMenuItem;
SepV4: TMenuItem; SepV4: TMenuItem;
mnuBmPlaceOnCarets: TMenuItem; mnuBmPlaceOnCarets: TMenuItem;
mnuFileNewMenu: TMenuItem; mnuFileNewMenu: TMenuItem;
mnuPluginsEmpty: TMenuItem; mnuPluginsEmpty: TMenuItem;
ImageListSide: TImageList; ImageListSide: TImageList;
FontDlg: TFontDialog; FontDlg: TFontDialog;
skipping to change at line 231 skipping to change at line 225
SepEd7: TMenuItem; SepEd7: TMenuItem;
mnuEditTabToSp: TMenuItem; mnuEditTabToSp: TMenuItem;
mnuEditCharmap: TMenuItem; mnuEditCharmap: TMenuItem;
SepV2: TMenuItem; SepV2: TMenuItem;
MenuItem11: TMenuItem; MenuItem11: TMenuItem;
MenuItem12: TMenuItem; MenuItem12: TMenuItem;
MenuItem14: TMenuItem; MenuItem14: TMenuItem;
SepHelp1: TMenuItem; SepHelp1: TMenuItem;
SepHelp2: TMenuItem; SepHelp2: TMenuItem;
SepFile1: TMenuItem; SepFile1: TMenuItem;
MenuItem23: TMenuItem;
MenuItem24: TMenuItem; MenuItem24: TMenuItem;
MenuItem25: TMenuItem; MenuItem25: TMenuItem;
SepEd6: TMenuItem; SepEd6: TMenuItem;
mnuFileEndUn: TMenuItem; mnuFileEndUn: TMenuItem;
mnuFileEndMac: TMenuItem; mnuFileEndMac: TMenuItem;
mnuFileEnds: TMenuItem; mnuFileEnds: TMenuItem;
SepFile4: TMenuItem; SepFile4: TMenuItem;
mnuFileEndWin: TMenuItem; mnuFileEndWin: TMenuItem;
mnuFileEnc: TMenuItem; mnuFileEnc: TMenuItem;
mnuTextUndo: TMenuItem; mnuTextUndo: TMenuItem;
skipping to change at line 253 skipping to change at line 246
MenuItem32: TMenuItem; MenuItem32: TMenuItem;
mnuTextCut: TMenuItem; mnuTextCut: TMenuItem;
mnuTextCopy: TMenuItem; mnuTextCopy: TMenuItem;
mnuTextPaste: TMenuItem; mnuTextPaste: TMenuItem;
mnuTextDelete: TMenuItem; mnuTextDelete: TMenuItem;
MenuItem37: TMenuItem; MenuItem37: TMenuItem;
mnuTextSel: TMenuItem; mnuTextSel: TMenuItem;
mnuTextGotoDef: TMenuItem; mnuTextGotoDef: TMenuItem;
mnuPlugins: TMenuItem; mnuPlugins: TMenuItem;
mnuFileHtml: TMenuItem; mnuFileHtml: TMenuItem;
mnuTreeFold9: TMenuItem;
mnuTreeFold7: TMenuItem;
mnuTreeFold8: TMenuItem;
mnuTreeFold2: TMenuItem;
mnuTreeFold5: TMenuItem;
mnuTreeFold6: TMenuItem;
mnuTreeFold3: TMenuItem;
mnuTreeFold4: TMenuItem;
mnuTreeUnfoldAll: TMenuItem;
mnuTreeFoldAll: TMenuItem;
mnuTreeFoldLevel: TMenuItem;
mnuViewSide: TMenuItem; mnuViewSide: TMenuItem;
mnuOpKeys: TMenuItem; mnuOpKeys: TMenuItem;
mnuHelpWiki: TMenuItem; mnuHelpWiki: TMenuItem;
mnuOpThemeUi: TMenuItem; mnuOpThemeUi: TMenuItem;
mnuEditTrimL: TMenuItem; mnuEditTrimL: TMenuItem;
mnuEditTrimR: TMenuItem; mnuEditTrimR: TMenuItem;
mnuEditTrim: TMenuItem; mnuEditTrim: TMenuItem;
mnuTabColor: TMenuItem; mnuTabColor: TMenuItem;
MenuItem29: TMenuItem;
mnuTabsizeSpace: TMenuItem;
mnuFind2Prev: TMenuItem;
mnuTabSaveAs: TMenuItem; mnuTabSaveAs: TMenuItem;
mnuTabSave: TMenuItem; mnuTabSave: TMenuItem;
mnuFindPrev: TMenuItem; mnuFindPrev: TMenuItem;
mnuOpLexLib: TMenuItem; mnuOpLexLib: TMenuItem;
mnuOpLexSub: TMenuItem; mnuOpLexSub: TMenuItem;
mnuOpLexProp: TMenuItem; mnuOpLexProp: TMenuItem;
mnuFileCloseDel: TMenuItem; mnuFileCloseDel: TMenuItem;
mnuOpLexer: TMenuItem; mnuOpLexer: TMenuItem;
mnuViewStatus: TMenuItem; mnuViewStatus: TMenuItem;
mnuViewFullscr: TMenuItem; mnuViewFullscr: TMenuItem;
mnuFindWordNext: TMenuItem; mnuFindWordNext: TMenuItem;
mnuFindWordPrev: TMenuItem; mnuFindWordPrev: TMenuItem;
SepSr2: TMenuItem; SepSr2: TMenuItem;
mnuFind2Next: TMenuItem;
MenuItem20: TMenuItem;
mnuFind2WordNext: TMenuItem;
mnuFind2WordPrev: TMenuItem;
mnuHelpForum: TMenuItem; mnuHelpForum: TMenuItem;
mnuViewToolbar: TMenuItem; mnuViewToolbar: TMenuItem;
mnuFontText: TMenuItem; mnuFontText: TMenuItem;
mnuFontUi: TMenuItem; mnuFontUi: TMenuItem;
mnuFontSub: TMenuItem; mnuFontSub: TMenuItem;
mnuFileReopen: TMenuItem; mnuFileReopen: TMenuItem;
mnuOpUser: TMenuItem; mnuOpUser: TMenuItem;
SepOp1: TMenuItem; SepOp1: TMenuItem;
mnuOp: TMenuItem; mnuOp: TMenuItem;
mnuOpDefault: TMenuItem; mnuOpDefault: TMenuItem;
skipping to change at line 395 skipping to change at line 370
mnuViewWrap: TMenuItem; mnuViewWrap: TMenuItem;
mnuViewMinimap: TMenuItem; mnuViewMinimap: TMenuItem;
mnuViewSplitSub: TMenuItem; mnuViewSplitSub: TMenuItem;
MenuItem10: TMenuItem; MenuItem10: TMenuItem;
SepV1: TMenuItem; SepV1: TMenuItem;
mnuViewUnpriShow: TMenuItem; mnuViewUnpriShow: TMenuItem;
mnuViewUnpriSpaces: TMenuItem; mnuViewUnpriSpaces: TMenuItem;
mnuViewUnpriEnds: TMenuItem; mnuViewUnpriEnds: TMenuItem;
mnuViewUnpriEndsDet: TMenuItem; mnuViewUnpriEndsDet: TMenuItem;
mnuViewUnpri: TMenuItem; mnuViewUnpri: TMenuItem;
mnuEndsWin: TMenuItem;
mnuEndsUnix: TMenuItem;
mnuEndsMac: TMenuItem;
mnuViewSplitDo: TMenuItem; mnuViewSplitDo: TMenuItem;
mnuViewSplitHorz: TMenuItem; mnuViewSplitHorz: TMenuItem;
mnuHelp: TMenuItem; mnuHelp: TMenuItem;
mnuView: TMenuItem; mnuView: TMenuItem;
mnuViewBottom: TMenuItem; mnuViewBottom: TMenuItem;
mnuFileCloseAll: TMenuItem; mnuFileCloseAll: TMenuItem;
mnuFileCloseOther: TMenuItem; mnuFileCloseOther: TMenuItem;
SepFile2: TMenuItem; SepFile2: TMenuItem;
mnuFileNew: TMenuItem; mnuFileNew: TMenuItem;
mnuGr1p2V: TMenuItem; mnuGr1p2V: TMenuItem;
skipping to change at line 429 skipping to change at line 401
SepFile3: TMenuItem; SepFile3: TMenuItem;
mnuFileExit: TMenuItem; mnuFileExit: TMenuItem;
mnuEdit: TMenuItem; mnuEdit: TMenuItem;
mnuFileOpenDir: TMenuItem; mnuFileOpenDir: TMenuItem;
mnuFileOpenSub: TMenuItem; mnuFileOpenSub: TMenuItem;
mnuFileOpen: TMenuItem; mnuFileOpen: TMenuItem;
mnuFileSave: TMenuItem; mnuFileSave: TMenuItem;
mnuFileSaveAs: TMenuItem; mnuFileSaveAs: TMenuItem;
mnuFileClose: TMenuItem; mnuFileClose: TMenuItem;
OpenDlg: TOpenDialog; OpenDlg: TOpenDialog;
PopupEnc: TPopupMenu;
PopupEnds: TPopupMenu;
PopupLex: TPopupMenu;
PopupFind: TPopupMenu;
PopupText: TPopupMenu; PopupText: TPopupMenu;
PopupTree: TPopupMenu;
PopupTabSize: TPopupMenu;
PopupRecents: TPopupMenu; PopupRecents: TPopupMenu;
PopupTab: TPopupMenu; PopupTab: TPopupMenu;
PythonEngine: TPythonEngine; PythonEngine: TPythonEngine;
PythonIO: TPythonInputOutput; PythonIO: TPythonInputOutput;
PythonMod: TPythonModule; PythonMod: TPythonModule;
SaveDlg: TSaveDialog; SaveDlg: TSaveDialog;
SplitterHorz: TSplitter; SplitterHorz: TSplitter;
SplitterVert: TSplitter; SplitterVert: TSplitter;
TimerStatusAlt: TTimer; TimerStatusAlt: TTimer;
TimerTreeFill: TTimer; TimerTreeFill: TTimer;
TimerCmd: TTimer; TimerCmd: TTimer;
TimerStatus: TTimer; TimerStatusClear: TTimer;
TimerEdCaret: TTimer;
ToolbarMain: TATFlatToolbar; ToolbarMain: TATFlatToolbar;
ToolbarSideMid: TATFlatToolbar; ToolbarSideMid: TATFlatToolbar;
ToolbarSideLow: TATFlatToolbar; ToolbarSideLow: TATFlatToolbar;
ToolbarSideTop: TATFlatToolbar; ToolbarSideTop: TATFlatToolbar;
UniqInstance: TUniqueInstance; UniqInstance: TUniqueInstance;
procedure AppPropsActivate(Sender: TObject); procedure AppPropsActivate(Sender: TObject);
procedure AppPropsEndSession(Sender: TObject); procedure AppPropsEndSession(Sender: TObject);
procedure AppPropsQueryEndSession(var Cancel: Boolean); procedure AppPropsQueryEndSession(var Cancel: Boolean);
procedure ButtonCancelClick(Sender: TObject); procedure ButtonCancelClick(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
skipping to change at line 483 skipping to change at line 448
procedure ListboxOutClick(Sender: TObject); procedure ListboxOutClick(Sender: TObject);
procedure ListboxOutDrawItem(Sender: TObject; C: TCanvas; AIndex: integer; c onst ARect: TRect); procedure ListboxOutDrawItem(Sender: TObject; C: TCanvas; AIndex: integer; c onst ARect: TRect);
procedure ListboxOutKeyDown(Sender: TObject; var Key: Word; Shift: TShiftSta te); procedure ListboxOutKeyDown(Sender: TObject; var Key: Word; Shift: TShiftSta te);
procedure mnuEditClick(Sender: TObject); procedure mnuEditClick(Sender: TObject);
procedure mnuTabColorClick(Sender: TObject); procedure mnuTabColorClick(Sender: TObject);
procedure mnuTabCopyDirClick(Sender: TObject); procedure mnuTabCopyDirClick(Sender: TObject);
procedure mnuTabCopyFullPathClick(Sender: TObject); procedure mnuTabCopyFullPathClick(Sender: TObject);
procedure mnuTabCopyNameClick(Sender: TObject); procedure mnuTabCopyNameClick(Sender: TObject);
procedure mnuTabMoveF2Click(Sender: TObject); procedure mnuTabMoveF2Click(Sender: TObject);
procedure mnuTabMoveF3Click(Sender: TObject); procedure mnuTabMoveF3Click(Sender: TObject);
procedure MenuRecentsClear(Sender: TObject);
procedure mnuFind2NextClick(Sender: TObject);
procedure mnuFind2PrevClick(Sender: TObject);
procedure mnuFind2WordNextClick(Sender: TObject);
procedure mnuFind2WordPrevClick(Sender: TObject);
procedure DoHelpAbout; procedure DoHelpAbout;
procedure DoHelpForum; procedure DoHelpForum;
procedure DoHelpWiki; procedure DoHelpWiki;
procedure DoHelpIssues; procedure DoHelpIssues;
procedure DoHelpHotkeys; procedure DoHelpHotkeys;
procedure MenuWindowClick(Sender: TObject);
procedure mnuTabCloseAllAllClick(Sender: TObject); procedure mnuTabCloseAllAllClick(Sender: TObject);
procedure mnuTabCloseAllSameClick(Sender: TObject); procedure mnuTabCloseAllSameClick(Sender: TObject);
procedure mnuTabCloseLeftClick(Sender: TObject); procedure mnuTabCloseLeftClick(Sender: TObject);
procedure mnuTabCloseOtherAllClick(Sender: TObject); procedure mnuTabCloseOtherAllClick(Sender: TObject);
procedure mnuTabCloseOtherSameClick(Sender: TObject); procedure mnuTabCloseOtherSameClick(Sender: TObject);
procedure mnuTabCloseRightClick(Sender: TObject); procedure mnuTabCloseRightClick(Sender: TObject);
procedure mnuTabCloseThisClick(Sender: TObject); procedure mnuTabCloseThisClick(Sender: TObject);
procedure mnuTabMove1Click(Sender: TObject); procedure mnuTabMove1Click(Sender: TObject);
procedure mnuTabMove2Click(Sender: TObject); procedure mnuTabMove2Click(Sender: TObject);
procedure mnuTabMove3Click(Sender: TObject); procedure mnuTabMove3Click(Sender: TObject);
skipping to change at line 525 skipping to change at line 484
procedure mnuTreeFold3Click(Sender: TObject); procedure mnuTreeFold3Click(Sender: TObject);
procedure mnuTreeFold4Click(Sender: TObject); procedure mnuTreeFold4Click(Sender: TObject);
procedure mnuTreeFold5Click(Sender: TObject); procedure mnuTreeFold5Click(Sender: TObject);
procedure mnuTreeFold6Click(Sender: TObject); procedure mnuTreeFold6Click(Sender: TObject);
procedure mnuTreeFold7Click(Sender: TObject); procedure mnuTreeFold7Click(Sender: TObject);
procedure mnuTreeFold8Click(Sender: TObject); procedure mnuTreeFold8Click(Sender: TObject);
procedure mnuTreeFold9Click(Sender: TObject); procedure mnuTreeFold9Click(Sender: TObject);
procedure mnuTreeFoldAllClick(Sender: TObject); procedure mnuTreeFoldAllClick(Sender: TObject);
procedure mnuTreeSortedClick(Sender: TObject); procedure mnuTreeSortedClick(Sender: TObject);
procedure mnuTreeUnfoldAllClick(Sender: TObject); procedure mnuTreeUnfoldAllClick(Sender: TObject);
procedure PopupRecentsPopup(Sender: TObject);
procedure PopupTabPopup(Sender: TObject); procedure PopupTabPopup(Sender: TObject);
procedure PopupTabSizePopup(Sender: TObject);
procedure PopupTextPopup(Sender: TObject); procedure PopupTextPopup(Sender: TObject);
procedure PythonEngineAfterInit(Sender: TObject); procedure PythonEngineAfterInit(Sender: TObject);
procedure PythonIOSendUniData(Sender: TObject; const Data: UnicodeString); procedure PythonIOSendUniData(Sender: TObject; const Data: UnicodeString);
procedure PythonModInitialization(Sender: TObject); procedure PythonModInitialization(Sender: TObject);
procedure StatusPanelClick(Sender: TObject; AIndex: Integer); procedure StatusPanelClick(Sender: TObject; AIndex: Integer);
procedure TimerAppIdleTimer(Sender: TObject); procedure TimerAppIdleTimer(Sender: TObject);
procedure TimerCmdTimer(Sender: TObject); procedure TimerCmdTimer(Sender: TObject);
procedure TimerStatusAltTimer(Sender: TObject); procedure TimerStatusAltTimer(Sender: TObject);
procedure TimerStatusBusyTimer(Sender: TObject); procedure TimerStatusWorkTimer(Sender: TObject);
procedure TimerStatusTimer(Sender: TObject); procedure TimerStatusClearTimer(Sender: TObject);
procedure TimerTreeFillTimer(Sender: TObject); procedure TimerTreeFillTimer(Sender: TObject);
procedure TimerEdCaretTimer(Sender: TObject);
procedure UniqInstanceOtherInstance(Sender: TObject; ParamCount: Integer; procedure UniqInstanceOtherInstance(Sender: TObject; ParamCount: Integer;
Parameters: array of String); Parameters: array of String);
{$ifdef windows} {$ifdef windows}
procedure SecondInstance(const Msg: TBytes); procedure SecondInstance(const Msg: TBytes);
{$endif} {$endif}
private private
{ private declarations } { private declarations }
PopupTree: TPopupMenu;
PopupEnds: TPopupMenu;
PopupEnc: TPopupMenu;
PopupLex: TPopupMenu;
PopupTabSize: TPopupMenu;
PopupViewerMode: TPopupMenu;
PopupPicScale: TPopupMenu;
PopupListboxOutput: TPopupMenu;
PopupListboxValidate: TPopupMenu;
mnuTreeFoldAll: TMenuItem;
mnuTreeUnfoldAll: TMenuItem;
mnuTreeFoldLevel: TMenuItem;
mnuTreeFold2: TMenuItem;
mnuTreeFold3: TMenuItem;
mnuTreeFold4: TMenuItem;
mnuTreeFold5: TMenuItem;
mnuTreeFold6: TMenuItem;
mnuTreeFold7: TMenuItem;
mnuTreeFold8: TMenuItem;
mnuTreeFold9: TMenuItem;
mnuTreeSorted: TMenuItem;
mnuEndsWin: TMenuItem;
mnuEndsUnix: TMenuItem;
mnuEndsMac: TMenuItem;
mnuTabsizeSpace: TMenuItem;
mnuTabsizeConvTabs: TMenuItem;
mnuTabsizeConvSpaces: TMenuItem;
mnuTabsizesValue: array[cMenuTabsizeMin..cMenuTabsizeMax] of TMenuItem;
mnuToolbarCaseLow: TMenuItem; mnuToolbarCaseLow: TMenuItem;
mnuToolbarCaseUp: TMenuItem; mnuToolbarCaseUp: TMenuItem;
mnuToolbarCaseTitle: TMenuItem; mnuToolbarCaseTitle: TMenuItem;
mnuToolbarCaseInvert: TMenuItem; mnuToolbarCaseInvert: TMenuItem;
mnuToolbarCaseSent: TMenuItem; mnuToolbarCaseSent: TMenuItem;
mnuToolbarCommentLineAdd: TMenuItem; mnuToolbarCommentLineAdd: TMenuItem;
mnuToolbarCommentLineDel: TMenuItem; mnuToolbarCommentLineDel: TMenuItem;
mnuToolbarCommentLineToggle: TMenuItem; mnuToolbarCommentLineToggle: TMenuItem;
mnuToolbarCommentStream: TMenuItem; mnuToolbarCommentStream: TMenuItem;
mnuToolbarSortAsc: TMenuItem; mnuToolbarSortAsc: TMenuItem;
skipping to change at line 664 skipping to change at line 650
FOrigShowSideBar: boolean; FOrigShowSideBar: boolean;
FOrigShowTabs: boolean; FOrigShowTabs: boolean;
FAllowLoadKeymap: boolean; FAllowLoadKeymap: boolean;
FAllowOnFocus: boolean; FAllowOnFocus: boolean;
FHandledOnShow: boolean; FHandledOnShow: boolean;
FFileNamesDroppedInitially: array of string; FFileNamesDroppedInitially: array of string;
FFileNameLogDebug: string; FFileNameLogDebug: string;
FFileNameLogConsole: string; FFileNameLogConsole: string;
FCodetreeDblClicking: boolean; FCodetreeDblClicking: boolean;
FCodetreeModifiedVersion: integer; FCodetreeModifiedVersion: integer;
FCodetreeNeedsSelJump: boolean;
FMenuCopy: TPopupMenu; FMenuCopy: TPopupMenu;
FMenuItemTabSize: array[cMenuTabsizeMin..cMenuTabsizeMax] of TMenuItem;
FMenuVisible: boolean; FMenuVisible: boolean;
FPopupListboxOutput: TPopupMenu;
FPopupListboxValidate: TPopupMenu;
FNewClickedEditor: TATSynEdit; FNewClickedEditor: TATSynEdit;
FPyComplete_Editor: TATSynEdit; FPyComplete_Editor: TATSynEdit;
FPyComplete_Text: string; FPyComplete_Text: string;
FPyComplete_CharsLeft: integer; FPyComplete_CharsLeft: integer;
FPyComplete_CharsRight: integer; FPyComplete_CharsRight: integer;
FPyComplete_CaretPos: TPoint; FPyComplete_CaretPos: TPoint;
FCmdTimer_Code: integer; FCmdTimer_Code: integer;
FCmdTimer_Ed: TATSynEdit; FCmdTimer_Ed: TATSynEdit;
FCmdTimer_Frame: TEditorFrame; FCmdTimer_Frame: TEditorFrame;
FLastDirOfOpenDlg: string; FLastDirOfOpenDlg: string;
FLastLexerForPluginsMenu: string; FLastLexerForPluginsMenu: string;
FLastSidebarPanel: string; FLastSidebarPanel: string;
FLastBottomPanel: string; FLastBottomPanel: string;
FLastStatusbarMessage: string; FLastStatusbarMessage: string;
FLastSelectedCommand: integer; FLastSelectedCommand: integer;
FLastMousePos: TPoint; FLastMousePos: TPoint;
FLastMaximized: boolean; FLastMaximized: boolean;
FLexerProgressIndex: integer; FLexerProgressIndex: integer;
FShowPassed: boolean;
FOption_OpenReadOnly: boolean; FOption_OpenReadOnly: boolean;
FOption_OpenNewWindow: boolean; FOption_OpenNewWindow: boolean;
FOption_WindowPos: string; FOption_WindowPos: string;
FOption_Encoding: string; FOption_Encoding: string;
FOption_FileOpenOptions: string; FOption_FileOpenOptions: string;
FOption_GroupMode: TATGroupsMode; FOption_GroupMode: TATGroupsMode;
FOption_GroupSizes: TATGroupsPoints; FOption_GroupSizes: TATGroupsPoints;
FOption_GroupPanelSize: TPoint; FOption_GroupPanelSize: TPoint;
FOption_SidebarTab: string; FOption_SidebarTab: string;
procedure CodeTreeFilter_OnChange(Sender: TObject); procedure CodeTreeFilter_OnChange(Sender: TObject);
procedure CodeTreeFilter_ResetOnClick(Sender: TObject); procedure CodeTreeFilter_ResetOnClick(Sender: TObject);
procedure CodeTreeFilter_OnCommand(Sender: TObject; ACmd: integer; procedure CodeTreeFilter_OnCommand(Sender: TObject; ACmd: integer;
const AText: string; var AHandled: boolean); const AText: string; var AHandled: boolean);
procedure DisablePluginMenuItems; procedure DisablePluginMenuItems;
procedure DoApplyCenteringOption; procedure DoApplyCenteringOption;
procedure DoApplyLexerStyleMaps(AndApplyTheme: boolean); procedure DoApplyLexerStyleMaps(AndApplyTheme: boolean);
procedure DoApplyTranslationToGroups(G: TATGroups); procedure DoApplyTranslationToGroups(G: TATGroups);
procedure DoClearSingleFirstTab; procedure DoClearSingleFirstTab;
procedure DoCloseAllTabs; procedure DoCloseAllTabs;
procedure DoCodetree_OnContextPopup(Sender: TObject; MousePos: TPoint;
var Handled: Boolean);
procedure DoDialogMenuThemes_ThemeSyntaxSelect(const AStr: string); procedure DoDialogMenuThemes_ThemeSyntaxSelect(const AStr: string);
procedure DoDialogMenuThemes_ThemeUiSelect(const AStr: string); procedure DoDialogMenuThemes_ThemeUiSelect(const AStr: string);
procedure DoFileDialog_PrepareDir(Dlg: TFileDialog); procedure DoFileDialog_PrepareDir(Dlg: TFileDialog);
procedure DoFileDialog_SaveDir(Dlg: TFileDialog); procedure DoFileDialog_SaveDir(Dlg: TFileDialog);
procedure DoCommandsMsgStatus(Sender: TObject; const ARes: string); procedure DoCommandsMsgStatus(Sender: TObject; const ARes: string);
procedure DoFindMarkingInit(AMode: TATFindMarkingMode); procedure DoFindMarkingInit(AMode: TATFindMarkingMode);
procedure DoFindOptions_OnChange(Sender: TObject); procedure DoFindOptions_OnChange(Sender: TObject);
procedure DoFindOptions_ApplyDict(const AText: string); procedure DoFindOptions_ApplyDict(const AText: string);
procedure DoFindOptions_ResetInSelection; procedure DoFindOptions_ResetInSelection;
function DoFindOptions_GetDict: PPyObject; function DoFindOptions_GetDict: PPyObject;
skipping to change at line 798 skipping to change at line 785
procedure DoBottom_OnTabClick(Sender: TObject); procedure DoBottom_OnTabClick(Sender: TObject);
procedure DoBottom_AddonsClick(Sender: TObject); procedure DoBottom_AddonsClick(Sender: TObject);
procedure DoBottom_FindClick(Sender: TObject); procedure DoBottom_FindClick(Sender: TObject);
function DoBottom_CaptionToControlHandle(const ACaption: string): PtrInt; function DoBottom_CaptionToControlHandle(const ACaption: string): PtrInt;
function DoBottom_AddTab(const ACaption: string; function DoBottom_AddTab(const ACaption: string;
AImageIndex: integer; AHandle: PtrInt): boolean; AImageIndex: integer; AHandle: PtrInt): boolean;
function DoBottom_CaptionToPanelsIndex(const ACaption: string): integer; function DoBottom_CaptionToPanelsIndex(const ACaption: string): integer;
function DoBottom_ActivateTab(const ACaption: string; AndFocus: boolean): bo olean; function DoBottom_ActivateTab(const ACaption: string; AndFocus: boolean): bo olean;
function DoBottom_CaptionToTabIndex(const ACaption: string): integer; function DoBottom_CaptionToTabIndex(const ACaption: string): integer;
function DoBottom_RemoveTab(const ACaption: string): boolean; function DoBottom_RemoveTab(const ACaption: string): boolean;
function DoBottom_TranslatedCaption(const ACaption: string): string;
procedure DoAutoComplete; procedure DoAutoComplete;
procedure DoCudaLibAction(const AMethod: string); procedure DoCudaLibAction(const AMethod: string);
procedure DoDialogCharMap; procedure DoDialogCharMap;
procedure DoFindActionFromString(const AStr: string); procedure DoFindActionFromString(const AStr: string);
procedure DoGotoFromInput(const AInput: string); procedure DoGotoFromInput(const AInput: string);
procedure DoGotoDefinition; procedure DoGotoDefinition;
procedure DoShowFuncHint; procedure DoShowFuncHint;
procedure DoApplyGutterVisible(AValue: boolean); procedure DoApplyGutterVisible(AValue: boolean);
procedure DoApplyFrameOps(F: TEditorFrame; const Op: TEditorOps; AForceApply : boolean); procedure DoApplyFrameOps(F: TEditorFrame; const Op: TEditorOps; AForceApply : boolean);
procedure DoApplyFont_Text; procedure DoApplyFont_Text;
skipping to change at line 859 skipping to change at line 847
procedure FrameOnEditorClickMoveCaret(Sender: TObject; APrevPnt, ANewPnt: TP oint); procedure FrameOnEditorClickMoveCaret(Sender: TObject; APrevPnt, ANewPnt: TP oint);
function GetFloatBottom: boolean; function GetFloatBottom: boolean;
function GetFloatSide: boolean; function GetFloatSide: boolean;
function GetFloatGroups: boolean; function GetFloatGroups: boolean;
function GetShowFloatGroup1: boolean; function GetShowFloatGroup1: boolean;
function GetShowFloatGroup2: boolean; function GetShowFloatGroup2: boolean;
function GetShowFloatGroup3: boolean; function GetShowFloatGroup3: boolean;
function GetShowOnTop: boolean; function GetShowOnTop: boolean;
function GetShowSidebarOnRight: boolean; function GetShowSidebarOnRight: boolean;
procedure InitAppleMenu; procedure InitAppleMenu;
procedure InitPopupTree;
procedure InitPopupPicScale;
procedure InitPopupListboxOutput;
procedure InitPopupListboxValidate;
procedure InitPopupViewerMode;
procedure InitPopupEnc;
procedure InitPopupEnds;
procedure InitPopupLex;
procedure InitPopupTabSize;
procedure InitFloatGroup(var F: TForm; var G: TATGroups; ATag: integer; procedure InitFloatGroup(var F: TForm; var G: TATGroups; ATag: integer;
const ARect: TRect; AOnClose: TCloseEvent; AOnGroupEmpty: TNotifyEvent); const ARect: TRect; AOnClose: TCloseEvent; AOnGroupEmpty: TNotifyEvent);
procedure InitFloatGroups; procedure InitFloatGroups;
procedure InitSidebar; procedure InitSidebar;
procedure InitToolbar; procedure InitToolbar;
function IsWindowMaximizedOrFullscreen: boolean; function IsWindowMaximizedOrFullscreen: boolean;
function IsAllowedToOpenFileNow: boolean; function IsAllowedToOpenFileNow: boolean;
function IsThemeNameExist(const AName: string; AThemeUI: boolean): boolean; function IsThemeNameExist(const AName: string; AThemeUI: boolean): boolean;
procedure ListboxOutContextPopup(Sender: TObject; MousePos: TPoint; var Hand
led: Boolean);
procedure ListboxValidateContextPopup(Sender: TObject; MousePos: TPoint; var
Handled: Boolean);
procedure PopupToolbarCaseOnPopup(Sender: TObject);
procedure PopupToolbarCommentOnPopup(Sender: TObject);
procedure PopupToolbarSortOnPopup(Sender: TObject);
procedure LiteLexer_ApplyStyle(Sender: TObject; AStyleHash: integer; var APa rt: TATLinePart); procedure LiteLexer_ApplyStyle(Sender: TObject; AStyleHash: integer; var APa rt: TATLinePart);
function LiteLexer_GetStyleHash(Sender: TObject; const AStyleName: string): integer; function LiteLexer_GetStyleHash(Sender: TObject; const AStyleName: string): integer;
procedure MenuRecentsClear(Sender: TObject);
procedure MenuRecentsPopup(Sender: TObject);
procedure MenuRecentItemClick(Sender: TObject);
procedure MenuEncWithReloadClick(Sender: TObject); procedure MenuEncWithReloadClick(Sender: TObject);
procedure MenuitemClick_CommandFromTag(Sender: TObject); procedure MenuitemClick_CommandFromTag(Sender: TObject);
procedure MenuitemClick_CommandFromHint(Sender: TObject); procedure MenuitemClick_CommandFromHint(Sender: TObject);
procedure MenuPicScaleClick(Sender: TObject); procedure MenuPicScaleClick(Sender: TObject);
procedure MenuPluginClick(Sender: TObject); procedure MenuPluginClick(Sender: TObject);
procedure MenuTabsizeClick(Sender: TObject); procedure MenuTabsizeClick(Sender: TObject);
procedure MenuViewerModeClick(Sender: TObject);
procedure MenuEncNoReloadClick(Sender: TObject);
procedure MenuLexerClick(Sender: TObject);
procedure MenuMainClick(Sender: TObject);
procedure MsgLogConsole(const AText: string); procedure MsgLogConsole(const AText: string);
procedure MsgLogDebug(const AText: string); procedure MsgLogDebug(const AText: string);
procedure MsgLogToFilename(const AText, AFilename: string; AWithTime: boolea n); procedure MsgLogToFilename(const AText, AFilename: string; AWithTime: boolea n);
procedure MsgStatusAlt(const AText: string; ASeconds: integer); procedure MsgStatusAlt(const AText: string; ASeconds: integer);
function GetStatusbarPrefix(Frame: TEditorFrame): string; function GetStatusbarPrefix(Frame: TEditorFrame): string;
procedure MsgStatusFileOpened(const AFileName1, AFileName2: string); procedure MsgStatusFileOpened(const AFileName1, AFileName2: string);
procedure PopupListboxOutputCopyClick(Sender: TObject); procedure PopupListboxOutputCopyClick(Sender: TObject);
procedure PopupListboxOutputClearClick(Sender: TObject); procedure PopupListboxOutputClearClick(Sender: TObject);
procedure PopupListboxValidateClearClick(Sender: TObject); procedure PopupListboxValidateClearClick(Sender: TObject);
procedure PopupListboxValidateCopyClick(Sender: TObject); procedure PopupListboxValidateCopyClick(Sender: TObject);
skipping to change at line 909 skipping to change at line 918
procedure SetThemeSyntax(const AValue: string); procedure SetThemeSyntax(const AValue: string);
procedure SetThemeUi(const AValue: string); procedure SetThemeUi(const AValue: string);
function SFindOptionsToTextHint: string; function SFindOptionsToTextHint: string;
procedure DoOps_ShowEventPlugins; procedure DoOps_ShowEventPlugins;
procedure DoOps_ResetLexerSpecificOptions; procedure DoOps_ResetLexerSpecificOptions;
procedure DoOps_LoadPluginFromInf(const fn_inf: string); procedure DoOps_LoadPluginFromInf(const fn_inf: string);
procedure DoOps_LoadSidebarIcons; procedure DoOps_LoadSidebarIcons;
procedure DoOps_LoadTreeIcons; procedure DoOps_LoadTreeIcons;
procedure DoOps_LoadToolBarIcons; procedure DoOps_LoadToolBarIcons;
procedure DoOps_LoadCommandLineOptions; procedure DoOps_LoadCommandLineOptions;
procedure DoOps_LoadLexerLib; procedure DoOps_LoadLexerLib(AOnCreate: boolean);
procedure DoOps_SaveHistory; procedure DoOps_SaveHistory;
procedure DoOps_SaveHistory_GroupView(c: TJsonConfig); procedure DoOps_SaveHistory_GroupView(c: TJsonConfig);
procedure DoOps_SaveOptionBool(const APath: string; AValue: boolean); procedure DoOps_SaveOptionBool(const APath: string; AValue: boolean);
procedure DoOps_SaveThemes; procedure DoOps_SaveThemes;
procedure DoOps_LoadHistory; procedure DoOps_LoadHistory;
procedure DoOps_LoadHistory_GroupView(c: TJsonConfig); procedure DoOps_LoadHistory_GroupView(c: TJsonConfig);
function DoOps_SaveSession(fn_session: string): boolean; function DoOps_SaveSession(fn_session: string): boolean;
function DoOps_LoadSession(fn_session: string): boolean; function DoOps_LoadSession(fn_session: string): boolean;
procedure DoOps_LoadOptionsAndApplyAll; procedure DoOps_LoadOptionsAndApplyAll;
procedure DoOps_LoadOptionsLexerSpecific(F: TEditorFrame); procedure DoOps_LoadOptionsLexerSpecific(F: TEditorFrame);
skipping to change at line 1029 skipping to change at line 1038
procedure SetLexerIndex(AIndex: integer); procedure SetLexerIndex(AIndex: integer);
procedure SetShowStatus(AValue: boolean); procedure SetShowStatus(AValue: boolean);
procedure SetShowToolbar(AValue: boolean); procedure SetShowToolbar(AValue: boolean);
procedure SetShowBottom(AValue: boolean); procedure SetShowBottom(AValue: boolean);
procedure SetShowSideBar(AValue: boolean); procedure SetShowSideBar(AValue: boolean);
procedure SetShowSidePanel(AValue: boolean); procedure SetShowSidePanel(AValue: boolean);
procedure SetShowTabsMain(AValue: boolean); procedure SetShowTabsMain(AValue: boolean);
procedure SplitterOnPaint_Gr(Sender: TObject); procedure SplitterOnPaint_Gr(Sender: TObject);
procedure SplitterOnPaint_Main(Sender: TObject); procedure SplitterOnPaint_Main(Sender: TObject);
procedure StopAllTimers; procedure StopAllTimers;
procedure UpdateMenuRecents(sub: TMenuItem);
procedure UpdateSidebarButtonOverlay; procedure UpdateSidebarButtonOverlay;
procedure UpdateBottomPanels(const ACaption: string; AndFocus: boolean); procedure UpdateBottomPanels(const ACaption: string; AndFocus: boolean);
procedure UpdateEditorTabsize(AValue: integer); procedure UpdateEditorTabsize(AValue: integer);
procedure UpdateKeymapDynamicItems(ACategory: TAppCommandCategory); procedure UpdateKeymapDynamicItems(ACategory: TAppCommandCategory);
procedure UpdateMenuItemAltObject(mi: TMenuItem; cmd: integer); procedure UpdateMenuItemAltObject(mi: TMenuItem; cmd: integer);
procedure UpdateMenuItemChecked(mi: TMenuItem; saved: TATMenuItemsAlt; AValu e: boolean); procedure UpdateMenuItemChecked(mi: TMenuItem; saved: TATMenuItemsAlt; AValu e: boolean);
procedure UpdateMenuItemHint(mi: TMenuItem; const AHint: string); procedure UpdateMenuItemHint(mi: TMenuItem; const AHint: string);
procedure UpdateMenuItemHotkey(mi: TMenuItem; cmd: integer); procedure UpdateMenuItemHotkey(mi: TMenuItem; cmd: integer);
procedure UpdateMenuPicScale;
procedure UpdateMenuTabsize;
procedure UpdateMenuLexersTo(AMenu: TMenuItem); procedure UpdateMenuLexersTo(AMenu: TMenuItem);
procedure UpdateMenuRecent(F: TEditorFrame; const AFileName: string); procedure UpdateMenuRecent(F: TEditorFrame; const AFileName: string);
procedure UpdateMenuHotkeys; procedure UpdateMenuHotkeys;
procedure UpdateMenuLexers;
procedure UpdateMenuPlugins; procedure UpdateMenuPlugins;
procedure UpdateMenuPlugins_Shortcuts(AForceUpdate: boolean=false); procedure UpdateMenuPlugins_Shortcuts(AForceUpdate: boolean=false);
procedure UpdateMenuChecks; procedure UpdateMenuChecks;
procedure UpdateMenuEnc(AMenu: TMenuItem); procedure UpdateMenuEnc(AMenu: TMenuItem);
procedure UpdateBottomLayout(ASetFloating: boolean); procedure UpdateBottomLayout(ASetFloating: boolean);
procedure DoApplyUiOps; procedure DoApplyUiOps;
procedure DoApplyUiOpsToGroups(G: TATGroups); procedure DoApplyUiOpsToGroups(G: TATGroups);
procedure DoApplyInitialGroupSizes; procedure DoApplyInitialGroupSizes;
procedure DoApplyInitialSidebarPanel; procedure DoApplyInitialSidebarPanel;
procedure DoApplyInitialWindowPos; procedure DoApplyInitialWindowPos;
procedure InitPyEngine; procedure InitPyEngine;
procedure FrameOnChangeCaption(Sender: TObject); procedure FrameOnChangeCaption(Sender: TObject);
procedure FrameOnUpdateStatus(Sender: TObject); procedure FrameOnUpdateStatus(Sender: TObject);
function DoTabAdd(APages: TATPages; const ACaption: string; function DoTabAdd(APages: TATPages; const ACaption: string;
AndActivate: boolean=true; AndActivate: boolean=true;
AAllowNearCurrent: boolean=true): TATTabData; AAllowNearCurrent: boolean=true): TATTabData;
procedure FrameOnFocus(Sender: TObject); procedure FrameOnFocus(Sender: TObject);
function GetFrame(AIndex: integer): TEditorFrame; function GetFrame(AIndex: integer): TEditorFrame;
procedure MenuEncNoReloadClick(Sender: TObject);
procedure MenuLexerClick(Sender: TObject);
procedure MenuMainClick(Sender: TObject);
procedure MenuRecentsClick(Sender: TObject);
procedure SetFrame(Frame: TEditorFrame); procedure SetFrame(Frame: TEditorFrame);
procedure UpdateFrameLineEnds(Frame: TEditorFrame; AValue: TATLineEnds); procedure UpdateFrameLineEnds(Frame: TEditorFrame; AValue: TATLineEnds);
procedure MsgStatus(AText: string); procedure MsgStatus(AText: string);
procedure UpdateSidebarButtons; procedure UpdateSidebarButtons;
procedure UpdateSidebarPanels(const ACaption: string; AndFocus: boolean); procedure UpdateSidebarPanels(const ACaption: string; AndFocus: boolean);
procedure UpdateStatusbarPanelsFromString(const AText: string); procedure UpdateStatusbarPanelsFromString(const AText: string);
procedure UpdateStatusbarHints; procedure UpdateStatusbarHints;
procedure UpdateBottomButtons; procedure UpdateBottomButtons;
procedure UpdateStatus_ForFrame(AStatus: TATStatus; F: TEditorFrame); procedure UpdateStatus_ForFrame(AStatus: TATStatus; F: TEditorFrame);
procedure UpdateStatus_RealWork; procedure UpdateStatus_RealWork;
skipping to change at line 1318 skipping to change at line 1321
end; end;
{ TfmMain } { TfmMain }
{$I formmain_py_toolbars.inc} {$I formmain_py_toolbars.inc}
{$I formmain_py_statusbars.inc} {$I formmain_py_statusbars.inc}
{$I formmain_py_api.inc} {$I formmain_py_api.inc}
{$I formmain_py_helpers.inc} {$I formmain_py_helpers.inc}
{$I formmain_py_pluginwork.inc} {$I formmain_py_pluginwork.inc}
procedure TfmMain.MenuViewerModeClick(Sender: TObject);
var
F: TEditorFrame;
begin
F:= CurrentFrame;
if F=nil then exit;
if not F.IsBinary then exit;
F.Binary.Mode:= TATBinHexMode((Sender as TComponent).Tag);
UpdateStatus;
end;
procedure TfmMain.InitPopupListboxOutput;
begin
if PopupListboxOutput=nil then
begin
PopupListboxOutput:= TPopupMenu.Create(Self);
mnuContextOutputClear:= TMenuItem.Create(Self);
mnuContextOutputClear.OnClick:= @PopupListboxOutputClearClick;
PopupListboxOutput.Items.Add(mnuContextOutputClear);
mnuContextOutputCopy:= TMenuItem.Create(Self);
mnuContextOutputCopy.OnClick:= @PopupListboxOutputCopyClick;
PopupListboxOutput.Items.Add(mnuContextOutputCopy);
end;
end;
procedure TfmMain.InitPopupListboxValidate;
begin
if PopupListboxValidate=nil then
begin
PopupListboxValidate:= TPopupMenu.Create(Self);
mnuContextValidateClear:= TMenuItem.Create(Self);
mnuContextValidateClear.OnClick:= @PopupListboxValidateClearClick;
PopupListboxValidate.Items.Add(mnuContextValidateClear);
mnuContextValidateCopy:= TMenuItem.Create(Self);
mnuContextValidateCopy.OnClick:= @PopupListboxValidateCopyClick;
PopupListboxValidate.Items.Add(mnuContextValidateCopy);
end;
end;
procedure TfmMain.InitPopupViewerMode;
var
mi: TMenuItem;
mode: TATBinHexMode;
begin
if PopupViewerMode=nil then
begin
PopupViewerMode:= TPopupMenu.Create(Self);
for mode:= Low(mode) to High(mode) do
begin
mi:= TMenuItem.Create(Self);
mi.Caption:= msgViewer+': '+msgViewerModes[mode];
mi.OnClick:= @MenuViewerModeClick;
mi.Tag:= Ord(mode);
PopupViewerMode.Items.Add(mi);
end;
end;
end;
procedure TfmMain.InitPopupEnc;
begin
if PopupEnc=nil then
begin
PopupEnc:= TPopupMenu.Create(Self);
end;
UpdateMenuEnc(PopupEnc.Items);
end;
procedure TfmMain.InitPopupEnds;
begin
if PopupEnds=nil then
begin
PopupEnds:= TPopupMenu.Create(Self);
mnuEndsWin:= TMenuItem.Create(Self);
mnuEndsUnix:= TMenuItem.Create(Self);
mnuEndsMac:= TMenuItem.Create(Self);
UpdateMenuItemHotkey(mnuEndsWin, cmd_LineEndWin);
UpdateMenuItemHotkey(mnuEndsUnix, cmd_LineEndUnix);
UpdateMenuItemHotkey(mnuEndsMac, cmd_LineEndMac);
PopupEnds.Items.Add(mnuEndsWin);
PopupEnds.Items.Add(mnuEndsUnix);
PopupEnds.Items.Add(mnuEndsMac);
end;
mnuEndsWin.Caption:= msgEndWin;
mnuEndsUnix.Caption:= msgEndUnix;
mnuEndsMac.Caption:= msgEndMac;
end;
procedure TfmMain.InitPopupLex;
begin
if PopupLex=nil then
begin
PopupLex:= TPopupMenu.Create(Self);
end;
UpdateMenuLexersTo(PopupLex.Items);
end;
procedure TfmMain.StatusPanelClick(Sender: TObject; AIndex: Integer); procedure TfmMain.StatusPanelClick(Sender: TObject; AIndex: Integer);
var var
Frame: TEditorFrame; Frame: TEditorFrame;
Data: TATStatusData; Data: TATStatusData;
begin begin
Frame:= CurrentFrame; Frame:= CurrentFrame;
if Frame=nil then exit; if Frame=nil then exit;
Data:= Status.GetPanelData(AIndex); Data:= Status.GetPanelData(AIndex);
if Data=nil then exit; if Data=nil then exit;
if Frame.IsPicture then if Frame.IsPicture then
begin begin
case Data.Tag of case Data.Tag of
StatusbarTag_TabSize: StatusbarTag_TabSize:
begin begin
InitPopupPicScale;
PopupPicScale.Popup; PopupPicScale.Popup;
end; end;
end; end;
exit; exit;
end; end;
if Frame.IsBinary then if Frame.IsBinary then
begin begin
case Data.Tag of case Data.Tag of
StatusbarTag_Enc: StatusbarTag_Enc:
with Mouse.CursorPos do begin
Frame.Binary.TextEncodingsMenu(X, Y); with Mouse.CursorPos do
Frame.Binary.TextEncodingsMenu(X, Y);
end;
StatusbarTag_Lexer:
begin
InitPopupViewerMode;
PopupViewerMode.PopUp;
end;
end; end;
exit; exit;
end; end;
case Data.Tag of case Data.Tag of
StatusbarTag_Caret:
begin
DoDialogGoto;
end;
StatusbarTag_Enc: StatusbarTag_Enc:
begin begin
if not Frame.ReadOnly[Frame.Editor] then if not Frame.ReadOnly[Frame.Editor] then
begin
InitPopupEnc;
PopupEnc.PopUp; PopupEnc.PopUp;
end;
end; end;
StatusbarTag_LineEnds: StatusbarTag_LineEnds:
begin begin
if not Frame.ReadOnly[Frame.Editor] then if not Frame.ReadOnly[Frame.Editor] then
begin
InitPopupEnds;
PopupEnds.PopUp; PopupEnds.PopUp;
end;
end; end;
StatusbarTag_Lexer: StatusbarTag_Lexer:
begin begin
InitPopupLex;
PopupLex.PopUp; PopupLex.PopUp;
end; end;
StatusbarTag_TabSize: StatusbarTag_TabSize:
begin begin
InitPopupTabSize;
PopupTabSize.Popup; PopupTabSize.Popup;
end; end;
StatusbarTag_SelMode: StatusbarTag_SelMode:
begin begin
with Frame.Editor do with Frame.Editor do
begin begin
OptMouseColumnSelectionWithoutKey:= not OptMouseColumnSelectionWithout Key; OptMouseColumnSelectionWithoutKey:= not OptMouseColumnSelectionWithout Key;
UpdateStatus; UpdateStatus;
end; end;
end; end;
skipping to change at line 1441 skipping to change at line 1567
DoPyEvent(Ed, cEventOnMouseStop, [ DoPyEvent(Ed, cEventOnMouseStop, [
IntToStr(PntLocal.X), IntToStr(PntLocal.X),
IntToStr(PntLocal.Y) IntToStr(PntLocal.Y)
]); ]);
Break; Break;
end; end;
end; end;
end; end;
AppUpdateWatcherFrames; AppUpdateWatcherFrames;
if FCodetreeNeedsSelJump then
begin
FCodetreeNeedsSelJump:= false;
UpdateTree(false);
end;
end; end;
procedure TfmMain.TimerStatusTimer(Sender: TObject); procedure TfmMain.TimerStatusClearTimer(Sender: TObject);
begin begin
MsgStatus(''); MsgStatus('');
TimerStatus.Enabled:= false; TimerStatusClear.Enabled:= false;
end; end;
procedure TfmMain.TimerStatusAltTimer(Sender: TObject); procedure TfmMain.TimerStatusAltTimer(Sender: TObject);
begin begin
TimerStatusAlt.Enabled:= false; TimerStatusAlt.Enabled:= false;
StatusForm.Hide; StatusForm.Hide;
end; end;
procedure TfmMain.TimerStatusBusyTimer(Sender: TObject); procedure TfmMain.TimerStatusWorkTimer(Sender: TObject);
begin begin
TimerStatusBusy.Enabled:= false; TimerStatusWork.Enabled:= false;
UpdateStatus_RealWork; UpdateStatus_RealWork;
end; end;
procedure TfmMain.TimerTreeFillTimer(Sender: TObject); procedure TfmMain.TimerTreeFillTimer(Sender: TObject);
begin begin
TimerTreeFill.Enabled:= false; TimerTreeFill.Enabled:= false;
UpdateTree(true); UpdateTree(true);
end; end;
procedure TfmMain.TimerEdCaretTimer(Sender: TObject);
begin
TimerEdCaret.Enabled:= false;
UpdateTree(false);
end;
procedure TfmMain.DoCodetree_OnDblClick(Sender: TObject); procedure TfmMain.DoCodetree_OnDblClick(Sender: TObject);
var var
Ed: TATSynEdit; Ed: TATSynEdit;
PntBegin, PntEnd: TPoint; PntBegin, PntEnd: TPoint;
begin begin
DoCodetree_GetSyntaxRange(CodeTree.Tree.Selected, PntBegin, PntEnd); DoCodetree_GetSyntaxRange(CodeTree.Tree.Selected, PntBegin, PntEnd);
Ed:= CurrentEditor; Ed:= CurrentEditor;
FCodetreeDblClicking:= true; FCodetreeDblClicking:= true;
Ed.DoGotoPos( Ed.DoGotoPos(
skipping to change at line 1699 skipping to change at line 1825
CustomDialog_DoPyCallback:= @DoPyCallbackFromAPI; CustomDialog_DoPyCallback:= @DoPyCallbackFromAPI;
FFileNameLogDebug:= AppDir_Settings+DirectorySeparator+'app.log'; FFileNameLogDebug:= AppDir_Settings+DirectorySeparator+'app.log';
FFileNameLogConsole:= AppDir_Settings+DirectorySeparator+'console.log'; FFileNameLogConsole:= AppDir_Settings+DirectorySeparator+'console.log';
DoMenuitemEllipsis(mnuOpThemeUi); DoMenuitemEllipsis(mnuOpThemeUi);
DoMenuitemEllipsis(mnuOpThemeSyntax); DoMenuitemEllipsis(mnuOpThemeSyntax);
DoMenuitemEllipsis(mnuOpKeys); DoMenuitemEllipsis(mnuOpKeys);
DoMenuitemEllipsis(mnuOpThemes); DoMenuitemEllipsis(mnuOpThemes);
DoMenuitemEllipsis(mnuOpLangs); DoMenuitemEllipsis(mnuOpLangs);
mnuToolbarCaseLow:= TMenuItem.Create(Self);
mnuToolbarCaseLow.Caption:= mnuCaseLow.Caption;
mnuToolbarCaseLow.Tag:= cCommand_TextCaseLower;
mnuToolbarCaseLow.OnClick:= @MenuitemClick_CommandFromTag;
mnuToolbarCaseUp:= TMenuItem.Create(Self);
mnuToolbarCaseUp.Caption:= mnuCaseUp.Caption;
mnuToolbarCaseUp.Tag:= cCommand_TextCaseUpper;
mnuToolbarCaseUp.OnClick:= @MenuitemClick_CommandFromTag;
mnuToolbarCaseTitle:= TMenuItem.Create(Self);
mnuToolbarCaseTitle.Caption:= mnuCaseTitle.Caption;
mnuToolbarCaseTitle.Tag:= cCommand_TextCaseTitle;
mnuToolbarCaseTitle.OnClick:= @MenuitemClick_CommandFromTag;
mnuToolbarCaseInvert:= TMenuItem.Create(Self);
mnuToolbarCaseInvert.Caption:= mnuCaseInvert.Caption;
mnuToolbarCaseInvert.Tag:= cCommand_TextCaseInvert;
mnuToolbarCaseInvert.OnClick:= @MenuitemClick_CommandFromTag;
mnuToolbarCaseSent:= TMenuItem.Create(Self);
mnuToolbarCaseSent.Caption:= mnuCaseSent.Caption;
mnuToolbarCaseSent.Tag:= cCommand_TextCaseSentence;
mnuToolbarCaseSent.OnClick:= @MenuitemClick_CommandFromTag;
PopupToolbarCase:= TPopupMenu.Create(Self); PopupToolbarCase:= TPopupMenu.Create(Self);
PopupToolbarCase.Items.Add(mnuToolbarCaseUp); PopupToolbarCase.OnPopup:= @PopupToolbarCaseOnPopup;
PopupToolbarCase.Items.Add(mnuToolbarCaseLow);
PopupToolbarCase.Items.Add(mnuToolbarCaseTitle);
PopupToolbarCase.Items.Add(mnuToolbarCaseInvert);
PopupToolbarCase.Items.Add(mnuToolbarCaseSent);
mnuToolbarCommentLineToggle:= TMenuItem.Create(Self);
mnuToolbarCommentLineToggle.Caption:= 'Line comment: toggle';
mnuToolbarCommentLineToggle.Hint:= 'cuda_comments,cmt_toggle_line_body';
mnuToolbarCommentLineToggle.OnClick:= @MenuitemClick_CommandFromHint;
mnuToolbarCommentLineAdd:= TMenuItem.Create(Self);
mnuToolbarCommentLineAdd.Caption:= 'Line comment: add';
mnuToolbarCommentLineAdd.Hint:= 'cuda_comments,cmt_add_line_body';
mnuToolbarCommentLineAdd.OnClick:= @MenuitemClick_CommandFromHint;
mnuToolbarCommentLineDel:= TMenuItem.Create(Self);
mnuToolbarCommentLineDel.Caption:= 'Line comment: remove';
mnuToolbarCommentLineDel.Hint:= 'cuda_comments,cmt_del_line';
mnuToolbarCommentLineDel.OnClick:= @MenuitemClick_CommandFromHint;
mnuToolbarCommentStream:= TMenuItem.Create(Self);
mnuToolbarCommentStream.Caption:= 'Stream comment: toggle';
mnuToolbarCommentStream.Hint:= 'cuda_comments,cmt_toggle_stream';
mnuToolbarCommentStream.OnClick:= @MenuitemClick_CommandFromHint;
PopupToolbarComment:= TPopupMenu.Create(Self); PopupToolbarComment:= TPopupMenu.Create(Self);
PopupToolbarComment.Items.Add(mnuToolbarCommentLineToggle); PopupToolbarComment.OnPopup:= @PopupToolbarCommentOnPopup;
PopupToolbarComment.Items.Add(mnuToolbarCommentLineAdd);
PopupToolbarComment.Items.Add(mnuToolbarCommentLineDel);
PopupToolbarComment.Items.Add(mnuToolbarCommentStream);
mnuToolbarSortAsc:= TMenuItem.Create(Self);
mnuToolbarSortAsc.Caption:= 'Sort ascending';
mnuToolbarSortAsc.Hint:= 'cuda_sort,sort_asc';
mnuToolbarSortAsc.OnClick:= @MenuitemClick_CommandFromHint;
mnuToolbarSortDesc:= TMenuItem.Create(Self);
mnuToolbarSortDesc.Caption:= 'Sort descending';
mnuToolbarSortDesc.Hint:= 'cuda_sort,sort_desc';
mnuToolbarSortDesc.OnClick:= @MenuitemClick_CommandFromHint;
mnuToolbarSortAscNocase:= TMenuItem.Create(Self);
mnuToolbarSortAscNocase.Caption:= 'Sort ascending, ignore case';
mnuToolbarSortAscNocase.Hint:= 'cuda_sort,sort_asc_nocase';
mnuToolbarSortAscNocase.OnClick:= @MenuitemClick_CommandFromHint;
mnuToolbarSortDescNocase:= TMenuItem.Create(Self);
mnuToolbarSortDescNocase.Caption:= 'Sort descending, ignore case';
mnuToolbarSortDescNocase.Hint:= 'cuda_sort,sort_desc_nocase';
mnuToolbarSortDescNocase.OnClick:= @MenuitemClick_CommandFromHint;
mnuToolbarSortSep1:= TMenuItem.Create(Self);
mnuToolbarSortSep1.Caption:= '-';
mnuToolbarSortDialog:= TMenuItem.Create(Self);
mnuToolbarSortDialog.Caption:= 'Sort dialog...';
mnuToolbarSortDialog.Hint:= 'cuda_sort,sort_dlg';
mnuToolbarSortDialog.OnClick:= @MenuitemClick_CommandFromHint;
mnuToolbarSortSep2:= TMenuItem.Create(Self);
mnuToolbarSortSep2.Caption:= '-';
mnuToolbarSortReverse:= TMenuItem.Create(Self);
mnuToolbarSortReverse.Caption:= 'Reverse lines';
mnuToolbarSortReverse.Hint:= 'cuda_sort,reverse';
mnuToolbarSortReverse.OnClick:= @MenuitemClick_CommandFromHint;
mnuToolbarSortShuffle:= TMenuItem.Create(Self);
mnuToolbarSortShuffle.Caption:= 'Shuffle lines';
mnuToolbarSortShuffle.Hint:= 'cuda_sort,shuffle';
mnuToolbarSortShuffle.OnClick:= @MenuitemClick_CommandFromHint;
mnuToolbarSortRemoveDup:= TMenuItem.Create(Self);
mnuToolbarSortRemoveDup.Caption:= 'Remove duplicate lines';
mnuToolbarSortRemoveDup.Hint:= 'cuda_sort,del_dup';
mnuToolbarSortRemoveDup.OnClick:= @MenuitemClick_CommandFromHint;
mnuToolbarSortRemoveBlank:= TMenuItem.Create(Self);
mnuToolbarSortRemoveBlank.Caption:= 'Remove blank lines';
mnuToolbarSortRemoveBlank.Hint:= 'cuda_sort,del_blank';
mnuToolbarSortRemoveBlank.OnClick:= @MenuitemClick_CommandFromHint;
PopupToolbarSort:= TPopupMenu.Create(Self); PopupToolbarSort:= TPopupMenu.Create(Self);
PopupToolbarSort.Items.Add(mnuToolbarSortAsc); PopupToolbarSort.OnPopup:= @PopupToolbarSortOnPopup;
PopupToolbarSort.Items.Add(mnuToolbarSortDesc);
PopupToolbarSort.Items.Add(mnuToolbarSortAscNocase);
PopupToolbarSort.Items.Add(mnuToolbarSortDescNocase);
PopupToolbarSort.Items.Add(mnuToolbarSortSep1);
PopupToolbarSort.Items.Add(mnuToolbarSortDialog);
PopupToolbarSort.Items.Add(mnuToolbarSortSep2);
PopupToolbarSort.Items.Add(mnuToolbarSortReverse);
PopupToolbarSort.Items.Add(mnuToolbarSortShuffle);
PopupToolbarSort.Items.Add(mnuToolbarSortRemoveDup);
PopupToolbarSort.Items.Add(mnuToolbarSortRemoveBlank);
{$ifdef windows} {$ifdef windows}
if IsSetToOneInstance then if IsSetToOneInstance then
with TInstanceManage.GetInstance do with TInstanceManage.GetInstance do
case Status of case Status of
isFirst: isFirst:
begin begin
SetFormHandleForActivate(Self.Handle); SetFormHandleForActivate(Self.Handle);
OnSecondInstanceSentData := @SecondInstance; OnSecondInstanceSentData := @SecondInstance;
end; end;
skipping to change at line 1834 skipping to change at line 1864
InitSidebar; InitSidebar;
CodeTree:= TAppTreeContainer.Create(Self); CodeTree:= TAppTreeContainer.Create(Self);
CodeTree.Parent:= PanelLeft; CodeTree.Parent:= PanelLeft;
CodeTree.Align:= alClient; CodeTree.Align:= alClient;
CodeTree.Tree.Images:= ImageListTree; CodeTree.Tree.Images:= ImageListTree;
CodeTree.Themed:= true; CodeTree.Themed:= true;
CodeTree.Tree.OnDblClick:= @DoCodetree_OnDblClick; CodeTree.Tree.OnDblClick:= @DoCodetree_OnDblClick;
CodeTree.Tree.OnMouseMove:= @DoCodetree_OnMouseMove; CodeTree.Tree.OnMouseMove:= @DoCodetree_OnMouseMove;
CodeTree.Tree.OnKeyDown:= @DoCodetree_OnKeyDown; CodeTree.Tree.OnKeyDown:= @DoCodetree_OnKeyDown;
CodeTree.Tree.PopupMenu:= PopupTree; CodeTree.Tree.OnContextPopup:= @DoCodetree_OnContextPopup;
PanelCodeTreeTop:= TATPanelSimple.Create(Self); PanelCodeTreeTop:= TATPanelSimple.Create(Self);
PanelCodeTreeTop.Parent:= PanelLeft; PanelCodeTreeTop.Parent:= PanelLeft;
PanelCodeTreeTop.Align:= alTop; PanelCodeTreeTop.Align:= alTop;
PanelCodeTreeTop.Top:= PanelLeftTitle.Height; //fix pos relative to title PanelCodeTreeTop.Top:= PanelLeftTitle.Height; //fix pos relative to title
PanelCodeTreeTop.Height:= UiOps.InputHeight; PanelCodeTreeTop.Height:= UiOps.InputHeight;
CodeTreeFilter:= TTreeFilterEdit.Create(Self); CodeTreeFilter:= TTreeFilterEdit.Create(Self);
CodeTreeFilter.Hide; CodeTreeFilter.Hide;
skipping to change at line 1864 skipping to change at line 1894
CodeTreeFilterReset.ShowHint:= true; CodeTreeFilterReset.ShowHint:= true;
CodeTreeFilterReset.Hint:= msgTooltipClearFilter; CodeTreeFilterReset.Hint:= msgTooltipClearFilter;
CodeTreeFilterReset.OnClick:= @CodeTreeFilter_ResetOnClick; CodeTreeFilterReset.OnClick:= @CodeTreeFilter_ResetOnClick;
CodeTreeFilterInput:= TATComboEdit.Create(Self); CodeTreeFilterInput:= TATComboEdit.Create(Self);
CodeTreeFilterInput.Parent:= PanelCodeTreeTop; CodeTreeFilterInput.Parent:= PanelCodeTreeTop;
CodeTreeFilterInput.Align:= alClient; CodeTreeFilterInput.Align:= alClient;
CodeTreeFilterInput.OnChange:= @CodeTreeFilter_OnChange; CodeTreeFilterInput.OnChange:= @CodeTreeFilter_OnChange;
CodeTreeFilterInput.OnCommand:= @CodeTreeFilter_OnCommand; CodeTreeFilterInput.OnCommand:= @CodeTreeFilter_OnCommand;
FPopupListboxOutput:= TPopupMenu.Create(Self);
mnuContextOutputClear:= TMenuItem.Create(Self);
mnuContextOutputClear.Caption:= msgFileClearList;
mnuContextOutputClear.OnClick:= @PopupListboxOutputClearClick;
FPopupListboxOutput.Items.Add(mnuContextOutputClear);
mnuContextOutputCopy:= TMenuItem.Create(Self);
mnuContextOutputCopy.Caption:= msgEditCopy;
mnuContextOutputCopy.OnClick:= @PopupListboxOutputCopyClick;
FPopupListboxOutput.Items.Add(mnuContextOutputCopy);
FPopupListboxValidate:= TPopupMenu.Create(Self);
mnuContextValidateClear:= TMenuItem.Create(Self);
mnuContextValidateClear.Caption:= msgFileClearList;
mnuContextValidateClear.OnClick:= @PopupListboxValidateClearClick;
FPopupListboxValidate.Items.Add(mnuContextValidateClear);
mnuContextValidateCopy:= TMenuItem.Create(Self);
mnuContextValidateCopy.Caption:= msgEditCopy;
mnuContextValidateCopy.OnClick:= @PopupListboxValidateCopyClick;
FPopupListboxValidate.Items.Add(mnuContextValidateCopy);
ListboxOut:= TATListbox.Create(Self); ListboxOut:= TATListbox.Create(Self);
ListboxOut.VirtualMode:= false; ListboxOut.VirtualMode:= false;
ListboxOut.Parent:= PanelBottom; ListboxOut.Parent:= PanelBottom;
ListboxOut.Align:= alClient; ListboxOut.Align:= alClient;
ListboxOut.CanGetFocus:= true; ListboxOut.CanGetFocus:= true;
ListboxOut.OwnerDrawn:= true; ListboxOut.OwnerDrawn:= true;
ListboxOut.PopupMenu:= FPopupListboxOutput;
ListboxOut.ScrollStyleVert:= alssShow; ListboxOut.ScrollStyleVert:= alssShow;
ListboxOut.ScrollStyleHorz:= alssAuto; ListboxOut.ScrollStyleHorz:= alssAuto;
ListboxOut.OnDblClick:= @ListboxOutClick; ListboxOut.OnDblClick:= @ListboxOutClick;
ListboxOut.OnDrawItem:= @ListboxOutDrawItem; ListboxOut.OnDrawItem:= @ListboxOutDrawItem;
ListboxOut.OnKeyDown:= @ListboxOutKeyDown; ListboxOut.OnKeyDown:= @ListboxOutKeyDown;
ListboxOut.OnContextPopup:= @ListboxOutContextPopup;
ListboxVal:= TATListbox.Create(Self); ListboxVal:= TATListbox.Create(Self);
ListboxVal.VirtualMode:= false; ListboxVal.VirtualMode:= false;
ListboxVal.Parent:= PanelBottom; ListboxVal.Parent:= PanelBottom;
ListboxVal.Align:= alClient; ListboxVal.Align:= alClient;
ListboxVal.CanGetFocus:= true; ListboxVal.CanGetFocus:= true;
ListboxVal.OwnerDrawn:= true; ListboxVal.OwnerDrawn:= true;
ListboxVal.PopupMenu:= FPopupListboxValidate;
ListboxVal.ScrollStyleVert:= alssShow; ListboxVal.ScrollStyleVert:= alssShow;
ListboxVal.ScrollStyleHorz:= alssAuto; ListboxVal.ScrollStyleHorz:= alssAuto;
ListboxVal.OnDblClick:= @ListboxOutClick; ListboxVal.OnDblClick:= @ListboxOutClick;
ListboxVal.OnDrawItem:= @ListboxOutDrawItem; ListboxVal.OnDrawItem:= @ListboxOutDrawItem;
ListboxVal.OnKeyDown:= @ListboxOutKeyDown; ListboxVal.OnKeyDown:= @ListboxOutKeyDown;
ListboxVal.OnContextPopup:= @ListboxValidateContextPopup;
AppBookmarkImagelist.AddImages(ImageListBm); AppBookmarkImagelist.AddImages(ImageListBm);
for i:= 2 to 9 do for i:= 2 to 9 do
begin begin
AppBookmarkSetup[i].Color:= clDefault; AppBookmarkSetup[i].Color:= clDefault;
AppBookmarkSetup[i].ImageIndex:= i-1; AppBookmarkSetup[i].ImageIndex:= i-1;
end; end;
PanelAll.Align:= alClient; PanelAll.Align:= alClient;
PaintTest.Height:= 150; PaintTest.Height:= 150;
skipping to change at line 1958 skipping to change at line 1966
Status.HeightInitial:= Status.Height; Status.HeightInitial:= Status.Height;
Status.Padding:= 2; Status.Padding:= 2;
Status.OnPanelClick:= @StatusPanelClick; Status.OnPanelClick:= @StatusPanelClick;
Status.ShowHint:= true; Status.ShowHint:= true;
fmConsole:= TfmConsole.Create(Self); fmConsole:= TfmConsole.Create(Self);
fmConsole.Parent:= PanelBottom; fmConsole.Parent:= PanelBottom;
fmConsole.Align:= alClient; fmConsole.Align:= alClient;
fmConsole.OnConsoleNav:= @DoOnConsoleNav; fmConsole.OnConsoleNav:= @DoOnConsoleNav;
fmGoto:= TfmGoto.Create(Self);
ListboxOut.Align:= alClient;
ListboxVal.Align:= alClient;
Groups:= TATGroups.Create(Self); Groups:= TATGroups.Create(Self);
Groups.Parent:= PanelEditors; Groups.Parent:= PanelEditors;
Groups.Align:= alClient; Groups.Align:= alClient;
Groups.Mode:= gmOne; Groups.Mode:= gmOne;
Groups.Images:= ImageListTabs; Groups.Images:= ImageListTabs;
Groups.OnChangeMode:=@DoGroupsChangeMode; Groups.OnChangeMode:=@DoGroupsChangeMode;
Groups.OnTabFocus:= @DoOnTabFocus; Groups.OnTabFocus:= @DoOnTabFocus;
Groups.OnTabAdd:= @DoOnTabAdd; Groups.OnTabAdd:= @DoOnTabAdd;
Groups.OnTabClose:= @DoOnTabClose; Groups.OnTabClose:= @DoOnTabClose;
Groups.OnTabMove:= @DoOnTabMove; Groups.OnTabMove:= @DoOnTabMove;
skipping to change at line 1990 skipping to change at line 1993
AppSidePanels.Add(Panel); AppSidePanels.Add(Panel);
FFinder:= TATEditorFinder.Create; FFinder:= TATEditorFinder.Create;
FFinder.OptRegex:= true; FFinder.OptRegex:= true;
FFinder.OnConfirmReplace:= @FinderOnConfirmReplace; FFinder.OnConfirmReplace:= @FinderOnConfirmReplace;
FFinder.OnProgress:= @FinderOnProgress; FFinder.OnProgress:= @FinderOnProgress;
FFinder.OnBadRegex:= @FinderOnBadRegex; FFinder.OnBadRegex:= @FinderOnBadRegex;
FFinder.OnFound:=@FinderOnFound; FFinder.OnFound:=@FinderOnFound;
FFinder.OnGetToken:= @FinderOnGetToken; FFinder.OnGetToken:= @FinderOnGetToken;
UpdateMenuEnc(PopupEnc.Items);
UpdateMenuEnc(mnuFileEnc);
InitStatusbarControls; InitStatusbarControls;
FFindStop:= false; FFindStop:= false;
FFindConfirmAll:= mrNone; FFindConfirmAll:= mrNone;
Groups.Splitter1.OnPaint:= @SplitterOnPaint_Gr; Groups.Splitter1.OnPaint:= @SplitterOnPaint_Gr;
Groups.Splitter2.OnPaint:= @SplitterOnPaint_Gr; Groups.Splitter2.OnPaint:= @SplitterOnPaint_Gr;
Groups.Splitter3.OnPaint:= @SplitterOnPaint_Gr; Groups.Splitter3.OnPaint:= @SplitterOnPaint_Gr;
Groups.Splitter4.OnPaint:= @SplitterOnPaint_Gr; Groups.Splitter4.OnPaint:= @SplitterOnPaint_Gr;
Groups.Splitter5.OnPaint:= @SplitterOnPaint_Gr; Groups.Splitter5.OnPaint:= @SplitterOnPaint_Gr;
skipping to change at line 2020 skipping to change at line 2021
UpdateMenuItemHint(mnuFile, 'top-file'); UpdateMenuItemHint(mnuFile, 'top-file');
UpdateMenuItemHint(mnuEdit, 'top-edit'); UpdateMenuItemHint(mnuEdit, 'top-edit');
UpdateMenuItemHint(mnuSel, 'top-sel'); UpdateMenuItemHint(mnuSel, 'top-sel');
UpdateMenuItemHint(mnuSr, 'top-sr'); UpdateMenuItemHint(mnuSr, 'top-sr');
UpdateMenuItemHint(mnuView, 'top-view'); UpdateMenuItemHint(mnuView, 'top-view');
UpdateMenuItemHint(mnuOp, 'top-op'); UpdateMenuItemHint(mnuOp, 'top-op');
UpdateMenuItemHint(mnuHelp, 'top-help'); UpdateMenuItemHint(mnuHelp, 'top-help');
UpdateMenuItemHint(mnuGroups, 'top-groups'); UpdateMenuItemHint(mnuGroups, 'top-groups');
UpdateMenuItemHint(mnuPlugins, 'plugins'); UpdateMenuItemHint(mnuPlugins, 'plugins');
UpdateMenuItemHint(mnuFileOpenSub, '_recents'); UpdateMenuItemHint(mnuFileOpenSub, '_recents');
UpdateMenuItemHint(mnuFileEnc, '_enc');
UpdateMenuItemHint(mnuFileEnds, '_ends'); UpdateMenuItemHint(mnuFileEnds, '_ends');
UpdateMenuItemHint(mnuOpPlugins, '_oplugins'); UpdateMenuItemHint(mnuOpPlugins, '_oplugins');
mnuFileOpenSub.Parent.OnClick:= @MenuRecentsPopup;
DoOps_OnCreate; DoOps_OnCreate;
//option is applied only once at app start //option is applied only once at app start
if not UiOps.ShowMenubar then if not UiOps.ShowMenubar then
ShowMenu:= false; ShowMenu:= false;
end; end;
procedure TfmMain.DoOps_OnCreate; procedure TfmMain.DoOps_OnCreate;
begin begin
//must load window position in OnCreate to fix flickering with maximized windo w, Win10 //must load window position in OnCreate to fix flickering with maximized windo w, Win10
DoOps_LoadCommandLineOptions; DoOps_LoadCommandLineOptions;
DoOps_LoadOptions(AppFile_OptionsUser, EditorOps); //before LoadHistory DoOps_LoadOptions(AppFile_OptionsUser, EditorOps); //before LoadHistory
DoOps_LoadLexerLib; //before LoadHistory DoOps_LoadLexerLib(true); //before LoadHistory
DoFileOpen('', ''); //before LoadHistory DoFileOpen('', ''); //before LoadHistory
DoOps_LoadSidebarIcons; //before LoadPlugins (for sidebar icons) DoOps_LoadSidebarIcons; //before LoadPlugins (for sidebar icons)
DoOps_LoadTreeIcons; DoOps_LoadTreeIcons;
DoOps_LoadToolBarIcons; DoOps_LoadToolBarIcons;
InitPyEngine; //before LoadPlugins InitPyEngine; //before LoadPlugins
DoOps_LoadPlugins; //before LoadHistory (for on_open for restored session) DoOps_LoadPlugins; //before LoadHistory (for on_open for restored session)
DoOps_LoadHistory; DoOps_LoadHistory;
skipping to change at line 2155 skipping to change at line 2156
else else
ACanClose:= true; ACanClose:= true;
if ACanClose then if ACanClose then
StopAllTimers; StopAllTimers;
end; end;
procedure TfmMain.StopAllTimers; procedure TfmMain.StopAllTimers;
begin begin
TimerAppIdle.AutoEnabled:=false; TimerAppIdle.AutoEnabled:=false;
TimerStatus.Enabled:= false; TimerStatusClear.Enabled:= false;
TimerStatusBusy.Enabled:= false; TimerStatusWork.Enabled:= false;
TimerStatusAlt.Enabled:= false; TimerStatusAlt.Enabled:= false;
TimerTreeFill.Enabled:= false; TimerTreeFill.Enabled:= false;
TimerEdCaret.Enabled:= false;
TimerAppIdle.Enabled:= false; TimerAppIdle.Enabled:= false;
TimerCmd.Enabled:= false; TimerCmd.Enabled:= false;
end; end;
procedure TfmMain.UpdateSidebarButtonOverlay; procedure TfmMain.UpdateSidebarButtonOverlay;
var var
Btn: TATButton; Btn: TATButton;
NCount, i: integer; NCount, i: integer;
begin begin
for i:= 0 to ToolbarSideLow.ButtonCount-1 do for i:= 0 to ToolbarSideLow.ButtonCount-1 do
skipping to change at line 2367 skipping to change at line 2367
SplitterVert.Left:= PanelLeft.Width; SplitterVert.Left:= PanelLeft.Width;
end; end;
procedure TfmMain.FormShow(Sender: TObject); procedure TfmMain.FormShow(Sender: TObject);
var var
NTickShowEnd, NTickShowEnd,
NTickPluginBegin, NTickPluginEnd: QWord; NTickPluginBegin, NTickPluginEnd: QWord;
Frame: TEditorFrame; Frame: TEditorFrame;
i: integer; i: integer;
begin begin
(*
{$ifdef darwin} {$ifdef darwin}
// https://bugs.freepascal.org/view.php?id=35599 // https://bugs.freepascal.org/view.php?id=35599
SplitterHorz.ResizeStyle:= rsUpdate; SplitterHorz.ResizeStyle:= rsUpdate;
SplitterVert.ResizeStyle:= rsUpdate; SplitterVert.ResizeStyle:= rsUpdate;
Groups.Splitter1.ResizeStyle:= rsUpdate; Groups.Splitter1.ResizeStyle:= rsUpdate;
Groups.Splitter2.ResizeStyle:= rsUpdate; Groups.Splitter2.ResizeStyle:= rsUpdate;
Groups.Splitter3.ResizeStyle:= rsUpdate; Groups.Splitter3.ResizeStyle:= rsUpdate;
Groups.Splitter4.ResizeStyle:= rsUpdate; Groups.Splitter4.ResizeStyle:= rsUpdate;
Groups.Splitter5.ResizeStyle:= rsUpdate; Groups.Splitter5.ResizeStyle:= rsUpdate;
{$endif} {$endif}
*)
if FHandledOnShow then exit; if FHandledOnShow then exit;
DoControlLock(Self); DoControlLock(Self);
if FLastMaximized then if FLastMaximized then
begin begin
FLastMaximized:= false; FLastMaximized:= false;
WindowState:= wsMaximized; WindowState:= wsMaximized;
end; end;
DoApplyInitialGroupSizes; DoApplyInitialGroupSizes;
DoApplyFont_Text; DoApplyFont_Text;
DoApplyFont_Ui; DoApplyFont_Ui;
DoApplyFont_Output; DoApplyFont_Output;
DoApplyUiOps;
if UiOps.ReopenSession then if UiOps.ReopenSession then
DoOps_LoadSession(GetSessionFilename); DoOps_LoadSession(GetSessionFilename);
if FConsoleMustShow then
DoShowConsole(false);
FHandledOnShow:= true; FHandledOnShow:= true;
FAllowLoadKeymap:= true; FAllowLoadKeymap:= true;
DoOps_LoadKeymap; DoOps_LoadKeymap;
NTickPluginBegin:= GetTickCount64; NTickPluginBegin:= GetTickCount64;
DoPyEvent(CurrentEditor, cEventOnStart, []); DoPyEvent(CurrentEditor, cEventOnStart, []);
NTickPluginEnd:= GetTickCount64; NTickPluginEnd:= GetTickCount64;
DoApplyUiOps; //after plugin on_start, ConfigToolbar is slow with visible tool bar
DoApplyInitialSidebarPanel; DoApplyInitialSidebarPanel;
UpdateMenuPlugins; UpdateMenuPlugins;
UpdateMenuPlugins_Shortcuts(true); UpdateMenuPlugins_Shortcuts(true);
UpdateMenuHotkeys; UpdateMenuHotkeys;
UpdateMenuTabsize;
UpdateMenuPicScale;
UpdateSidebarButtons; UpdateSidebarButtons;
UpdateBottomButtons; UpdateBottomButtons;
UpdateStatus; UpdateStatus;
DoLoadCommandLine; DoLoadCommandLine;
DoApplyInitialWindowPos; DoApplyInitialWindowPos;
if ShowBottom then
if FLastBottomPanel='' then
DoShowConsole(false);
//postpone parsing until frames are shown //postpone parsing until frames are shown
AllowFrameParsing:= true; AllowFrameParsing:= true;
for i:= 0 to FrameCount-1 do for i:= 0 to FrameCount-1 do
begin begin
Frame:= Frames[i]; Frame:= Frames[i];
if Frame.Visible then if Frame.Visible then
Frame.DoShow; Frame.DoShow;
end; end;
FAllowOnFocus:= true; FAllowOnFocus:= true;
skipping to change at line 2453 skipping to change at line 2459
DoShowFirstStartInfo; DoShowFirstStartInfo;
if UiOps.NotificationEnabled then if UiOps.NotificationEnabled then
begin begin
AppNotifThread:= TAppNotifThread.Create(false); AppNotifThread:= TAppNotifThread.Create(false);
AppNotifThread.Priority:= tpLower; AppNotifThread.Priority:= tpLower;
end; end;
if DirectoryExists(AppDir_Py+DirectorySeparator+'cuda_brackets_hilite') then if DirectoryExists(AppDir_Py+DirectorySeparator+'cuda_brackets_hilite') then
MsgLogConsole('WARNING: plugin Bracket Helper is not needed anymore, remove it and use option "bracket_highlight"'); MsgLogConsole('WARNING: plugin Bracket Helper is not needed anymore, remove it and use option "bracket_highlight"');
FShowPassed:= true;
end; end;
procedure TfmMain.DoShowFirstStartInfo; procedure TfmMain.DoShowFirstStartInfo;
begin begin
if not FileExistsUTF8(AppFile_History) then if not FileExistsUTF8(AppFile_History) then
begin begin
MsgBox(msgFirstStartInfo, MB_OK or MB_ICONINFORMATION); MsgBox(msgFirstStartInfo, MB_OK or MB_ICONINFORMATION);
end; end;
end; end;
procedure TfmMain.FrameAddRecent(Sender: TObject; const AFileName: string); procedure TfmMain.FrameAddRecent(Sender: TObject; const AFileName: string);
begin begin
UpdateMenuRecent(Sender as TEditorFrame, AFileName); UpdateMenuRecent(Sender as TEditorFrame, AFileName);
end; end;
procedure TfmMain.FrameOnChangeCaretPos(Sender: TObject); procedure TfmMain.FrameOnChangeCaretPos(Sender: TObject);
begin begin
if FCodetreeDblClicking then exit; if FCodetreeDblClicking then exit;
TimerEdCaret.Enabled:= false; FCodetreeNeedsSelJump:= true;
TimerEdCaret.Enabled:= true;
end; end;
procedure TfmMain.FrameOnMsgStatus(Sender: TObject; const AStr: string); procedure TfmMain.FrameOnMsgStatus(Sender: TObject; const AStr: string);
begin begin
MsgStatus(AStr); MsgStatus(AStr);
end; end;
procedure TfmMain.MenuRecentsClear(Sender: TObject); procedure TfmMain.MenuRecentsClear(Sender: TObject);
begin begin
DoClearRecentFileHistory; DoClearRecentFileHistory;
end; end;
procedure TfmMain.mnuFind2NextClick(Sender: TObject);
begin
CurrentEditor.DoCommand(cmd_FindNext);
end;
procedure TfmMain.mnuFind2PrevClick(Sender: TObject);
begin
CurrentEditor.DoCommand(cmd_FindPrev);
end;
procedure TfmMain.mnuFind2WordNextClick(Sender: TObject);
begin
CurrentEditor.DoCommand(cmd_FindCurWordNext);
end;
procedure TfmMain.mnuFind2WordPrevClick(Sender: TObject);
begin
CurrentEditor.DoCommand(cmd_FindCurWordPrev);
end;
procedure TfmMain.DoClearRecentFileHistory; procedure TfmMain.DoClearRecentFileHistory;
begin begin
FListRecents.Clear; FListRecents.Clear;
UpdateMenuRecent(nil, ''); UpdateMenuRecent(nil, '');
// //
DeleteFileUTF8(AppFile_HistoryFiles); DeleteFileUTF8(AppFile_HistoryFiles);
end; end;
function TfmMain.DoFileInstallZip(const fn: string; out DirTarget: string; function TfmMain.DoFileInstallZip(const fn: string; out DirTarget: string;
ASilent: boolean): boolean; ASilent: boolean): boolean;
skipping to change at line 2526 skipping to change at line 2513
msg, msg2: string; msg, msg2: string;
AddonType: TAppAddonType; AddonType: TAppAddonType;
begin begin
DoInstallAddonFromZip(fn, AppDir_DataAutocomplete, msg, msg2, DoInstallAddonFromZip(fn, AppDir_DataAutocomplete, msg, msg2,
Result, AddonType, DirTarget, ASilent); Result, AddonType, DirTarget, ASilent);
if Result then if Result then
begin begin
if AddonType in [cAddonTypeLexer, cAddonTypeLexerLite] then if AddonType in [cAddonTypeLexer, cAddonTypeLexerLite] then
begin begin
DoOps_LoadLexerLib; DoOps_LoadLexerLib(false);
end; end;
if AddonType=cAddonTypePlugin then if AddonType=cAddonTypePlugin then
begin begin
DoOps_LoadPlugins; DoOps_LoadPlugins;
DoOps_LoadKeymap; DoOps_LoadKeymap;
UpdateMenuPlugins; UpdateMenuPlugins;
UpdateMenuPlugins_Shortcuts(true); UpdateMenuPlugins_Shortcuts(true);
end; end;
skipping to change at line 2638 skipping to change at line 2625
Form.Free Form.Free
end; end;
end; end;
procedure TfmMain.DoDialogLexerProp(an: TecSyntAnalyzer); procedure TfmMain.DoDialogLexerProp(an: TecSyntAnalyzer);
begin begin
if DoShowDialogLexerProp(an, if DoShowDialogLexerProp(an,
EditorOps.OpFontName, EditorOps.OpFontName,
EditorOps.OpFontSize) then EditorOps.OpFontSize) then
begin begin
//DoLexerExportFromLibToFile(an);
UpdateMenuLexers;
UpdateStatus; UpdateStatus;
UpdateCurrentFrame; UpdateCurrentFrame;
end; end;
end; end;
procedure TfmMain.DoDialogLexerLib; procedure TfmMain.DoDialogLexerLib;
begin begin
if DoShowDialogLexerLib( if DoShowDialogLexerLib(
AppDir_DataAutocomplete, AppDir_DataAutocomplete,
EditorOps.OpFontName, EditorOps.OpFontName,
EditorOps.OpFontSize, EditorOps.OpFontSize,
@DoOnDeleteLexer @DoOnDeleteLexer
) then ) then
begin begin
UpdateMenuLexers;
UpdateStatus; UpdateStatus;
UpdateCurrentFrame; UpdateCurrentFrame;
end; end;
end; end;
procedure TfmMain.DoApplyLexerStyleMaps(AndApplyTheme: boolean); procedure TfmMain.DoApplyLexerStyleMaps(AndApplyTheme: boolean);
var var
i: integer; i: integer;
begin begin
for i:= 0 to FrameCount-1 do for i:= 0 to FrameCount-1 do
skipping to change at line 2689 skipping to change at line 2673
if DoDialogLexerStylesMap(F.Lexer[F.Editor]) then if DoDialogLexerStylesMap(F.Lexer[F.Editor]) then
DoApplyLexerStyleMaps(false); DoApplyLexerStyleMaps(false);
end; end;
procedure TfmMain.DoHelpAbout; procedure TfmMain.DoHelpAbout;
var var
Form: TfmAbout; Form: TfmAbout;
begin begin
Form:= TfmAbout.Create(Self); Form:= TfmAbout.Create(Self);
with Form do
try try
labelVersion.Caption:= cAppExeVersion; Form.labelVersion.Caption:= cAppExeVersion;
ShowModal; Form.ShowModal;
finally finally
Free Form.Free;
end; end;
end; end;
procedure TfmMain.DoHelpForum; procedure TfmMain.DoHelpForum;
begin begin
OpenURL('http://synwrite.sourceforge.net/forums/viewforum.php?f=20'); OpenURL('http://synwrite.sourceforge.net/forums/viewforum.php?f=20');
end; end;
procedure TfmMain.MenuWindowClick(Sender: TObject);
begin
SetFrame(Frames[(Sender as TMenuItem).Tag]);
end;
procedure TfmMain.UpdateFrameLineEnds(Frame: TEditorFrame; AValue: TATLineEnds); procedure TfmMain.UpdateFrameLineEnds(Frame: TEditorFrame; AValue: TATLineEnds);
begin begin
if Assigned(Frame) then if Assigned(Frame) then
Frame.LineEnds[Frame.Editor]:= AValue; Frame.LineEnds[Frame.Editor]:= AValue;
UpdateStatus; UpdateStatus;
MsgStatus(msgStatusEndsChanged); MsgStatus(msgStatusEndsChanged);
end; end;
type type
TUniqInstanceHack = class(TUniqueInstance); TUniqInstanceHack = class(TUniqueInstance);
skipping to change at line 2818 skipping to change at line 2796
Status.DoubleBuffered:= UiOps.DoubleBuffered; Status.DoubleBuffered:= UiOps.DoubleBuffered;
ButtonCancel.DoubleBuffered:= UiOps.DoubleBuffered; ButtonCancel.DoubleBuffered:= UiOps.DoubleBuffered;
StatusProgress.DoubleBuffered:= UiOps.DoubleBuffered; StatusProgress.DoubleBuffered:= UiOps.DoubleBuffered;
LexerProgress.DoubleBuffered:= UiOps.DoubleBuffered; LexerProgress.DoubleBuffered:= UiOps.DoubleBuffered;
ListboxOut.DoubleBuffered:= UiOps.DoubleBuffered; ListboxOut.DoubleBuffered:= UiOps.DoubleBuffered;
ListboxVal.DoubleBuffered:= UiOps.DoubleBuffered; ListboxVal.DoubleBuffered:= UiOps.DoubleBuffered;
if Assigned(fmConsole) then if Assigned(fmConsole) then
fmConsole.IsDoubleBuffered:= UiOps.DoubleBuffered; fmConsole.IsDoubleBuffered:= UiOps.DoubleBuffered;
if Assigned(fmFind) then if Assigned(fmFind) then
fmFind.IsDoubleBuffered:= UiOps.DoubleBuffered; fmFind.IsDoubleBuffered:= UiOps.DoubleBuffered;
if Assigned(fmGoto) then
fmGoto.IsDoubleBuffered:= UiOps.DoubleBuffered;
//end apply DoubleBuffered //end apply DoubleBuffered
UpdateBottomLayout(FloatBottom); UpdateBottomLayout(FloatBottom);
UpdateStatusbarPanelsFromString(UiOps.StatusPanels); UpdateStatusbarPanelsFromString(UiOps.StatusPanels);
UpdateStatusbarHints; UpdateStatusbarHints;
TimerTreeFill.Interval:= UiOps.TreeTimeFill; TimerTreeFill.Interval:= UiOps.TreeTimeFill;
TimerEdCaret.Interval:= UiOps.TreeTimeCaret;
CodeTree.Tree.ToolTips:= UiOps.TreeShowTooltips; CodeTree.Tree.ToolTips:= UiOps.TreeShowTooltips;
CodeTree.Invalidate; CodeTree.Invalidate;
CodeTreeFilterInput.OptBorderFocusedActive:= UiOps.ShowActiveBorder; CodeTreeFilterInput.OptBorderFocusedActive:= UiOps.ShowActiveBorder;
CodeTreeFilterReset.Width:= AppScale(UiOps.ScrollbarWidth); CodeTreeFilterReset.Width:= AppScale(UiOps.ScrollbarWidth);
EditorCaretPropsFromString(fmConsole.memo.CaretPropsReadonly, EditorOps.OpCare tViewReadonly); EditorCaretPropsFromString(fmConsole.memo.CaretPropsReadonly, EditorOps.OpCare tViewReadonly);
fmConsole.memo.OptBorderFocusedActive:= UiOps.ShowActiveBorder; fmConsole.memo.OptBorderFocusedActive:= UiOps.ShowActiveBorder;
fmConsole.ed.Height:= AppScale(UiOps.InputHeight); fmConsole.ed.Height:= AppScale(UiOps.InputHeight);
fmConsole.ed.OptBorderFocusedActive:= UiOps.ShowActiveBorder; fmConsole.ed.OptBorderFocusedActive:= UiOps.ShowActiveBorder;
fmConsole.Wordwrap:= UiOps.ConsoleWordWrap; fmConsole.MemoWordWrap:= UiOps.ConsoleWordWrap;
DoApplyUiOpsToGroups(Groups); DoApplyUiOpsToGroups(Groups);
if FloatGroups then if FloatGroups then
begin begin
DoApplyUiOpsToGroups(GroupsF1); DoApplyUiOpsToGroups(GroupsF1);
DoApplyUiOpsToGroups(GroupsF2); DoApplyUiOpsToGroups(GroupsF2);
DoApplyUiOpsToGroups(GroupsF3); DoApplyUiOpsToGroups(GroupsF3);
end; end;
ShowStatus:= UiOps.ShowStatusbar; ShowStatus:= UiOps.ShowStatusbar;
skipping to change at line 2880 skipping to change at line 2855
begin begin
PanelCodeTreeTop.Visible:= CodeTree.Visible; PanelCodeTreeTop.Visible:= CodeTree.Visible;
PanelCodeTreeTop.Align:= alBottom; PanelCodeTreeTop.Align:= alBottom;
end; end;
end; end;
PanelCodeTreeTop.Height:= AppScale(UiOps.InputHeight); PanelCodeTreeTop.Height:= AppScale(UiOps.InputHeight);
Status.HeightInitial:= UiOps.StatusHeight; Status.HeightInitial:= UiOps.StatusHeight;
TimerStatus.Interval:= UiOps.StatusTime*1000; TimerStatusClear.Interval:= UiOps.StatusTime*1000;
ATFlatTheme.FontName:= UiOps.VarFontName; ATFlatTheme.FontName:= UiOps.VarFontName;
ATFlatTheme.FontSize:= UiOps.VarFontSize; ATFlatTheme.FontSize:= UiOps.VarFontSize;
ATFlatTheme.ScalePercents:= UiOps.Scale; ATFlatTheme.ScalePercents:= UiOps.Scale;
ATFlatTheme.ScaleFontPercents:= UiOps.ScaleFont; ATFlatTheme.ScaleFontPercents:= UiOps.ScaleFont;
{$ifndef windows} {$ifndef windows}
ATFlatTheme.EnableColorBgOver:= false; ATFlatTheme.EnableColorBgOver:= false;
{$endif} {$endif}
skipping to change at line 3354 skipping to change at line 3329
end; end;
procedure TfmMain.DoDialogCommands; procedure TfmMain.DoDialogCommands;
var var
Ed: TATSynEdit; Ed: TATSynEdit;
NCmd: integer; NCmd: integer;
begin begin
Ed:= CurrentEditor; Ed:= CurrentEditor;
MsgStatus(msgStatusHelpOnShowCommands); MsgStatus(msgStatusHelpOnShowCommands);
UpdateKeymapDynamicItems(categ_Lexer);
UpdateKeymapDynamicItems(categ_OpenedFile); UpdateKeymapDynamicItems(categ_OpenedFile);
UpdateKeymapDynamicItems(categ_RecentFile); UpdateKeymapDynamicItems(categ_RecentFile);
NCmd:= DoDialogCommands_Custom(true, true, true, true, true, true, false, '', FLastSelectedCommand); NCmd:= DoDialogCommands_Custom(true, true, true, true, true, true, false, '', FLastSelectedCommand);
if NCmd>0 then if NCmd>0 then
begin begin
FLastSelectedCommand:= NCmd; FLastSelectedCommand:= NCmd;
Ed.DoCommand(NCmd); Ed.DoCommand(NCmd);
UpdateCurrentFrame; UpdateCurrentFrame;
end; end;
skipping to change at line 3473 skipping to change at line 3449
end; end;
if bKeysChanged then if bKeysChanged then
UpdateMenuPlugins_Shortcuts(true); UpdateMenuPlugins_Shortcuts(true);
end; end;
procedure TfmMain.DoDialogGoto; procedure TfmMain.DoDialogGoto;
var var
Str: string; Str: string;
begin begin
if not Assigned(fmGoto) then
fmGoto:= TfmGoto.Create(Self);
fmGoto.Localize; fmGoto.Localize;
fmGoto.IsDoubleBuffered:= UiOps.DoubleBuffered;
fmGoto.Width:= AppScale(UiOps.ListboxSizeX); fmGoto.Width:= AppScale(UiOps.ListboxSizeX);
UpdateInputForm(fmGoto, false); UpdateInputForm(fmGoto, false);
if fmGoto.ShowModal=mrOk then if fmGoto.ShowModal=mrOk then
begin begin
Str:= UTF8Encode(fmGoto.edInput.Text); Str:= UTF8Encode(fmGoto.edInput.Text);
if DoPyEvent(CurrentEditor, cEventOnGotoEnter, if DoPyEvent(CurrentEditor, cEventOnGotoEnter,
[SStringToPythonString(Str)]) = cPyFalse then exit; [SStringToPythonString(Str)]) = cPyFalse then exit;
skipping to change at line 3816 skipping to change at line 3796
UpdateMenuEnabled(mnuTabMove4, (NVis>=4) and (NCur<>3)); UpdateMenuEnabled(mnuTabMove4, (NVis>=4) and (NCur<>3));
UpdateMenuEnabled(mnuTabMove5, (NVis>=5) and (NCur<>4)); UpdateMenuEnabled(mnuTabMove5, (NVis>=5) and (NCur<>4));
UpdateMenuEnabled(mnuTabMove6, (NVis>=6) and (NCur<>5)); UpdateMenuEnabled(mnuTabMove6, (NVis>=6) and (NCur<>5));
UpdateMenuEnabled(mnuTabMoveF1, (NCur<>6)); UpdateMenuEnabled(mnuTabMoveF1, (NCur<>6));
UpdateMenuEnabled(mnuTabMoveF2, (NCur<>7)); UpdateMenuEnabled(mnuTabMoveF2, (NCur<>7));
UpdateMenuEnabled(mnuTabMoveF3, (NCur<>8)); UpdateMenuEnabled(mnuTabMoveF3, (NCur<>8));
UpdateMenuEnabled(mnuTabMoveNext, (NVis>=2) and (NCur<6)); UpdateMenuEnabled(mnuTabMoveNext, (NVis>=2) and (NCur<6));
UpdateMenuEnabled(mnuTabMovePrev, (NVis>=2) and (NCur<6)); UpdateMenuEnabled(mnuTabMovePrev, (NVis>=2) and (NCur<6));
end; end;
procedure TfmMain.PopupTabSizePopup(Sender: TObject);
var
Ed: TATSynEdit;
Msg: string;
NTab, i: integer;
begin
Ed:= CurrentEditor;
if Ed.OptTabSpaces then
Msg:= msgStatusbarTextSpaces
else
Msg:= msgStatusbarTextTab;
NTab:= Ed.OptTabSize;
for i:= cMenuTabsizeMin to cMenuTabsizeMax do
begin
FMenuItemTabSize[i].Caption:= Msg+': '+IntToStr(i);
FMenuItemTabSize[i].Checked:= NTab=i;
end;
mnuTabsizeSpace.Checked:= Ed.OptTabSpaces;
end;
procedure TfmMain.PythonEngineAfterInit(Sender: TObject); procedure TfmMain.PythonEngineAfterInit(Sender: TObject);
var var
Str: array of string; Str: array of string;
{$ifdef windows} {$ifdef windows}
dir: string; dir: string;
{$endif} {$endif}
PathAppend: boolean; PathAppend: boolean;
InitList: TStringList; InitList: TStringList;
InitPy: string; InitPy: string;
begin begin
skipping to change at line 3896 skipping to change at line 3854
PythonEngine.DllName:= ExtractFileName(UiOps.PyLibrary); PythonEngine.DllName:= ExtractFileName(UiOps.PyLibrary);
PythonEngine.LoadDll; PythonEngine.LoadDll;
if PythonOK then if PythonOK then
GetPythonEngine.ExecString('import sys') GetPythonEngine.ExecString('import sys')
else else
begin begin
FConsoleMustShow:= true; FConsoleMustShow:= true;
MsgLogConsole(msgCannotInitPython1); MsgLogConsole(msgCannotInitPython1);
MsgLogConsole(msgCannotInitPython2); MsgLogConsole(msgCannotInitPython2);
fmConsole.ShowError:= true;
DisablePluginMenuItems; DisablePluginMenuItems;
end; end;
end; end;
procedure TfmMain.DisablePluginMenuItems; procedure TfmMain.DisablePluginMenuItems;
begin begin
mnuPlugins.Enabled:= false; if Assigned(mnuPlugins) then
mnuPlugins.Enabled:= false;
mnuToolbarCommentLineAdd.Enabled:= false;
mnuToolbarCommentLineDel.Enabled:= false;
mnuToolbarCommentLineToggle.Enabled:= false;
mnuToolbarCommentStream.Enabled:= false;
mnuToolbarSortAsc.Enabled:= false;
mnuToolbarSortDesc.Enabled:= false;
mnuToolbarSortAscNocase.Enabled:= false;
mnuToolbarSortDescNocase.Enabled:= false;
mnuToolbarSortDialog.Enabled:= false;
mnuToolbarSortShuffle.Enabled:= false;
mnuToolbarSortReverse.Enabled:= false;
mnuToolbarSortRemoveBlank.Enabled:= false;
mnuToolbarSortRemoveDup.Enabled:= false;
end; end;
procedure TfmMain.MenuEncNoReloadClick(Sender: TObject); procedure TfmMain.MenuEncNoReloadClick(Sender: TObject);
begin begin
SetFrameEncoding(CurrentFrame, (Sender as TMenuItem).Caption, false); SetFrameEncoding(CurrentFrame, (Sender as TMenuItem).Caption, false);
end; end;
procedure TfmMain.MenuEncWithReloadClick(Sender: TObject); procedure TfmMain.MenuEncWithReloadClick(Sender: TObject);
begin begin
SetFrameEncoding(CurrentFrame, (Sender as TMenuItem).Caption, true); SetFrameEncoding(CurrentFrame, (Sender as TMenuItem).Caption, true);
skipping to change at line 4011 skipping to change at line 3954
i: integer; i: integer;
begin begin
for i:= 0 to FrameCount-1 do for i:= 0 to FrameCount-1 do
begin begin
Frame:= Frames[i]; Frame:= Frames[i];
if i<ListNames.Count then if i<ListNames.Count then
Frame.LexerName[Frame.Ed1]:= ListNames[i]; Frame.LexerName[Frame.Ed1]:= ListNames[i];
end; end;
end; end;
procedure TfmMain.DoOps_LoadLexerLib; procedure TfmMain.DoOps_LoadLexerLib(AOnCreate: boolean);
var var
fn_ops, DirLexers, LexName: string; fn_ops, DirLexers, LexName: string;
ListFiles, ListBackup: TStringlist; ListFiles, ListBackup: TStringlist;
an: TecSyntAnalyzer; an: TecSyntAnalyzer;
i, j: integer; i, j: integer;
begin begin
ListFiles:= TStringList.Create; ListFiles:= TStringList.Create;
ListBackup:= TStringList.Create; ListBackup:= TStringList.Create;
try try
DoOps_LexersDisableInFrames(ListBackup); if not AOnCreate then
DoOps_LexersDisableInFrames(ListBackup);
AppManager.Clear; AppManager.Clear;
AppManagerLite.Clear; AppManagerLite.Clear;
//load lite lexers //load lite lexers
DirLexers:= AppDir_LexersLite; DirLexers:= AppDir_LexersLite;
AppManagerLite.LoadFromDir(DirLexers); AppManagerLite.LoadFromDir(DirLexers);
//load EControl lexers //load EControl lexers
DirLexers:= AppDir_Lexers; DirLexers:= AppDir_Lexers;
skipping to change at line 4062 skipping to change at line 4006
begin begin
an:= AppManager.Lexers[i]; an:= AppManager.Lexers[i];
for j:= 0 to an.SubAnalyzers.Count-1 do for j:= 0 to an.SubAnalyzers.Count-1 do
begin begin
LexName:= an.SubLexerName(j); LexName:= an.SubLexerName(j);
if LexName<>'' then if LexName<>'' then
an.SubAnalyzers[j].SyntAnalyzer:= AppManager.FindLexerByName(LexName); an.SubAnalyzers[j].SyntAnalyzer:= AppManager.FindLexerByName(LexName);
end; end;
end; end;
UpdateMenuLexers; if not AOnCreate then
DoOps_LexersRestoreInFrames(ListBackup);
DoOps_LexersRestoreInFrames(ListBackup);
finally finally
FreeAndNil(ListFiles); FreeAndNil(ListFiles);
FreeAndNil(ListBackup); FreeAndNil(ListBackup);
end; end;
end; end;
procedure TfmMain.UpdateMenuLexers;
begin
UpdateKeymapDynamicItems(categ_Lexer);
DoOps_LoadKeymap;
UpdateMenuLexersTo(PopupLex.Items);
end;
procedure TfmMain.UpdateMenuLexersTo(AMenu: TMenuItem); procedure TfmMain.UpdateMenuLexersTo(AMenu: TMenuItem);
var var
sl: TStringList; sl: TStringList;
an: TecSyntAnalyzer; an: TecSyntAnalyzer;
an_lite: TATLiteLexer; an_lite: TATLiteLexer;
mi, mi0: TMenuItem; mi, mi0: TMenuItem;
ch, ch0: char; ch, ch0: char;
i: integer; i: integer;
begin begin
if AMenu=nil then exit; if AMenu=nil then exit;
skipping to change at line 4178 skipping to change at line 4114
procedure TfmMain.MsgStatus(AText: string); procedure TfmMain.MsgStatus(AText: string);
begin begin
SReplaceAll(AText, #10, ' '); SReplaceAll(AText, #10, ' ');
SReplaceAll(AText, #13, ' '); SReplaceAll(AText, #13, ' ');
FLastStatusbarMessage:= AText; FLastStatusbarMessage:= AText;
DoStatusbarTextByTag(Status, StatusbarTag_Msg, GetStatusbarPrefix(CurrentFrame )+AText); DoStatusbarTextByTag(Status, StatusbarTag_Msg, GetStatusbarPrefix(CurrentFrame )+AText);
if AText='' then exit; if AText='' then exit;
TimerStatus.Enabled:= false; TimerStatusClear.Enabled:= false;
TimerStatus.Enabled:= true; TimerStatusClear.Enabled:= true;
end; end;
procedure TfmMain.MsgStatusAlt(const AText: string; ASeconds: integer); procedure TfmMain.MsgStatusAlt(const AText: string; ASeconds: integer);
const const
cMaxSeconds = 30; cMaxSeconds = 30;
cSpacing = 3; cSpacing = 3;
var var
P: TPoint; P: TPoint;
begin begin
if StatusForm=nil then if StatusForm=nil then
skipping to change at line 4388 skipping to change at line 4324
F.Ed1.Modified:= false; F.Ed1.Modified:= false;
UpdateStatus; UpdateStatus;
MsgStatus(msgStatusReopened+' '+ExtractFileName(F.FileName)); MsgStatus(msgStatusReopened+' '+ExtractFileName(F.FileName));
end; end;
function TfmMain.DoFileCloseAll(AWithCancel: boolean): boolean; function TfmMain.DoFileCloseAll(AWithCancel: boolean): boolean;
var var
Flags: integer; Flags: integer;
F: TEditorFrame; F: TEditorFrame;
ListNoSave: TList; ListNoSave: TFPList;
i: integer; i: integer;
begin begin
if AWithCancel then if AWithCancel then
Flags:= MB_YESNOCANCEL or MB_ICONQUESTION Flags:= MB_YESNOCANCEL or MB_ICONQUESTION
else else
Flags:= MB_YESNO or MB_ICONQUESTION; Flags:= MB_YESNO or MB_ICONQUESTION;
ListNoSave:= TList.Create; ListNoSave:= TFPList.Create;
try try
for i:= 0 to FrameCount-1 do for i:= 0 to FrameCount-1 do
begin begin
F:= Frames[i]; F:= Frames[i];
if F.Ed1.Modified or F.Ed2.Modified then if F.Ed1.Modified or F.Ed2.Modified then
case MsgBox( case MsgBox(
Format(msgConfirmSaveModifiedTab, [F.TabCaption]), Format(msgConfirmSaveModifiedTab, [F.TabCaption]),
Flags) of Flags) of
ID_YES: ID_YES:
begin begin
skipping to change at line 4452 skipping to change at line 4388
MB_OKCANCEL or MB_ICONWARNING)=ID_OK then MB_OKCANCEL or MB_ICONWARNING)=ID_OK then
if Groups.CloseTabs(tabCloseCurrent, false) then if Groups.CloseTabs(tabCloseCurrent, false) then
DeleteFileUTF8(fn); DeleteFileUTF8(fn);
end; end;
procedure TfmMain.DoFileNew; procedure TfmMain.DoFileNew;
begin begin
DoFileOpen('', ''); DoFileOpen('', '');
end; end;
procedure TfmMain.MenuRecentsClick(Sender: TObject); procedure TfmMain.MenuRecentItemClick(Sender: TObject);
var var
fn: string; fn: string;
n: integer; n: integer;
begin begin
n:= (Sender as TComponent).Tag; n:= (Sender as TComponent).Tag;
fn:= SExpandHomeDirInFilename(FListRecents[n]); fn:= SExpandHomeDirInFilename(FListRecents[n]);
if FileExistsUTF8(fn) then if FileExistsUTF8(fn) then
DoFileOpen(fn, '') DoFileOpen(fn, '')
else else
begin begin
skipping to change at line 5084 skipping to change at line 5020
begin begin
CodeTree.Tree.FullCollapse; CodeTree.Tree.FullCollapse;
end; end;
procedure TfmMain.mnuTreeSortedClick(Sender: TObject); procedure TfmMain.mnuTreeSortedClick(Sender: TObject);
begin begin
if CodeTree.Tree.SortType=stNone then if CodeTree.Tree.SortType=stNone then
CodeTree.Tree.SortType:= stText CodeTree.Tree.SortType:= stText
else else
CodeTree.Tree.SortType:= stNone; CodeTree.Tree.SortType:= stNone;
mnuTreeSorted.Checked:= CodeTree.Tree.SortType<>stNone;
end; end;
procedure TfmMain.mnuTreeUnfoldAllClick(Sender: TObject); procedure TfmMain.mnuTreeUnfoldAllClick(Sender: TObject);
begin begin
CodeTree.Tree.FullExpand; CodeTree.Tree.FullExpand;
end; end;
procedure TfmMain.DoFileExportHtml(F: TEditorFrame); procedure TfmMain.DoFileExportHtml(F: TEditorFrame);
var var
Ed: TATSynEdit; Ed: TATSynEdit;
skipping to change at line 5284 skipping to change at line 5218
end; end;
if (Key=VK_RETURN) then if (Key=VK_RETURN) then
begin begin
(Sender as TTreeView).OnDblClick(Sender); (Sender as TTreeView).OnDblClick(Sender);
Key:= 0; Key:= 0;
exit exit
end; end;
end; end;
procedure TfmMain.DoCodetree_OnContextPopup(Sender: TObject; MousePos: TPoint;
var Handled: Boolean);
begin
InitPopupTree;
PopupTree.Popup;
Handled:= true;
end;
procedure TfmMain.DoCodetree_GotoBlockForCurrentNode(AndSelect: boolean); procedure TfmMain.DoCodetree_GotoBlockForCurrentNode(AndSelect: boolean);
var var
Ed: TATSynEdit; Ed: TATSynEdit;
Node: TTreeNode; Node: TTreeNode;
P1, P2: TPoint; P1, P2: TPoint;
begin begin
Node:= CodeTree.Tree.Selected; Node:= CodeTree.Tree.Selected;
if Node=nil then exit; if Node=nil then exit;
DoCodetree_GetSyntaxRange(Node, P1, P2); DoCodetree_GetSyntaxRange(Node, P1, P2);
skipping to change at line 5308 skipping to change at line 5250
Ed:= CurrentEditor; Ed:= CurrentEditor;
Ed.DoGotoPos(P1, P2, Ed.DoGotoPos(P1, P2,
UiOps.FindIndentHorz, UiOps.FindIndentHorz,
UiOps.FindIndentVert, UiOps.FindIndentVert,
true, true,
true true
); );
end; end;
procedure TfmMain.ListboxOutContextPopup(Sender: TObject; MousePos: TPoint; var
Handled: Boolean);
begin
InitPopupListboxOutput;
mnuContextOutputCopy.Caption:= cStrMenuitemCopy;
mnuContextOutputClear.Caption:= msgFileClearList;
PopupListboxOutput.Popup;
Handled:= true;
end;
procedure TfmMain.ListboxValidateContextPopup(Sender: TObject; MousePos: TPoint;
var Handled: Boolean);
begin
InitPopupListboxValidate;
mnuContextValidateCopy.Caption:= cStrMenuitemCopy;
mnuContextValidateClear.Caption:= msgFileClearList;
PopupListboxValidate.Popup;
Handled:= true;
end;
procedure TfmMain.PopupToolbarCaseOnPopup(Sender: TObject);
begin
if mnuToolbarCaseLow=nil then
begin
mnuToolbarCaseLow:= TMenuItem.Create(Self);
mnuToolbarCaseLow.Tag:= cCommand_TextCaseLower;
mnuToolbarCaseLow.OnClick:= @MenuitemClick_CommandFromTag;
mnuToolbarCaseUp:= TMenuItem.Create(Self);
mnuToolbarCaseUp.Tag:= cCommand_TextCaseUpper;
mnuToolbarCaseUp.OnClick:= @MenuitemClick_CommandFromTag;
mnuToolbarCaseTitle:= TMenuItem.Create(Self);
mnuToolbarCaseTitle.Tag:= cCommand_TextCaseTitle;
mnuToolbarCaseTitle.OnClick:= @MenuitemClick_CommandFromTag;
mnuToolbarCaseInvert:= TMenuItem.Create(Self);
mnuToolbarCaseInvert.Tag:= cCommand_TextCaseInvert;
mnuToolbarCaseInvert.OnClick:= @MenuitemClick_CommandFromTag;
mnuToolbarCaseSent:= TMenuItem.Create(Self);
mnuToolbarCaseSent.Tag:= cCommand_TextCaseSentence;
mnuToolbarCaseSent.OnClick:= @MenuitemClick_CommandFromTag;
PopupToolbarCase.Items.Add(mnuToolbarCaseUp);
PopupToolbarCase.Items.Add(mnuToolbarCaseLow);
PopupToolbarCase.Items.Add(mnuToolbarCaseTitle);
PopupToolbarCase.Items.Add(mnuToolbarCaseInvert);
PopupToolbarCase.Items.Add(mnuToolbarCaseSent);
end;
mnuToolbarCaseLow.Caption:= msgTextCaseLower;
mnuToolbarCaseUp.Caption:= msgTextCaseUpper;
mnuToolbarCaseTitle.Caption:= msgTextCaseTitle;
mnuToolbarCaseInvert.Caption:= msgTextCaseInvert;
mnuToolbarCaseSent.Caption:= msgTextCaseSentence;
end;
procedure TfmMain.PopupToolbarCommentOnPopup(Sender: TObject);
begin
if not PythonOK then exit;
if mnuToolbarCommentLineAdd=nil then
begin
mnuToolbarCommentLineAdd:= TMenuItem.Create(Self);
mnuToolbarCommentLineAdd.Hint:= 'cuda_comments,cmt_add_line_body';
mnuToolbarCommentLineAdd.OnClick:= @MenuitemClick_CommandFromHint;
mnuToolbarCommentLineDel:= TMenuItem.Create(Self);
mnuToolbarCommentLineDel.Hint:= 'cuda_comments,cmt_del_line';
mnuToolbarCommentLineDel.OnClick:= @MenuitemClick_CommandFromHint;
mnuToolbarCommentLineToggle:= TMenuItem.Create(Self);
mnuToolbarCommentLineToggle.Hint:= 'cuda_comments,cmt_toggle_line_body';
mnuToolbarCommentLineToggle.OnClick:= @MenuitemClick_CommandFromHint;
mnuToolbarCommentStream:= TMenuItem.Create(Self);
mnuToolbarCommentStream.Hint:= 'cuda_comments,cmt_toggle_stream';
mnuToolbarCommentStream.OnClick:= @MenuitemClick_CommandFromHint;
PopupToolbarComment.Items.Add(mnuToolbarCommentLineToggle);
PopupToolbarComment.Items.Add(mnuToolbarCommentLineAdd);
PopupToolbarComment.Items.Add(mnuToolbarCommentLineDel);
PopupToolbarComment.Items.Add(mnuToolbarCommentStream);
end;
mnuToolbarCommentLineAdd.Caption:= msgCommentLineAdd;
mnuToolbarCommentLineDel.Caption:= msgCommentLineDel;
mnuToolbarCommentLineToggle.Caption:= msgCommentLineToggle;
mnuToolbarCommentStream.Caption:= msgCommentStreamToggle;
end;
procedure TfmMain.PopupToolbarSortOnPopup(Sender: TObject);
begin
if not PythonOK then exit;
if mnuToolbarSortDialog=nil then
begin
mnuToolbarSortAsc:= TMenuItem.Create(Self);
mnuToolbarSortAsc.Hint:= 'cuda_sort,sort_asc';
mnuToolbarSortAsc.OnClick:= @MenuitemClick_CommandFromHint;
mnuToolbarSortDesc:= TMenuItem.Create(Self);
mnuToolbarSortDesc.Hint:= 'cuda_sort,sort_desc';
mnuToolbarSortDesc.OnClick:= @MenuitemClick_CommandFromHint;
mnuToolbarSortAscNocase:= TMenuItem.Create(Self);
mnuToolbarSortAscNocase.Hint:= 'cuda_sort,sort_asc_nocase';
mnuToolbarSortAscNocase.OnClick:= @MenuitemClick_CommandFromHint;
mnuToolbarSortDescNocase:= TMenuItem.Create(Self);
mnuToolbarSortDescNocase.Hint:= 'cuda_sort,sort_desc_nocase';
mnuToolbarSortDescNocase.OnClick:= @MenuitemClick_CommandFromHint;
mnuToolbarSortSep1:= TMenuItem.Create(Self);
mnuToolbarSortSep1.Caption:= '-';
mnuToolbarSortDialog:= TMenuItem.Create(Self);
mnuToolbarSortDialog.Hint:= 'cuda_sort,sort_dlg';
mnuToolbarSortDialog.OnClick:= @MenuitemClick_CommandFromHint;
mnuToolbarSortSep2:= TMenuItem.Create(Self);
mnuToolbarSortSep2.Caption:= '-';
mnuToolbarSortReverse:= TMenuItem.Create(Self);
mnuToolbarSortReverse.Hint:= 'cuda_sort,reverse';
mnuToolbarSortReverse.OnClick:= @MenuitemClick_CommandFromHint;
mnuToolbarSortShuffle:= TMenuItem.Create(Self);
mnuToolbarSortShuffle.Hint:= 'cuda_sort,shuffle';
mnuToolbarSortShuffle.OnClick:= @MenuitemClick_CommandFromHint;
mnuToolbarSortRemoveDup:= TMenuItem.Create(Self);
mnuToolbarSortRemoveDup.Hint:= 'cuda_sort,del_dup';
mnuToolbarSortRemoveDup.OnClick:= @MenuitemClick_CommandFromHint;
mnuToolbarSortRemoveBlank:= TMenuItem.Create(Self);
mnuToolbarSortRemoveBlank.Hint:= 'cuda_sort,del_blank';
mnuToolbarSortRemoveBlank.OnClick:= @MenuitemClick_CommandFromHint;
PopupToolbarSort.Items.Add(mnuToolbarSortAsc);
PopupToolbarSort.Items.Add(mnuToolbarSortDesc);
PopupToolbarSort.Items.Add(mnuToolbarSortAscNocase);
PopupToolbarSort.Items.Add(mnuToolbarSortDescNocase);
PopupToolbarSort.Items.Add(mnuToolbarSortSep1);
PopupToolbarSort.Items.Add(mnuToolbarSortDialog);
PopupToolbarSort.Items.Add(mnuToolbarSortSep2);
PopupToolbarSort.Items.Add(mnuToolbarSortReverse);
PopupToolbarSort.Items.Add(mnuToolbarSortShuffle);
PopupToolbarSort.Items.Add(mnuToolbarSortRemoveDup);
PopupToolbarSort.Items.Add(mnuToolbarSortRemoveBlank);
end;
mnuToolbarSortAsc.Caption:= msgSortAsc;
mnuToolbarSortDesc.Caption:= msgSortDesc;
mnuToolbarSortAscNocase.Caption:= msgSortAscNocase;
mnuToolbarSortDescNocase.Caption:= msgSortDescNocase;
mnuToolbarSortDialog.Caption:= msgSortDialog;
mnuToolbarSortReverse.Caption:= msgSortReverse;
mnuToolbarSortShuffle.Caption:= msgSortShuffle;
mnuToolbarSortRemoveDup.Caption:= msgSortRemoveDup;
mnuToolbarSortRemoveBlank.Caption:= msgSortRemoveBlank;
end;
procedure TfmMain.ListboxOutKeyDown(Sender: TObject; var Key: Word; procedure TfmMain.ListboxOutKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState); Shift: TShiftState);
var var
Prop: ^TAppPanelProps; Prop: ^TAppPanelProps;
List: TATListbox; List: TATListbox;
begin begin
//Esc //Esc
if (Key=VK_ESCAPE) then if (Key=VK_ESCAPE) then
begin begin
CurrentFrame.SetFocus; CurrentFrame.SetFocus;
skipping to change at line 5880 skipping to change at line 5984
Num:= StrToIntDef(AMenuCmd, 0); //command code Num:= StrToIntDef(AMenuCmd, 0); //command code
if Num>0 then if Num>0 then
begin begin
UpdateMenuItemHotkey(mi, Num); UpdateMenuItemHotkey(mi, Num);
UpdateMenuItemAltObject(mi, Num); UpdateMenuItemAltObject(mi, Num);
end end
else else
if AMenuCmd='_recents' then if AMenuCmd='_recents' then
begin begin
mnuFileOpenSub:= mi; mnuFileOpenSub:= mi;
UpdateMenuRecent(nil, '');
end end
else else
if AMenuCmd='_plugins' then if AMenuCmd='_plugins' then
begin begin
mnuPlugins:= mi; mnuPlugins:= mi;
TAppMenuProps(mi.Tag).CommandString:= 'plugins'; TAppMenuProps(mi.Tag).CommandString:= 'plugins';
UpdateMenuPlugins; UpdateMenuPlugins;
end end
else else
if AMenuCmd='_oplugins' then if AMenuCmd='_oplugins' then
begin begin
mnuOpPlugins:= mi; mnuOpPlugins:= mi;
UpdateMenuPlugins; UpdateMenuPlugins;
end end
else else
if AMenuCmd='_enc' then
begin
mnuFileEnc:= mi;
UpdateMenuEnc(mi);
end
else
begin begin
TAppMenuProps(mi.Tag).CommandCode:= -1; TAppMenuProps(mi.Tag).CommandCode:= -1;
TAppMenuProps(mi.Tag).CommandString:= AMenuCmd; TAppMenuProps(mi.Tag).CommandString:= AMenuCmd;
if (AMenuCmd<>'0') and (AMenuCmd<>'') then if (AMenuCmd<>'0') and (AMenuCmd<>'') then
mi.OnClick:= @MenuMainClick; mi.OnClick:= @MenuMainClick;
end; end;
if AMenuHotkey<>'' then if AMenuHotkey<>'' then
mi.ShortCut:= TextToShortCut(AMenuHotkey); mi.ShortCut:= TextToShortCut(AMenuHotkey);
if AIndex>=0 then if AIndex>=0 then
miMain.Insert(AIndex, mi) miMain.Insert(AIndex, mi)
else else
miMain.Add(mi); miMain.Add(mi);
if Assigned(mnuFileOpenSub) and Assigned(mnuFileOpenSub.Parent) then
mnuFileOpenSub.Parent.OnClick:= @MenuRecentsPopup;
Result:= IntToStr(PtrInt(mi)); Result:= IntToStr(PtrInt(mi));
end; end;
end; end;
procedure TfmMain.DoMenu_Remove(const AMenuId: string); procedure TfmMain.DoMenu_Remove(const AMenuId: string);
var var
mi: TMenuItem; mi: TMenuItem;
begin begin
mi:= Py_MenuItemFromId(AMenuId); mi:= Py_MenuItemFromId(AMenuId);
mi.Free; mi.Free;
skipping to change at line 5976 skipping to change at line 6076
end; end;
procedure TfmMain.MsgLogDebug(const AText: string); procedure TfmMain.MsgLogDebug(const AText: string);
begin begin
if UiOps.LogDebug then if UiOps.LogDebug then
MsgLogToFilename(AText, FFileNameLogDebug, true); MsgLogToFilename(AText, FFileNameLogDebug, true);
end; end;
procedure TfmMain.MsgLogConsole(const AText: string); procedure TfmMain.MsgLogConsole(const AText: string);
begin begin
if UiOps.LogConsole then FConsoleQueue.Push(AText);
MsgLogToFilename(AText, FFileNameLogConsole, false);
fmConsole.DoAddLine(AText);
fmConsole.DoUpdate;
end; end;
procedure TfmMain.MsgLogToFilename(const AText, AFilename: string; AWithTime: bo olean); procedure TfmMain.MsgLogToFilename(const AText, AFilename: string; AWithTime: bo olean);
var var
f: TextFile; f: TextFile;
S: string; S: string;
begin begin
AssignFile(f, AFileName); AssignFile(f, AFileName);
{$I-} {$I-}
Append(f); Append(f);
 End of changes. 109 change blocks. 
318 lines changed or deleted 419 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)