[GB.REPORT2]

* NEW: A new class ReportSizeParser to replace TSizeParse. 
  TSizeParse is maintained but deprecated.
* NEW: The ReportViewer is updated when the report layout is finished.



git-svn-id: svn://localhost/gambas/trunk@7509 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Fabien Bodard 2015-12-10 14:35:51 +00:00
parent 88f79e6a45
commit 23058fcc2d
13 changed files with 206 additions and 133 deletions

View file

@ -1,9 +1,11 @@
# Gambas Connection File 3.0
[Connection]
Type="mysql"
User="root"
Type="sqlite"
RememberPassword=False
IgnoreCharset=False
DisplayMetadata=False
Database="test"
Database="test.db"
Host="/home/fabien"
Path="/home/fabien"
RememberTemplate=False
Requests=[""]

View file

@ -999,6 +999,69 @@ _Free
m
#ReportGridView
ReportFrame
C
:Data
:
(Row)i(Column)i
_IsControl
C
b
T
_IsContainer
C
b
_Properties
C
s
"*"
_DefaultEvent
C
s
"Data"
None
C
i
0
Horizontal
C
i
1
Vertical
C
i
2
Both
C
i
3
Columns
r
_ReportGridView_Columns
Rows
r
_ReportGridView_Rows
Header
p
i
_NormalizeUnits
m
_GetSizeHints
m
ReportSizeHints
(AvailableW)f(AvailableH)f(TotalWidth)f(TotalHeight)f(DataIndex)i
_Paint
m
(Page)i(X)f(Y)f(hControl)TControl;(DataIndex)i
#ReportHBox
ReportContainer
C
@ -1277,6 +1340,39 @@ FromString
M
ReportSizeHints
(Width)s(Height)s[(NotFinished)b]
#ReportSizeParser
C
Value
v
f
Unit
v
s
_new
m
(Size)s[(bAllowRelative)b]
'Create a new size object from its description.
'#bAllowRelative# can be TRUE to allow the use of "%" as unit.
ToInch
m
f
IsRelative
m
b
GetValue
m
f
_get
M
TSizeParse
(Size)s
#ReportSvgImage
ReportFrame
C
@ -1485,6 +1581,10 @@ tmrLayout_Timer
m
Refresh
m
MoveNext
m
@ -1505,10 +1605,6 @@ MoveTo
m
(Page)i
Refresh
m
_ForceLayout
m
@ -1521,39 +1617,6 @@ UnlockLayout
m
#TSizeParse
C
Value
v
f
Unit
v
s
_new
m
(Size)s[(bAllowRelative)b]
'Create a new size object from its description.
'#bAllowRelative# can be TRUE to allow the use of "%" as unit.
ToInch
m
f
IsRelative
m
b
GetValue
m
f
_get
M
TSizeParse
(Size)s
#_ReportBorderSide
C

View file

@ -6,6 +6,7 @@ ReportContainer!
ReportControl!
ReportDrawingArea!
ReportFrame!
ReportGridView!
ReportHBox!
ReportImage!
ReportLabel!
@ -16,11 +17,11 @@ ReportPageBreak!
ReportPanel!
ReportSection!
ReportSizeHints!
ReportSizeParser!
ReportSvgImage!
ReportTextLabel!
ReportVBox!
ReportView!
TSizeParse!
_ReportBorderSide
_ReportBoxShadow
_ReportGridView_Column

View file

@ -1,7 +1,7 @@
# Gambas Project File 3.0
# Compiled with Gambas 3.8.90
Title=ReportsEvolution
Startup=Report9
Startup=Report3
Icon=icon.png
Version=3.8.90
VersionFile=1
@ -10,7 +10,6 @@ Component=gb.gui
Component=gb.form
Component=gb.db
Component=gb.settings
Environment="GB_GUI=gb.qt5"
TabSize=2
Translate=1
Language=en

View file

@ -1,7 +1,7 @@
' Gambas class file
Public Sub _new()
Report.Preview()
End
Public Sub Form_Open()

View file

@ -2,7 +2,7 @@
'Static Public Type As String
Public Sub _new(Optional sType As String = "mysql")
Public Sub _new(Optional sType As String = "sqlite")
Dim hResult As Result
Dim Rlbl As ReportLabel

View file

@ -12,7 +12,7 @@ Public Sub _new()
'ReportVBox1.Border.Left.Width = "1mm"
'ReportVBox1.DataCount = 3
For i = 0 To 20
For i = 0 To 800
'If i = 3 Then hBreak = New ReportPageBreak(Me)
hCont = New ReportLabel(Me)
hCont.BoxShadow.Blur = "5mm"

View file

@ -1,25 +1,27 @@
# Gambas Form File 3.0
{ Report Report
#MoveScaled(0,0,64,64)
#MoveScaled(0,0,64,57)
Padding = ReportPadding["Top:2cm;Bottom:2cm;Left:2cm;Right:2cm"]
AutoResize = True
Spacing = "5mm"
Paper = Printer.A3
Index = 0
Text = ("")
{ ReportLabel1 ReportLabel
#MoveScaled(6,0,52,7)
Font = Font["+14"]
BoxShadow = ReportBoxShadow["0mm 7mm 7mm 0mm #FF8000"]
Text = ("PARCELLAIRE")
BoxShadow = ReportBoxShadow["3mm 3mm 3mm 0mm #FF8000"]
Text = ("PARCELLAIRE $NPAGE")
Alignment = Align.Center
UseField = True
}
{ ReportImage1 ReportImage
#MoveScaled(8,10,41,28)
Height = "14cm"
BoxShadow = ReportBoxShadow["-18px -6mm 23px 21px #000000"]
Border = ReportBorder["Top:1mm #000000;Bottom:1mm #000000;Left:1mm #000000;Right:1mm #000000"]
BoxShadow = ReportBoxShadow["1mm 1mm 2px 2px #000000"]
Stretch = Report.None
Image = Image.Load("capture12.png")
}
Index = 0
}

View file

@ -0,0 +1,83 @@
' Gambas class file
' Gambas class file
Export
Fast
'>>>>>>>>>>>>>>>>>>>>>> PUBLIC VARIABLES >>>>>>>>>>>>>>>>>>>>>>>>>
Public Value As Float
Public Unit As String
'>>>>>>>>>>>>>>>>>>>>>>>>>> PROPERTIES >>>>>>>>>>>>>>>>>>>>>>>>>>>
'>>>>>>>>>>>>>>>>>>>>>> PRIVATE VARIABLES >>>>>>>>>>>>>>>>>>>>>>>>
'##################### PUBLIC PROCEDURES #########################
'' Create a new size object from its description.
'' #bAllowRelative# can be TRUE to allow the use of "%" as unit.
Public Sub _new(Size As String, Optional bAllowRelative As Boolean)
Dim I As Integer
Dim sCar As String
If Not size Then
Unit = "cm"
Value = 0
Endif
Size = Trim(Size)
If Not Size Then
Unit = "px"
Return
Endif
For I = 1 To Len(Size)
sCar = Mid$(Size, I, 1)
If Not IsDigit(sCar) And If sCar <> "-" And If sCar <> "." Then Break
Next
Value = CFloat(Left$(Size, I - 1))
Unit = Trim(Mid$(Size, I))
If Not Unit Then Unit = "px"
If Not Report.AllowedUnits.Exist(Unit) Then
If Not bAllowRelative Or Unit <> "%" Then
Error.Raise("Unknown unit")
Endif
Endif
End
Public Sub ToInch() As Float
Return Report.UnitToInch(Value, Unit)
End
Public Sub IsRelative() As Boolean
Return Unit = "%"
End
Public Sub GetValue() As Float
If IsRelative() Then
Return Value
Else
Return ToInch()
Endif
End
Static Public Sub _get(Size As String) As TSizeParse
Dim hSize As TSizeParse = New TSizeParse(Size)
Return hSize
End
'##################### PRIVATE PROCEDURES ########################
'######################## PROPERTIES #############################

View file

@ -1,81 +1,3 @@
' Gambas class file
Export
Fast
'>>>>>>>>>>>>>>>>>>>>>> PUBLIC VARIABLES >>>>>>>>>>>>>>>>>>>>>>>>>
Public Value As Float
Public Unit As String
'>>>>>>>>>>>>>>>>>>>>>>>>>> PROPERTIES >>>>>>>>>>>>>>>>>>>>>>>>>>>
'>>>>>>>>>>>>>>>>>>>>>> PRIVATE VARIABLES >>>>>>>>>>>>>>>>>>>>>>>>
'##################### PUBLIC PROCEDURES #########################
'' Create a new size object from its description.
'' #bAllowRelative# can be TRUE to allow the use of "%" as unit.
Public Sub _new(Size As String, Optional bAllowRelative As Boolean)
Dim I As Integer
Dim sCar As String
If Not size Then
Unit = "cm"
Value = 0
Endif
Size = Trim(Size)
If Not Size Then
Unit = "px"
Return
Endif
For I = 1 To Len(Size)
sCar = Mid$(Size, I, 1)
If Not IsDigit(sCar) And If sCar <> "-" And If sCar <> "." Then Break
Next
Value = CFloat(Left$(Size, I - 1))
Unit = Trim(Mid$(Size, I))
If Not Unit Then Unit = "px"
If Not Report.AllowedUnits.Exist(Unit) Then
If Not bAllowRelative Or Unit <> "%" Then
Error.Raise("Unknown unit")
Endif
Endif
End
Public Sub ToInch() As Float
Return Report.UnitToInch(Value, Unit)
End
Public Sub IsRelative() As Boolean
Return Unit = "%"
End
Public Sub GetValue() As Float
If IsRelative() Then
Return Value
Else
Return ToInch()
Endif
End
Static Public Sub _get(Size As String) As TSizeParse
Dim hSize As TSizeParse = New TSizeParse(Size)
Return hSize
End
'##################### PRIVATE PROCEDURES ########################
'######################## PROPERTIES #############################
Inherits ReportSizeParser

View file

@ -158,7 +158,7 @@
Spacing = True
{ Label2 Label
MoveScaled(0,0,12,4)
Text = ("Recto Verso")
Text = ("Two-sided")
}
{ cmbDuplex ComboBox
MoveScaled(15,0,21,4)

View file

@ -143,6 +143,7 @@ Public Sub tmrLayout_Timer()
If Not $hReport._LayoutNotFinished Or If $bLOckLayout Then
tmrLayout.Stop
$hView.Refresh
Return
Endif

View file

@ -1,4 +1,4 @@
Report9
Report3
ReportsEvolution
0
0