diff --git a/comp/src/gb.gui.base/.project b/comp/src/gb.gui.base/.project index 427a69005..def42b4e2 100644 --- a/comp/src/gb.gui.base/.project +++ b/comp/src/gb.gui.base/.project @@ -1,6 +1,6 @@ # Gambas Project File 3.0 Title=Common controls and classes for GUI components -Startup=FTestTreeView +Startup=FTestIconView Icon=.hidden/window.png Version=3.17.90 VersionFile=1 diff --git a/comp/src/gb.gui.base/.src/IconView/IconView.class b/comp/src/gb.gui.base/.src/IconView/IconView.class index 2852d13c6..296c033a8 100644 --- a/comp/src/gb.gui.base/.src/IconView/IconView.class +++ b/comp/src/gb.gui.base/.src/IconView/IconView.class @@ -847,6 +847,8 @@ Public Sub ScrollArea_KeyPress() Dim iInd As Integer Dim iPos As Integer Dim iStart As Integer + Dim N As Integer + Dim iCurrent As Integer If Not Me.Enabled Or If Me.Design Then Return @@ -894,6 +896,21 @@ Public Sub ScrollArea_KeyPress() SetCurrentItem($iCurrent + $nColumn, True, bShift) Endif Stop Event + + Case Key.PageUp, Key.PageDown + If $bHorizontal Then + N = $hView.ClientW \ $iGridWidth + Else + N = $hView.ClientH \ $iGridHeight + Endif + N = Max(1, N) + If iCode = Key.PageUp Then + iCurrent = $iCurrent - N * $nColumn + If iCurrent < 0 Then iCurrent += (Abs(iCurrent + 1) \ $nColumn + 1) * $nColumn + Else + iCurrent = Min($aItems.Max, $iCurrent + N * $nColumn) + Endif + SetCurrentItem(iCurrent, True, bShift) Case Key.Home SetCurrentItem(0, True, bShift)