Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/MacClassic/Window functions Example
Function:
Required plugins for this example: MBS MacOSX Plugin, MBS Util Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacClassic/Window Functions Example
This example is the version from Sun, 17th Mar 2012.
Project "Window Functions Example.rbp"
Class Window1 Inherits Window
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control StaticText2 Inherits Label
ControlInstance StaticText2 Inherits Label
End Control
Control StaticText3 Inherits Label
ControlInstance StaticText3 Inherits Label
End Control
Control StaticText4 Inherits Label
ControlInstance StaticText4 Inherits Label
End Control
Control WindowLeft Inherits Label
ControlInstance WindowLeft Inherits Label
End Control
Control Timer1 Inherits Timer
ControlInstance Timer1 Inherits Timer
EventHandler Sub Action() if self.CollapsedMBS then msgBox "I'm collapsed." end if End EventHandler
End Control
Control WindowTop Inherits Label
ControlInstance WindowTop Inherits Label
End Control
Control WindowWidth Inherits Label
ControlInstance WindowWidth Inherits Label
End Control
Control WindowHeight Inherits Label
ControlInstance WindowHeight Inherits Label
End Control
Control StaticText5 Inherits Label
ControlInstance StaticText5 Inherits Label
End Control
Control StaticText6 Inherits Label
ControlInstance StaticText6 Inherits Label
End Control
Control StaticText7 Inherits Label
ControlInstance StaticText7 Inherits Label
End Control
Control StaticText8 Inherits Label
ControlInstance StaticText8 Inherits Label
End Control
Control ContentLeft Inherits Label
ControlInstance ContentLeft Inherits Label
End Control
Control ContentTop Inherits Label
ControlInstance ContentTop Inherits Label
End Control
Control ContentWidth Inherits Label
ControlInstance ContentWidth Inherits Label
End Control
Control ContentHeight Inherits Label
ControlInstance ContentHeight Inherits Label
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action() self.CollapsedMBS=true End EventHandler
End Control
Control PushButton2 Inherits PushButton
ControlInstance PushButton2 Inherits PushButton
EventHandler Sub Action() CollapseAllWindowsMBS true End EventHandler
End Control
Control PushButton3 Inherits PushButton
ControlInstance PushButton3 Inherits PushButton
EventHandler Sub Action() if not RunningOnCarbonXMBS then msgBox "This button is useless without Mac OS X!" end if EnableAquaPrefMenuMBS #if debugbuild then msgBox "The Preference menu can't be used while in the RB IDE." #endif End EventHandler
End Control
Control PushButton4 Inherits PushButton
ControlInstance PushButton4 Inherits PushButton
EventHandler Sub Action() DisableAquaPrefMenuMBS End EventHandler
End Control
Control StaticText9 Inherits Label
ControlInstance StaticText9 Inherits Label
End Control
Control MenubarH Inherits Label
ControlInstance MenubarH Inherits Label
End Control
EventHandler Sub Moved() update End EventHandler
EventHandler Sub Open() update End EventHandler
EventHandler Sub Resized() update End EventHandler
Sub update() dim s as IntegerRectMBS s=self.WindowStructureRectMBS WindowLeft.text=str(s.left) WindowTop.text=str(s.top) Windowwidth.text=str(s.width) WindowHeight.text=str(s.height) ContentLeft.text=str(left) ContentTop.text=str(top) ContentWidth.text=str(width) ContentHeight.text=str(height) menubarh.text=str(MenuBarHeightMBS) End Sub
End Class
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 Function HandleAppleEvent(theEvent As AppleEvent, eventClass As String, eventID As String) As Boolean #if targetcarbon // Doesn't make sense else // Check if it's the preferences call if eventClass = "aevt" and eventID = "pref" then MsgBox "There are no preferences!" return true // We handled that Apple Event end if #endif End EventHandler
End Class
End Project

See also:

Feedback, Comments & Corrections

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




Links
MBS Xojo PDF Plugins