diff --git a/comp/src/gb.form/.project b/comp/src/gb.form/.project index 7fe8b08b6..257a18fe0 100644 --- a/comp/src/gb.form/.project +++ b/comp/src/gb.form/.project @@ -1,7 +1,6 @@ # Gambas Project File 3.0 -# Compiled with Gambas 3.10.90 Title=More controls for graphical components -Startup=Main +Startup=FTabPanel Version=3.10.90 VersionFile=1 Component=gb.image diff --git a/comp/src/gb.form/.src/Main.module b/comp/src/gb.form/.src/Main.module index f1a963f8c..872f844a2 100644 --- a/comp/src/gb.form/.src/Main.module +++ b/comp/src/gb.form/.src/Main.module @@ -129,11 +129,8 @@ Public Sub PaintColor(X As Integer, Y As Integer, W As Integer, H As Integer, iC Endif - End - - #If False Private Sub AddUnique(aStr As String[], sVal As String) diff --git a/comp/src/gb.form/.src/TabPanel/_TabPanelButton.class b/comp/src/gb.form/.src/TabPanel/_TabPanelButton.class index e0bf9a718..91a74540e 100644 --- a/comp/src/gb.form/.src/TabPanel/_TabPanelButton.class +++ b/comp/src/gb.form/.src/TabPanel/_TabPanelButton.class @@ -20,7 +20,7 @@ Private $hPicture As Picture Private $bShowClose As Boolean Private $bInClose As Boolean -Private Const BUTTON_SIZE As Integer = 14 +Static Private BUTTON_SIZE As Integer Static Private $bDragging As Boolean Private $bDrag As Boolean @@ -34,6 +34,8 @@ Private $bInside As Boolean Public Sub _new() + If BUTTON_SIZE = 0 Then BUTTON_SIZE = Desktop.Scale * 2 + $hDrawingArea = New DrawingArea(Me) As "DrawingArea" $hDrawingArea.Mouse = Mouse.Pointing $hDrawingArea.Name = Me.Name & "_DrawingArea" @@ -69,9 +71,9 @@ Public Sub DrawingArea_Draw() Dim bHighlight As Boolean Dim bFirst As Boolean Dim iIndex As Integer - Dim hPict As Picture Dim iBg As Integer Dim hFont As Font + Dim S As Float hTabPanel = GetParent() @@ -175,12 +177,29 @@ Public Sub DrawingArea_Draw() End Select If $bShowClose And If Not $bDragging Then - hPict = Picture[If($bInClose, "img/delete-h.png", "img/delete.png")] + + Paint.Save + If System.RightToLeft Then - Draw.Picture(hPict, 2, (Me.H - hPict.H) \ 2) + Paint.Translate(4, (Me.H - BUTTON_SIZE) \ 2) Else - Draw.Picture(hPict, Me.W - hPict.W - 2, (Me.H - hPict.H) \ 2) + Paint.Translate(Me.W - BUTTON_SIZE - 4, (Me.H - BUTTON_SIZE) \ 2) Endif + + S = BUTTON_SIZE / 4 + Paint.MoveTo(S, S) + Paint.RelLineTo(S * 2, S * 2) + Paint.MoveTo(S * 3, S) + Paint.RelLineTo(- S * 2, S * 2) + + Paint.LineWidth = Desktop.Scale / 4 + Paint.LineCap = Paint.LineCapRound + Paint.Background = If($bInClose, Color.TextForeground, Color.LightForeground) + + Paint.Stroke + + Paint.Restore + Endif If $bSelected And If Me.Parent.HasFocus Then @@ -224,19 +243,19 @@ Public Sub UpdateLayout() Dim bClosable As Boolean = IsClosable() If $bRichText Then - S = Me.Parent.Font.RichTextWidth($sText) + 16 + S = Me.Parent.Font.RichTextWidth($sText) + Desktop.Scale * 2 Else - S = Me.Parent.Font.TextWidth($sText) + 16 + S = Me.Parent.Font.TextWidth($sText) + Desktop.Scale * 2 Endif Select Case $iOrientation Case Align.Left, Align.Right - If $hPicture Then S += $hPicture.W '- 4 - If bClosable Then S += BUTTON_SIZE - 4 + If $hPicture Then S += $hPicture.H '- 4 + If bClosable Then S += BUTTON_SIZE Me.H = S Case Else If $hPicture Then S += $hPicture.W '- 4 - If bClosable Then S += BUTTON_SIZE - 4 + If bClosable Then S += BUTTON_SIZE Me.W = S End Select diff --git a/comp/src/gb.form/.src/Test/FTabPanel.class b/comp/src/gb.form/.src/Test/FTabPanel.class index 2c6998711..aeb15139d 100644 --- a/comp/src/gb.form/.src/Test/FTabPanel.class +++ b/comp/src/gb.form/.src/Test/FTabPanel.class @@ -24,7 +24,7 @@ Public Sub Form_Open() For I = 0 To TabPanel2.Count - 1 TabPanel2.Index = I TabPanel2.Text = "Tab " & (I + 1) & " " & String$(CInt(Rnd(1, 10)), "-") - TabPanel2.Picture = Picture["icon:/16/bookmark"] + TabPanel2.Picture = Picture["icon:/32/bookmark"] hLabel = New Label(TabPanel2) hLabel.Move(8, 8, 8, 8) hLabel.AutoResize = True diff --git a/comp/src/gb.form/.src/Test/FTestValueBox.class b/comp/src/gb.form/.src/Test/FTestValueBox.class index 2a3eec784..533aaf639 100644 --- a/comp/src/gb.form/.src/Test/FTestValueBox.class +++ b/comp/src/gb.form/.src/Test/FTestValueBox.class @@ -1,18 +1,8 @@ ' Gambas class file -Public Sub Button1_Click() - - ValueBox1.Type = ValueBox.Date - -End - -Public Sub ValueBox1_Change() - - Debug - -End - Public Sub Form_Open() + DateBox1.Value = Date(30, 1, 1) + End diff --git a/comp/src/gb.form/.src/Test/FTestValueBox.form b/comp/src/gb.form/.src/Test/FTestValueBox.form index 519e88bc2..73529b81a 100644 --- a/comp/src/gb.form/.src/Test/FTestValueBox.form +++ b/comp/src/gb.form/.src/Test/FTestValueBox.form @@ -1,23 +1,22 @@ # Gambas Form File 3.0 { Form Form - MoveScaled(0,0,64,64) - Arrangement = Arrange.Vertical - { ValueBox1 ValueBox - MoveScaled(9,11,17,4) - Alignment = Align.Left - } - { ValueBox2 ValueBox - MoveScaled(9,16,17,4) - } + MoveScaled(0,0,58,61) { TextBox1 TextBox MoveScaled(11,26,24,4) Text = ("Hello world!") } { Spring1 Spring - MoveScaled(32,33,4,6) + MoveScaled(25,32,4,6) } { Button1 Button - MoveScaled(26,42,16,4) + MoveScaled(19,42,16,4) + } + { DateBox1 DateBox + MoveScaled(12,4,24,4) + } + { ValueBox1 ValueBox + MoveScaled(9,13,24,4) + Type = ValueBox.Date } } diff --git a/comp/src/gb.form/img/delete-h-dark.png b/comp/src/gb.form/img/delete-h-dark.png deleted file mode 100644 index dbcb17bdc..000000000 Binary files a/comp/src/gb.form/img/delete-h-dark.png and /dev/null differ diff --git a/comp/src/gb.form/img/delete-h.png b/comp/src/gb.form/img/delete-h.png deleted file mode 100644 index 3a24d7d45..000000000 Binary files a/comp/src/gb.form/img/delete-h.png and /dev/null differ diff --git a/comp/src/gb.form/img/delete.png b/comp/src/gb.form/img/delete.png deleted file mode 100644 index 4632917c3..000000000 Binary files a/comp/src/gb.form/img/delete.png and /dev/null differ