Platforms to show: All Mac Windows Linux Cross-Platform
/WinFrameworks/Windows Sharing Panel
Last modified Wed, 11th Feb 2025.
You find this example project in your MBS Xojo Plugin download as a Xojo project file within the examples folder: /WinFrameworks/Windows Sharing Panel
Download this example: Windows Sharing Panel.zip
Project "Windows Sharing Panel.xojo_binary_project"
Class App Inherits DesktopApplication
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
EventHandler Sub Opening()
End EventHandler
End Class
Class MainWindow Inherits DesktopWindow
Control ShareTextButton Inherits DesktopButton
ControlInstance ShareTextButton Inherits DesktopButton
EventHandler Sub Pressed()
panel = new WindowsSharePanel
panel.Title = "Export"
panel.Text = TextArea1.Text
panel.RTF = TextArea1.StyledText.RTFData
panel.Present
End EventHandler
End Control
Control TextArea1 Inherits DesktopTextArea
ControlInstance TextArea1 Inherits DesktopTextArea
End Control
Control Label1 Inherits DesktopLabel
ControlInstance Label1 Inherits DesktopLabel
End Control
Control ShareImageButton Inherits DesktopButton
ControlInstance ShareImageButton Inherits DesktopButton
EventHandler Sub Pressed()
panel = new WindowsSharePanel
// bitmap image
var p as Picture = LogoMBS(500)
var d as MemoryBlock = p.ToData(Picture.Formats.JPEG)
panel.Title = "Export"
panel.PictureData = d
// thumbnail
p = LogoMBS(200)
d = p.ToData(Picture.Formats.JPEG)
panel.ThumbnailData = d
panel.Present
End EventHandler
End Control
Control ShareFileButton Inherits DesktopButton
ControlInstance ShareFileButton Inherits DesktopButton
EventHandler Sub Pressed()
panel = new WindowsSharePanel
var f as FolderItem = SpecialFolder.Temporary.Child("test.jpg")
var p as Picture = LogoMBS(500)
p.Save(f, Picture.Formats.JPEG)
panel.Title = "Export"
panel.AddFile f
panel.Present
End EventHandler
End Control
EventHandler Sub Opening()
System.DebugLog CurrentMethodName
End EventHandler
Property panel As WindowsSharePanel
End Class
MenuBar MainMenuBar
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem EditSeparator1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem EditSeparator2 = "-"
MenuItem EditSelectAll = "Select &All"
MenuItem HelpMenu = "&Help"
End MenuBar
Sign
End Sign
Class WindowsSharePanel Inherits WindowsSharePanelMBS
EventHandler Sub DataRequested()
System.DebugLog CurrentMethodName
// last chance to provide data dynamically
me.Description = "Just a test"
End EventHandler
EventHandler Sub ShareCancelled()
System.DebugLog CurrentMethodName
End EventHandler
EventHandler Sub ShareCompleted()
System.DebugLog CurrentMethodName
End EventHandler
EventHandler Sub Shown()
System.DebugLog CurrentMethodName
End EventHandler
EventHandler Sub TargetApplicationChosen(ApplicationName as String)
System.DebugLog CurrentMethodName+": "+ApplicationName
End EventHandler
End Class
End Project
See also:
- /WinFrameworks/Windows File Dialog
- /WinFrameworks/Windows Location
- /WinFrameworks/Windows ML Test
- /WinFrameworks/Windows OCR
- /WinFrameworks/Windows PDF Viewer
- /WinFrameworks/Windows Photo Acquire
- /WinFrameworks/Windows Spell Checker
- /WinFrameworks/Windows Store
Download this example: Windows Sharing Panel.zip
The items on this page are in the following plugins: MBS WinFrameworks Plugin.