Code:
Init()
Sub Init
GraphicsWindow.BackgroundColor = "#FF408080"
GraphicsWindow.Title = "Untitled Small Media Player Window"
GraphicsWindow.BrushColor = "Black"
GraphicsWindow.FontName = "MS Gothic"
SlFlBtn = Controls.AddButton("Select File",20,140)
Controls.SetSize(SlFlBtn,101,25)
PlayBtn = Controls.AddButton("Play",20,170)
Controls.SetSize(PlayBtn,101,25)
GraphicsWindow.BrushColor = "#FF000040"
GraphicsWindow.PenColor = "#FF000040"
Overlay = Shapes.AddRectangle(530,290)
Shapes.Move(Overlay,220,100)
GraphicsWindow.BrushColor = "Black"
GraphicsWindow.FontName = "Times New Roman"
GraphicsWindow.FontBold = "False"
NmWnTb = Controls.AddTextBox(20,100)
Controls.SetTextBoxText(NmWnTb,"")
Controls.SetSize(NmWnTb,100,25)
GraphicsWindow.FontName = "MS Gothic"
GraphicsWindow.FontBold = "True"
SubmitBtn = Controls.AddButton("Submit",140,100)
Controls.SetSize(SubmitBtn,51,25)
GraphicsWindow.FontName = "Ubuntu Mono"
GraphicsWindow.FontBold = "False"
LabelNmWn = Shapes.AddText("Name Window:")
Controls.SetSize(LabelNmWn,87,15)
Shapes.Move(LabelNmWn,20,80)
GraphicsWindow.BrushColor = "#FFFFFF80"
GraphicsWindow.FontName = "Segoe UI"
GraphicsWindow.FontBold = "True"
GraphicsWindow.FontSize = 24
Logo = Shapes.AddText("Basic Media Player")
Controls.SetSize(Logo,220,30)
Shapes.Move(Logo,0,0)
GraphicsWindow.FontBold = "False"
GraphicsWindow.BrushColor = "Black"
GraphicsWindow.FontName = "MS Gothic"
GraphicsWindow.FontSize = 12
GraphicsWindow.FontBold = "True"
AboutBtn = Controls.AddButton("About",230,10)
Controls.SetSize(AboutBtn,51,25)
LicenseBtn = Controls.AddButton("Licensing",290,10)
Controls.SetSize(LicenseBtn,71,25)
MediaPlayer = LDControls.AddMediaPlayer(530,290)
Shapes.Move(MediaPlayer,220,100)
PauseBtn = Controls.AddButton("Pause",20,200)
Controls.SetSize(PauseBtn,101,24.5)
LDControls.MediaPlayerEnded = Pause
Controls.ButtonClicked = Onclick
EndSub
Sub Pause
LDControls.MediaPlayerPause(MediaPlayer)
EndSub
Sub Onclick
last = Controls.LastClickedButton
If last = SubmitBtn Then
windowname = Controls.GetTextBoxText(NmWnTb)
GraphicsWindow.Title = windowname
ElseIf last = LicenseBtn Then
GraphicsWindow.ShowMessage("GPLv3", "")
ElseIf last = AboutBtn Then
GraphicsWindow.ShowMessage("You have the right to modify and republish the altered software. Created by sm4llprogrammer2008", "")
ElseIf last = SlFlBtn Then
getfile = LDDialogs.OpenFile("1=png;2=jpg;3=mp3;4=wav;5=mp4","")
ElseIf last = PlayBtn Then
LDControls.MediaPlayerLoad(MediaPlayer, getfile)
LDControls.MediaPlayerPlay(MediaPlayer)
ElseIf last = PauseBtn Then
LDControls.MediaPlayerPause(MediaPlayer)
EndIf
EndSub