浏览代码

Components panel on Preferences dialog

Source commit: f4170f5925db73e2ed91960c686bda1dd3ff1c95
Martin Prikryl 9 年之前
父节点
当前提交
6609bd32d5
共有 4 个文件被更改,包括 27 次插入5 次删除
  1. 2 0
      source/forms/Preferences.cpp
  2. 14 3
      source/forms/Preferences.dfm
  3. 1 0
      source/forms/Preferences.h
  4. 10 2
      source/windows/GUITools.cpp

+ 2 - 0
source/forms/Preferences.cpp

@@ -114,6 +114,8 @@ __fastcall TPreferencesDialog::TPreferencesDialog(
   LoadDialogImage(ExplorerInterfacePicture, L"Explorer");
   LoadDialogImage(ExplorerInterfacePicture, L"Explorer");
 
 
   LinkLabel(UpdatesLink);
   LinkLabel(UpdatesLink);
+
+  HideComponentsPanel(this);
 }
 }
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
 __fastcall TPreferencesDialog::~TPreferencesDialog()
 __fastcall TPreferencesDialog::~TPreferencesDialog()

+ 14 - 3
source/forms/Preferences.dfm

@@ -6,7 +6,7 @@ object PreferencesDialog: TPreferencesDialog
   BorderIcons = [biSystemMenu, biMinimize, biMaximize, biHelp]
   BorderIcons = [biSystemMenu, biMinimize, biMaximize, biHelp]
   BorderStyle = bsDialog
   BorderStyle = bsDialog
   Caption = 'Preferences'
   Caption = 'Preferences'
-  ClientHeight = 439
+  ClientHeight = 489
   ClientWidth = 545
   ClientWidth = 545
   Color = clBtnFace
   Color = clBtnFace
   ParentFont = True
   ParentFont = True
@@ -16,7 +16,7 @@ object PreferencesDialog: TPreferencesDialog
   OnShow = FormShow
   OnShow = FormShow
   DesignSize = (
   DesignSize = (
     545
     545
-    439)
+    489)
   PixelsPerInch = 96
   PixelsPerInch = 96
   TextHeight = 13
   TextHeight = 13
   object OKButton: TButton
   object OKButton: TButton
@@ -3068,9 +3068,20 @@ object PreferencesDialog: TPreferencesDialog
     TabOrder = 3
     TabOrder = 3
     OnClick = HelpButtonClick
     OnClick = HelpButtonClick
   end
   end
+  object ComponentsPanel: TPanel
+    Left = 0
+    Top = 439
+    Width = 545
+    Height = 50
+    Align = alBottom
+    BevelOuter = bvNone
+    Color = clWindow
+    ParentBackground = False
+    TabOrder = 4
+  end
   object RegisterAsUrlHandlerMenu: TPopupMenu
   object RegisterAsUrlHandlerMenu: TPopupMenu
     Left = 56
     Left = 56
-    Top = 384
+    Top = 443
     object RegisterAsUrlHandlerItem: TMenuItem
     object RegisterAsUrlHandlerItem: TMenuItem
       Caption = 'Register'
       Caption = 'Register'
       OnClick = RegisterAsUrlHandlerItemClick
       OnClick = RegisterAsUrlHandlerItemClick

+ 1 - 0
source/forms/Preferences.h

@@ -308,6 +308,7 @@ __published:
   TEdit *UpdatesAuthenticationEmailEdit;
   TEdit *UpdatesAuthenticationEmailEdit;
   TStaticText *UpdatesLink;
   TStaticText *UpdatesLink;
   TCheckBox *ShowTipsCheck;
   TCheckBox *ShowTipsCheck;
+  TPanel *ComponentsPanel;
   void __fastcall FormShow(TObject *Sender);
   void __fastcall FormShow(TObject *Sender);
   void __fastcall ControlChange(TObject *Sender);
   void __fastcall ControlChange(TObject *Sender);
   void __fastcall EditorFontButtonClick(TObject *Sender);
   void __fastcall EditorFontButtonClick(TObject *Sender);

+ 10 - 2
source/windows/GUITools.cpp

@@ -700,18 +700,26 @@ void __fastcall HideComponentsPanel(TForm * Form)
   Panel->Visible = false;
   Panel->Visible = false;
   Form->Height -= Offset;
   Form->Height -= Offset;
 
 
-  // Shift back bottom-anchored controls
-  // (needed for toolbar panel on Progress window)
   for (int Index = 0; Index < Form->ControlCount; Index++)
   for (int Index = 0; Index < Form->ControlCount; Index++)
   {
   {
     TControl * Control = Form->Controls[Index];
     TControl * Control = Form->Controls[Index];
 
 
+    // Shift back bottom-anchored controls
+    // (needed for toolbar panel on Progress window and butons on Preferences dialog),
     if ((Control->Align == alNone) &&
     if ((Control->Align == alNone) &&
         Control->Anchors.Contains(akBottom) &&
         Control->Anchors.Contains(akBottom) &&
         !Control->Anchors.Contains(akTop))
         !Control->Anchors.Contains(akTop))
     {
     {
       Control->Top += Offset;
       Control->Top += Offset;
     }
     }
+
+    // Resize back all-anchored controls
+    // (needed for main panel on Preferences dialog),
+    if (Control->Anchors.Contains(akBottom) &&
+        Control->Anchors.Contains(akTop))
+    {
+      Control->Height += Offset;
+    }
   }
   }
 }
 }
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------