فهرست منبع

UpdatePanelClosePaintBox -> UpdatePanelCloseBitBtn, with F6 support.

Martijn Laan 1 ماه پیش
والد
کامیت
667c35e3fc
4فایلهای تغییر یافته به همراه29 افزوده شده و 22 حذف شده
  1. 1 0
      Projects/Compil32.dpr
  2. 1 0
      Projects/Compil32.dproj
  3. 13 11
      Projects/Src/IDE.MainForm.dfm
  4. 14 11
      Projects/Src/IDE.MainForm.pas

+ 1 - 0
Projects/Compil32.dpr

@@ -47,6 +47,7 @@ uses
   NewStaticText in '..\Components\NewStaticText.pas',
   NewStaticText in '..\Components\NewStaticText.pas',
   BidiUtils in '..\Components\BidiUtils.pas',
   BidiUtils in '..\Components\BidiUtils.pas',
   DropListBox in '..\Components\DropListBox.pas',
   DropListBox in '..\Components\DropListBox.pas',
+  NewBitBtn in '..\Components\NewBitBtn.pas',
   NewCheckListBox in '..\Components\NewCheckListBox.pas',
   NewCheckListBox in '..\Components\NewCheckListBox.pas',
   NewNotebook in '..\Components\NewNotebook.pas',
   NewNotebook in '..\Components\NewNotebook.pas',
   TaskbarProgressFunc in '..\Components\TaskbarProgressFunc.pas',
   TaskbarProgressFunc in '..\Components\TaskbarProgressFunc.pas',

+ 1 - 0
Projects/Compil32.dproj

@@ -127,6 +127,7 @@
         <DCCReference Include="..\Components\NewStaticText.pas"/>
         <DCCReference Include="..\Components\NewStaticText.pas"/>
         <DCCReference Include="..\Components\BidiUtils.pas"/>
         <DCCReference Include="..\Components\BidiUtils.pas"/>
         <DCCReference Include="..\Components\DropListBox.pas"/>
         <DCCReference Include="..\Components\DropListBox.pas"/>
+        <DCCReference Include="..\Components\NewBitBtn.pas"/>
         <DCCReference Include="..\Components\NewCheckListBox.pas"/>
         <DCCReference Include="..\Components\NewCheckListBox.pas"/>
         <DCCReference Include="..\Components\NewNotebook.pas"/>
         <DCCReference Include="..\Components\NewNotebook.pas"/>
         <DCCReference Include="..\Components\TaskbarProgressFunc.pas"/>
         <DCCReference Include="..\Components\TaskbarProgressFunc.pas"/>

+ 13 - 11
Projects/Src/IDE.MainForm.dfm

@@ -373,22 +373,24 @@ object MainForm: TMainForm
     TabOrder = 1
     TabOrder = 1
     Visible = False
     Visible = False
     StyleName = 'Windows'
     StyleName = 'Windows'
-    object UpdatePanelClosePaintBox: TPaintBox
+    object UpdatePanelCloseBitBtn: TNewBitBtn
       AlignWithMargins = True
       AlignWithMargins = True
-      Left = 330
-      Top = 10
-      Width = 21
-      Height = 21
-      Margins.Top = 10
-      Margins.Right = 10
-      Margins.Bottom = 10
+      Left = 328
+      Top = 8
+      Width = 25
+      Height = 25
+      Margins.Top = 8
+      Margins.Right = 8
+      Margins.Bottom = 8
       Align = alRight
       Align = alRight
-      OnClick = UpdatePanelClosePaintBoxClick
-      OnPaint = UpdatePanelClosePaintBoxPaint
+      Caption = 'Close Banner'
+      TabOrder = 1
+      OnClick = UpdatePanelCloseBitBtnClick
+      OnPaint = UpdatePanelCloseBitBtnPaint
     end
     end
     object UpdatePanelDonateImage: TImage
     object UpdatePanelDonateImage: TImage
       AlignWithMargins = True
       AlignWithMargins = True
-      Left = 303
+      Left = 301
       Top = 10
       Top = 10
       Width = 21
       Width = 21
       Height = 21
       Height = 21

+ 14 - 11
Projects/Src/IDE.MainForm.pas

@@ -26,7 +26,7 @@ uses
   Generics.Collections, UIStateForm, StdCtrls, ExtCtrls, Menus, Buttons, ComCtrls, CommCtrl,
   Generics.Collections, UIStateForm, StdCtrls, ExtCtrls, Menus, Buttons, ComCtrls, CommCtrl,
   ScintInt, ScintEdit, IDE.ScintStylerInnoSetup, NewTabSet, ModernColors, IDE.IDEScintEdit,
   ScintInt, ScintEdit, IDE.ScintStylerInnoSetup, NewTabSet, ModernColors, IDE.IDEScintEdit,
   Shared.DebugStruct, Shared.CompilerInt.Struct, NewUxTheme, ImageList, ImgList, ToolWin, IDE.HelperFunc,
   Shared.DebugStruct, Shared.CompilerInt.Struct, NewUxTheme, ImageList, ImgList, ToolWin, IDE.HelperFunc,
-  VirtualImageList, BaseImageCollection;
+  VirtualImageList, BaseImageCollection, NewBitBtn;
 
 
 const
 const
   WM_StartCommandLineCompile = WM_USER + $1000;
   WM_StartCommandLineCompile = WM_USER + $1000;
@@ -263,7 +263,7 @@ type
     EFindRegEx: TMenuItem;
     EFindRegEx: TMenuItem;
     UpdatePanel: TPanel;
     UpdatePanel: TPanel;
     UpdateLinkLabel: TLinkLabel;
     UpdateLinkLabel: TLinkLabel;
-    UpdatePanelClosePaintBox: TPaintBox;
+    UpdatePanelCloseBitBtn: TNewBitBtn;
     UpdatePanelDonateImage: TImage;
     UpdatePanelDonateImage: TImage;
     procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
     procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
     procedure FExitClick(Sender: TObject);
     procedure FExitClick(Sender: TObject);
@@ -389,8 +389,8 @@ type
     procedure EFindRegExClick(Sender: TObject);
     procedure EFindRegExClick(Sender: TObject);
     procedure UpdateLinkLabelLinkClick(Sender: TObject; const Link: string;
     procedure UpdateLinkLabelLinkClick(Sender: TObject; const Link: string;
       LinkType: TSysLinkType);
       LinkType: TSysLinkType);
-    procedure UpdatePanelClosePaintBoxPaint(Sender: TObject);
-    procedure UpdatePanelClosePaintBoxClick(Sender: TObject);
+    procedure UpdatePanelCloseBitBtnPaint(Sender: TObject; Canvas: TCanvas; var ARect: TRect);
+    procedure UpdatePanelCloseBitBtnClick(Sender: TObject);
     procedure UpdatePanelDonateImageClick(Sender: TObject);
     procedure UpdatePanelDonateImageClick(Sender: TObject);
   private
   private
     { Private declarations }
     { Private declarations }
@@ -1028,6 +1028,7 @@ begin
   FHiddenFiles := TStringList.Create(dupError, True, True);
   FHiddenFiles := TStringList.Create(dupError, True, True);
   FActiveMemo := FMainMemo;
   FActiveMemo := FMainMemo;
   FActiveMemo.Visible := True;
   FActiveMemo.Visible := True;
+  ActiveControl := FActiveMemo;
   FErrorMemo := FMainMemo;
   FErrorMemo := FMainMemo;
   FStepMemo := FMainMemo;
   FStepMemo := FMainMemo;
   UpdateMarginsAndSquigglyAndCaretWidths;
   UpdateMarginsAndSquigglyAndCaretWidths;
@@ -1321,8 +1322,11 @@ begin
       if ControlToAdd <> nil then
       if ControlToAdd <> nil then
         AddControlToArray(ControlToAdd, Controls, NControls);
         AddControlToArray(ControlToAdd, Controls, NControls);
     end;
     end;
-    if UpdatePanel.Visible and FUpdatePanelMessages[UpdateLinkLabel.Tag].HasLink then
-      AddControlToArray(UpdateLinkLabel, Controls, NControls);
+    if UpdatePanel.Visible then begin
+      if FUpdatePanelMessages[UpdateLinkLabel.Tag].HasLink then
+        AddControlToArray(UpdateLinkLabel, Controls, NControls);
+      AddControlToArray(UpdatePanelCloseBitBtn, Controls, NControls);
+    end;
 
 
     { Now move focus to next }
     { Now move focus to next }
     if NControls > 1 then begin
     if NControls > 1 then begin
@@ -8021,10 +8025,10 @@ begin
   end else
   end else
     Handled := False;
     Handled := False;
   if Handled then
   if Handled then
-    UpdatePanelClosePaintBoxClick(Sender);
+    UpdatePanelCloseBitBtnClick(Sender);
 end;
 end;
 
 
-procedure TMainForm.UpdatePanelClosePaintBoxClick(Sender: TObject);
+procedure TMainForm.UpdatePanelCloseBitBtnClick(Sender: TObject);
 begin
 begin
   var MessageToHideIndex := UpdateLinkLabel.Tag;
   var MessageToHideIndex := UpdateLinkLabel.Tag;
   var Ini := TConfigIniFile.Create;
   var Ini := TConfigIniFile.Create;
@@ -8042,13 +8046,12 @@ begin
   HDonate.Click;
   HDonate.Click;
 end;
 end;
 
 
-procedure TMainForm.UpdatePanelClosePaintBoxPaint(Sender: TObject);
+procedure TMainForm.UpdatePanelCloseBitBtnPaint(Sender: TObject; Canvas: TCanvas; var ARect: TRect);
 const
 const
   MENU_SYSTEMCLOSE = 17;
   MENU_SYSTEMCLOSE = 17;
   MSYSC_NORMAL = 1;
   MSYSC_NORMAL = 1;
 begin
 begin
-  var Canvas := UpdatePanelClosePaintBox.Canvas;
-  var R := TRect.Create(0, 0, UpdatePanelClosePaintBox.Width, UpdatePanelClosePaintBox.Height);
+  var R := ARect;
   if FMenuThemeData <> 0 then begin
   if FMenuThemeData <> 0 then begin
     var Offset := MulDiv(1, CurrentPPI, 96);
     var Offset := MulDiv(1, CurrentPPI, 96);
     Inc(R.Left, Offset);
     Inc(R.Left, Offset);