"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "app/formmain_updates_proc.inc" 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_updates_proc.inc  (CudaText-1.92.0):formmain_updates_proc.inc  (CudaText-1.93.0)
skipping to change at line 72 skipping to change at line 72
begin begin
Btn.Checked:= AChecked; Btn.Checked:= AChecked;
Btn.Enabled:= AEnabled; Btn.Enabled:= AEnabled;
exit exit
end; end;
end; end;
end; end;
procedure TfmMain.UpdateStatus; procedure TfmMain.UpdateStatus;
begin begin
TimerStatusBusy.Enabled:= false; TimerStatusWork.Enabled:= false;
TimerStatusBusy.Enabled:= true; TimerStatusWork.Enabled:= true;
end; end;
procedure TfmMain.UpdateStatus_RealWork; procedure TfmMain.UpdateStatus_RealWork;
var var
F: TEditorFrame; F: TEditorFrame;
Ed: TATSynEdit; Ed: TATSynEdit;
begin begin
F:= CurrentFrame; F:= CurrentFrame;
if F=nil then exit; if F=nil then exit;
Ed:= F.Editor; Ed:= F.Editor;
skipping to change at line 142 skipping to change at line 142
begin begin
S:= cEncConvNames[F.Binary.TextEncoding]; S:= cEncConvNames[F.Binary.TextEncoding];
end end
else else
S:= ''; S:= '';
DoStatusbarTextByTag(AStatus, StatusbarTag_Enc, S); DoStatusbarTextByTag(AStatus, StatusbarTag_Enc, S);
DoStatusbarTextByTag(AStatus, StatusbarTag_LineEnds, ''); DoStatusbarTextByTag(AStatus, StatusbarTag_LineEnds, '');
if F.IsBinary then if F.IsBinary then
S:= ViewerModeString(F.Binary) S:= msgViewer+': '+msgViewerModes[F.Binary.Mode]
else else
if F.IsPicture then if F.IsPicture then
begin begin
Size:= F.PictureSizes; Size:= F.PictureSizes;
S:= Format(msgStatusPictureNxN, [Size.X, Size.Y]); S:= Format(msgStatusPictureNxN, [Size.X, Size.Y]);
end; end;
DoStatusbarTextByTag(AStatus, StatusbarTag_Lexer, S); DoStatusbarTextByTag(AStatus, StatusbarTag_Lexer, S);
if F.IsBinary then if F.IsBinary then
S:= '' S:= ''
skipping to change at line 435 skipping to change at line 435
ATFlatTheme.ScaleFontPercents:= UiOps.ScaleFont; ATFlatTheme.ScaleFontPercents:= UiOps.ScaleFont;
if Assigned(fmFind) then fmFind.UpdateFonts; if Assigned(fmFind) then fmFind.UpdateFonts;
end; end;
procedure TfmMain.DoApplyFont_Output; procedure TfmMain.DoApplyFont_Output;
begin begin
//empty now //empty now
end; end;
procedure TfmMain.UpdateMenuRecent(F: TEditorFrame; const AFileName: string); procedure TfmMain.UpdateMenuRecents(sub: TMenuItem);
var var
sub: TMenuItem;
mi: TMenuItem; mi: TMenuItem;
i: integer;
SName: string; SName: string;
i: integer;
begin begin
if F=nil then
SAddStringToHistory('', FListRecents, UiOps.MaxHistoryMenu)
else
begin
if not F.IsText then exit;
if AFileName='' then exit;
if F.NotInRecents then exit;
SAddStringToHistory(
SCollapseHomeDirInFilename(AFileName),
FListRecents,
UiOps.MaxHistoryMenu);
F.DoSaveHistory(F.Ed1);
if not F.EditorsLinked then
F.DoSaveHistory(F.Ed2);
end;
sub:= mnuFileOpenSub;
if sub=nil then exit; if sub=nil then exit;
sub.Clear; sub.Clear;
for i:= 0 to FListRecents.Count-1 do for i:= 0 to FListRecents.Count-1 do
begin; begin;
mi:= TMenuItem.Create(Self); mi:= TMenuItem.Create(Self);
SName:= IntToStr(i+1)+'. '+ SName:= IntToStr(i+1)+'. '+
ExtractFileName(FListRecents[i])+' ('+ ExtractFileName(FListRecents[i])+' ('+
ExtractFileDir(FListRecents[i])+')'; ExtractFileDir(FListRecents[i])+')';
mi.Caption:= StringReplace(SName, '&', '&&', [rfReplaceAll]); mi.Caption:= StringReplace(SName, '&', '&&', [rfReplaceAll]);
mi.Tag:= i; mi.Tag:= i;
mi.OnClick:= @MenuRecentsClick; mi.OnClick:= @MenuRecentItemClick;
sub.Add(mi); sub.Add(mi);
end; end;
mi:= TMenuItem.Create(Self); mi:= TMenuItem.Create(Self);
mi.Caption:= '-'; mi.Caption:= '-';
sub.Add(mi); sub.Add(mi);
mi:= TMenuItem.Create(Self); mi:= TMenuItem.Create(Self);
mi.Caption:= msgFileClearList; mi.Caption:= msgFileClearList;
mi.OnClick:= @MenuRecentsClear; mi.OnClick:= @MenuRecentsClear;
sub.Add(mi); sub.Add(mi);
end;
//---------- procedure TfmMain.UpdateMenuRecent(F: TEditorFrame; const AFileName: string);
PopupRecents.Items.Clear; begin
for i:= 0 to sub.Count-1 do if F=nil then
SAddStringToHistory('', FListRecents, UiOps.MaxHistoryMenu)
else
begin begin
mi:= TMenuItem.Create(Self); if not F.IsText then exit;
mi.Caption:= sub.Items[i].Caption; if AFileName='' then exit;
mi.Tag:= sub.Items[i].Tag; if F.NotInRecents then exit;
mi.OnClick:= sub.Items[i].OnClick; SAddStringToHistory(
PopupRecents.Items.Add(mi); SCollapseHomeDirInFilename(AFileName),
FListRecents,
UiOps.MaxHistoryMenu);
F.DoSaveHistory(F.Ed1);
if not F.EditorsLinked then
F.DoSaveHistory(F.Ed2);
end; end;
end; end;
procedure TfmMain.PopupRecentsPopup(Sender: TObject);
begin
UpdateMenuRecents(PopupRecents.Items);
end;
procedure TfmMain.MenuRecentsPopup(Sender: TObject);
begin
UpdateMenuRecents(mnuFileOpenSub);
end;
procedure TfmMain.DoApplyAllOps; procedure TfmMain.DoApplyAllOps;
var var
F: TEditorFrame; F: TEditorFrame;
i: integer; i: integer;
begin begin
DoApplyFont_Text; DoApplyFont_Text;
DoApplyFont_Ui; DoApplyFont_Ui;
DoApplyFont_Output; DoApplyFont_Output;
DoApplyUiOps; DoApplyUiOps;
skipping to change at line 633 skipping to change at line 633
cmd_Groups4vert : DoSave(mi, mnuGr4V_Alt); cmd_Groups4vert : DoSave(mi, mnuGr4V_Alt);
cmd_Groups4grid : DoSave(mi, mnuGr4G_Alt); cmd_Groups4grid : DoSave(mi, mnuGr4G_Alt);
cmd_Groups6horz : DoSave(mi, mnuGr6H_Alt); cmd_Groups6horz : DoSave(mi, mnuGr6H_Alt);
cmd_Groups6vert : DoSave(mi, mnuGr6V_Alt); cmd_Groups6vert : DoSave(mi, mnuGr6V_Alt);
cmd_Groups6grid : DoSave(mi, mnuGr6_Alt); cmd_Groups6grid : DoSave(mi, mnuGr6_Alt);
end; end;
end; end;
procedure TfmMain.UpdateMenuHotkeys; procedure TfmMain.UpdateMenuHotkeys;
begin begin
UpdateMenuItemHotkey(mnuTabsizeConvSpaces, cmd_ConvertSpacesToTabsLeading);
UpdateMenuItemHotkey(mnuTabsizeConvTabs, cmd_ConvertTabsToSpacesLeading);
UpdateMenuItemHotkey(mnuApple_About, cmd_HelpAbout); UpdateMenuItemHotkey(mnuApple_About, cmd_HelpAbout);
UpdateMenuItemHotkey(mnuApple_CheckUpd, cmd_HelpCheckUpdates); UpdateMenuItemHotkey(mnuApple_CheckUpd, cmd_HelpCheckUpdates);
UpdateMenuItemHotkey(mnuFileEnc, cmd_MenuEnc);
UpdateMenuItemHotkey(mnuFileEndWin, cmd_LineEndWin); UpdateMenuItemHotkey(mnuFileEndWin, cmd_LineEndWin);
UpdateMenuItemHotkey(mnuFileEndUn, cmd_LineEndUnix); UpdateMenuItemHotkey(mnuFileEndUn, cmd_LineEndUnix);
UpdateMenuItemHotkey(mnuFileEndMac, cmd_LineEndMac); UpdateMenuItemHotkey(mnuFileEndMac, cmd_LineEndMac);
UpdateMenuItemHotkey(mnuEndsWin, cmd_LineEndWin);
UpdateMenuItemHotkey(mnuEndsUnix, cmd_LineEndUnix);
UpdateMenuItemHotkey(mnuEndsMac, cmd_LineEndMac);
UpdateMenuItemHotkey(mnuFileNew, cmd_FileNew); UpdateMenuItemHotkey(mnuFileNew, cmd_FileNew);
UpdateMenuItemHotkey(mnuFileNewMenu, cmd_FileNewMenu); UpdateMenuItemHotkey(mnuFileNewMenu, cmd_FileNewMenu);
UpdateMenuItemHotkey(mnuFileOpen, cmd_FileOpen); UpdateMenuItemHotkey(mnuFileOpen, cmd_FileOpen);
UpdateMenuItemHotkey(mnuFileOpenDir, cmd_FileOpenFolder); UpdateMenuItemHotkey(mnuFileOpenDir, cmd_FileOpenFolder);
UpdateMenuItemHotkey(mnuFileReopen, cmd_FileReopen); UpdateMenuItemHotkey(mnuFileReopen, cmd_FileReopen);
UpdateMenuItemHotkey(mnuFileSave, cmd_FileSave); UpdateMenuItemHotkey(mnuFileSave, cmd_FileSave);
UpdateMenuItemHotkey(mnuFileSaveAs, cmd_FileSaveAs); UpdateMenuItemHotkey(mnuFileSaveAs, cmd_FileSaveAs);
UpdateMenuItemHotkey(mnuFileSaveAll, cmd_FileSaveAll); UpdateMenuItemHotkey(mnuFileSaveAll, cmd_FileSaveAll);
UpdateMenuItemHotkey(mnuFileClose, cmd_FileClose); UpdateMenuItemHotkey(mnuFileClose, cmd_FileClose);
UpdateMenuItemHotkey(mnuFileCloseAll, cmd_FileCloseAll); UpdateMenuItemHotkey(mnuFileCloseAll, cmd_FileCloseAll);
skipping to change at line 1357 skipping to change at line 1351
ToolbarSideTop.AddButton(cSidebarIconTree, @DoSidebar_OnTabClick, msgPanelTree _Init, msgPanelTree_Init, '', UiOps.ShowSidebarCaptions); ToolbarSideTop.AddButton(cSidebarIconTree, @DoSidebar_OnTabClick, msgPanelTree _Init, msgPanelTree_Init, '', UiOps.ShowSidebarCaptions);
// //
ToolbarSideLow.AddButton(cSidebarIconConsole, @DoBottom_OnTabClick, msgPanelCo nsole_Init, msgPanelConsole_Init, '', UiOps.ShowSidebarCaptions); ToolbarSideLow.AddButton(cSidebarIconConsole, @DoBottom_OnTabClick, msgPanelCo nsole_Init, msgPanelConsole_Init, '', UiOps.ShowSidebarCaptions);
ToolbarSideLow.AddButton(cSidebarIconOutput, @DoBottom_OnTabClick, msgPanelOut put_Init, msgPanelOutput_Init, '', UiOps.ShowSidebarCaptions); ToolbarSideLow.AddButton(cSidebarIconOutput, @DoBottom_OnTabClick, msgPanelOut put_Init, msgPanelOutput_Init, '', UiOps.ShowSidebarCaptions);
ToolbarSideLow.AddButton(cSidebarIconValidate, @DoBottom_OnTabClick, msgPanelV alidate_Init, msgPanelValidate_Init, '', UiOps.ShowSidebarCaptions); ToolbarSideLow.AddButton(cSidebarIconValidate, @DoBottom_OnTabClick, msgPanelV alidate_Init, msgPanelValidate_Init, '', UiOps.ShowSidebarCaptions);
// //
ToolbarSideMid.AddButton(cSidebarIconFind, @DoBottom_FindClick, msgPanelSearch _Init, msgPanelSearch_Init, '', UiOps.ShowSidebarCaptions); ToolbarSideMid.AddButton(cSidebarIconFind, @DoBottom_FindClick, msgPanelSearch _Init, msgPanelSearch_Init, '', UiOps.ShowSidebarCaptions);
ToolbarSideMid.AddSep; ToolbarSideMid.AddSep;
end; end;
procedure TfmMain.UpdateMenuTabsize; procedure TfmMain.InitPopupTabSize;
var var
Ed: TATSynEdit;
Msg: string;
NTab, i: integer;
mi: TMenuItem; mi: TMenuItem;
i: integer;
begin begin
for i:= cMenuTabsizeMax downto cMenuTabsizeMin do if PopupTabSize=nil then
begin begin
PopupTabSize:= TPopupMenu.Create(Self);
mi:= TMenuItem.Create(Self); mi:= TMenuItem.Create(Self);
mi.Caption:= 'tab: '+IntToStr(i); mi.Caption:= '-';
mi.Tag:= i; PopupTabSize.Items.Add(mi);
mi.OnClick:= @MenuTabsizeClick;
FMenuItemTabSize[i]:= mi; mnuTabsizeSpace:= TMenuItem.Create(Self);
PopupTabSize.Items.Insert(0, mi); mnuTabsizeSpace.OnClick:= @mnuTabsizeSpaceClick;
PopupTabSize.Items.Add(mnuTabsizeSpace);
mi:= TMenuItem.Create(Self);
mi.Caption:= '-';
PopupTabSize.Items.Add(mi);
mnuTabsizeConvTabs:= TMenuItem.Create(Self);
PopupTabSize.Items.Add(mnuTabsizeConvTabs);
mnuTabsizeConvSpaces:= TMenuItem.Create(Self);
PopupTabSize.Items.Add(mnuTabsizeConvSpaces);
for i:= cMenuTabsizeMax downto cMenuTabsizeMin do
begin
mi:= TMenuItem.Create(Self);
mi.Caption:= IntToStr(i);
mi.Tag:= i;
mi.OnClick:= @MenuTabsizeClick;
mnuTabsizesValue[i]:= mi;
PopupTabSize.Items.Insert(0, mi);
end;
end; end;
mnuTabsizeSpace.Caption:= msgTabsizeUseSpaces;
mnuTabsizeConvSpaces.Caption:= msgTabsizeConvSpaces;
mnuTabsizeConvTabs.Caption:= msgTabsizeConvTabs;
UpdateMenuItemHotkey(mnuTabsizeConvSpaces, cmd_ConvertSpacesToTabsLeading);
UpdateMenuItemHotkey(mnuTabsizeConvTabs, cmd_ConvertTabsToSpacesLeading);
Ed:= CurrentEditor;
if Ed.OptTabSpaces then
Msg:= msgStatusbarTextSpaces
else
Msg:= msgStatusbarTextTab;
NTab:= Ed.OptTabSize;
for i:= cMenuTabsizeMin to cMenuTabsizeMax do
begin
mnuTabsizesValue[i].Caption:= Msg+': '+IntToStr(i);
mnuTabsizesValue[i].Checked:= NTab=i;
end;
mnuTabsizeSpace.Checked:= Ed.OptTabSpaces;
end; end;
procedure TfmMain.UpdateMenuPicScale; procedure TfmMain.InitPopupTree;
var
mi: TMenuItem;
begin
if PopupTree=nil then
begin
PopupTree:= TPopupMenu.Create(Self);
mnuTreeFoldAll:= TMenuItem.Create(Self);
mnuTreeFoldAll.OnClick:= @mnuTreeFoldAllClick;
PopupTree.Items.Add(mnuTreeFoldAll);
mnuTreeUnfoldAll:= TMenuItem.Create(Self);
mnuTreeUnfoldAll.OnClick:= @mnuTreeUnfoldAllClick;
PopupTree.Items.Add(mnuTreeUnfoldAll);
mnuTreeFoldLevel:= TMenuItem.Create(Self);
PopupTree.Items.Add(mnuTreeFoldLevel);
mnuTreeFold2:= TMenuItem.Create(Self);
mnuTreeFold2.Caption:= '2';
mnuTreeFold2.OnClick:= @mnuTreeFold2Click;
mnuTreeFoldLevel.Add(mnuTreeFold2);
mnuTreeFold3:= TMenuItem.Create(Self);
mnuTreeFold3.Caption:= '3';
mnuTreeFold3.OnClick:= @mnuTreeFold3Click;
mnuTreeFoldLevel.Add(mnuTreeFold3);
mnuTreeFold4:= TMenuItem.Create(Self);
mnuTreeFold4.Caption:= '4';
mnuTreeFold4.OnClick:= @mnuTreeFold4Click;
mnuTreeFoldLevel.Add(mnuTreeFold4);
mnuTreeFold5:= TMenuItem.Create(Self);
mnuTreeFold5.Caption:= '5';
mnuTreeFold5.OnClick:= @mnuTreeFold5Click;
mnuTreeFoldLevel.Add(mnuTreeFold5);
mnuTreeFold6:= TMenuItem.Create(Self);
mnuTreeFold6.Caption:= '6';
mnuTreeFold6.OnClick:= @mnuTreeFold6Click;
mnuTreeFoldLevel.Add(mnuTreeFold6);
mnuTreeFold7:= TMenuItem.Create(Self);
mnuTreeFold7.Caption:= '7';
mnuTreeFold7.OnClick:= @mnuTreeFold7Click;
mnuTreeFoldLevel.Add(mnuTreeFold7);
mnuTreeFold8:= TMenuItem.Create(Self);
mnuTreeFold8.Caption:= '8';
mnuTreeFold8.OnClick:= @mnuTreeFold8Click;
mnuTreeFoldLevel.Add(mnuTreeFold8);
mnuTreeFold9:= TMenuItem.Create(Self);
mnuTreeFold9.Caption:= '9';
mnuTreeFold9.OnClick:= @mnuTreeFold9Click;
mnuTreeFoldLevel.Add(mnuTreeFold9);
mi:= TMenuItem.Create(Self);
mi.Caption:= '-';
PopupTree.Items.Add(mi);
mnuTreeSorted:= TMenuItem.Create(Self);
mnuTreeSorted.OnClick:= @mnuTreeSortedClick;
PopupTree.Items.Add(mnuTreeSorted);
end;
mnuTreeFoldAll.Caption:= cStrMenuitemFoldAll;
mnuTreeUnfoldAll.Caption:= cStrMenuitemUnfoldAll;
mnuTreeFoldLevel.Caption:= cStrMenuitemFoldLevel;
mnuTreeSorted.Caption:= msgTreeSorted;
mnuTreeSorted.Checked:= CodeTree.Tree.SortType<>stNone;
end;
procedure TfmMain.InitPopupPicScale;
const const
cSizes: array[0..8] of integer = cSizes: array[0..8] of integer =
(-1, 33, 50, 100, 150, 200, 500, 1000, 1500); (-1, 33, 50, 100, 150, 200, 500, 1000, 1500);
var var
mi: TMenuItem; mi: TMenuItem;
i: integer; i: integer;
begin begin
for i:= Low(cSizes) to High(cSizes) do if PopupPicScale=nil then
begin begin
mi:= TMenuItem.Create(Self); PopupPicScale:= TPopupMenu.Create(Self);
if cSizes[i]=-1 then for i:= Low(cSizes) to High(cSizes) do
mi.Caption:= 'default' begin
else mi:= TMenuItem.Create(Self);
mi.Caption:= IntToStr(cSizes[i])+'%'; if cSizes[i]=-1 then
mi.Tag:= cSizes[i]; mi.Caption:= msgDefault
mi.OnClick:= @MenuPicScaleClick; else
PopupPicScale.Items.Add(mi); mi.Caption:= IntToStr(cSizes[i])+'%';
mi.Tag:= cSizes[i];
mi.OnClick:= @MenuPicScaleClick;
PopupPicScale.Items.Add(mi);
end;
end; end;
end; end;
 End of changes. 25 change blocks. 
57 lines changed or deleted 178 lines changed or added

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