Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/MacControls/PDFViewControlMBS Test
Function:
Required plugins for this example: MBS MacBase Plugin, MBS MacCocoa Plugin, MBS MacControls Plugin, MBS Main Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacControls/PDFViewControlMBS Test
This example is the version from Sun, 13th May 2017.
Project "PDFViewControlMBS Test.rbp"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
EventHandler Sub NewDocument() dim f as FolderItem = GetOpenFolderItem(MyFileTypes.Pdf) if f <> nil then OpenDocument f end if End EventHandler
EventHandler Sub OpenDocument(item As FolderItem) dim d as new PDFDocumentMBS(item) if d.pageCount < 1 then return // error? dim p as new PDFWindow dim v as PDFViewMBS = p.PDFView.View v.displaysPageBreaks = true v.autoScales = true v.displayMode = v.kPDFDisplaySinglePage v.document = d dim t as PDFThumbnailViewMBS = p.PDFThumbnailView.View t.maximumNumberOfColumns = 1 t.PDFView = v End EventHandler
End Class
Class PDFWindow Inherits Window
Control PDFView Inherits PDFViewControlMBS
ControlInstance PDFView Inherits PDFViewControlMBS
End Control
Control PDFThumbnailView Inherits PDFThumbnailViewControlMBS
ControlInstance PDFThumbnailView Inherits PDFThumbnailViewControlMBS
EventHandler Sub Open() dim v as PDFThumbnailViewMBS = me.View v.backgroundColor = NSColorMBS.whiteColor End EventHandler
End Control
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"
End MenuBar
MyFileTypes
Filetype application/pdf
End MyFileTypes
End Project

Feedback, Comments & Corrections

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




Links
MBS FileMaker Plugins