[GB.REPORT]

* BUG: Correct the Size int procedure of images
* NEW: Add a button to compute all the page on Preview form


git-svn-id: svn://localhost/gambas/trunk@3819 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Fabien Bodard 2011-04-30 22:34:54 +00:00
parent fd46efdac8
commit bb6c67caaf
6 changed files with 47 additions and 52 deletions

View file

@ -781,7 +781,7 @@ C
_Properties
C
s
*,Image{Image}
*,Stretch,Image{Image}
_Similar
C
s
@ -936,7 +936,7 @@ C
_Properties
C
s
*,Image{SvgImage}
*,Stretch,Image{SvgImage}
_Similar
C
s

View file

@ -29,7 +29,7 @@ Public Sub DrawingArea1_Draw()
'$hreport.Layout
$hReport.Scale = $fScale
$hreport._Layout(SpinBox1.Value - 1)
$hreport._Layout(IIf(ToolButton1.Tag, -1, SpinBox1.Value - 1))
$hReport.Paint($iPage)
Label2.Text = " / " & IIf($hreport._LayoutNotFinished, "Computing...", $hreport.PageCount)
SpinBox1.MaxValue = IIf($hreport._LayoutNotFinished, $hReport.PageCount + 1, $hReport.PageCount)
@ -194,4 +194,12 @@ Public Sub SpinBox1_Enter()
End
Public Sub ToolButton1_Click()
Last.Tag = True
DrawingArea1.Refresh
ToolButton1.Enabled = False
End

View file

@ -82,8 +82,13 @@
MoveScaled(51,0,8,4)
AutoResize = True
}
{ ToolButton1 ToolButton
MoveScaled(58,0,4,4)
ToolTip = ("Compute all")
Picture = Picture["icon:/22/last"]
}
{ HBox1 HBox
MoveScaled(59,0,12,3)
MoveScaled(62,0,12,3)
Expand = True
}
}

View file

@ -113,6 +113,7 @@ Public Sub _Layout(Optional iPage As Integer = -1)
Dim CBaseSection As ReportContainer
Dim i As Integer
'If iPage < 0 Then Return
If Not $bLayoutIsDirty Then Return
If iPage > -1 Then
If iPage <= $iCurPage Then Return
Else

View file

@ -18,26 +18,25 @@ Public Sub _GetSizeHints(AvailableW As Float, AvailableH As Float, TotalWidth As
Dim w As Float = IIf(Me._Width > AvailableW, AvailableW, Me._Width)
Dim Scale As Float
If h > 0 Or w > 0 Then
If h = 0 Then H = AvailableH
If w = 0 Then w = AvailableW
If $bStretch Then
hMyHints.Width = w + Me.Padding._Top + Me.Padding._Bottom
hMyHints.Height = h + AvailableW + Me.Padding._Left + Me.Padding._Right
Else
If h > w Then
Scale = $hpic.Width / $hpic.Height
hMyHints.Width = (h * Scale) + Me.Padding._Left + Me.Padding._Right
hMyHints.Height = h + Me.Padding._Top + Me.Padding._Bottom
Else
Scale = $hpic.Height / $hpic.Width
hMyHints.Height = (w * Scale) + Me.Padding._Top + Me.Padding._Bottom
hMyHints.Width = w + Me.Padding._Left + Me.Padding._Right
Endif
Endif
If $bStretch Then
hMyHints.Width = w + Me.Padding._Top + Me.Padding._Bottom
hMyHints.Height = h + AvailableW + Me.Padding._Left + Me.Padding._Right
Else
hMyHints.Height = AvailableH + Me.Padding._Top + Me.Padding._Bottom
hMyHints.Width = AvailableW + Me.Padding._Left + Me.Padding._Right
If h < w Then
Scale = $hpic.Width / $hpic.Height
hMyHints.Width = (h * Scale) + Me.Padding._Left + Me.Padding._Right
hMyHints.Height = h + Me.Padding._Top + Me.Padding._Bottom
Else
Scale = $hpic.Height / $hpic.Width
hMyHints.Height = (w * Scale) + Me.Padding._Top + Me.Padding._Bottom
hMyHints.Width = w + Me.Padding._Left + Me.Padding._Right
Endif
Endif
Return hMyHints
End

View file

@ -18,13 +18,15 @@ Public Sub _GetSizeHints(AvailableW As Float, AvailableH As Float, TotalWidth As
Dim h As Float = IIf(Me._Height > AvailableH, AvailableH, Me._Height)
Dim w As Float = IIf(Me._Width > AvailableW, AvailableW, Me._Width)
Dim Scale As Float
If h > 0 Or w > 0 Then
If h = 0 Then H = AvailableH
If w = 0 Then w = AvailableW
If $bStretch Then
hMyHints.Width = w + Me.Padding._Top + Me.Padding._Bottom
hMyHints.Height = h + AvailableW + Me.Padding._Left + Me.Padding._Right
hMyHints.Height = h + Me.Padding._Top + Me.Padding._Bottom
hMyHints.Width = w + Me.Padding._Left + Me.Padding._Right
Else
If h > w Then
If h < w Then
Scale = $hSvgImage.Width / $hSvgImage.Height
hMyHints.Width = (h * Scale) + Me.Padding._Left + Me.Padding._Right
hMyHints.Height = h + Me.Padding._Top + Me.Padding._Bottom
@ -34,34 +36,14 @@ Public Sub _GetSizeHints(AvailableW As Float, AvailableH As Float, TotalWidth As
hMyHints.Width = w + Me.Padding._Left + Me.Padding._Right
Endif
Endif
Else
hMyHints.Height = AvailableH + Me.Padding._Top + Me.Padding._Bottom
hMyHints.Width = AvailableW + Me.Padding._Left + Me.Padding._Right
Endif
' If h > 0 Or w > 0 Then
'
' If h > w Then
' Scale = $hSvgImage.Width / $hSvgImage.Height
' hMyHints.Width = (h * Scale) + Me.Padding._Left + Me.Padding._Right
' hMyHints.Height = h + Me.Padding._Top + Me.Padding._Bottom
' Else
' Scale = $hSvgImage.Height / $hSvgImage.Width
' hMyHints.Height = (w * Scale) + Me.Padding._Top + Me.Padding._Bottom
' hMyHints.Width = w + Me.Padding._Left + Me.Padding._Right
' Endif
' Else
' hMyHints.Height = AvailableH + Me.Padding._Top + Me.Padding._Bottom
' hMyHints.Width = AvailableW + Me.Padding._Left + Me.Padding._Right
' Endif
Return hMyHints
End
Public Sub _Paint(Page As Integer, X As Float, Y As Float, hControl As TControl, VirtualId As Integer)
Dim iX, iY, iW, iH As Integer
iX = (x + hControl.RealLeft + MTools.UnitsToPixels(Me.Padding._Left + Me.Border._Left))
@ -94,13 +76,13 @@ Private Sub Image_Write(Value As SvgImage)
End
Private Function Stretch_Read() As Boolean
Return $bStretch
End
Private Sub Stretch_Write(Value As Boolean)
$bStretch = Value
End