diff --git a/app/src/gambas3/support.txt b/app/src/gambas3/support.txt index b5aee3d29..25b9d8a8b 100644 --- a/app/src/gambas3/support.txt +++ b/app/src/gambas3/support.txt @@ -1,9 +1,9 @@ 54 Maurizio Da Lio 37 GNU/Linex 33 Radoslav Dejanovic +20 Ricardo Díaz Martin 18 Kari Laine 16 DistroWatch.com -16 Ricardo Díaz Martin 15 Yvick Miossec 15 Christian Henri Fischer 12 Leo Barnhoorn diff --git a/comp/src/gb.gui.base/.info b/comp/src/gb.gui.base/.info index cf7df11f9..14c8949f9 100644 --- a/comp/src/gb.gui.base/.info +++ b/comp/src/gb.gui.base/.info @@ -211,6 +211,10 @@ FillY P i +Image +M + +(Image)Image;(X)i(Y)i[(Width)i(Height)i(SrcX)i(SrcY)i(SrcWidth)i(SrcHeight)i] _GetInfo M DrawInfo @@ -307,10 +311,6 @@ Zoom M (Image)Image;(Zoom)i(X)i(Y)i[(SrcX)i(SrcY)i(SrcWidth)i(SrcHeight)i] -Image -M - -(Image)Image;(X)i(Y)i[(Width)i(Height)i(SrcX)i(SrcY)i(SrcWidth)i(SrcHeight)i] Picture M @@ -319,6 +319,69 @@ Tile M (Picture)Picture;(X)i(Y)i(W)i(H)i +#Fill + +C +None +C +i +0 +Solid +C +i +1 +Dense94 +C +i +2 +Dense88 +C +i +3 +Dense63 +C +i +4 +Dense50 +C +i +5 +Dense37 +C +i +6 +Dense12 +C +i +7 +Dense6 +C +i +8 +Horizontal +C +i +9 +Vertical +C +i +10 +Cross +C +i +11 +Diagonal +C +i +12 +BackDiagonal +C +i +13 +CrossDiagonal +C +i +14 #GridView UserControl C @@ -1036,6 +1099,33 @@ _End m +#Line + +C +None +C +i +0 +Solid +C +i +1 +Dash +C +i +2 +Dot +C +i +3 +DashDot +C +i +4 +DashDotDot +C +i +5 #ListBox UserControl C diff --git a/comp/src/gb.gui.base/.list b/comp/src/gb.gui.base/.list index 8eb7a0a1f..d7cd71dda 100644 --- a/comp/src/gb.gui.base/.list +++ b/comp/src/gb.gui.base/.list @@ -1,9 +1,11 @@ Action ColumnView Draw +Fill GridView HSplit IconView +Line ListBox ListView ScrollArea diff --git a/comp/src/gb.gui.base/.project b/comp/src/gb.gui.base/.project index cb7452ace..f7c97bb2f 100644 --- a/comp/src/gb.gui.base/.project +++ b/comp/src/gb.gui.base/.project @@ -1,8 +1,7 @@ # Gambas Project File 3.0 # Compiled with Gambas 3.4.0 Title=gb.gui.base -Startup=FIconView -Profiling=1 +Startup=FScrollArea Version=3.4.0 VersionFile=1 Component=gb.image diff --git a/comp/src/gb.gui.base/.src/Draw.module b/comp/src/gb.gui.base/.src/Draw.module index 8029a7d7e..3356c25df 100644 --- a/comp/src/gb.gui.base/.src/Draw.module +++ b/comp/src/gb.gui.base/.src/Draw.module @@ -44,6 +44,8 @@ End Struct Private Enum DRAW_CIRCLE, DRAW_ELLIPSE, DRAW_ARC +Private $hPattern As New Image[15] + Public Sub _GetInfo() As DrawInfo Dim hInfo As DrawInfo = Paint._Tag @@ -345,13 +347,40 @@ Public Sub Line(X1 As Integer, Y1 As Integer, X2 As Integer, Y2 As Integer) End +Private Sub HasFillStyle(hInfo As DrawInfo) As Boolean + + Dim hImage As Image + + Select Case hInfo.FillStyle + + Case Fill.None + Return False + + Case Fill.Solid + Paint.Background = hInfo.FillColor + + Case Fill.Dense94 To Fill.CrossDiagonal + If IsNull($hPattern[hInfo.FillStyle]) Then $hPattern[hInfo.FillStyle] = Image.Load("pattern/" & hInfo.FillStyle & ".png") + hImage = $hPattern[hInfo.FillStyle].Copy() + If hInfo.Transparent Then hImage.Replace(Color.White, Color.Transparent) + hImage.Replace(Color.Black, hInfo.FillColor) + Paint.Brush = Paint.Image(hImage) + + Default + Return + + End Select + + Return True + +End + Public Sub Rect(X As Integer, Y As Integer, Width As Integer, Height As Integer) Dim hInfo As DrawInfo = _GetInfo() Dim iBg As Integer - If hInfo.FillStyle Then - Paint.Background = hInfo.FillColor + If HasFillStyle(hInfo) Then Paint.Rectangle(X, Y, Width, Height) Paint.Fill Endif @@ -438,9 +467,7 @@ Private Sub DrawEllipse(iAction As Integer, X As Float, Y As Float, W As Float, Paint.Ellipse(X, Y, W, H, Start, {End} - Start, True) Endif - - If hInfo.FillStyle And If iAction <> DRAW_ARC Then - Paint.Background = hInfo.FillColor + If iAction <> DRAW_ARC And If HasFillStyle(hInfo) Then Paint.Fill(hInfo.LineStyle) Endif @@ -556,9 +583,8 @@ Public Sub Polygon(Points As Integer[]) fOffset = GetStrokeOffset() - If hInfo.FillStyle Then + If HasFillStyle(hInfo) Then - Paint.Background = hInfo.FillColor Paint.Fill(hInfo.LineStyle <> Line.None) Endif diff --git a/comp/src/gb.gui.base/.src/Fill.class b/comp/src/gb.gui.base/.src/Fill.class new file mode 100644 index 000000000..6d6c1c129 --- /dev/null +++ b/comp/src/gb.gui.base/.src/Fill.class @@ -0,0 +1,5 @@ +' Gambas class file + +Export + +Public Enum None, Solid, Dense94, Dense88, Dense63, Dense50, Dense37, Dense12, Dense6, Horizontal, Vertical, Cross, Diagonal, BackDiagonal, CrossDiagonal diff --git a/comp/src/gb.gui.base/.src/Line.class b/comp/src/gb.gui.base/.src/Line.class new file mode 100644 index 000000000..caea24a51 --- /dev/null +++ b/comp/src/gb.gui.base/.src/Line.class @@ -0,0 +1,5 @@ +' Gambas class file + +Export + +Public Enum None, Solid, Dash, Dot, DashDot, DashDotDot \ No newline at end of file diff --git a/comp/src/gb.gui.base/.src/Test/FMain1.class b/comp/src/gb.gui.base/.src/Test/FMain1.class deleted file mode 100644 index 62be64635..000000000 --- a/comp/src/gb.gui.base/.src/Test/FMain1.class +++ /dev/null @@ -1,18 +0,0 @@ -' Gambas class file - -Public Sub _new() - -End - -Public Sub Form_Open() - - Me.Center - -End - - -Public Sub Button1_Click() - - Me.Close() - -End diff --git a/comp/src/gb.gui.base/.src/Test/FMain1.form b/comp/src/gb.gui.base/.src/Test/FMain1.form deleted file mode 100644 index 22285ff76..000000000 --- a/comp/src/gb.gui.base/.src/Test/FMain1.form +++ /dev/null @@ -1,78 +0,0 @@ -# Gambas Form File 3.0 - -{ Form Form - MoveScaled(0,0,116,104) - Background = &HECECEC& - Arrangement = Arrange.Vertical - Spacing = True - Margin = True - Padding = 8 - { VSplit1 VSplit - MoveScaled(3,4,110,92) - Expand = True - { Panel1 Panel - MoveScaled(2,3,105,24) - Arrangement = Arrange.Fill - Margin = True - Padding = 4 - Border = Border.Plain - { Panel6 Panel - MoveScaled(2,3,100,19) - Background = &HBBCCCC& - Border = Border.Raised - } - } - { VSplit2 VSplit - MoveScaled(2,29,105,59) - Expand = True - { Panel2 Panel - MoveScaled(5,3,97,27) - Expand = True - Arrangement = Arrange.Horizontal - Spacing = True - Margin = True - Padding = 4 - Border = Border.Plain - { TextArea1 TextArea - MoveScaled(1,2,39,22) - Expand = True - Text = ("TextArea1") - } - { TextArea2 TextArea - MoveScaled(55,1,41,25) - Expand = True - Text = ("TextArea2") - } - } - { Panel3 Panel - MoveScaled(4,33,98,21) - Arrangement = Arrange.Vertical - Spacing = True - Margin = True - Padding = 4 - Border = Border.Plain - { TextArea3 TextArea - MoveScaled(2,2,94,9) - Text = ("TextArea3") - } - { TextArea4 TextArea - MoveScaled(2,12,92,7) - Expand = True - Text = ("TextArea4") - } - } - } - } - { Panel4 Panel - MoveScaled(3,98,111,5) - Arrangement = Arrange.Horizontal - { Panel5 Panel - MoveScaled(11,0,7,5) - Expand = True - } - { Button1 Button - MoveScaled(94,0,12,5) - Text = ("Quitter") - } - } -} diff --git a/comp/src/gb.gui.base/.src/Test/FScrollArea.class b/comp/src/gb.gui.base/.src/Test/FScrollArea.class index 914a720e0..74775f2ca 100644 --- a/comp/src/gb.gui.base/.src/Test/FScrollArea.class +++ b/comp/src/gb.gui.base/.src/Test/FScrollArea.class @@ -11,20 +11,11 @@ End Public Sub ScrollArea1_Draw() - Dim X, Y As Integer - - Draw.FillRect(Draw.Clip.X, Draw.Clip.Y, Draw.Clip.W, Draw.Clip.H, Color.TextBackground) Draw.Translate(- ScrollArea1.ScrollX, - ScrollArea1.ScrollY) - Draw.Font.Bold = True - Draw.Font.Grade = 3 - For X = 0 To 3 - For Y = 0 To 6 - Draw.Text("Coucou", X * 80 + 10, Y * 24 + 10) - Next - Next - Draw.LineStyle = Line.Solid - Draw.Foreground = Color.Black - Draw.Rect(0, 0, 300, 300) - Draw.Rect(1, 1, 298, 298) + Draw.Fillstyle = Fill.Dense6 + Draw.FillColor = Color.Red + 'Draw.Transparent = True + Draw.Ellipse(55, 78, 190, 300) + Draw.Ellipse(78, 55, 300, 190) End diff --git a/comp/src/gb.gui.base/.src/Test/FScrollArea.form b/comp/src/gb.gui.base/.src/Test/FScrollArea.form index 1ac479065..eb5c8b102 100644 --- a/comp/src/gb.gui.base/.src/Test/FScrollArea.form +++ b/comp/src/gb.gui.base/.src/Test/FScrollArea.form @@ -2,10 +2,10 @@ { Form Form MoveScaled(0,0,56,53) - Arrangement = Arrange.Vertical + Arrangement = Arrange.Fill Margin = True { ScrollArea1 ScrollArea - MoveScaled(4,2,35,30) + MoveScaled(4,3,35,30) Mouse = Mouse.Pointing Border = False } diff --git a/comp/src/gb.gui.base/.startup b/comp/src/gb.gui.base/.startup index 61cf30f48..cf07547a4 100644 --- a/comp/src/gb.gui.base/.startup +++ b/comp/src/gb.gui.base/.startup @@ -1,4 +1,4 @@ -FIconView +FScrollArea gb.gui.base 0 0 diff --git a/comp/src/gb.gui.base/pattern/10.png b/comp/src/gb.gui.base/pattern/10.png new file mode 100644 index 000000000..01dc29be6 Binary files /dev/null and b/comp/src/gb.gui.base/pattern/10.png differ diff --git a/comp/src/gb.gui.base/pattern/11.png b/comp/src/gb.gui.base/pattern/11.png new file mode 100644 index 000000000..57e6ea2a9 Binary files /dev/null and b/comp/src/gb.gui.base/pattern/11.png differ diff --git a/comp/src/gb.gui.base/pattern/12.png b/comp/src/gb.gui.base/pattern/12.png new file mode 100644 index 000000000..fec2ac9ec Binary files /dev/null and b/comp/src/gb.gui.base/pattern/12.png differ diff --git a/comp/src/gb.gui.base/pattern/13.png b/comp/src/gb.gui.base/pattern/13.png new file mode 100644 index 000000000..ed119ddf1 Binary files /dev/null and b/comp/src/gb.gui.base/pattern/13.png differ diff --git a/comp/src/gb.gui.base/pattern/14.png b/comp/src/gb.gui.base/pattern/14.png new file mode 100644 index 000000000..c48e07615 Binary files /dev/null and b/comp/src/gb.gui.base/pattern/14.png differ diff --git a/comp/src/gb.gui.base/pattern/2.png b/comp/src/gb.gui.base/pattern/2.png new file mode 100644 index 000000000..f1ae750da Binary files /dev/null and b/comp/src/gb.gui.base/pattern/2.png differ diff --git a/comp/src/gb.gui.base/pattern/3.png b/comp/src/gb.gui.base/pattern/3.png new file mode 100644 index 000000000..e88dfe3cc Binary files /dev/null and b/comp/src/gb.gui.base/pattern/3.png differ diff --git a/comp/src/gb.gui.base/pattern/4.png b/comp/src/gb.gui.base/pattern/4.png new file mode 100644 index 000000000..28e903c6f Binary files /dev/null and b/comp/src/gb.gui.base/pattern/4.png differ diff --git a/comp/src/gb.gui.base/pattern/5.png b/comp/src/gb.gui.base/pattern/5.png new file mode 100644 index 000000000..71b6fef58 Binary files /dev/null and b/comp/src/gb.gui.base/pattern/5.png differ diff --git a/comp/src/gb.gui.base/pattern/6.png b/comp/src/gb.gui.base/pattern/6.png new file mode 100644 index 000000000..5d2662791 Binary files /dev/null and b/comp/src/gb.gui.base/pattern/6.png differ diff --git a/comp/src/gb.gui.base/pattern/7.png b/comp/src/gb.gui.base/pattern/7.png new file mode 100644 index 000000000..9de46516a Binary files /dev/null and b/comp/src/gb.gui.base/pattern/7.png differ diff --git a/comp/src/gb.gui.base/pattern/8.png b/comp/src/gb.gui.base/pattern/8.png new file mode 100644 index 000000000..eb3b9b938 Binary files /dev/null and b/comp/src/gb.gui.base/pattern/8.png differ diff --git a/comp/src/gb.gui.base/pattern/9.png b/comp/src/gb.gui.base/pattern/9.png new file mode 100644 index 000000000..738966f52 Binary files /dev/null and b/comp/src/gb.gui.base/pattern/9.png differ diff --git a/gb.gtk/src/CConst.cpp b/gb.gtk/src/CConst.cpp index 64accc3e8..41820d82e 100644 --- a/gb.gtk/src/CConst.cpp +++ b/gb.gtk/src/CConst.cpp @@ -119,45 +119,6 @@ GB_DESC CScrollDesc[] = }; -GB_DESC CLineDesc[] = -{ - GB_DECLARE("Line", 0), GB_VIRTUAL_CLASS(), - - GB_CONSTANT("None", "i", LINE_NONE), - GB_CONSTANT("Solid", "i", LINE_SOLID), - GB_CONSTANT("Dash", "i", LINE_DASH), - GB_CONSTANT("Dot", "i", LINE_DOT), - GB_CONSTANT("DashDot", "i", LINE_DASH_DOT), - GB_CONSTANT("DashDotDot", "i", LINE_DASH_DOT_DOT), - - GB_END_DECLARE -}; - - -GB_DESC CFillDesc[] = -{ - GB_DECLARE("Fill", 0), GB_VIRTUAL_CLASS(), - - GB_CONSTANT("None", "i", FILL_NONE), - GB_CONSTANT("Solid", "i", FILL_SOLID), - GB_CONSTANT("Dense94", "i", FILL_DENSE_94), - GB_CONSTANT("Dense88", "i", FILL_DENSE_88), - GB_CONSTANT("Dense63", "i", FILL_DENSE_63), - GB_CONSTANT("Dense50", "i", FILL_DENSE_50), - GB_CONSTANT("Dense37", "i", FILL_DENSE_37), - GB_CONSTANT("Dense12", "i", FILL_DENSE_12), - GB_CONSTANT("Dense6", "i", FILL_DENSE_06), - GB_CONSTANT("Horizontal", "i", FILL_HORIZONTAL), - GB_CONSTANT("Vertical", "i", FILL_VERTICAL), - GB_CONSTANT("Cross", "i", FILL_CROSS), - GB_CONSTANT("Diagonal", "i", FILL_DIAGONAL), - GB_CONSTANT("BackDiagonal", "i", FILL_BACK_DIAGONAL), - GB_CONSTANT("CrossDiagonal", "i", FILL_CROSS_DIAGONAL), - - GB_END_DECLARE -}; - - GB_DESC CSelectDesc[] = { GB_DECLARE("Select", 0), GB_VIRTUAL_CLASS(), diff --git a/gb.gtk/src/main.cpp b/gb.gtk/src/main.cpp index 6d405cc25..60243a412 100644 --- a/gb.gtk/src/main.cpp +++ b/gb.gtk/src/main.cpp @@ -119,8 +119,6 @@ extern "C" CArrangeDesc, CBorderDesc, CScrollDesc, - CLineDesc, - CFillDesc, CColorDesc, CFontsDesc, CFontDesc, diff --git a/gb.qt4/src/CConst.cpp b/gb.qt4/src/CConst.cpp index 4eccb6634..4f443a445 100644 --- a/gb.qt4/src/CConst.cpp +++ b/gb.qt4/src/CConst.cpp @@ -236,45 +236,6 @@ GB_DESC CScrollDesc[] = }; -GB_DESC CLineDesc[] = -{ - GB_DECLARE("Line", 0), GB_VIRTUAL_CLASS(), - - GB_CONSTANT("None", "i", LINE_NONE), - GB_CONSTANT("Solid", "i", LINE_SOLID), - GB_CONSTANT("Dash", "i", LINE_DASH), - GB_CONSTANT("Dot", "i", LINE_DOT), - GB_CONSTANT("DashDot", "i", LINE_DASH_DOT), - GB_CONSTANT("DashDotDot", "i", LINE_DASH_DOT_DOT), - - GB_END_DECLARE -}; - - -GB_DESC CFillDesc[] = -{ - GB_DECLARE("Fill", 0), GB_VIRTUAL_CLASS(), - - GB_CONSTANT("None", "i", FILL_NONE), - GB_CONSTANT("Solid", "i", FILL_SOLID), - GB_CONSTANT("Dense94", "i", FILL_DENSE_94), - GB_CONSTANT("Dense88", "i", FILL_DENSE_88), - GB_CONSTANT("Dense63", "i", FILL_DENSE_63), - GB_CONSTANT("Dense50", "i", FILL_DENSE_50), - GB_CONSTANT("Dense37", "i", FILL_DENSE_37), - GB_CONSTANT("Dense12", "i", FILL_DENSE_12), - GB_CONSTANT("Dense6", "i", FILL_DENSE_06), - GB_CONSTANT("Horizontal", "i", FILL_HORIZONTAL), - GB_CONSTANT("Vertical", "i", FILL_VERTICAL), - GB_CONSTANT("Cross", "i", FILL_CROSS), - GB_CONSTANT("Diagonal", "i", FILL_DIAGONAL), - GB_CONSTANT("BackDiagonal", "i", FILL_BACK_DIAGONAL), - GB_CONSTANT("CrossDiagonal", "i", FILL_CROSS_DIAGONAL), - - GB_END_DECLARE -}; - - GB_DESC CSelectDesc[] = { GB_DECLARE("Select", 0), GB_VIRTUAL_CLASS(), diff --git a/gb.qt4/src/cpaint_impl.cpp b/gb.qt4/src/cpaint_impl.cpp index 2c869574e..0405114f5 100644 --- a/gb.qt4/src/cpaint_impl.cpp +++ b/gb.qt4/src/cpaint_impl.cpp @@ -1120,9 +1120,10 @@ static void BrushColor(GB_BRUSH *brush, GB_COLOR color) static void BrushImage(GB_BRUSH *brush, GB_IMAGE image) { - QImage *img = CIMAGE_get((CIMAGE *)image); + QImage img(*CIMAGE_get((CIMAGE *)image)); - QBrush *br = new QBrush(*img); + img.detach(); + QBrush *br = new QBrush(img); *brush = (GB_BRUSH)br; } diff --git a/gb.qt4/src/main.cpp b/gb.qt4/src/main.cpp index 4ddbc8977..efc434908 100644 --- a/gb.qt4/src/main.cpp +++ b/gb.qt4/src/main.cpp @@ -998,7 +998,7 @@ extern "C" { GB_DESC *GB_CLASSES[] EXPORT = { CBorderDesc, CColorDesc, - CAlignDesc, CArrangeDesc, CScrollDesc, CKeyDesc, CLineDesc, CFillDesc, CSelectDesc, + CAlignDesc, CArrangeDesc, CScrollDesc, CKeyDesc, CSelectDesc, CMessageDesc, CImageDesc, CPictureDesc, CFontDesc, CFontsDesc,