[GB.REPORT]
* OPT: the size, orientation properties are removed, now the page size is defined by the painting device. git-svn-id: svn://localhost/gambas/trunk@2727 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
fffee54d40
commit
ad8ed0628e
3 changed files with 12 additions and 88 deletions
|
@ -82,7 +82,7 @@ CA
|
|||
_Properties
|
||||
C
|
||||
s
|
||||
*,Orientation{Report.Portrait;Landscape},Size
|
||||
*
|
||||
_HiddenControls
|
||||
C
|
||||
s
|
||||
|
@ -91,14 +91,6 @@ _IsForm
|
|||
C
|
||||
b
|
||||
-1
|
||||
Portrait
|
||||
C
|
||||
i
|
||||
0
|
||||
Landscape
|
||||
C
|
||||
i
|
||||
1
|
||||
Count
|
||||
r
|
||||
i
|
||||
|
@ -115,14 +107,6 @@ Scale
|
|||
p
|
||||
f
|
||||
|
||||
Orientation
|
||||
p
|
||||
i
|
||||
|
||||
Size
|
||||
p
|
||||
s
|
||||
|
||||
_New
|
||||
m
|
||||
|
||||
|
|
|
@ -4,21 +4,17 @@ Create Static
|
|||
Export
|
||||
Inherits ReportVBox
|
||||
|
||||
Public Const _Properties As String = "*,Orientation{Report.Portrait;Landscape},Size"
|
||||
Public Const _Properties As String = "*"
|
||||
Public Const _HiddenControls As String = "Report,ReportControl,ReportContainer"
|
||||
Public Const _IsForm As Boolean = True
|
||||
|
||||
'Public Constants
|
||||
Public Const Portrait As Integer = 0
|
||||
Public Const Landscape As Integer = 1
|
||||
Public {Debug} As Boolean = False
|
||||
|
||||
Private iCurPage As Integer = 0
|
||||
Private $iCount As Integer = -1
|
||||
Private $bLayoutIsDirty As Boolean = True
|
||||
Private $fScale As Float = 1.0
|
||||
Private $iOrientation As Integer = Portrait
|
||||
Private $sSize As String = "A4"
|
||||
Private $hReportTControl As New TControl
|
||||
Private hData As Object
|
||||
|
||||
|
@ -26,15 +22,13 @@ Property Read Count As Integer
|
|||
Property Height As String
|
||||
Property Width As String
|
||||
Property Scale As Float
|
||||
Property Orientation As Integer
|
||||
Property Size As String
|
||||
|
||||
'EVENT Data()
|
||||
|
||||
Public Sub _New()
|
||||
|
||||
object.Attach(Me, Me, "Report")
|
||||
SetReportSize
|
||||
|
||||
$hReportTControl.RelPage = 0
|
||||
ReportControl._ObjectFromId[Me.id] = Me
|
||||
|
||||
|
@ -43,9 +37,11 @@ End
|
|||
Public Sub Layout()
|
||||
|
||||
If Not $bLayoutIsDirty Then Return
|
||||
|
||||
MTools.ReportResolution = Paint.ResolutionX
|
||||
SetReportSize()
|
||||
Me.Width = MTools.PixelsToUnits(Paint.Width) & " cm"
|
||||
Me.Height = MTools.PixelsToUnits(Paint.Height) & " cm"
|
||||
|
||||
|
||||
$hReportTControl.ctrl = Me
|
||||
$iCount = $hReportTControl._SetGeometry(0, 0, Me.Width, Me.Height) + 1
|
||||
MTools.PageCount = $iCount
|
||||
|
@ -148,62 +144,6 @@ End
|
|||
'
|
||||
' End
|
||||
|
||||
|
||||
Private Function Size_Read() As String
|
||||
|
||||
Return $sSize
|
||||
|
||||
End
|
||||
|
||||
Private Sub Size_Write(Value As String)
|
||||
|
||||
$sSize = Value
|
||||
|
||||
End
|
||||
|
||||
Private Sub SetReportSize()
|
||||
Dim w As Float
|
||||
Dim h As Float
|
||||
If $sSize = "Custom" Then Return
|
||||
Select Case $sSize
|
||||
Case "A4"
|
||||
w = 21
|
||||
h = 29.7
|
||||
Case "A3"
|
||||
w = 29.7
|
||||
h = 42
|
||||
|
||||
Case "A5"
|
||||
|
||||
Case "A6"
|
||||
Case "Letter"
|
||||
Case Else
|
||||
End Select
|
||||
|
||||
If Me.Orientation = Portrait Then
|
||||
Me.Width = w & " cm"
|
||||
Me.Height = h & " cm"
|
||||
Else
|
||||
Me.Width = h & " cm"
|
||||
Me.Height = w & " cm"
|
||||
|
||||
Endif
|
||||
|
||||
End
|
||||
|
||||
|
||||
Private Function Orientation_Read() As Integer
|
||||
|
||||
Return $iOrientation
|
||||
|
||||
End
|
||||
|
||||
Private Sub Orientation_Write(Value As Integer)
|
||||
|
||||
$iOrientation = Value
|
||||
|
||||
End
|
||||
|
||||
Public Sub Clear()
|
||||
|
||||
Super._Free
|
||||
|
@ -212,8 +152,8 @@ Public Sub Clear()
|
|||
'$iResolution = Desktop.Resolution
|
||||
$bLayoutIsDirty = True
|
||||
$fScale = 1.0
|
||||
$iOrientation = Portrait
|
||||
$sSize = "A4"
|
||||
|
||||
|
||||
Me.Spacing = "0 cm"
|
||||
Me.Padding = "0 cm"
|
||||
End
|
||||
|
|
|
@ -221,8 +221,8 @@ Public Sub Test4()
|
|||
|
||||
|
||||
'Report.Resolution = Desktop.Resolution
|
||||
report.size = "A4"
|
||||
report.orientation = report.Portrait
|
||||
'report.size = "A4"
|
||||
'report.orientation = report.Portrait
|
||||
'Report.Units = Units.cm
|
||||
Report.Padding = "1 cm"
|
||||
Object.Attach(report, Me, "Report")
|
||||
|
@ -449,7 +449,7 @@ Public Sub Slider1_Change()
|
|||
|
||||
'Report.Debug = True
|
||||
|
||||
DrawingArea1.Resize(UnitsToPixels(Report._Width) * Slider1.Value / 100, UnitsToPixels(Report._Height) * Slider1.Value / 100)
|
||||
DrawingArea1.Resize((21 * Desktop.Resolution / 2.54) * Slider1.Value / 100, (29.7 * Desktop.Resolution / 2.54) * Slider1.Value / 100)
|
||||
|
||||
DrawingArea1.Refresh
|
||||
|
||||
|
|
Loading…
Reference in a new issue