Commit bd36dc9d authored by Benoît Minisini's avatar Benoît Minisini

Add menu entries for toggling most of the debugging environment variables.

[DEVELOPMENT ENVIRONMENT]
* BUG: Display an appropriate message when project testing fails.
* NEW: Update french translation.
* NEW: Make the IDE depend on the 'gb.test' component.
* NEW: Code editor: error messages now use the same background as the editor, to ensure they are always readable.
* NEW: Add menu entries for toggling most of the debugging environment variables.
parent 849a3485
This diff is collapsed.
......@@ -29,6 +29,7 @@ Component=gb.form.terminal
Component=gb.gui.qt.webkit
Component=gb.markdown
Component=gb.signal
Component=gb.test
Description="Integrated Development Environment for Gambas"
Authors="Benoît Minisini\nFabien Bodard\nCharlie Reinl\nJosé Luis Redrejo\nRobert Rowe\nTobias Boege"
Arguments=[["-t","/home/benoit/gambas/git/master/app/src/gambas3"],["--help"]]
......
......@@ -426,7 +426,10 @@ End
Public Sub Process_Kill()
Dim sMsg As String
Dim bTest As Boolean
bTest = $bTest
If Not Project.AboutToQuit Then AfterStop
If Not $hProcess Then Return ' $hProcess may be NULL if the event loop is called somewhere during AfterStop()
......@@ -445,7 +448,11 @@ Public Sub Process_Kill()
End Select
If sMsg Then FMain.ShowWarning(sMsg)
Else If $hProcess.Value Then
FMain.ShowInfo(Subst(("The program has returned\nthe value: &1"), $hProcess.Value))
If bTest Then
FMain.ShowWarning(("The test has failed!"))
Else
FMain.ShowInfo(Subst(("The program has returned\nthe value: &1"), $hProcess.Value))
Endif
Endif
$hProcess = Null
......
......@@ -182,7 +182,7 @@
#MoveScaled(73,17)
}
Index = 5
Text = ("Test")
Text = ("Unit tests")
{ panTest HBox
MoveScaled(0,0,119,4)
{ btnTestClear ToolButton
......@@ -193,7 +193,7 @@
{ btnTest ToolButton
MoveScaled(5,0,14,4)
AutoResize = True
Text = ("Test again")
Text = ("Run test")
Picture = Picture["icon:/small/ok"]
}
}
......
......@@ -96,12 +96,13 @@
{ mnuSelectAll Menu
Action = ".select-all"
Text = Shortcut(("Select All"), "A")
Picture = Picture["icon:/small/select-all"]
Shortcut = "Ctrl+A"
}
{ mnuHideSelection Menu
Action = ".hide"
Text = ("Hide selection")
Picture = Picture["img/draw/hide.png"]
Picture = Picture["icon:/small/unselect"]
Shortcut = "Esc"
}
{ mnuSelection Menu
......@@ -457,7 +458,7 @@
MoveScaled(86,0,4,4)
ToolTip = ("Hide selection")
Action = ".hide"
Picture = Picture["img/draw/hide.png"]
Picture = Picture["icon:/small/unselect"]
}
{ btnEditSelection ToolButton btnTool
Name = "btnEditSelection"
......@@ -660,7 +661,7 @@
{ Action hide
Text = "Hide selection"
Shortcut = "Esc"
Picture = "img/draw/hide.png"
Picture = "icon:/small/unselect"
}
{ Action intersection
Text = "Intersection"
......@@ -732,6 +733,7 @@
{ Action select-all
Text = "Select All"
Shortcut = "Ctrl+A"
Picture = "icon:/small/select-all"
}
{ Action tiff
Text = "Save as TIFF"
......
......@@ -173,7 +173,11 @@ End
Public Sub Form_Arrange()
panOpen.Move(Me.ClientW - panOpen.W - Desktop.Scale, Me.ClientH - panOpen.H - Desktop.Scale)
If System.RightToLeft Then
panOpen.Move(Desktop.Scale, Me.ClientH - panOpen.H - Desktop.Scale)
Else
panOpen.Move(Me.ClientW - panOpen.W - Desktop.Scale, Me.ClientH - panOpen.H - Desktop.Scale)
Endif
panOpen.Raise
End
......@@ -257,9 +257,10 @@ Public Sub ShowMessageLabel(sStr As String, iStyle As Integer, Optional bBottom
Endif
$hLabel.Foreground = Me.Styles[Highlight.Normal].Color
'If IsMissing(iStyle) Then iStyle = Highlight.Highlight
$hLabel.Background = Color.Merge(Me.Styles[iStyle].Color, Me.Styles[Highlight.Background].Color, 0.3)
' $hLabel.Foreground = Me.Styles[Highlight.Normal].Color
' $hLabel.Background = Color.Merge(Me.Styles[iStyle].Color, Me.Styles[Highlight.Background].Color, 0.3)
$hLabel.Foreground = Me.Styles[iStyle].Color 'Me.Styles[Highlight.Normal].Color
$hLabel.Background = Me.Styles[Highlight.Background].Color
$hLabel.Text = "&nbsp;&nbsp;" & Replace(Replace(sStr, "<p>", " "), "<br>", " ") & "&nbsp;&nbsp;"
$bLabelBottom = bBottom
......
......@@ -1236,6 +1236,8 @@ Public Sub UpdateMenu()
bVisible = False
If Project.Components Then
mnuEnvDbDebug.Visible = Project.Components.Exist("gb.db")
If Project.Components.Exist("gb.gui") Or If Project.Components.Exist("gb.gui.qt") Then
bVisible = True
Endif
......@@ -1309,7 +1311,7 @@ Public Sub OnProjectChange()
mnuRedirectStderr.Value = Project.RedirectStderr
mnuUseHttpServer.Value = Project.UseHttpServer
mnuProfile.Value = Project.Profiling
'Action["breakerr"].Value = Project.BreakOnError
OnRefreshComponents
UpdateRunButton
......@@ -2607,14 +2609,17 @@ Public Sub OnRefreshComponents()
Dim iPos As Integer
Dim sComp As String
Dim hMenu As Menu
Dim aEnv As String[]
For Each hMenu In mnuGUI.Children
If hMenu.Text Then hMenu.Checked = False
If hMenu.Tag Then hMenu.Visible = Project.Documentation.Components.Exist(hMenu.Tag)
sComp = Mid$(hMenu.Tag, InStr(hMenu.Tag, "=") + 1)
If sComp Then hMenu.Visible = Project.Documentation.Components.Exist(sComp)
Next
hMenu = Null
iPos = Project.Environment.Find("GB_GUI=*", gb.Like)
aEnv = Project.Environment
iPos = aEnv.Find("GB_GUI=*", gb.Like)
If iPos >= 0 Then
sComp = Scan(Project.Environment[iPos], "*=*")[1]
For Each hMenu In mnuGUI.Children
......@@ -2632,31 +2637,46 @@ Public Sub OnRefreshComponents()
mnuSetGUICurrentDesktop.Checked = True
Endif
For Each hMenu In [mnuEnvReverse, mnuEnvNoJit, mnuEnvDbDebug]
hMenu.Checked = aEnv.Exist(hMenu.Tag)
Next
End
Public Sub mnuSetGUI_Click()
Public Sub mnuSetEnv_Click()
Dim sComp As String
Dim iPos As Integer
Dim aEnv As String[] = Project.Environment
Dim aEnv As String[]
Dim sEnv As String
Dim sVar As String
Dim sValue As String
Dim hMenu As Menu
hMenu = Last
sComp = Last.Tag
iPos = aEnv.Find("GB_GUI=*", gb.Like)
sEnv = hMenu.Tag
iPos = InStr(sEnv, "=")
sVar = Left(sEnv, iPos - 1)
sValue = Mid(sEnv, iPos + 1)
If Not sComp Then
aEnv = Project.Environment
iPos = aEnv.Find(sVar & "=*", gb.Like)
If Not sValue Then
If iPos >= 0 Then
aEnv.Remove(iPos)
Goto WRITE_PROJECT
Endif
Else
sEnv = "GB_GUI=" & sComp
If iPos < 0 Then
aEnv.Add(sEnv, 0)
Goto WRITE_PROJECT
Else If aEnv[iPos] <> sEnv Then
aEnv[iPos] = sEnv
Goto WRITE_PROJECT
Else If hMenu.Toggle
aEnv.Remove(iPos)
Goto WRITE_PROJECT
Endif
Endif
......
......@@ -265,6 +265,37 @@
Picture = Picture["icon:/small/ok"]
Shortcut = "F4"
}
{ Menu14 Menu
}
{ mnuPause Menu
Action = "pause"
Text = Shortcut(("Pause"), "P")
Picture = Picture["icon:/small/pause"]
Shortcut = "Pause"
}
{ mnuStop Menu
Action = "stop"
Text = Shortcut(("Stop"), "S")
Picture = Picture["icon:/small/stop"]
Shortcut = "Alt+Pause"
}
{ mnuStep Menu
Action = "step"
Text = Shortcut(("Step"), "e")
Picture = Picture["icon:/small/end"]
Shortcut = "F8"
}
{ mnuForward Menu
Action = "forward"
Text = Shortcut(("Forward"), "F")
Picture = Picture["icon:/small/forward"]
Shortcut = "Shift+F8"
}
{ mnuFrom Menu
Action = "return"
Text = Shortcut(("Finish"), "h")
Picture = Picture["icon:/small/eject"]
}
{ Menu36 Menu
}
{ mnuUseTerminal Menu
......@@ -287,70 +318,66 @@
Text = Shortcut(("Activate profiling"), "g")
Toggle = True
}
{ Menu44 Menu
}
{ mnuEnvReverse Menu mnuSetEnv
Name = "mnuEnvReverse"
Text = ("Invert language orientation")
Toggle = True
Tag = "GB_REVERSE=1"
}
{ mnuEnvNoJit Menu mnuSetEnv
Name = "mnuEnvNoJit"
Text = ("Disable just-in-time compiler")
Toggle = True
Tag = "GB_NO_JIT=1"
}
{ mnuEnvJitDebug Menu mnuSetEnv
Name = "mnuEnvJitDebug"
Text = ("Show just-in-time compiler debugging messages")
Toggle = True
Tag = "GB_JIT_DEBUG=1"
}
{ mnuEnvDbDebug Menu mnuSetEnv
Name = "mnuEnvDbDebug"
Text = ("Show database requests")
Toggle = True
Tag = "GB_DB_DEBUG=1"
}
{ mnuGUI Menu
Action = "gui"
Text = ("GUI component")
{ mnuSetGUICurrentDesktop Menu mnuSetGUI
{ mnuSetGUICurrentDesktop Menu mnuSetEnv
Name = "mnuSetGUICurrentDesktop"
Text = ("Current desktop")
Tag = "GB_GUI="
}
{ Menu30 Menu
}
{ Menu21 Menu mnuSetGUI
{ Menu21 Menu mnuSetEnv
Name = "Menu21"
#Translate = False
Text = "QT4"
Tag = "gb.qt4"
Tag = "GB_GUI=gb.qt4"
}
{ Menu35 Menu mnuSetGUI
{ Menu35 Menu mnuSetEnv
Name = "Menu35"
Text = ("QT5")
Tag = "gb.qt5"
Tag = "GB_GUI=gb.qt5"
}
{ Menu27 Menu mnuSetGUI
{ Menu27 Menu mnuSetEnv
Name = "Menu27"
#Translate = False
Text = "GTK+2"
Tag = "gb.gtk"
Tag = "GB_GUI=gb.gtk"
}
{ Menu28 Menu mnuSetGUI
{ Menu28 Menu mnuSetEnv
Name = "Menu28"
#Translate = False
Text = "GTK+3"
Tag = "gb.gtk3"
Tag = "GB_GUI=gb.gtk3"
}
}
{ Menu14 Menu
}
{ mnuPause Menu
Action = "pause"
Text = Shortcut(("Pause"), "P")
Picture = Picture["icon:/small/pause"]
Shortcut = "Pause"
}
{ mnuStop Menu
Action = "stop"
Text = Shortcut(("Stop"), "S")
Picture = Picture["icon:/small/stop"]
Shortcut = "Alt+Pause"
}
{ mnuStep Menu
Action = "step"
Text = Shortcut(("Step"), "e")
Picture = Picture["icon:/small/end"]
Shortcut = "F8"
}
{ mnuForward Menu
Action = "forward"
Text = Shortcut(("Forward"), "F")
Picture = Picture["icon:/small/forward"]
Shortcut = "Shift+F8"
}
{ mnuFrom Menu
Action = "return"
Text = Shortcut(("Finish"), "h")
Picture = Picture["icon:/small/eject"]
}
{ Menu9 Menu
}
{ mnuOpenProfile Menu
......@@ -1315,13 +1342,6 @@
MoveScaled(86,8,0,9)
Visible = False
}
{ btnWorkspaceProperty ToolButton
MoveScaled(27,1,4,4)
Visible = False
ToolTip = ("Show properties sheet")
Ignore = True
Picture = Picture["icon:/small/properties"]
}
{ btnWorkspaceProject ToolButton
MoveScaled(22,1,4,4)
Visible = False
......@@ -1329,6 +1349,13 @@
Ignore = True
Picture = Picture["icon:/small/view-tree"]
}
{ btnWorkspaceProperty ToolButton
MoveScaled(27,1,4,4)
Visible = False
ToolTip = ("Show properties sheet")
Ignore = True
Picture = Picture["icon:/small/properties"]
}
}
{ panDebug SidePanel
MoveScaled(3,37,81,14)
......@@ -1383,13 +1410,6 @@
Text = ("Hierarchy")
Index = 0
}
{ btnPropertyHelp ToolButton
MoveScaled(4,0,4,4)
Visible = False
ToolTip = ("Show property help")
Ignore = True
Picture = Picture["icon:/small/help"]
}
{ btnPropertyToolbar ToolButton
MoveScaled(0,0,4,4)
Visible = False
......@@ -1397,6 +1417,13 @@
Ignore = True
Picture = Picture["img/16/control.png"]
}
{ btnPropertyHelp ToolButton
MoveScaled(4,0,4,4)
Visible = False
ToolTip = ("Show property help")
Ignore = True
Picture = Picture["icon:/small/help"]
}
}
{ panTool SidePanel
MoveScaled(5,49,21,37)
......
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