diff --git a/app/src/gambas3/.src/Editor/Code/FCompletion.class b/app/src/gambas3/.src/Editor/Code/FCompletion.class index c64acc690..29b661c30 100644 --- a/app/src/gambas3/.src/Editor/Code/FCompletion.class +++ b/app/src/gambas3/.src/Editor/Code/FCompletion.class @@ -1,7 +1,7 @@ ' Gambas class file Static Private $aNativeDatatypes As String[] = ["Boolean 0", "Byte 0", "Short 0", "Integer 0", "Long 0", "Single 0", "Float 0", "Date 0", "String 0", "Object 0", "Variant 0", "Pointer 0"] -Static Private $aSpecialMethods As String[] = ["_attach", "_call", "_compare", "_get", "_init", "_new", "_next", "_property", "_put", "_unknown"] +Static Private $aSpecialMethods As String[] = ["_attach", "_call", "_compare", "_get", "_init", "_new", "_next", "_property", "_put", "_unknown", "_exit"] Static Private $hClassPicture As Picture diff --git a/app/src/gambas3/.src/Editor/Code/FEditor.class b/app/src/gambas3/.src/Editor/Code/FEditor.class index 37887b214..ff6fa35e7 100644 --- a/app/src/gambas3/.src/Editor/Code/FEditor.class +++ b/app/src/gambas3/.src/Editor/Code/FEditor.class @@ -494,14 +494,15 @@ Private Sub CreateMenu() mnuGoto.Children.Clear cSymbol = CComponent.GetClassSymbols(Me.Name) - - For Each hSymbol In cSymbol - - If LCase(hSymbol.Kind) <> "m" Then Continue - If hSymbol.LineNumber = 0 Then Continue - cFunc.Add(hSymbol.Name) - - Next + If cSymbol Then + For Each hSymbol In cSymbol + + If LCase(hSymbol.Kind) <> "m" Then Continue + If hSymbol.LineNumber = 0 Then Continue + cFunc.Add(hSymbol.Name) + + Next + Endif cFunc.Sort(gb.IgnoreCase + gb.Natural) hParent = mnuGoto @@ -2785,6 +2786,10 @@ Private Sub FillProcCombo() Dim cSymbol As Collection Dim sText As String Dim sName As String + Dim aPrivate As String[] + Dim aStaticPrivate As String[] + Dim aStaticPublic As String[] + Dim aPublic As String[] 'DIM fTime AS Float 'DIM iInd AS Integer @@ -2809,23 +2814,65 @@ Private Sub FillProcCombo() If Project.IsSourcePath(Path) Then cSymbol = CComponent.GetClassSymbols(Me.Name) + If Not cSymbol Then cSymbol = New Collection Else cSymbol = CComponent.ScanSingleClass(Me) Endif + aStaticPrivate = New String[] + aPrivate = New String[] + aStaticPublic = New String[] + aPublic = New String[] + For Each hSymbol In cSymbol If LCase(hSymbol.Kind) <> "m" Then Continue If hSymbol.LineNumber = 0 Then Continue If hSymbol.Class <> Me.Name Then Continue - $aProc.Add(hSymbol.Name) - + + sName = hSymbol.Name + + If hSymbol.IsStatic() Then + If hSymbol.NotPublic Then + aStaticPrivate.Add(sName) + Else + aStaticPublic.Add(sName) + Endif + Else + If hSymbol.NotPublic Then + aPrivate.Add(sName) + Else + aPublic.Add(sName) + Endif + Endif + Next - $aProc.Sort(gb.IgnoreCase) + aStaticPrivate.Sort(gb.IgnoreCase) + aPrivate.Sort(gb.IgnoreCase) + aStaticPublic.Sort(gb.IgnoreCase) + aPublic.Sort(gb.IgnoreCase) + + If aStaticPublic.Count Then + $aProc.Add("-STATIC PUBLIC") + $aProc.Insert(aStaticPublic) + Endif + If aPublic.Count Then + $aProc.Add("-PUBLIC") + $aProc.Insert(aPublic) + Endif + If aStaticPrivate.Count Then + $aProc.Add("-STATIC PRIVATE") + $aProc.Insert(aStaticPrivate) + Endif + If aPrivate.Count Then + $aProc.Add("-PRIVATE") + $aProc.Insert(aPrivate) + Endif For Each sName In $aProc + If sName Begins "-" Then Continue hSymbol = cSymbol[sName] 'cmbProc.Add(sName) $cProc[hSymbol.Name] = hSymbol.LineNumber - 1 diff --git a/app/src/gambas3/.src/Editor/Code/FProcedureList.class b/app/src/gambas3/.src/Editor/Code/FProcedureList.class index cb56c9b34..4f8fbf280 100644 --- a/app/src/gambas3/.src/Editor/Code/FProcedureList.class +++ b/app/src/gambas3/.src/Editor/Code/FProcedureList.class @@ -21,6 +21,8 @@ End Public Sub Init(hModule As FEditor, sClass As String, aProc As String[], iCurrent As Integer, W As Integer, H As Integer) + Dim I As Integer + $hModule = hModule $sClass = sClass ' Copy it, as it can disappear during the Editor_Change() method @@ -32,9 +34,12 @@ Public Sub Init(hModule As FEditor, sClass As String, aProc As String[], iCurren gvwProc.Rows.UnselectAll gvwProc.Columns.Count = 1 Project.SetNormalFont(gvwProc) - gvwProc.Rows.H = gvwProc.Font.Height + 4 + 'gvwProc.Rows.H = gvwProc.Font.Height + 4 + For I = 0 To aProc.Max + If aProc[I] Begins "-" Then gvwProc.Rows[I].H = Desktop.Scale * 1.5 + Next - Me.Resize(W, Min(H, gvwProc.Rows.Count * gvwProc.Rows.Height + 2)) + Me.Resize(W, Min(H, gvwProc.ScrollHeight + 2)) Try gvwProc[$iCurrent, 0].EnsureVisible $sFind = "" @@ -54,11 +59,11 @@ Public Sub gvwProc_Data(Row As Integer, (Column) As Integer) Dim hSymbol As CSymbolInfo Dim sName As String - 'Dim hColor As Color - Try sName = $aProc[Row] If Not sName Then Return + If sName Begins "-" Then Return + gvwProc.Data.Text = sName If $sClass Then @@ -84,7 +89,7 @@ Public Sub gvwProc_Data(Row As Integer, (Column) As Integer) 'gvwProc.Data.Picture = Picture["img/16/point.png"] 'gvwProc.Data.Foreground = Color.Lighter(Color.Foreground) If FCompletion.GetSpecialMethods().Exist(sName, gb.IgnoreCase) Then - gvwProc.Data.Background = Color.Background + gvwProc.Data.Foreground = Color.SelectedBackground Endif Else If InStr(sName, "_") Then 'gvwProc.Data.Picture = Picture["img/16/event.png"] @@ -97,7 +102,7 @@ Public Sub gvwProc_Data(Row As Integer, (Column) As Integer) gvwProc.Data.Background = Color.SelectedBackground gvwProc.Data.Foreground = Color.SelectedForeground Else If Row = $iInit Then - gvwProc.Data.Background = Color.LightBackground + gvwProc.Data.Background = Color.Merge(Color.LightBackground, Color.TextBackground) Endif End @@ -113,6 +118,7 @@ Private Sub SetCurrent(iCurrent As Integer) Dim iOld As Integer = $iCurrent If iCurrent = iOld Then Return + If iCurrent >= 0 And If $aProc[iCurrent] = "-" Then Return $iCurrent = iCurrent If iOld >= 0 Then gvwProc.Rows[iOld].Refresh @@ -200,3 +206,23 @@ End ' Debug gvwProc.ScrollY ' ' End + +Public Sub gvwProc_Draw(X As Integer, Y As Integer, Width As Integer, Height As Integer, Row As Integer, Column As Integer) + + Dim sName As String + Dim WT As Float + + Try sName = $aProc[Row] + If sName Not Begins "-" Then Return + sName = Mid$(sName, 2) + + Paint.Font.Grade = -3 + WT = Paint.TextSize(sName).Width + Desktop.Scale + + Paint.FillRect(X - 2, Y + Height \ 2, Width + 4, 1, Color.LightForeground) + Paint.FillRect(X + (Width - WT) / 2, Y, WT, Height, Color.TextBackground) + + Paint.Background = Color.LightForeground + Paint.DrawText(sName, X, Y, Width, Height, Align.Center) + +End diff --git a/app/src/gambas3/.src/Editor/Code/FProcedureList.form b/app/src/gambas3/.src/Editor/Code/FProcedureList.form index 7ee54fa75..9b97e9051 100644 --- a/app/src/gambas3/.src/Editor/Code/FProcedureList.form +++ b/app/src/gambas3/.src/Editor/Code/FProcedureList.form @@ -16,6 +16,7 @@ Mouse = Mouse.Pointing Border = False Grid = False + Padding = 1 } } }