[CONFIGURATION]

* NEW: Compile and install gb.report2 component.

[DEVELOPMENT ENVIRONMENT]
* NEW: Add support for gb.report2 and gb.scanner.
* BUG: Correctly reset Application.Busy when opening a connection fails.
* BUG: Project property dialog: Fix management of required components.
* NEW: Project property dialog: Add management of excluded components.

[GB.DB]
* NEW: More detailed error message for SQLite connections.

[GB.DB.SQLITE3]
* NEW: More detailed error message for SQLite connections.


git-svn-id: svn://localhost/gambas/trunk@6892 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2015-02-05 20:34:44 +00:00
parent 5a20bb6465
commit 50fba09151
18 changed files with 646 additions and 869 deletions

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -150,6 +150,8 @@ Static Private Sub InitComponentNames()
$cName["gb.qt4.webkit"] = ("QT4 WebKit component")
$cName["gb.qt4.opengl"] = ("OpenGL with QT4 toolkit")
$cName["gb.report"] = ("Report designer")
$cName["gb.report2"] = ("Report designer")
$cName["gb.scanner"] = ("Scanner management library based on SANE")
$cName["gb.sdl"] = ("SDL library")
$cName["gb.sdl.sound"] = ("SDL sound & CD-ROM management")
$cName["gb.sdl2"] = ("SDL2 component")

View file

@ -216,6 +216,9 @@ Public Sub Reload() As Boolean
Dim hConfig As Settings
Dim sTitle As String
Dim iBusy As Integer
iBusy = Application.Busy
hConfig = New Settings(Path)
@ -316,9 +319,9 @@ Public Sub Reload() As Boolean
Catch
Application.Busy = 0
Application.Busy = iBusy
Me.Enabled = False
Message.Error(("Unable to connect to database.") & "\n\n" & Error.Text & "\n\n" & Error.Backtrace.Join("\n"))
FMain.ShowError(("Unable to connect to database.") & "<p>" & Error.Text)
Return True
End

View file

@ -2035,6 +2035,8 @@ Public Sub ShowMessage(sMsg As String, sIcon As String, Optional sKey As String)
If sKey Then sMsg = "<b>" & GetKeyTitle(sKey) & "</b><p>" & sMsg
sMsg = Replace(sMsg, "\n", "<br>")
If FMain.Visible And If panProject.Visible And If Not panProject.Hidden Then
msgError.Open(sMsg, Picture["icon:/32/" & sIcon])
@ -2046,8 +2048,6 @@ Public Sub ShowMessage(sMsg As String, sIcon As String, Optional sKey As String)
' panError.Show
Else
sMsg = Replace(sMsg, "\n", "<br>")
If sIcon = "error" Then
Message.Error(sMsg)
Else If sIcon = "warning" Then

View file

@ -6003,6 +6003,8 @@ Public Sub ReadComponentFile() As Collection
cComp["Need"] = Split(sLine)
Case "require", "requires"
cComp["Require"] = Split(sLine)
Case "exclude", "excludes"
cComp["Exclude"] = Split(sLine)
Case "implement", "implements"
cComp["Implement"] = Split(sLine)
Case "state"
@ -6063,6 +6065,9 @@ Public Sub WriteComponentFile(cComp As Collection) As Boolean
aData = cComp["Require"]
If aData And If aData.Count Then Print #hFile, "Requires="; aData.Join(",")
aData = cComp["Exclude"]
If aData And If aData.Count Then Print #hFile, "Excludes="; aData.Join(",")
sData = cComp["CompatibleUntil"]
If sData And If sData <> "0.0.0" Then Print #hFile, "CompatibleUntil="; sData

View file

@ -606,7 +606,7 @@ Public Sub CheckSelection() As Boolean
Next
For Each sExcl In CComponent.All[sComp].Exclude
If Not aComp.Find(sExcl) Then Continue
If Not aComp.Exist(sExcl) Then Continue
If Not aExclude.Exist(sExcl) Then aExclude.Add(sExcl)
Next

View file

@ -23,6 +23,7 @@ Private Const LIBRARY_TAB As Integer = 3
Private $bInitInfo As Boolean
Private $aNeed As String[]
Private $aRequire As String[]
Private $aExclude As String[]
Private $aImplement As String[]
Private $hComp As FileCompletion
@ -1003,6 +1004,7 @@ Private Sub ReadComponentFile()
$aNeed = New String[]
$aRequire = New String[]
$aExclude = New String[]
$aImplement = New String[]
cComp = Project.ReadComponentFile()
@ -1010,7 +1012,8 @@ Private Sub ReadComponentFile()
If cComp.Exist("Need") Then $aNeed = cComp["Need"]
If cComp.Exist("Require") Then $aRequire = cComp["Require"]
If cComp.Exist("Implement") Then $aRequire = cComp["Implement"]
If cComp.Exist("Exclude") Then $aExclude = cComp["Exclude"]
If cComp.Exist("Implement") Then $aImplement = cComp["Implement"]
cmbComponentState.Index = cComp["State"]
cmbHidden.Index = If(cComp["Hidden"], 0, 1)
If cComp.Exist("Include") Then txtIncludeInfo.Text = cComp["Include"].Join(",")
@ -1055,6 +1058,7 @@ Private Sub WriteComponent()
cComp["Implement"] = $aImplement
cComp["Need"] = $aNeed
cComp["Require"] = $aRequire
cComp["Exclude"] = $aExclude
If chkCompat.Value Then cComp["CompatibleUntil"] = CStr(txtMajor.Value) & "." & CStr(txtMinor.Value) & "." & CStr(txtRelease.Value)
cComp["Include"] = Split(Trim(txtIncludeInfo.Text))
@ -1068,23 +1072,23 @@ End
Private Sub ReadComponent()
Dim aComp As String[]
Dim hComp As CComponent
'Dim hComp As CComponent
ReadComponentFile
aComp = New String[]
For Each hComp In CComponent.All
If hComp.Hidden Then Continue
If hComp.Key = CComponent.PROJECT_NAME Then Continue
If hComp.Key = Project.Name Then Continue
If hComp.Key = "gb" Then Continue
If $aRequire.Exist(hComp.Key) Then Continue
aComp.Add(hComp.Key)
Next
aComp.Sort
' aComp = New String[]
' For Each hComp In CComponent.All
' If hComp.Hidden Then Continue
' If hComp.Key = CComponent.PROJECT_NAME Then Continue
' If hComp.Key = Project.Name Then Continue
' If hComp.Key = "gb" Then Continue
' If $aRequire.Exist(hComp.Key) Then Continue
' aComp.Add(hComp.Key)
' Next
' aComp.Sort
lstRequire.List = $aRequire
lstExclude.List = $aExclude
ReadFeatures(panNeed, $aNeed)
ReadFeatures(panNeed2, $aNeed)
@ -1101,17 +1105,17 @@ Private Sub ReadFeatures(hCont As Container, aFeature As String[])
End
Private Sub AddRequire(sComp As String)
Private Sub AddRequireExclude(sComp As String, aComp As String[], hList As ListBox)
If sComp = Project.Name Then Return
If $aRequire.Find(sComp) >= 0 Then Return
$aRequire.Add(sComp)
lstRequire.Add(sComp)
If aComp.Find(sComp) >= 0 Then Return
aComp.Add(sComp)
hList.Add(sComp)
End
Public Sub btnRemove_Click()
Public Sub btnRemoveRequire_Click()
If lstRequire.Index < 0 Then Return
$aRequire.Remove($aRequire.Find(lstRequire.Text))
@ -1119,7 +1123,7 @@ Public Sub btnRemove_Click()
End
Public Sub btnRemoveAll_Click()
Public Sub btnRemoveAllRequire_Click()
lstRequire.Clear
$aRequire.Clear
@ -1162,12 +1166,38 @@ Public Sub Form_Arrange()
End
Public Sub btnAdd_Click()
Public Sub btnAddRequire_Click()
Dim sComp As String
sComp = FSelectComponent.Run($aRequire)
If Not sComp Then Return
AddRequire(sComp)
AddRequireExclude(sComp, $aRequire, lstRequire)
End
Public Sub btnAddExclude_Click()
Dim sComp As String
sComp = FSelectComponent.Run($aExclude)
If Not sComp Then Return
AddRequireExclude(sComp, $aExclude, lstExclude)
End
Public Sub btnRemoveExclude_Click()
If lstExclude.Index < 0 Then Return
$aExclude.Remove($aExclude.Find(lstExclude.Text))
lstExclude.Remove(lstExclude.Index)
End
Public Sub btnRemoveAllExclude_Click()
lstExclude.Clear
$aExclude.Clear
End

View file

@ -164,7 +164,7 @@
{ Label11 Label
MoveScaled(0,38,16,4)
Font = Font["Bold"]
Text = ("Author(s)")
Text = ("Authors")
}
{ txtAuthor TextArea
MoveScaled(18,38,57,20)
@ -185,7 +185,7 @@
Text = ("Information")
}
{ HBox15 HBox
MoveScaled(0,5,78,4)
MoveScaled(0,4,78,4)
Spacing = True
Indent = True
{ Label26 Label
@ -199,7 +199,7 @@
}
}
{ HBox16 HBox
MoveScaled(0,10,71,4)
MoveScaled(0,9,71,4)
Spacing = True
Indent = True
{ Label25 Label
@ -213,7 +213,7 @@
}
}
{ panCompatible HBox
MoveScaled(0,15,71,4)
MoveScaled(0,14,71,4)
Spacing = True
Indent = True
{ chkCompat CheckBox
@ -237,7 +237,7 @@
}
}
{ HBox14 HBox
MoveScaled(0,20,71,4)
MoveScaled(0,19,71,4)
Spacing = True
Indent = True
{ Label13 Label
@ -250,12 +250,12 @@
}
}
{ Label15 Label
MoveScaled(0,27,79,3)
MoveScaled(0,24,79,3)
Font = Font["Bold"]
Text = ("Required features")
}
{ HBox7 HBox
MoveScaled(0,32,75,12)
MoveScaled(0,28,75,12)
Indent = True
{ panNeed Panel
MoveScaled(1,0,37,12)
@ -292,35 +292,68 @@
}
}
}
{ Label14 Label
MoveScaled(0,45,79,3)
Font = Font["Bold"]
Text = ("Required components")
{ Panel12 HBox
MoveScaled(0,43,80,3)
{ Label14 Label
MoveScaled(0,0,35,3)
Font = Font["Bold"]
Expand = True
Text = ("Required components")
}
{ Label17 Label
MoveScaled(39,0,35,3)
Font = Font["Bold"]
Expand = True
Text = ("Excluded components")
}
}
{ HBox10 HBox
MoveScaled(0,48,61,19)
MoveScaled(0,48,81,19)
Expand = True
Spacing = True
Indent = True
{ lstRequire ListBox
MoveScaled(1,2,35,16)
MoveScaled(1,1,20,16)
Expand = True
Sorted = True
}
{ VBox5 VBox
MoveScaled(38,1,21,17)
MoveScaled(22,1,18,16)
Spacing = True
{ btnAdd Button
{ btnAddRequire Button
MoveScaled(0,0,16,4)
Text = ("Add") & "..."
Picture = Picture["icon:/small/add"]
}
{ btnRemove Button
{ btnRemoveRequire Button
MoveScaled(0,5,17,4)
Text = Shortcut(("Remove"), "R")
Picture = Picture["icon:/small/remove"]
}
{ btnRemoveAll Button
{ btnRemoveAllRequire Button
MoveScaled(0,10,17,4)
Text = ("Remove All")
Picture = Picture["icon:/small/trash"]
}
}
{ lstExclude ListBox
MoveScaled(41,1,20,16)
Expand = True
Sorted = True
}
{ VBox2 VBox
MoveScaled(62,1,18,16)
Spacing = True
{ btnAddExclude Button
MoveScaled(0,0,16,4)
Text = ("Add") & "..."
Picture = Picture["icon:/small/add"]
}
{ btnRemoveExclude Button
MoveScaled(0,5,17,4)
Text = Shortcut(("Remove"), "R")
Picture = Picture["icon:/small/remove"]
}
{ btnRemoveAllExlude Button
MoveScaled(0,10,17,4)
Text = ("Remove All")
Picture = Picture["icon:/small/trash"]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 781 B

After

Width:  |  Height:  |  Size: 873 B

View file

@ -72,7 +72,7 @@ Public Sub Open(Text As String, Optional Icon As Picture)
Me.H = 1
Me.Show
$H = Max($hIcon.H + Desktop.Scale * 2, Me.Font.RichTextHeight(Text, Me.Parent.ClientW - Desktop.Scale * 3 - $hIcon.W) + Desktop.Scale * 4)
$H = Max($hIcon.H + Desktop.Scale * 2, Me.Font.RichTextHeight(Text, Me.Parent.ClientW - Desktop.Scale * 4 - $hIcon.W) + Desktop.Scale * 4)
If $bAnimate Then
@ -143,14 +143,17 @@ End
Public Sub View_Draw()
Dim X As Integer
Dim X, W As Integer
W = Me.W - Desktop.Scale * 2
If $hIcon Then
Paint.DrawPicture($hIcon, Desktop.Scale, Desktop.Scale)
X += $hIcon.W + Desktop.Scale * 2
X += $hIcon.W + Desktop.Scale * 3
W -= $hIcon.W - Desktop.Scale * 2
Endif
Paint.DrawRichText($sText, X, Desktop.Scale * 2, Me.W - Desktop.Scale * 2, Me.H - Desktop.Scale * 2, Align.TopLeft)
Paint.DrawRichText($sText, X, Desktop.Scale * 2, W, Me.H - Desktop.Scale * 2, Align.TopLeft)
If $bSeparator Then
If Me.Y > 0 Then

View file

@ -2,7 +2,8 @@
# Compiled with Gambas 3.6.90
Title=ReportsEvolution
Startup=Report3
Version=0.0.1
Version=3.6.90
VersionFile=1
Component=gb.image
Component=gb.gui
Component=gb.form

View file

@ -1,174 +0,0 @@
[Bookmarks]
ReportContainer=[560,822]
[Breakpoints]
Count=0
[DebugWindow]
Count=0
[DebugWindow/$aSections]
Geometry=[-55,269,210,210]
[DebugWindow/$aSections[0]]
Geometry=[354,0,210,210]
[DebugWindow/$aSections[0].Ctrl]
Geometry=[872,411,274,210]
[DebugWindow/$hReport]
Geometry=[554,335,758,561]
[DebugWindow/CSection.Children]
Geometry=[1313,366,210,210]
[DebugWindow/CSection.Children[16]]
Geometry=[1116,173,210,210]
[DebugWindow/CSection.Children[22]]
Geometry=[1326,206,210,210]
[DebugWindow/Control]
ShowHidden=True
Geometry=[0,0,210,210]
[DebugWindow/Me]
Geometry=[19,13,294,210]
[DebugWindow/Me.BackGround._PaintBrush(X1, Y1, X2, Y2)]
Geometry=[-7,-10,210,210]
[DebugWindow/Me.BackGround._PaintBrush(X1, Y1, X2, Y2).Matrix]
Geometry=[7,4,210,210]
[DebugWindow/Me.Children]
Geometry=[108,220,210,210]
[DebugWindow/Object.Parent(Me)]
Geometry=[-7,-10,210,210]
[DebugWindow/Parent]
Geometry=[-7,-10,210,210]
[DebugWindow/Report1]
ShowHidden=True
Geometry=[-7,-10,210,210]
[DebugWindow/ReportVBox(Me).Children]
Geometry=[7,4,294,210]
[DebugWindow/ReportVBox(Me).Children[0]]
Geometry=[21,18,294,210]
[DebugWindow/ReportVBox(ReportVBox(Me).Children[0]).Children]
Geometry=[35,32,294,210]
[DebugWindow/String]
Geometry=[0,0,210,210]
[DebugWindow/TCont]
Geometry=[-7,-10,210,210]
[DebugWindow/TSizeParse[s]]
Geometry=[-7,-10,210,210]
[DebugWindow/_ObjectFromId]
Geometry=[-7,420,256,282]
[DebugWindow/_ObjectFromId["0"]]
Geometry=[7,4,210,210]
[DebugWindow/aPageItems]
Geometry=[-7,-10,210,210]
[DebugWindow/aPageItems[0]]
Geometry=[7,4,210,210]
[DebugWindow/aPageItems[1]]
Geometry=[7,4,210,210]
[DebugWindow/aPageItems[9]]
Geometry=[7,4,210,210]
[DebugWindow/aPageItems[9].Ctrl]
Geometry=[21,18,210,210]
[DebugWindow/ctrl]
Geometry=[-7,-10,342,210]
[DebugWindow/hChild]
Geometry=[1120,176,473,436]
[DebugWindow/hChild._GetSizeHints(AvailableW, AvailableH - fHeight, AvailableW, AvailableH, j)]
Geometry=[-7,114,210,210]
[DebugWindow/hChildHints]
Geometry=[0,0,210,210]
[DebugWindow/hMyHints]
Geometry=[-7,-10,210,210]
[DebugWindow/hRep]
Geometry=[-7,247,210,210]
[DebugWindow/hReport]
Geometry=[-7,-10,210,210]
[DebugWindow/hSizeInt]
Geometry=[222,282,210,210]
[DebugWindow/hchild]
Geometry=[-7,-10,210,210]
[DebugWindow/hchild.Margin]
Geometry=[502,541,210,210]
[DebugWindow/hrc]
Geometry=[1133,212,210,210]
[DebugWindow/htmpInts]
Geometry=[28,264,210,210]
[DebugWindow/ochild]
Geometry=[-7,-10,210,210]
[FCommit]
LastCommit="[GB.REPORT2]\n* BUG: Force image clipping\n---- Cette ligne et les suivantes seront ignorées ----\n\nM .project\nM .settings\nM .src/ReportImage.class\nM .src/ReportSvgImage.class\nM .src/Tests/Report11.report\nM .src/Tests/Report3.report\nM .startup"
[OpenFile]
Active=22
File[1]=".src/ReportSvgImage.class:62.2"
Count=22
File[2]=".src/ReportImage.class:86.0"
File[3]=".src/ReportGridView.class:8.11"
File[4]=".src/Tests/FMain.form"
File[5]=".src/Tests/Module1.module:0.0"
File[6]=".src/Report.class:91.2"
File[7]=".src/ReportLabel.class:9.0"
File[8]=".src/ReportPanel.class:14.34"
File[9]=".src/Viewer/FPreview.class:259.3"
File[10]=".src/Viewer/ReportView.class:108.22"
File[11]=".src/ReportContainer.class:852.17"
File[12]=".src/Types/TSizeParse.class:49.2"
File[13]=".src/Optional/Align.class:0.0"
File[14]=".src/Optional/Line.class:0.0"
File[15]=".src/Tools/CPrint.class:0.0"
File[16]=".src/Types/TControl.class:0.0"
File[17]=".src/Tests/Report4.report"
File[18]=".src/Tests/Report4.class:4.1"
File[19]=".src/Tests/Report5.class:0.0"
File[20]=".src/Tests/OutputReport2.report"
File[21]=".src/Tests/Report1.report"
File[22]=".src/Tests/Report3.report"
[VersionControl]
User="gambix"
RememberPassword=1
[Watches]
Count=4
Watch[1]="AvailableW"
Watch[2]="Left(s)"
Watch[3]="fHeight - fMaxSpc"
Watch[4]="fTH - fMaxSpc"

View file

@ -2,7 +2,7 @@ Report3
ReportsEvolution
0
0
0.0.1
3.6.90
gb.image
gb.gui

View file

@ -1,2 +1 @@
gb.eval.highlight gb.args gb.settings gb.gui.base gb.form gb.form.stock gb.form.dialog gb.form.mdi gb.db.form gb.desktop gb.web gb.report
gb.chart gb.mysql gb.net.smtp gb.net.pop3 gb.memcached gb.map gb.logging gb.markdown gb.media.form gb.scanner gb.util gb.util.web gb.report2
gb.eval.highlight gb.args gb.settings gb.gui.base gb.form gb.form.stock gb.form.dialog gb.form.mdi gb.db.form gb.desktop gb.web gb.report gb.report2 gb.chart gb.mysql gb.net.smtp gb.net.pop3 gb.memcached gb.map gb.logging gb.markdown gb.media.form gb.scanner gb.util gb.util.web

View file

@ -660,7 +660,7 @@ static int open_database(DB_DESC *desc, DB_DATABASE * db)
}
else
{
GB.Error("Unable to locate database: &1", name);
GB.Error("Unable to locate database `&1` in `&2`", name, desc->host);
GB.FreeString(&name);
delete conn;
return TRUE;

View file

@ -156,7 +156,7 @@ static int open_database(DB_DESC *desc, DB_DATABASE * db)
db_fullpath = FindDatabase(desc->name, desc->host);
if (!db_fullpath)
{
GB.Error("Unable to locate database: &1", desc->name);
GB.Error("Unable to locate database `&1` in `&2`", desc->name, desc->host);
return TRUE;
}