Commit 1ced6157 authored by Benoît Minisini's avatar Benoît Minisini
Browse files

Rework the position history to fix some problems. Compiling the prpoject now...

Rework the position history to fix some problems. Compiling the prpoject now automatically hides the error message tooltip.

[DEVELOPMENT ENVIRONMENT]
* BUG: Rework the position history to fix some problems.
* NEW: Compiling the prpoject now automatically hides the error message tooltip.
parent 2906f041
Pipeline #372462397 passed with stage
in 27 minutes and 37 seconds
......@@ -31,7 +31,7 @@ Component=gb.signal
Description="Integrated Development Environment for Gambas"
Authors="Benoît Minisini\nFabien Bodard\nCharlie Reinl\nJosé Luis Redrejo\nRobert Rowe\nTobias Boege"
Arguments=[["-L"],["-t","/home/benoit/gambas/git/master/app/src/gambas3"],["--help"]]
Environment="GB_GUI=gb.gtk3\n GTK_DEBUG=interactive\nGB_NO_JIT=1"
Environment="GB_GUI=gb.qt5\n GTK_DEBUG=interactive\nGB_NO_JIT=1"
TabSize=2
Translate=1
Language=en
......
......@@ -43,6 +43,30 @@ Static Private Sub AddPosition(hPos As CPosition)
End
Static Private Sub MakePos(hForm As Object) As CPosition
Dim hPos As CPosition
Dim hEditor As TextEditor
If Not hForm Then Return
hPos = New CPosition
hPos.Path = hForm.Path
Try hEditor = hForm.GetEditor()
If hEditor Then
hPos.Line = hEditor.Line
hPos.Column = hEditor.Column
Try hPos.Method = hForm.GetProcAt(hPos.Line)
Else
hPos.Line = -1
hPos.Column = -1
Endif
Return hPos
End
Static Public Sub SaveCurrent(hForm As Object, Optional bForce As Boolean)
......@@ -65,7 +89,7 @@ Static Public Sub SaveCurrent(hForm As Object, Optional bForce As Boolean)
hPos.Line = hEditor.LastLine
hPos.Column = hEditor.LastColumn
Try hPos.Method = hForm.GetProcAt(hPos.LastLine)
Try hPos.Method = hForm.GetProcAt(hPos.Line)
AddPosition(hPos)
hPos = hPos.Copy()
......@@ -91,7 +115,15 @@ End
Static Public Sub MovePrevious()
Dim hCurrent As CPosition
If $iCurrent <= 0 Then Return
hCurrent = MakePos(Project.ActiveForm)
If hCurrent And If Not hCurrent.IsEqual($aPositions[$iCurrent]) Then
$aPositions[$iCurrent].Move()
Return
Endif
Dec $iCurrent
$aPositions[$iCurrent].Move()
......
......@@ -822,24 +822,10 @@ End
Public Sub Editors_Cursor()
RefreshLineInfo()
CPosition.SaveCurrent(Me)
Project.UpdateStatus(True)
End
Public Sub Editors_MouseDown()
CPosition.Disable
End
Public Sub Editors_MouseUp()
CPosition.Enable
CPosition.SaveCurrent(Me)
End
Public Sub mnuLowerCase_Click()
If $hEditor.ReadOnly Then Return
......
......@@ -196,7 +196,6 @@ Public Function Save() As Boolean
$hCompletion.Hide
HideSignature
HideMessage
Save.Begin(Path)
......@@ -398,14 +397,12 @@ End
Public Sub Editors_Cursor()
If RefreshLineInfo() Then
HideMessage
$hCompletion.Hide
HideSignature
Endif
If $hEditor.Line = $hEditor.StopLine Then Design.CheckErrorMessage(Me)
CPosition.SaveCurrent(Me)
Project.UpdateStatus(True)
End
......@@ -483,10 +480,6 @@ Public Sub Form_GotFocus()
End
Public Sub Form_Deactivate()
End
Public Sub Goto(iLine As Integer, Optional iColumn As Integer = -1, Optional bCenter As Boolean)
'DEC iLine
......@@ -2264,7 +2257,6 @@ Public Sub Editors_Scroll()
$hCompletion.Position()
FSignature.Position(Me)
HideMessage
End
......@@ -2525,6 +2517,12 @@ Public Sub OnProjectDebug()
End
Public Sub OnProjectCompile()
$hEditor.HideMessageLabel
End
Public Sub OnShowString(sStr As String, bIgnoreCase As Boolean, bWordOnly As Boolean)
edtEditor.HighlightString(sStr, bIgnoreCase, bWordOnly)
......@@ -2641,19 +2639,10 @@ Public Sub Editors_LostFocus()
End
Public Sub Editors_MouseDown()
CPosition.Disable
End
Public Sub Editors_MouseUp()
Dim sText As String
CPosition.Enable
CPosition.SaveCurrent(Me)
If Mouse.Control Then
If Mouse.Left Then
FindDefinition
......@@ -2740,15 +2729,6 @@ Public Sub ShowErrorMessage(sMsg As String, (sIcon) As String)
End
Private Sub HideMessage()
If Balloon.Control = $hEditor Then
Balloon.Hide
Endif
'timWatch_Timer
End
Public Sub timProc_Timer()
CheckBreakpoints
......
......@@ -940,21 +940,6 @@ Public Sub Editors_Cursor()
End
Public Sub Editors_MouseDown()
CPosition.Disable
End
Public Sub Editors_MouseUp()
CPosition.Enable
CPosition.SaveCurrent(Me)
End
Public Sub mnuLowerCase_Click()
If $hEditor.ReadOnly Then Return
......
......@@ -2276,6 +2276,7 @@ Public Sub OpenFile(sPath As String, Optional iLine As Integer, Optional iColumn
If Not hForm Then Return
CPosition.Disable
Try ShowFile(hForm)
If Error Then
CPosition.Enable
......@@ -2591,6 +2592,7 @@ Public Function Compile(Optional bAll As Boolean, Optional bNoDebug As Boolean,
Dim I As Integer
Dim sLine As String
Dim sError As String
Dim hForm As Object
If Project.ReadOnly Then Return
If Project.Running Then Return 'TRUE
......@@ -2600,7 +2602,11 @@ Public Function Compile(Optional bAll As Boolean, Optional bNoDebug As Boolean,
sDir = Project.Dir
FProperty.SaveProperty
Save(True)
Save(True)
For Each hForm In Workspace.Windows
Try hForm.OnProjectCompile()
Next
If HasConflict Then
UnlockIt()
......@@ -3065,7 +3071,7 @@ Public Sub Activate(hForm As Object)
FImageProperty.OnProjectActivate
Try ActiveForm.SetFocus
CPosition.SaveCurrent(ActiveForm)
CPosition.SaveCurrent(ActiveForm, True)
'If hForm Then FMain.HideDebug(sType = "FConnectionEditor")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment