Platforms to show: All Mac Windows Linux Cross-Platform

/Encryption/Base 64/Encode Base64 with Events


Required plugins for this example: MBS Encryption Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Encryption/Base 64/Encode Base64 with Events

This example is the version from Tue, 23th May 2016.

Project "Encode Base64 with Events.xojo_binary_project"
FileTypes
Filetype special/any
Filetype application/binary
End FileTypes
MenuBar Menu
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = "File"
MenuItem FileQuit = "Quit"
MenuItem UntitledMenu0 = "Edit"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cut"
MenuItem EditCopy = "Copy"
MenuItem EditPaste = "Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
EventHandler Sub Open() dim f as folderItem dim b as binaryStream dim s as string dim t,l as integer dim m as MyBase64 m=new MyBase64 f=getopenFolderItem("special/any") b=f.openasbinaryFile(false) s=b.read(b.length) b.close l=lenb(s) t=ticks s=m.encodeBase64(s,76,chr(13)) t=ticks-t if s="" then MsgBox "Encoding failed." else msgBox format(t/60,"0.0")+" Seconds which is "+format(l*60.0/1024.0/1024.0/t,"0.0")+" MegaBytes/s" f=getsaveFolderItem("application/binary",f.displayName+" base64") b=f.createBinaryFile("application/binary") b.write s b.close end if quit exception quit End EventHandler
End Class
Class ProcessWindow Inherits Window
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control ProgressBar1 Inherits ProgressBar
ControlInstance ProgressBar1 Inherits ProgressBar
End Control
End Class
Class MyBase64 Inherits Base64MBS
EventHandler Sub Finished(wascanceled as boolean) ProcessWindow.Close End EventHandler
EventHandler Sub Start() ProcessWindow.show End EventHandler
EventHandler Function Working(percent as double) As boolean dim i as integer dim b as ProgressBar i=percent*100 b=ProcessWindow.ProgressBar1 if b.Value<>i then // event may come too often. ProcessWindow.ProgressBar1.Maximum=100 ProcessWindow.ProgressBar1.Value=percent*100 end if End EventHandler
End Class
End Project

See also:

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


The biggest plugin in space...