Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/Win/Windows CD Burning
Function:
Required plugins for this example: MBS Util Plugin, MBS Win Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Win/Windows CD Burning
This example is the version from Sun, 17th Mar 2012.
Project "Windows CD Burning.rbp"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action() // To add a file/folder copy it to the system burn folder: dim file as FolderItem dim folder as FolderItem folder=WindowsBurnAreaFolderMBS file=GetOpenFolderItem("") if file<>nil then file.CopyFileTo folder List.AddRow file.Name end if End EventHandler
End Control
Control PushButton2 Inherits PushButton
ControlInstance PushButton2 Inherits PushButton
EventHandler Sub Action() // burn with the system GUI. // we pass self to specify the parent window b.CDBurn self // clear items on end list.DeleteAllRows ClearBurnFolder End EventHandler
End Control
EventHandler Sub Open() if TargetWin32 then b=new WindowsBurnMBS if b.HasRecordableDrive=false then MsgBox "No CD Recorder found." end if ClearBurnFolder else MsgBox "This example is only for Windows" quit end if End EventHandler
Sub ClearBurnFolder() dim f as FolderItem f=WindowsBurnAreaFolderMBS if f<>Nil then deleteFolderContent f end if End Sub
Private Sub deleteFolderContent(f as folderitem) dim files(-1) as FolderItem dim i,c as integer dim file as FolderItem c=f.Count for i=1 to c files.Append f.TrueItem(i) next c=UBound(files) for i=0 to c file=files(i) if file.Directory then deleteFolderContent file end if file.Delete next End Sub
Property b As windowsBurnMBS
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
End Project

See also:

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Win Plugin.




Links
MBS Xojo blog