Skip to content
Commits on Source (5)
# Gambas Project File 3.0
# Compiled with Gambas 3.0.0
Title=DNS client example
Startup=FMain
Icon=dnsclient.png
Version=3.6.2
Version=3.13.90
VersionFile=1
Component=gb.image
Component=gb.gui
......@@ -15,3 +14,4 @@ Maintainer=benoit
Vendor=Princeton
Address=benoit@desnouettes
License=General Public Licence
Packager=1
......@@ -10,7 +10,6 @@
}
{ Label1 Label
MoveScaled(1,6,61,4)
Text = ("")
}
{ TextBox1 TextBox
MoveScaled(1,11,28,4)
......@@ -29,32 +28,27 @@
Font = Font["Bold"]
Background = &H5500FF&
Foreground = &HFFFF00&
Text = ("")
}
{ Label3 Label
MoveScaled(30,15,32,4)
Font = Font["Bold"]
Background = &H5500FF&
Foreground = &HFFFF00&
Text = ("")
}
{ Label4 Label
MoveScaled(30,19,32,4)
Font = Font["Bold"]
Background = &H5500FF&
Foreground = &HFFFF00&
Text = ("")
}
{ Timer1 #Timer
#X = 204
#Y = 300
#MoveScaled(25.5,37.5)
}
{ Label5 Label
MoveScaled(18,45,27,4)
Font = Font["12,Bold"]
Background = &HAA0000&
Foreground = &HFFFFFF&
Text = ("")
Alignment = Align.Center
}
{ Button2 Button
......@@ -82,34 +76,30 @@
Font = Font["Bold"]
Background = &H5500FF&
Foreground = &HFFFF00&
Text = ("")
}
{ Label7 Label
MoveScaled(30,27,32,4)
Font = Font["Bold"]
Background = &H5500FF&
Foreground = &HFFFF00&
Text = ("")
}
{ Label8 Label
MoveScaled(30,31,32,4)
Font = Font["Bold"]
Background = &H5500FF&
Foreground = &HFFFF00&
Text = ("")
}
{ Label9 Label
MoveScaled(30,35,32,4)
Font = Font["Bold"]
Background = &H5500FF&
Foreground = &HFFFF00&
Text = ("")
}
{ ComboBox1 ComboBox
MoveScaled(1,1,37,4)
Text = (" ")
ReadOnly = True
List = [("Host Name to IP"), ("IP to Host Name")]
Text = (" ")
}
{ Button3 Button
MoveScaled(24,40,12,4)
......
......@@ -974,7 +974,11 @@ Public Function GetClassSymbols(sClass As String, Optional sComponent As String)
Dim sFamily As String
If Len(sClass) <= 1 Then
If sClass <> "." And If Not IsUpper(sClass) Then Return
If sClass = "s" Then
sClass = "_BoxedString"
Else
If sClass <> "." And If Not IsUpper(sClass) Then Return
Endif
Endif
'Debug sClass
......
......@@ -103,10 +103,10 @@ Public Sub Open(hForm As Object, sMode As String, Optional sClass As String, Opt
Case "."
$bGambas = True
$sText = ""
If String.Len(sClass) = 1 Then
Dec Application.Busy
Return
Endif
' If String.Len(sClass) = 1 Then
' Dec Application.Busy
' Return
' Endif
$sClass = sClass
$bStatic = bStatic
'$bPrivate = bPrivate
......
......@@ -217,9 +217,12 @@
ToolTip = ("Clear")
Picture = Picture["icon:/small/erase"]
}
{ Separator9 Separator
MoveScaled(12,0,1,4)
}
{ btnColorize ToolButton btnAction
Name = "btnColorize"
MoveScaled(12,0,4,4)
MoveScaled(13,0,4,4)
Tag = "colorize"
ToolTip = ("Colorize")
Picture = Picture["icon:/small/color"]
......
......@@ -21,8 +21,8 @@
12 Kitiipong Mapagdee
12 Jacky Tripoteau
12 Edward Kelm
11 Gianluigi Gradaschi
10 Thierry Senges
10 Gianluigi Gradaschi
10 Nando Favaro
9 Technical Racing Products
9 David Losada
......
[Component]
Key=gb.form
Version=3.12.90
Version=3.13.90
Authors=Benoît Minisini
Needs=Form
comp/src/gb.form/.icon.png

10.3 KiB | W: | H:

comp/src/gb.form/.icon.png

10.7 KiB | W: | H:

comp/src/gb.form/.icon.png
comp/src/gb.form/.icon.png
comp/src/gb.form/.icon.png
comp/src/gb.form/.icon.png
  • 2-up
  • Swipe
  • Onion skin
# Gambas Project File 3.0
Title=More controls for graphical components
Startup=FTestListEditor
Version=3.12.90
Startup=FTestMenuButton
Version=3.13.90
VersionFile=1
Component=gb.image
Component=gb.gui
Component=gb.settings
Authors="Benoît Minisini"
Environment="GB_GUI=gb.qt5"
Environment="GB_GUI=gb.qt5\nGB_REVERSE=1"
TabSize=2
Translate=1
Language=en
......
......@@ -379,7 +379,7 @@ End
Public Sub DrawingArea_Draw()
Dim X, X2, Y As Integer
Dim X, X2, Y, W As Integer
Dim iFlag As Integer
Dim sText As String
Dim bFlat As Boolean
......@@ -387,6 +387,8 @@ Public Sub DrawingArea_Draw()
Dim iFg As Integer
Dim hFont As Font
Dim bMenu As Boolean
Dim iAlign As Integer
Dim DS As Integer = Desktop.Scale
iFlag = Style.StateOf($hDrawingArea)
......@@ -399,7 +401,7 @@ Public Sub DrawingArea_Draw()
'If Not Me.Enabled Then iFlag += Draw.Disabled
If $hDrawingArea.HasFocus Then iFlag += Draw.Hover
bDrawArrow = $bArrow And (Me.W > Desktop.Scale * 4)
bDrawArrow = $bArrow And (Me.W > DS * 4)
'' TODO: System.RightToLeft
......@@ -414,40 +416,71 @@ Public Sub DrawingArea_Draw()
Style.PaintButton(0, 0, Me.W, Me.H, $bPressed, iFlag, bFlat)
Endif
X = Desktop.Scale
If $hPicture Then
If System.RightToLeft Then
X = Paint.W - DS - $hPicture.W
Else
X = DS
Endif
If Me.Enabled Then
Paint.DrawPicture($hPicture, X, (Me.H - $hPicture.H) / 2)
Else
Paint.DrawImage($hPicture.Image.Desaturate(), X, (Me.H - $hPicture.H) / 2)
Endif
X += $hPicture.H + Desktop.Scale
Endif
If bDrawArrow Then
'If $bBorder Or If $bInside Then Draw.Style.Separator(Me.W - Desktop.Scale * 3, 3, 3, Me.H - 6, True)
Style.PaintArrow(Me.W - Desktop.Scale * 2, 0, Desktop.Scale, Me.H, Align.Bottom, iFlag)
If System.RightToLeft Then
Style.PaintArrow(DS, 0, DS, Me.H, Align.Bottom, iFlag)
Else
Style.PaintArrow(Me.W - DS * 2, 0, DS, Me.H, Align.Bottom, iFlag)
Endif
Endif
If $sText Then
If bDrawArrow Then Paint.ClipRect = Rect(0, 0, Me.W - Desktop.Scale * 3, Me.H)
iFg = Style.ForegroundOf(Me)
If Not Me.Enabled Then iFg = Color.Merge(Color.ButtonBackground, iFg)
If bMenu Then iFg = Color.SelectedForeground
Paint.Background = iFg
sText = $sText
If $iShortcutPos Then sText = String.Left($sText, $iShortcutPos - 1) & String.Mid$($sText, $iShortcutPos + 1)
If Not $hPicture And If Not $bArrow Then
X = (Me.W - Draw.Font.TextWidth(sText)) \ 2
X = DS
W = Me.W - DS * 2
If Not $hPicture And If Not bDrawArrow Then
iAlign = Align.Center
Else
iAlign = Align.Normal
If $hPicture Then
W -= $hPicture.W + DS
If Not System.RightToLeft Then X += $hPicture.W + DS
Endif
If bDrawArrow Then
If System.RightToLeft Then X += DS * 2
W -= DS * 2
Endif
Endif
Paint.DrawText(sText, X, 0, Me.W - X, Me.H, Align.Left)
Paint.ClipRect = Rect(X, 0, W, Me.H)
Paint.DrawText(sText, X, 0, W, Me.H, iAlign)
If $iShortcutPos Then
hFont = Paint.Font
If iAlign = Align.Center Then X += (W - hFont.TextWidth(sText)) \ 2
X2 = X + hFont.TextWidth(String.Left(sText, $iShortcutPos))
X += hFont.TextWidth(String.Left(sText, $iShortcutPos - 1))
Y = (Me.H - hFont.Height) / 2 + hFont.Ascent + 1
Paint.FillRect(X, Y, X2 - X, 1, iFg)
If System.RightToLeft Then
Paint.FillRect(Paint.W - X, Y, X2 - X, 1, iFg)
Else
Paint.FillRect(X, Y, X2 - X, 1, iFg)
Endif
Endif
Endif
......
......@@ -6,11 +6,11 @@ Private $bInside As Boolean
Private $bAnim As Boolean
Private Const HIDE_TIME As Float = 0.1
Private $sText As String
Public Sub _new()
'UpdatePicture
UpdateTitle
'dwgTitle_Font
End
......@@ -62,7 +62,7 @@ Public Sub SetHidden(bHidden As Boolean)
If bHidden = $bHidden Then Return
$bHidden = bHidden
btnExpand.Refresh
dwgTitle.Refresh
If $bHidden Then
......@@ -70,14 +70,14 @@ Public Sub SetHidden(bHidden As Boolean)
If $bAnim Then
eTime = Timer
DY = $H - panTitle.H
DY = $H - dwgTitle.H
While Timer < (eTime + HIDE_TIME)
Me.Parent.H = $H - ((Timer - eTime) / HIDE_TIME) * DY
Wait
Wend
Endif
Me.Parent.H = panTitle.H
Me.Parent.H = dwgTitle.H
panContainer.Hide
GetParent()._Hide()
......@@ -89,9 +89,9 @@ Public Sub SetHidden(bHidden As Boolean)
If $bAnim Then
eTime = Timer
DY = $H - panTitle.H
DY = $H - dwgTitle.H
While Timer < (eTime + HIDE_TIME)
Me.Parent.H = panTitle.H + ((Timer - eTime) / HIDE_TIME) * DY
Me.Parent.H = dwgTitle.H + ((Timer - eTime) / HIDE_TIME) * DY
Wait
Wend
Endif
......@@ -104,46 +104,32 @@ End
Public Sub GetText() As String
Return lblTitle.Text
Return $sText
End
Public Sub SetText(sText As String)
lblTitle.Text = sText
UpdateTitle
$sText = sText
dwgTitle.Refresh
End
Public Sub GetFont() As Font
Return lblTitle.Font
Return dwgTitle.Font
End
Public Sub SetFont(hFont As Font)
lblTitle.Font = hFont
UpdateTitle
dwgTitle.Font = hFont
dwgTitle.Refresh
End
Public Sub btnExpand_Enter()
$bInside = True
btnExpand.Refresh
End
Public Sub btnExpand_Leave()
$bInside = False
btnExpand.Refresh
End
Public Sub btnExpand_MouseDown()
If Not Me.Enabled Then Return
......@@ -163,45 +149,13 @@ Public Sub SetAnimated(bAnim As Boolean)
End
Private Sub UpdateTitle()
panTitle.H = Desktop.Scale + Max(Desktop.Scale * 2, ((lblTitle.Font.Height + Desktop.Scale - 1) \ Desktop.Scale) * Desktop.Scale)
btnExpand.W = Desktop.Scale * 2
End
Public Sub btnExpand_Draw()
Dim iFlag As Integer
Dim Y, W As Integer
Public Sub dwgTitle_Font()
W = Desktop.Scale * 3 / 2
Y = (btnExpand.H - W) / 2
dwgTitle.H = Desktop.Scale + Max(Desktop.Scale * 2, ((dwgTitle.Font.Height + Desktop.Scale - 1) \ Desktop.Scale) * Desktop.Scale)
If Not Me.Enabled Then iFlag += Draw.Disabled
If $bInside And If Me.Enabled Then
iFlag += Draw.Hover
'Draw.Style.Button(0, Y, W, W, False, iFlag, True)
Endif
Draw.Style.Arrow(0, Y, W, W, If($bHidden, Align.Right, Align.Bottom), iFlag)
'Draw.Rect(0, Y, W, W)
End
Public Sub panTitle_Enter()
panTitle.Background = Color.Merge(Color.Background, Color.TextBackground)
End
Public Sub panTitle_Leave()
panTitle.Background = Color.Default
End
Public Sub panTitle_MouseDown()
Public Sub dwgTitle_MouseDown()
SetHidden(Not $bHidden)
......@@ -219,3 +173,46 @@ Public Sub SetBorder(bBorder As Boolean)
End
Public Sub dwgTitle_Draw()
Dim iFlag As Integer
Dim Y, W As Integer
Dim D As Integer
D = Desktop.Scale
W = D * 3 / 2
Y = (Paint.H - W) / 2
If Not Me.Enabled Then iFlag += Draw.Disabled
If $bInside And If Me.Enabled Then iFlag += Draw.Hover
If System.RightToLeft Then
Style.PaintArrow(Paint.W - W, Y, W, W, If($bHidden, Align.Left, Align.Bottom), iFlag)
If $bInside Then Paint.DrawTextShadow($sText, 0, 0, Paint.W - W - D, Paint.H, Align.Normal)
Paint.DrawText($sText, 0, 0, Paint.W - W - D, Paint.H, Align.Normal)
Else
Style.PaintArrow(0, Y, W, W, If($bHidden, Align.Right, Align.Bottom), iFlag)
If $bInside Then Paint.DrawTextShadow($sText, W + D, 0, Paint.W, Paint.H, Align.Normal)
Paint.DrawText($sText, W + D, 0, Paint.W, Paint.H, Align.Normal)
Endif
End
Public Sub dwgTitle_Enter()
If Me.Enabled Then
$bInside = True
dwgTitle.Mouse = Mouse.Pointing
dwgTitle.Refresh
Endif
End
Public Sub dwgTitle_Leave()
$bInside = False
dwgTitle.Mouse = Mouse.Default
dwgTitle.Refresh
End
......@@ -4,20 +4,11 @@
MoveScaled(0,0,65,59)
Resizable = False
Arrangement = Arrange.Vertical
{ panTitle Panel
MoveScaled(1,2,46,4)
Arrangement = Arrange.Horizontal
{ btnExpand DrawingArea
MoveScaled(0,0,3,3)
}
{ lblTitle Label btnExpand
Name = "lblTitle"
MoveScaled(4,0,33,3)
AutoResize = True
}
{ dwgTitle DrawingArea
MoveScaled(1,2,58,4)
}
{ HBox1 HBox
MoveScaled(2,7,49,41)
MoveScaled(2,9,49,41)
Expand = True
{ Panel1 Panel
MoveScaled(2,8,2,3)
......
......@@ -311,7 +311,7 @@ End
Public Sub View_MouseWheel()
GotoIndex(- Sgn(Mouse.Delta))
GotoIndex(-Sgn(Mouse.Delta))
End
......
......@@ -101,7 +101,6 @@ Public Sub SpinBox_Change()
End
Private Function Step_Read() As Integer
Return $iStep
......@@ -118,7 +117,7 @@ End
Public Sub SpinBox_MouseWheel()
If Not Me.Enabled Then Return
$hSpinBox.Value += If(Mouse.Forward, $iStep, - $iStep)
$hSpinBox.Value += If(Mouse.Forward, $iStep, -$iStep)
Stop Event
End
......@@ -155,3 +154,12 @@ Private Sub Font_Write(Value As Font)
UpdateSpinBoxWidth
End
Public Sub SpinBox_KeyPress()
If Key.Code = Key.Esc Then
$hSlider.Value = $iDefault
Stop Event
Endif
End
......@@ -152,7 +152,7 @@ Public Sub EnsureCurrentVisible_Timer()
If Me.W <= ($aButton[$iCurrent].W + ARROW_WIDTH) Then
$X = - $aButton[$iCurrent].X
$X = -$aButton[$iCurrent].X
Else
......@@ -205,7 +205,7 @@ Public Sub EnsureCurrentVisible_Timer()
iLeftIndex = _GetFirstIndex()
iRightIndex = GetLastIndex()
Endif
$hLeftArrow.Visible = $X < (- $aButton[iLeftIndex].X) '+ $aButton[iIndex].X + $aButton[iIndex].W) > $hTabBar.W
$hLeftArrow.Visible = $X < (-$aButton[iLeftIndex].X) '+ $aButton[iIndex].X + $aButton[iIndex].W) > $hTabBar.W
$hRightArrow.Visible = ($X + $aButton[iRightIndex].X + $aButton[iRightIndex].W) > $hTabBar.W
Else
$hLeftArrow.Hide
......
......@@ -194,7 +194,7 @@ Public Sub DrawingArea_Draw()
Paint.MoveTo(S, S)
Paint.RelLineTo(S * 2, S * 2)
Paint.MoveTo(S * 3, S)
Paint.RelLineTo(- S * 2, S * 2)
Paint.RelLineTo(-S * 2, S * 2)
Paint.LineWidth = Desktop.Scale / 4
Paint.LineCap = Paint.LineCapRound
......
# Gambas Form File 3.0
{ Form Form
MoveScaled(0,0,100,72)
MoveScaled(0,0,100,82)
{ Menu1 Menu
{ Menu2 Menu
Text = ("Menu2")
......@@ -64,4 +64,7 @@
{ ButtonBox1 ButtonBox
MoveScaled(34,5,24,4)
}
{ SliderBox1 SliderBox
MoveScaled(9,70,32,4)
}
}