...
 
Commits (5)
......@@ -74,6 +74,9 @@ Private $sLastColor As Integer
Private $cInfo As New Collection
Private $bInfoTop As Boolean
Private $bFirstGrid As Boolean
Private $vGrid As Variant
Public Sub _new(sPath As String)
Me.Name = File.Name(sPath)
......@@ -652,7 +655,7 @@ Private Sub GetImagePos() As PointF
iSnap = FImageProperty.GetGridSnap()
If $bShowGrid And If iSnap Then
If $bShowGrid And If iSnap And If $sTool <> "draw" And If $sTool <> "erase" Then
X = (CInt(Floor(X + iSnap \ 2)) \ iSnap) * iSnap
Y = (CInt(Floor(Y + iSnap \ 2)) \ iSnap) * iSnap
......@@ -917,7 +920,7 @@ Private Sub UpdateInfo()
$cInfo!Size = Util.GetFileSize($hImage.Width * $hImage.Height * 4)
Endif
dwgInfo.Resize(dwgInfo.Font.TextWidth("99999") * 4 + Desktop.Scale * 4, dwgInfo.Font.Height * 2 + Desktop.Scale * 2)
dwgInfo.Resize(dwgInfo.Font.TextWidth("9") * Max(5, 3 + Len(CStr(Max($hImage.Width, $hImage.Height)))) * 4 + Desktop.Scale * 4, dwgInfo.Font.Height * 2 + Desktop.Scale * 2)
MoveInfo
dwgInfo.Refresh
......@@ -1737,16 +1740,18 @@ Public Sub imvImage_Draw(hZoom As Image)
'
' Endif
If $bShowGrid Then
Paint.Save
Paint.AntiAlias = False
Paint.LineWidth = 1 / imvImage.Zoom
Paint.Save
Paint.AntiAlias = False
Paint.Translate(hOffset.X, hOffset.Y)
Paint.Scale(imvImage.Zoom, imvImage.Zoom)
Paint.LineWidth = 1 / imvImage.Zoom
Paint.Translate(hOffset.X, hOffset.Y)
Paint.Scale(imvImage.Zoom, imvImage.Zoom)
Paint.DrawRect(0, 0, $hImage.W, $hImage.H, Color.Foreground, Paint.LineWidth)
If $bShowGrid Then
Paint.Rectangle(0, 0, $hImage.W, $hImage.H)
Paint.Clip()
......@@ -1774,12 +1779,12 @@ Public Sub imvImage_Draw(hZoom As Image)
Next
Endif
Paint.Background = &H808080&
Paint.Background = Color.Foreground '&H808080&
Paint.Stroke
Paint.Restore
Endif
Paint.Restore
If HasSelection() Then
......@@ -2802,18 +2807,33 @@ End
Public Sub btnGrid_Click()
Dim iSize As Integer
$bShowGrid = Not $bShowGrid
imvImage.Refresh
FImageProperty.ShowGridOption($bShowGrid)
If $bShowGrid And If Not $bFirstGrid Then
$bFirstGrid = True
iSize = Min($hImage.Width, $hImage.Height) \ 2
FImageProperty.SetGridResolution(iSize)
Endif
End
Public Sub UpdateGrid()
Public Sub UpdateGrid(vGrid As Variant)
$vGrid = vGrid
imvImage.Refresh
End
Public Sub GetGrid() As Variant
Return $vGrid
End
Public Sub btnDuplicate_Click()
......
......@@ -37,6 +37,7 @@ Private $iFillRule As Integer
Private $iNoUpdateBalance As Integer
Private $bChangingTab As Boolean
Private $bDoNotUpdateGrid As Boolean
'Static Public Value As String '"radialgradient(0.5,0.5,1,0.5,0.5,[&hFFFFFF,&h000000,&h00FF00],[0,0.5,1])" '"lineargradient(0,0.5,1,0.5,[&hFFFFFF,&h000000,&h00FF00],[0,0.5,1])"
......@@ -1024,6 +1025,7 @@ End
Public Sub OnProjectActivate()
Dim hCurrent As FImageEditor
Dim vGrid As Variant
UpdateBalance
'UpdateInfo
......@@ -1031,6 +1033,15 @@ Public Sub OnProjectActivate()
hCurrent = GetCurrent()
If hCurrent Then
ShowGridOption(hCurrent.HasGrid())
vGrid = hCurrent.GetGrid()
If vGrid Then
$bDoNotUpdateGrid = True
txtGridRes.Value = vGrid[0]
txtGridSnap.Value = vGrid[1]
chkGridSnap.Value = vGrid[2]
chkGridDiag.Value = vGrid[3]
$bDoNotUpdateGrid = False
Endif
ShowTextOption(hCurrent.GetTool() = "text")
Me.Enabled = Not hCurrent.ReadOnly
Endif
......@@ -1265,17 +1276,27 @@ Private Sub InitShapes()
End
Private Sub UpdateGrid()
Dim vGrid As Variant
If $bDoNotUpdateGrid Then Return
vGrid = [txtGridRes.Value, txtGridSnap.Value, chkGridSnap.Value, chkGridDiag.Value]
Try GetCurrent().UpdateGrid(vGrid)
End
Public Sub txtGridRes_Change()
txtGridSnap.MaxValue = txtGridRes.Value
txtGridSnap.Step = Lsl(1, Max(0, CInt(Log2(txtGridRes.Value)) - 3))
Try GetCurrent().UpdateGrid
UpdateGrid
End
Public Sub txtGridSnap_Change()
'Try GetCurrent().UpdateGrid
UpdateGrid
End
......@@ -1291,9 +1312,16 @@ Public Sub GetGridResolution() As Integer
End
Public Sub SetGridResolution(iSize As Integer) As Integer
txtGridRes.Value = iSize
End
Public Sub GetGridSnap() As Integer
Return txtGridSnap.Value
If chkGridSnap.Value Then Return txtGridSnap.Value
End
......@@ -1323,10 +1351,8 @@ Public Sub ShowGridOption(bShow As Boolean)
panGrid.Visible = bShow
sepGrid.Visible = bShow
End
End
Public Sub RefreshTextOption()
......@@ -1506,7 +1532,7 @@ End
Public Sub chkGridDiag_Click()
Try GetCurrent().UpdateGrid
UpdateGrid
End
......@@ -1515,3 +1541,9 @@ Public Sub cchColor_Change()
palColor.Current = cchColor.Value
End
Public Sub chkGridSnap_Click()
UpdateGrid
End
......@@ -597,22 +597,22 @@
}
{ txtGridRes SpinBox
MoveScaled(17,0,9,4)
MinValue = 8
MinValue = 4
MaxValue = 512
Step = 8
Step = 4
Value = 64
}
}
{ Panel5 HBox
MoveScaled(1,5,40,4)
{ Label13 Label
MoveScaled(0,0,14,4)
{ chkGridSnap CheckBox
MoveScaled(0,0,15,4)
Expand = True
AutoResize = True
Text = ("Grid snap")
}
{ txtGridSnap SpinBox
MoveScaled(29,0,9,4)
MinValue = 1
MaxValue = 512
Step = 8
Value = 8
......
......@@ -2474,11 +2474,11 @@ Public Sub dwgWelcome_Draw()
If Not frmWelcome.Visible Then Return
If Not $hCornerNW Then
$hCornerNW = Image.Load("img/welcome/corner.png")
$hCornerNW = Image.Load("welcome/corner.png")
$hCornerNE = $hCornerNW.Copy().RotateRight()
$hCornerSE = $hCornerNE.Copy().RotateRight()
$hCornerSW = $hCornerSE.Copy().RotateRight()
$hBorderN = Image.Load("img/welcome/border.png")
$hBorderN = Image.Load("welcome/border.png")
$hBorderE = $hBorderN.Copy().RotateRight()
$hBorderS = $hBorderE.Copy().RotateRight()
$hBorderW = $hBorderS.Copy().RotateRight()
......
......@@ -22,7 +22,7 @@
'
Public Const COLOR_ORANGE As Integer = &HDF6B00
Public Const COLOR_BLUE As Integer = &H3398C3
Public Const COLOR_BLUE As Integer = &H61A7C3 '&H3398C3
Public ProjectTree As TreeView
Public Tree As CProjectTree
......@@ -333,6 +333,7 @@ Public Sub Main()
Next
Try Component.Load("gb.inotify")
Try Component.Load("gb.media")
If Not Settings["/ShowMenus", True] Then Env["APPMENU_DISPLAY_BOTH"] = "1"
Env["QT_LOGGING_RULES"] = "*.debug=false"
......
......@@ -510,7 +510,7 @@ Public Sub dwgTitle_Draw()
Dim hDrawingArea As DrawingArea = Last
Paint.Background = Color.LightForeground
Paint.Background = Color.Merge(Color.LightForeground, Color.Foreground)
Paint.DrawText(hDrawingArea.Tag, 1, 0, Paint.W, Paint.H, Align.BottomNormal)
End
......
......@@ -20,7 +20,7 @@ Public Sub btnCancel_Click()
End
Public Sub UpdateLayout()
Private Sub UpdateLayout()
Dim sPrefix As String
Dim hChild As Control
......@@ -33,6 +33,13 @@ Public Sub UpdateLayout()
bOpt = bOpt Or hChild.Visible
Next
Select Case $sType
Case "image"
txtWidth.Value = Settings["/FCreateFile/ImageWidth", 8]
txtHeight.Value = Settings["/FCreateFile/ImageHeight", 8]
cmbImageType.Text = Settings["/FCreateFile/ImageType", "PNG"]
End Select
lblOption.Visible = bOpt
If Not $bDoNotSetName Then
......@@ -119,6 +126,15 @@ Private Sub CreateFile() As Boolean
Dim sTemp As String
Dim hImage As Image
Select Case sType
Case "image"
Settings["/FCreateFile/ImageWidth"] = txtWidth.Value
Settings["/FCreateFile/ImageHeight"] = txtHeight.Value
Settings["/FCreateFile/ImageType"] = cmbImageType.Text
End Select
Select Case sType
Case "text", "image", "html", "css", "js"
......
......@@ -18,6 +18,13 @@ Public Sub Run()
End
Public Sub _new()
dwgTitle.Background = Project.COLOR_BLUE
End
Public Sub Form_Open()
Dim aGroup As New CSoftwareGroup[]
......
' Gambas class file
Public Seed As Integer
Public Age As Integer
......@@ -3,6 +3,8 @@
Static Private BACKGROUND_COLOR As Integer = Project.COLOR_BLUE
Static Private TEXT_COLOR As Integer = Project.COLOR_ORANGE
Public NoTear As Boolean
Private $hLogo As Image
Private $hText As Image
......@@ -14,8 +16,14 @@ Private $aSnowFlakes As New CSnowFlake[]
Private MAX_SNOW_FLAKES As Integer = 250
Private $aImage As Image[]
Private $bIgnoreTree As Boolean
Private $bSnow As Boolean
Private $aTears As New CTear[]
Private $bTear As Boolean
Private $hTear As Image
Private $iTearAge As Integer
Public Sub _new(hDrawingArea As DrawingArea)
Public Sub _new(hDrawingArea As DrawingArea, Optional bHasTear As Boolean)
Dim hSnowFlake As Image
Dim I As Integer
......@@ -28,15 +36,21 @@ Public Sub _new(hDrawingArea As DrawingArea)
dNow = Now
If dNow >= Date(Year(dNow), 12, 25) Then
$hTimer = New Timer As "SnowTimer"
$hTimer.Delay = 50
hSnowFlake = Image.Load("img/snowflake.png")
hSnowFlake = Image.Load("welcome/snowflake.png")
$aImage = New Image[8]
For I = 0 To $aImage.Max
$aImage[I] = hSnowFlake.Stretch(I + 1, I + 1)
Next
$bSnow = True
Endif
$bTear = bHasTear
If $bSnow Or If $bTear Then
$hTimer = New Timer As "SnowTimer"
$hTimer.Delay = 50
Endif
End
......@@ -85,6 +99,15 @@ Public Sub dwgWelcome_Draw()
Dim hFir As Image
Dim sText As String
Dim sVersion As String
Dim hTear As CTear
Dim R As Float
Dim iAge As Integer
Dim XT As Float
Dim DXT As Float
Dim YT As Float
Dim J As Integer
Dim bDraw As Boolean
Dim DYT As Float
If Not $hLogo Then
......@@ -143,23 +166,92 @@ Public Sub dwgWelcome_Draw()
If $hTimer Then
If Not $hSnow Then
$hSnow = New Image(hDrawingArea.Width, hDrawingArea.Height, Color.Transparent)
Paint.Begin($hSnow)
hFir = Image.Load("img/fir.png")
Paint.DrawImage(hFir, 430, $hSnow.H - hFir.H)
If $bTear Then
If Not $hTear Then $hTear = New Image($hLogo.W, $hLogo.H, Color.Transparent, Image.Premultiplied)
$hTear.Fill(Color.Transparent)
Paint.Begin($hTear)
Paint.Translate(112, 87)
Debug $aTears.Count
I = 0
While I < $aTears.Count
hTear = $aTears[I]
Inc hTear.Age
bDraw = False
Randomize hTear.Seed
XT = 0.0
YT = 0.0
DXT = Rnd(-8, 8)
DYT = 0.1
For J = 0 To hTear.Age
iAge = hTear.Age - J
XT += DXT + Rnd(-0.1, 0.1)
YT += DYT
If Color[$hLogo[XT + 112, YT + 87]].Luminance < 24 Then
DYT = 0.1
Else
DYT = Max(0.5, DYT + 0.025)
Endif
DXT /= 2
If iAge < 128 And If (YT - R) < (Paint.H - 87) Then
R = Max(0.5, 3 - Sqr(iAge) / 4)
Paint.Ellipse(XT - R, YT - R, R * 2, R * 2)
Paint.Background = Color.RGB(240, 240, 255) ', 255 + (iAge \ 8) - 16)
Paint.Fill
bDraw = True
Endif
Next
If bDraw Then
Inc I
Else
$aTears.Remove(I)
Endif
Wend
Paint.End
Paint.DrawImage($hTear, hDrawingArea.W - $hLogo.Width - Desktop.Scale, 0)
Endif
If $bSnow Then
Paint.DrawImage($hSnow, 0, 0)
If Not $hSnow Then
$hSnow = New Image(hDrawingArea.Width, hDrawingArea.Height, Color.Transparent)
Paint.Begin($hSnow)
hFir = Image.Load("welcome/fir.png")
Paint.DrawImage(hFir, 430, $hSnow.H - hFir.H)
Paint.End
Endif
For I = 0 To $aSnowFlakes.Max
hSnowFlake = $aSnowFlakes[I]
With hSnowFlake
S = 1 + .Size \ 2
Paint.DrawImage($aImage[.Size], CInt(.X) - S, CInt(.Y) - S)
End With
Next
Paint.DrawImage($hSnow, 0, 0)
For I = 0 To $aSnowFlakes.Max
hSnowFlake = $aSnowFlakes[I]
With hSnowFlake
S = 1 + .Size \ 2
Paint.DrawImage($aImage[.Size], CInt(.X) - S, CInt(.Y) - S)
End With
Next
Endif
$hTimer.Start
......@@ -179,76 +271,94 @@ Fast Public Sub SnowTimer_Timer()
Dim X As Integer
Dim Y As Integer
Dim C As Integer
Dim hTear As CTear
$hTimer.Stop
If Not Object.IsValid(hDrawingArea) Then Return
H = hDrawingArea.H - 1
Paint.Begin($hSnow)
Paint.Background = Color.SetAlpha(&HF0F0F0&, 128)
If $bSnow Then
While I < $aSnowFlakes.Count
hSnowFlake = $aSnowFlakes[I]
With hSnowFlake
.X += .DX
.Y += .DY
X = CInt(.X)
Y = Min(H, CInt(.Y))
C = $hSnow[X, Y]
If Y < H And If C <> Color.White Then
If .IgnoreTree Or If Color[C].Alpha > 16 Then
Inc I
Continue
H = hDrawingArea.H - 1
Paint.Begin($hSnow)
Paint.Background = Color.SetAlpha(&HF0F0F0&, 128)
While I < $aSnowFlakes.Count
hSnowFlake = $aSnowFlakes[I]
With hSnowFlake
.X += .DX
.Y += .DY
X = CInt(.X)
Y = Min(H, CInt(.Y))
C = $hSnow[X, Y]
If Y < H And If C <> Color.White Then
If .IgnoreTree Or If Color[C].Alpha > 16 Then
Inc I
Continue
Endif
Endif
Endif
.X -= .DX
.Y -= .DY
If .DX Then
If .DX < 1 Then
.DX = 0
Else
.DX *= 0.5
.DY *= 0.75
.X -= .DX
.Y -= .DY
If .DX Then
If .DX < 1 Then
.DX = 0
Else
.DX *= 0.5
.DY *= 0.75
Endif
Inc I
Continue
Endif
Inc I
Continue
Endif
$aSnowFlakes.Remove(I)
'S = .Size \ 2
'Paint.DrawImage($aImage[S], X - S \ 2, Y - S \ 2)
'Paint.DrawImage($aImage[.Size], CInt(.X), CInt(.Y))
S = 1 + Min(3, .Size \ 2)
Paint.Ellipse(X - S \ 2, Y - S \ 2 + 1, S, S)
Paint.Fill
End With
Wend
$aSnowFlakes.Remove(I)
'S = .Size \ 2
'Paint.DrawImage($aImage[S], X - S \ 2, Y - S \ 2)
'Paint.DrawImage($aImage[.Size], CInt(.X), CInt(.Y))
S = 1 + Min(3, .Size \ 2)
Paint.Ellipse(X - S \ 2, Y - S \ 2 + 1, S, S)
Paint.Fill
Paint.End
End With
If $aSnowFlakes.Count < MAX_SNOW_FLAKES Then
For I = 0 To Rand(4)
hSnowFlake = New CSnowFlake
hSnowFlake.X = Rand(-10, hDrawingArea.W + 10)
hSnowFlake.Size = Rand($aImage.Max)
hSnowFlake.DY = 0.5 + hSnowFlake.Size / 3 + Rnd
hSnowFlake.DX = (Rnd * 3 - 1.5) * hSnowFlake.DY
hSnowFlake.IgnoreTree = $bIgnoreTree
$bIgnoreTree = Not $bIgnoreTree
$aSnowFlakes.Add(hSnowFlake)
Next
Wend
Paint.End
If $aSnowFlakes.Count < MAX_SNOW_FLAKES Then
For I = 0 To Rand(4)
hSnowFlake = New CSnowFlake
hSnowFlake.X = Rand(-10, hDrawingArea.W + 10)
hSnowFlake.Size = Rand($aImage.Max)
hSnowFlake.DY = 0.5 + hSnowFlake.Size / 3 + Rnd
hSnowFlake.DX = (Rnd * 3 - 1.5) * hSnowFlake.DY
hSnowFlake.IgnoreTree = $bIgnoreTree
$bIgnoreTree = Not $bIgnoreTree
$aSnowFlakes.Add(hSnowFlake)
Next
Endif
Endif
If $bTear Then
Inc $iTearAge
If Not NoTear And If $aTears.Count < 3 Then
Randomize
If $aTears.Count = 0 Or If Rnd < 0.005 Then
hTear = New CTear
hTear.Seed = Rand(2147483647)
$aTears.Add(hTear)
Endif
Endif
Endif
hDrawingArea.Refresh
End
......@@ -203,7 +203,7 @@ Private Sub FillAbout()
gvwAbout[1, 0].Alignment = Align.Top
'gvwAbout[1, 0].WordWrap = True
' Logo
gvwAbout[2, 0].Picture = Picture["img/logo/logo.png"]
gvwAbout[2, 0].Picture = Picture["icon:/128/gambas"]
gvwAbout[2, 0].Alignment = Align.Top
' Licence title
'gvwAbout[3, 0].Text = ("License")
......
' Gambas class file
Class Media
Class MediaPlayer
Static Public Filter As String
Static Private $sPath As String
Static Private $hLogo As Image
Private btnNew As CCoolButton
Private btnOpen As CCoolButton
Private btnOpenExtern As CCoolButton
......@@ -30,6 +31,7 @@ Private $iSort As Integer = CRecentProject.SORT_BY_DATE
Private $hRecent As CProjectList
Private $hExample As CProjectList
Private $hSoft As CProjectList
Private $hPlayer As MediaPlayer
' Static Public Function Run() As String
'
......@@ -56,8 +58,7 @@ Public Sub Form_Open()
Dim W As Integer
Dim sFont As String
Dim hCtrl As CCoolButton
If Not $hLogo Then $hLogo = Image.Load("img/logo/logo.png")
Dim bHasTear As Boolean
'Settings.Read(Me)
'Me.Center
......@@ -96,10 +97,42 @@ Public Sub Form_Open()
Toggle(LIST_EXAMPLE)
Endif
$hWelcome = New CWelcome(dwgWelcome)
bHasTear = PlaySound()
$hWelcome = New CWelcome(dwgWelcome, bHasTear)
$hSoft.Fill
End
Private Sub PlaySound() As Boolean
Dim dNow As Date
Dim iYear As Integer
Dim dEaster As Date
Dim sPlay As String
Dim sTemp As String
dNow = Date(Now)
iYear = Year(Now)
dEaster = Date.EasterDay(iYear)
If dNow = Date(iYear, 12, 25) Then
sPlay = "bells.mp3"
Else If dNow = Date(iYear, 8, 15) Or If dNow = dEaster Or If dNow = dEaster + 39 Then
sPlay = "spiritus.mp3"
Else
Return
Endif
Component.Load("gb.media")
$hPlayer = New MediaPlayer As "MediaPlayer"
sTemp = Temp$()
Copy "welcome" &/ sPlay To sTemp
$hPlayer.URL = Media.URL(sTemp)
$hPlayer.Play(True)
Return True
End
' Public Sub cvwRecent_Click()
......@@ -414,3 +447,11 @@ Public Sub Form_Activate()
Endif
End
Public Sub MediaPlayer_End()
'Debug
$hPlayer = Null
'$hWelcome.NoTear = True
End
......@@ -53,8 +53,6 @@
Mouse = Mouse.Arrow
Expand = True
Arrangement = Arrange.Vertical
Spacing = True
Margin = True
{ Panel3 HBox
MoveScaled(0,0,27,4)
{ panFilter Panel
......@@ -62,7 +60,6 @@
Expand = True
Arrangement = Arrange.Fill
Padding = 1
Border = Border.Plain
{ txtFilter ButtonBox
MoveScaled(1,0,5,4)
Foreground = Color.LightForeground
......@@ -85,24 +82,30 @@
}
}
}
{ lstExample ScrollView
MoveScaled(14,6,8,10)
{ Separator2 Separator
MoveScaled(3,6,20,0)
}
{ lstRecent ScrollView
MoveScaled(2,7,9,9)
Expand = True
Spacing = True
Margin = True
Border = False
ScrollBar = Scroll.Vertical
}
{ lstRecent ScrollView
MoveScaled(2,7,9,9)
{ lstExample ScrollView
MoveScaled(16,17,8,10)
Expand = True
Spacing = True
Margin = True
Border = False
ScrollBar = Scroll.Vertical
}
{ lstSoft ScrollView
MoveScaled(10,16,8,10)
MoveScaled(6,19,8,10)
Expand = True
Spacing = True
Margin = True
Border = False
ScrollBar = Scroll.Vertical
}
......
comp/src/gb.form.stock/gambas/128/archive.png

174 Bytes | W: | H:

comp/src/gb.form.stock/gambas/128/archive.png

172 Bytes | W: | H:

comp/src/gb.form.stock/gambas/128/archive.png
comp/src/gb.form.stock/gambas/128/archive.png
comp/src/gb.form.stock/gambas/128/archive.png
comp/src/gb.form.stock/gambas/128/archive.png
  • 2-up
  • Swipe
  • Onion skin
comp/src/gb.form.stock/gambas/32/access.png

194 Bytes | W: | H:

comp/src/gb.form.stock/gambas/32/access.png

189 Bytes | W: | H:

comp/src/gb.form.stock/gambas/32/access.png
comp/src/gb.form.stock/gambas/32/access.png
comp/src/gb.form.stock/gambas/32/access.png
comp/src/gb.form.stock/gambas/32/access.png
  • 2-up
  • Swipe
  • Onion skin
comp/src/gb.form.stock/gambas/32/archive.png

151 Bytes | W: | H:

comp/src/gb.form.stock/gambas/32/archive.png

151 Bytes | W: | H:

comp/src/gb.form.stock/gambas/32/archive.png
comp/src/gb.form.stock/gambas/32/archive.png
comp/src/gb.form.stock/gambas/32/archive.png
comp/src/gb.form.stock/gambas/32/archive.png
  • 2-up
  • Swipe
  • Onion skin
comp/src/gb.form.stock/gambas/32/print.png

192 Bytes | W: | H:

comp/src/gb.form.stock/gambas/32/print.png

173 Bytes | W: | H:

comp/src/gb.form.stock/gambas/32/print.png
comp/src/gb.form.stock/gambas/32/print.png
comp/src/gb.form.stock/gambas/32/print.png
comp/src/gb.form.stock/gambas/32/print.png
  • 2-up
  • Swipe
  • Onion skin
comp/src/gb.form.stock/gambas/32/printer.png

173 Bytes | W: | H:

comp/src/gb.form.stock/gambas/32/printer.png

184 Bytes | W: | H:

comp/src/gb.form.stock/gambas/32/printer.png
comp/src/gb.form.stock/gambas/32/printer.png
comp/src/gb.form.stock/gambas/32/printer.png
comp/src/gb.form.stock/gambas/32/printer.png
  • 2-up
  • Swipe
  • Onion skin
comp/src/gb.form.stock/gambas/32/resize.png

218 Bytes | W: | H:

comp/src/gb.form.stock/gambas/32/resize.png

183 Bytes | W: | H:

comp/src/gb.form.stock/gambas/32/resize.png
comp/src/gb.form.stock/gambas/32/resize.png
comp/src/gb.form.stock/gambas/32/resize.png
comp/src/gb.form.stock/gambas/32/resize.png
  • 2-up
  • Swipe
  • Onion skin
comp/src/gb.form.stock/gambas/32/tablet.png

190 Bytes | W: | H:

comp/src/gb.form.stock/gambas/32/tablet.png

295 Bytes | W: | H:

comp/src/gb.form.stock/gambas/32/tablet.png
comp/src/gb.form.stock/gambas/32/tablet.png
comp/src/gb.form.stock/gambas/32/tablet.png
comp/src/gb.form.stock/gambas/32/tablet.png
  • 2-up
  • Swipe
  • Onion skin
comp/src/gb.form.stock/gambas/32/wizard.png

311 Bytes | W: | H:

comp/src/gb.form.stock/gambas/32/wizard.png

311 Bytes | W: | H:

comp/src/gb.form.stock/gambas/32/wizard.png
comp/src/gb.form.stock/gambas/32/wizard.png
comp/src/gb.form.stock/gambas/32/wizard.png
comp/src/gb.form.stock/gambas/32/wizard.png
  • 2-up
  • Swipe
  • Onion skin
# Gambas Project File 3.0
Title=More controls for graphical components
Startup=FTestListEditor
Startup=FTestFileChooser
Version=3.14.90
VersionFile=1
Component=gb.image
......
......@@ -33,7 +33,7 @@ Private Sub ScanDir(sDir As String)
sPath = sDir &/ sFile
Try hStat = Stat(sPath)
If Error Then
Error Error.Text & ": " & sPath
Error Error.Where & ": " & Error.Text & ": " & sPath
Continue
Endif
......
......@@ -259,7 +259,7 @@ Private Sub ShowError(Optional sErr As String)
$bIgnoreNextTaskError = False
Return
Endif
If sErr Then $sError &= sErr
If sErr Then $sError &= sErr & "\n"
tabInfo[TAB_ERROR].Visible = True
txtError.Text = $sError
......@@ -267,7 +267,7 @@ End
Public Sub Task_Error(Data As String)
ShowError(Data)
ShowError(RTrim(Data))
End
......@@ -275,7 +275,7 @@ End
Public Sub Task_Kill()
Try UpdateSize(Last.Value)
If Error Then ShowError(Error.Text & "\n")
If Error Then ShowError(Error.Text)
lblSize.Foreground = Color.Default
End
......@@ -383,11 +383,11 @@ Public Sub tabInfo_Click()
Endif
hParent._RaiseClick()
If hParent Then hParent._RaiseClick()
Catch
ShowError(Error.Text & "\n")
ShowError(Error.Text)
End
......
......@@ -188,7 +188,7 @@
Index = 0
}
{ btnClose Button
MoveScaled(31,1,17,4)
MoveScaled(39,1,17,4)
Visible = False
Ignore = True
Text = ("Close")
......
......@@ -28,7 +28,7 @@ Public Sub _init()
$sDir = File.Dir(File.Dir(Temp$())) &/ "session"
Try Mkdir $sDir
$sDir &/= "gb.web.form2"
$sDir &/= "gb.web.gui"
Try Mkdir $sDir
End
......
......@@ -204,3 +204,9 @@ Public Sub WebListBox1_Select()
WebTextArea1.Text = aSel.Join()
End
Public Sub WebButton8_Click()
WebTextBox1.SetFocus(True)
End
......@@ -179,6 +179,10 @@
#MoveScaled(65,1,16,4)
Text = ("Progress") & "..."
}
{ WebButton8 WebButton
#MoveScaled(82,1,16,4)
Text = ("Highlight")
}
}
{ WebImage1 WebImage
#MoveScaled(1,8,133.75,6)
......
......@@ -898,10 +898,11 @@ TABLE.gw-calendar > TBODY > TR > TD.gw-date-current {
.gw-mandatory {
position: absolute;
box-shadow: 0 0 0.5em red;
box-shadow: inset 0 0 0.5em rgba(255,0,0,0.5);
top: 0;
left: 0;
z-index: -1;
z-index: 1;
pointer-events: none;
}
.gw-menu-shadow {
......
......@@ -40,6 +40,8 @@
static void *_from_element = NULL;
static int cb_message(CMEDIAPIPELINE *_object);
void MEDIA_raise_event(void *_object, int event)
{
gst_element_post_message(ELEMENT, gst_message_new_application(GST_OBJECT(ELEMENT), gst_structure_new("SendEvent", "event", G_TYPE_INT, event, NULL)));
......@@ -99,11 +101,13 @@ CMEDIACONTROL *MEDIA_get_control_from_element(void *element, bool create)
return ctrl;
}
bool MEDIA_set_state(void *_object, int state, bool error)
bool MEDIA_set_state(void *_object, int state, bool error, bool async)
{
GstStateChangeReturn status;
status = gst_element_set_state(ELEMENT, state);
if (async)
return FALSE;
if (status == GST_STATE_CHANGE_ASYNC)
status = gst_element_get_state(ELEMENT, NULL, NULL, GST_SECOND);
......@@ -114,6 +118,7 @@ bool MEDIA_set_state(void *_object, int state, bool error)
return TRUE;
}
cb_message(THIS_PIPELINE);
return FALSE;
}
......@@ -157,7 +162,8 @@ static GB_TYPE to_gambas_type(const GValue *value)
return GB_T_DATE;
else
{
fprintf(stderr, "gb.media: warning: unsupported data type: %s\n", G_VALUE_TYPE_NAME(value));
if (MAIN_debug)
fprintf(stderr, "gb.media: warning: unsupported data type: %s\n", G_VALUE_TYPE_NAME(value));
//GB.Error("Unsupported property datatype");
return GB_T_NULL;
}
......@@ -373,7 +379,8 @@ static void return_value(const GValue *value)
#endif
else
{
fprintf(stderr, "gb.media: warning: unsupported datatype: %s\n", G_VALUE_TYPE_NAME(value));
if (MAIN_debug)
fprintf(stderr, "gb.media: warning: unsupported datatype: %s\n", G_VALUE_TYPE_NAME(value));
GB.ReturnNull();
}
}
......@@ -1199,7 +1206,7 @@ BEGIN_PROPERTY(MediaControl_State)
}
else
{
MEDIA_set_state(THIS, VPROP(GB_INTEGER), TRUE);
MEDIA_set_state(THIS, VPROP(GB_INTEGER), TRUE, FALSE);
}
END_PROPERTY
......@@ -1818,7 +1825,8 @@ void MEDIA_stop_pipeline(CMEDIACONTROL *_object)
try++;
if (try > 25)
{
fprintf(stderr, "gb.media: warning: could not catch end of stream\n");
if (MAIN_debug)
fprintf(stderr, "gb.media: warning: could not catch end of stream\n");
break;
}
cb_message(THIS_PIPELINE);
......@@ -1826,8 +1834,7 @@ void MEDIA_stop_pipeline(CMEDIACONTROL *_object)
}
}
MEDIA_set_state(THIS, GST_STATE_READY, TRUE);
cb_message(THIS_PIPELINE);
MEDIA_set_state(THIS, GST_STATE_READY, TRUE, FALSE);
}
......@@ -1863,11 +1870,10 @@ BEGIN_METHOD_VOID(MediaPipeline_free)
END_METHOD
BEGIN_METHOD_VOID(MediaPipeline_Play)
BEGIN_METHOD(MediaPipeline_Play, GB_BOOLEAN async)
THIS->eos = FALSE;
MEDIA_set_state(THIS, GST_STATE_PLAYING, TRUE);
cb_message(THIS_PIPELINE);
MEDIA_set_state(THIS, GST_STATE_PLAYING, TRUE, VARGOPT(async, FALSE));
set_pipeline_rate(THIS);
END_METHOD
......@@ -1880,8 +1886,7 @@ END_METHOD
BEGIN_METHOD_VOID(MediaPipeline_Close)
MEDIA_set_state(THIS, GST_STATE_NULL, TRUE);
cb_message(THIS_PIPELINE);
MEDIA_set_state(THIS, GST_STATE_NULL, TRUE, FALSE);
END_METHOD
......@@ -1890,8 +1895,7 @@ BEGIN_METHOD_VOID(MediaPipeline_Pause)
if (THIS->state != GST_STATE_PLAYING)
return;
MEDIA_set_state(THIS, GST_STATE_PAUSED, TRUE);
cb_message(THIS_PIPELINE);
MEDIA_set_state(THIS, GST_STATE_PAUSED, TRUE, FALSE);
END_METHOD
......@@ -2180,7 +2184,7 @@ GB_DESC MediaPipelineDesc[] =
GB_PROPERTY("Pos", "f", MediaPipeline_Position),
GB_PROPERTY_READ("Length", "f", MediaPipeline_Duration),
GB_METHOD("Play", NULL, MediaPipeline_Play, NULL),
GB_METHOD("Play", NULL, MediaPipeline_Play, "[(Async)b]"),
GB_METHOD("Stop", NULL, MediaPipeline_Stop, NULL),
GB_METHOD("Pause", NULL, MediaPipeline_Pause, NULL),
GB_METHOD("Close", NULL, MediaPipeline_Close, NULL),
......
......@@ -124,7 +124,7 @@ typedef
void MEDIA_raise_event(void *_object, int event);
CMEDIACONTROL *MEDIA_get_control_from_element(void *element, bool create);
bool MEDIA_set_state(void *_object, int state, bool error);
bool MEDIA_set_state(void *_object, int state, bool error, bool async);
bool MEDIA_get_flag(void *element, char *property, int flag);
void MEDIA_set_flag(void *element, char *property, int flag, bool value);
......
......@@ -296,7 +296,7 @@ BEGIN_PROPERTY(MediaPlayerVideo_Visualisation)
playing = THIS_CONTROL->state == GST_STATE_PLAYING;
if (playing)
MEDIA_set_state(THIS, GST_STATE_PAUSED, FALSE);
MEDIA_set_state(THIS, GST_STATE_PAUSED, FALSE, FALSE);
//set_control(THIS, "vis-plugin", NULL);
//if (vis)
......@@ -305,7 +305,7 @@ BEGIN_PROPERTY(MediaPlayerVideo_Visualisation)
set_flag(THIS, GST_PLAY_FLAG_VIS, TRUE);
if (playing)
MEDIA_set_state(THIS, GST_STATE_PLAYING, FALSE);
MEDIA_set_state(THIS, GST_STATE_PLAYING, FALSE, FALSE);
}
END_PROPERTY
......
......@@ -29,6 +29,8 @@
#include "c_media.h"
#include "c_mediaplayer.h"
bool MAIN_debug = FALSE;
GB_INTERFACE GB EXPORT;
IMAGE_INTERFACE IMAGE EXPORT;
......@@ -70,17 +72,16 @@ int MAIN_get_x11_handle(void *control)
return (*get_handle)(control);
}
static void *_old_hook_main;
static void hook_main(int *argc, char ***argv)
{
gst_init(argc, argv);
CALL_HOOK_MAIN(_old_hook_main, argc, argv);
}
int EXPORT GB_INIT()
{
_old_hook_main = GB.Hook(GB_HOOK_MAIN, (void *)hook_main);
char *env;
gst_init(NULL, NULL);
env = getenv("GB_MEDIA_DEBUG");
if (env && atoi(env))
MAIN_debug = TRUE;
GB.GetInterface("gb.image", IMAGE_INTERFACE_VERSION, &IMAGE);
return 0;
}
......
......@@ -36,6 +36,7 @@
#include "gb.image.h"
#ifndef __MAIN_C
extern bool MAIN_debug;
extern GB_INTERFACE GB;
extern IMAGE_INTERFACE IMAGE;
#endif
......