[GB.FORM]

* NEW: You can now find IconView items by directly typing their name while 
  the control has the focus.


git-svn-id: svn://localhost/gambas/trunk@4578 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2012-03-29 20:21:10 +00:00
parent 27f01d30ee
commit 2670b8f0e9
5 changed files with 42 additions and 5 deletions

View File

@ -1,8 +1,8 @@
# Gambas Project File 3.0
# Compiled with Gambas 3.1.0
Title=More controls for graphical components
Startup=FMain
Version=3.0.90
Startup=FIconView
Version=3.1.0
VersionFile=1
Component=gb.image
Component=gb.gui

View File

@ -93,6 +93,9 @@ Private $iCurrentBefore As Integer
Private $hPicture As Picture
Private $sFindItem As String
Private $fFindTime As Float
Public Sub _new()
$hView = New ScrollArea(Me) As "ScrollArea"
@ -717,6 +720,10 @@ Public Sub ScrollArea_KeyPress()
Dim iCode As Integer
Dim bShift As Boolean
Dim fNow As Float
Dim iInd As Integer
Dim iPos As Integer
Dim iStart As Integer
If Not Me.Enabled Or If Me.Design Then Return
@ -784,6 +791,37 @@ Public Sub ScrollArea_KeyPress()
End Select
If Len(Key.Text) >= 2 Or If Asc(Key.Text) >= 32 Or If Key.Code = Key.Backspace Then
fNow = Timer
iStart = $iCurrent
If (fNow - $fFindTime) >= 2 Or iStart < 0 Then
$sFindItem = ""
Inc iStart
Endif
$fFindTime = fNow
If Key.Code = Key.Backspace Then
$sFindItem = String.Left$($sFindItem, -1)
Else
$sFindItem &= String.LCase(Key.Text)
Endif
iPos = iStart
For iInd = 0 To $aItems.Max
With $aItems[iPos]
'Debug iInd;; .Text
If String.LCase(.Text) Begins $sFindItem Then
SetCurrentItem(iPos, True)
Break
Endif
End With
Inc iPos
If iPos > $aItems.Max Then iPos = 0
Next
Endif
Endif
End

View File

@ -11,7 +11,6 @@
}
{ IconView1 IconView
MoveScaled(2,13,42,31)
Enabled = False
Mouse = Mouse.Cross
Expand = True
Mode = Select.Multiple

View File

@ -1,6 +1,6 @@
[Component]
Key=gb.report
Version=3.0.90
Version=3.1.0
State=1
Authors=Fabien Bodard
Needs=Form,ImageIO

View File

@ -3,7 +3,7 @@
Title=Report designer
Startup=Report2
Icon=printer1.png
Version=3.0.90
Version=3.1.0
VersionFile=1
Component=gb.image
Component=gb.gui