diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2015-08-12 17:30:59 +0100 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2015-08-12 17:31:42 +0100 |
commit | 7c995e871a6f520127d495fddb2d2b87bfabca74 (patch) | |
tree | f8f071d763663b67666e0564612f2c7c4c06e2dc | |
parent | 61d1b11c5d011d3603cbb8517152935e570706cc (diff) | |
download | fpGUI-7c995e871a6f520127d495fddb2d2b87bfabca74.tar.xz |
PageControl: Implements standardised Ctrl+TAB and Ctrl+Shift+TAB shortcuts.
The old shortcuts were some unique fpGUI combination which confused
everybody, and didn't work so well anyway. These old ones are now removed.
-rw-r--r-- | src/gui/fpg_tab.pas | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/src/gui/fpg_tab.pas b/src/gui/fpg_tab.pas index f15b59fa..5f0e7fbf 100644 --- a/src/gui/fpg_tab.pas +++ b/src/gui/fpg_tab.pas @@ -1243,26 +1243,24 @@ var i: integer; begin i := ActivePageIndex; - if ssAlt in shiftstate then - case keycode of - keyLeft: - begin - if ActivePage <> TfpgTabSheet(FPages.First) then - begin - ActivePage := TfpgTabSheet(FPages[i-1]); - consumed := True; - end; - end; - keyRight: - begin - if ActivePage <> TfpgTabSheet(FPages.Last) then - begin - ActivePage := TfpgTabSheet(FPages[i+1]); - consumed := True; - end; - end; - end; { case/else } + if (shiftstate = [ssCtrl]) and (keycode = keyTab) then + begin + consumed := True; + if ActivePage <> TfpgTabSheet(FPages.Last) then + ActivePage := TfpgTabSheet(FPages[i+1]) + else + ActivePage := TfpgTabSheet(FPages.First); // loop back to the front + end + else if (shiftstate = [ssCtrl, ssShift]) and (keycode = keyTab) then + begin + consumed := True; + if ActivePage <> TfpgTabSheet(FPages.First) then + ActivePage := TfpgTabSheet(FPages[i-1]) + else + ActivePage := TfpgTabSheet(FPages.Last); // loop back to the end + end; + if not consumed then inherited HandleKeyPress(keycode, shiftstate, consumed); end; |