Skip to content

Commit cc4e6f1

Browse files
committed
feat: add new keyboard shortcut editors on preferences dialog
todo: find the right event for applying a changed shortcut
1 parent 5e20c53 commit cc4e6f1

File tree

4 files changed

+439
-89
lines changed

4 files changed

+439
-89
lines changed

heidisql.lpi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,10 @@
447447
<HasResources Value="True"/>
448448
<ResourceBaseClass Value="Form"/>
449449
</Unit>
450+
<Unit>
451+
<Filename Value="source\vktable.pas"/>
452+
<IsPartOfProject Value="True"/>
453+
</Unit>
450454
</Units>
451455
</ProjectOptions>
452456
<CompilerOptions>

source/preferences.lfm

Lines changed: 164 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,35 +1619,52 @@ object frmPreferences: TfrmPreferences
16191619
ClientWidth = 870
16201620
ImageIndex = 13
16211621
object lblShortcut1: TLabel
1622-
Left = 382
1622+
AnchorSideLeft.Control = TreeShortcutItems
1623+
AnchorSideLeft.Side = asrBottom
1624+
AnchorSideTop.Control = lblShortcutHint
1625+
AnchorSideTop.Side = asrBottom
1626+
Left = 387
16231627
Height = 20
1624-
Top = 80
1628+
Top = 79
16251629
Width = 58
1630+
BorderSpacing.Around = 6
16261631
Caption = 'Shortcut:'
16271632
end
16281633
object lblShortcutHint: TLabel
1629-
Left = 382
1634+
AnchorSideLeft.Control = TreeShortcutItems
1635+
AnchorSideLeft.Side = asrBottom
1636+
AnchorSideRight.Control = tabShortcuts
1637+
AnchorSideRight.Side = asrBottom
1638+
Left = 387
16301639
Height = 69
16311640
Top = 4
1632-
Width = 467
1641+
Width = 477
16331642
Anchors = [akTop, akLeft, akRight]
16341643
AutoSize = False
1644+
BorderSpacing.Around = 6
16351645
Caption = 'Please select a shortcut item in the tree.'
16361646
WordWrap = True
16371647
end
16381648
object lblShortcut2: TLabel
1639-
Left = 382
1649+
AnchorSideLeft.Control = TreeShortcutItems
1650+
AnchorSideLeft.Side = asrBottom
1651+
AnchorSideTop.Control = comboShortcut1Key
1652+
AnchorSideTop.Side = asrBottom
1653+
Left = 387
16401654
Height = 20
1641-
Top = 135
1655+
Top = 145
16421656
Width = 129
1657+
BorderSpacing.Top = 6
1658+
BorderSpacing.Around = 6
16431659
Caption = 'Secondary shortcut:'
16441660
end
16451661
object TreeShortcutItems: TLazVirtualStringTree
1646-
Left = 0
1647-
Height = 520
1648-
Top = 0
1662+
Left = 6
1663+
Height = 508
1664+
Top = 6
16491665
Width = 375
16501666
Align = alLeft
1667+
BorderSpacing.Around = 6
16511668
Colors.BorderColor = 15987699
16521669
Colors.DisabledColor = clGray
16531670
Colors.DropMarkColor = 15385233
@@ -1679,27 +1696,157 @@ object frmPreferences: TfrmPreferences
16791696
OnInitNode = TreeShortcutItemsInitNode
16801697
end
16811698
object btnRemoveHotKey1: TSpeedButton
1682-
Left = 748
1683-
Height = 31
1684-
Top = 100
1685-
Width = 101
1699+
AnchorSideTop.Control = lblShortcut1
1700+
AnchorSideTop.Side = asrBottom
1701+
AnchorSideRight.Control = tabShortcuts
1702+
AnchorSideRight.Side = asrBottom
1703+
Left = 780
1704+
Height = 30
1705+
Top = 105
1706+
Width = 84
16861707
Anchors = [akTop, akRight]
1708+
AutoSize = True
1709+
BorderSpacing.Around = 6
16871710
Caption = 'Remove'
16881711
Images = MainForm.ImageListMain
16891712
ImageIndex = 26
16901713
OnClick = btnRemoveHotKeyClick
16911714
end
16921715
object btnRemoveHotKey2: TSpeedButton
1693-
Left = 748
1694-
Height = 31
1695-
Top = 180
1696-
Width = 101
1716+
AnchorSideTop.Control = lblShortcut2
1717+
AnchorSideTop.Side = asrBottom
1718+
AnchorSideRight.Control = tabShortcuts
1719+
AnchorSideRight.Side = asrBottom
1720+
Left = 780
1721+
Height = 30
1722+
Top = 171
1723+
Width = 84
16971724
Anchors = [akTop, akRight]
1725+
AutoSize = True
1726+
BorderSpacing.Around = 6
16981727
Caption = 'Remove'
16991728
Images = MainForm.ImageListMain
17001729
ImageIndex = 26
17011730
OnClick = btnRemoveHotKeyClick
17021731
end
1732+
object chkShortcut1Shift: TCheckBox
1733+
AnchorSideLeft.Control = TreeShortcutItems
1734+
AnchorSideLeft.Side = asrBottom
1735+
AnchorSideTop.Control = lblShortcut1
1736+
AnchorSideTop.Side = asrBottom
1737+
Left = 387
1738+
Height = 24
1739+
Top = 105
1740+
Width = 51
1741+
BorderSpacing.Around = 6
1742+
Caption = 'Shift'
1743+
TabOrder = 1
1744+
OnChange = Modified
1745+
end
1746+
object chkShortcut1Alt: TCheckBox
1747+
AnchorSideLeft.Control = chkShortcut1Shift
1748+
AnchorSideLeft.Side = asrBottom
1749+
AnchorSideTop.Control = lblShortcut1
1750+
AnchorSideTop.Side = asrBottom
1751+
Left = 444
1752+
Height = 24
1753+
Top = 105
1754+
Width = 40
1755+
BorderSpacing.Around = 6
1756+
Caption = 'Alt'
1757+
TabOrder = 2
1758+
OnChange = Modified
1759+
end
1760+
object chkShortcut1Control: TCheckBox
1761+
AnchorSideLeft.Control = chkShortcut1Alt
1762+
AnchorSideLeft.Side = asrBottom
1763+
AnchorSideTop.Control = lblShortcut1
1764+
AnchorSideTop.Side = asrBottom
1765+
Left = 490
1766+
Height = 24
1767+
Top = 105
1768+
Width = 44
1769+
BorderSpacing.Around = 6
1770+
Caption = 'Ctrl'
1771+
TabOrder = 3
1772+
OnChange = Modified
1773+
end
1774+
object comboShortcut1Key: TComboBox
1775+
AnchorSideLeft.Control = chkShortcut1Control
1776+
AnchorSideLeft.Side = asrBottom
1777+
AnchorSideTop.Control = lblShortcut1
1778+
AnchorSideTop.Side = asrBottom
1779+
AnchorSideRight.Control = btnRemoveHotKey1
1780+
Left = 540
1781+
Height = 28
1782+
Top = 105
1783+
Width = 234
1784+
Anchors = [akTop, akLeft, akRight]
1785+
BorderSpacing.Around = 6
1786+
ItemHeight = 20
1787+
Style = csDropDownList
1788+
TabOrder = 4
1789+
OnChange = Modified
1790+
end
1791+
object chkShortcut2Shift: TCheckBox
1792+
AnchorSideLeft.Control = TreeShortcutItems
1793+
AnchorSideLeft.Side = asrBottom
1794+
AnchorSideTop.Control = lblShortcut2
1795+
AnchorSideTop.Side = asrBottom
1796+
Left = 387
1797+
Height = 24
1798+
Top = 171
1799+
Width = 51
1800+
BorderSpacing.Around = 6
1801+
Caption = 'Shift'
1802+
TabOrder = 5
1803+
OnChange = Modified
1804+
end
1805+
object chkShortcut2Alt: TCheckBox
1806+
AnchorSideLeft.Control = chkShortcut2Shift
1807+
AnchorSideLeft.Side = asrBottom
1808+
AnchorSideTop.Control = lblShortcut2
1809+
AnchorSideTop.Side = asrBottom
1810+
Left = 444
1811+
Height = 24
1812+
Top = 171
1813+
Width = 40
1814+
BorderSpacing.Around = 6
1815+
Caption = 'Alt'
1816+
TabOrder = 6
1817+
OnChange = Modified
1818+
end
1819+
object chkShortcut2Control: TCheckBox
1820+
AnchorSideLeft.Control = chkShortcut2Alt
1821+
AnchorSideLeft.Side = asrBottom
1822+
AnchorSideTop.Control = lblShortcut2
1823+
AnchorSideTop.Side = asrBottom
1824+
Left = 490
1825+
Height = 24
1826+
Top = 171
1827+
Width = 44
1828+
BorderSpacing.Around = 6
1829+
Caption = 'Ctrl'
1830+
TabOrder = 7
1831+
OnChange = Modified
1832+
end
1833+
object comboShortcut2Key: TComboBox
1834+
AnchorSideLeft.Control = chkShortcut2Control
1835+
AnchorSideLeft.Side = asrBottom
1836+
AnchorSideTop.Control = lblShortcut2
1837+
AnchorSideTop.Side = asrBottom
1838+
AnchorSideRight.Control = btnRemoveHotKey2
1839+
Left = 540
1840+
Height = 28
1841+
Top = 171
1842+
Width = 234
1843+
Anchors = [akTop, akLeft, akRight]
1844+
BorderSpacing.Around = 6
1845+
ItemHeight = 20
1846+
Style = csDropDownList
1847+
TabOrder = 8
1848+
OnChange = Modified
1849+
end
17031850
end
17041851
object tabFiles: TTabSheet
17051852
Caption = 'Files and tabs'

0 commit comments

Comments
 (0)