Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/MacFrameworks/Cocoa Controls/SliderView
Function:
Required plugins for this example: MBS MacBase Plugin, MBS MacCocoa Plugin, MBS MacControls Plugin, MBS MacFrameworks Plugin, MBS Main Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacFrameworks/Cocoa Controls/SliderView
This example is the version from Sun, 17th Mar 2012.
Project "SliderView.rbp"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control CocoaControlMBS1 Inherits CocoaControlMBS
ControlInstance CocoaControlMBS1 Inherits CocoaControlMBS
EventHandler Function GetView() As NSViewMBS dim n as new MyNSSliderMBS(0,0,me.Width-20,me.Height) n.t=Info1 n.minValue=0 n.maxValue=100 n.doubleValue=50 Return n End EventHandler
End Control
Control CocoaControlMBS2 Inherits CocoaControlMBS
ControlInstance CocoaControlMBS2 Inherits CocoaControlMBS
EventHandler Function GetView() As NSViewMBS dim n as new MyNSSliderMBS(0,0,me.Width-20,me.Height) n.t=Info2 n.minValue=0 n.maxValue=100 n.doubleValue=50 n.numberOfTickMarks=10 Return n End EventHandler
End Control
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control Info1 Inherits Label
ControlInstance Info1 Inherits Label
End Control
Control Info2 Inherits Label
ControlInstance Info2 Inherits Label
End Control
Control Info3 Inherits Label
ControlInstance Info3 Inherits Label
End Control
Control StaticText2 Inherits Label
ControlInstance StaticText2 Inherits Label
End Control
Control CocoaControlMBS3 Inherits CocoaControlMBS
ControlInstance CocoaControlMBS3 Inherits CocoaControlMBS
EventHandler Function GetView() As NSViewMBS dim n as new MyNSSliderMBS(0,0,me.Width-20,me.Height) n.t=Info3 n.title="Hello" n.minValue=0 n.maxValue=100 n.doubleValue=50 n.numberOfTickMarks=10 n.allowsTickMarkValuesOnly=true Return n End EventHandler
End Control
Control Info4 Inherits Label
ControlInstance Info4 Inherits Label
End Control
Control StaticText3 Inherits Label
ControlInstance StaticText3 Inherits Label
End Control
Control CocoaControlMBS4 Inherits CocoaControlMBS
ControlInstance CocoaControlMBS4 Inherits CocoaControlMBS
EventHandler Function GetView() As NSViewMBS dim n as new MyNSSliderMBS(0,0,me.Width-20,me.Height) n.t=Info4 n.minValue=0 n.maxValue=100 n.doubleValue=50 n.numberOfTickMarks=10 n.allowsTickMarkValuesOnly=true n.tickMarkPosition=n.NSTickMarkAbove Return n End EventHandler
End Control
Control Info5 Inherits Label
ControlInstance Info5 Inherits Label
End Control
Control StaticText4 Inherits Label
ControlInstance StaticText4 Inherits Label
End Control
Control CocoaControlMBS5 Inherits CocoaControlMBS
ControlInstance CocoaControlMBS5 Inherits CocoaControlMBS
EventHandler Function GetView() As NSViewMBS dim n as new MyNSSliderMBS(0,0,me.Width-20,me.Height) n.t=Info5 n.minValue=0 n.maxValue=100 n.doubleValue=50 n.sliderType=n.NSCircularSlider Return n End EventHandler
End Control
Control CocoaControlMBS6 Inherits CocoaControlMBS
ControlInstance CocoaControlMBS6 Inherits CocoaControlMBS
EventHandler Function GetView() As NSViewMBS dim n as new MyNSSliderMBS(0,0,me.Width-20,me.Height) n.t=Info6 n.minValue=0 n.maxValue=100 n.doubleValue=50 n.sliderType=n.NSCircularSlider n.numberOfTickMarks=10 Return n End EventHandler
End Control
Control StaticText5 Inherits Label
ControlInstance StaticText5 Inherits Label
End Control
Control Info6 Inherits Label
ControlInstance Info6 Inherits Label
End Control
EventHandler Sub Open() if not CocoaControlMBS1.Available then MsgBox "This example requires Mac OS X 10.5." quit end if End EventHandler
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
Class MyNSSliderMBS Inherits NSSliderMBS
EventHandler Sub Action() t.text=str(me.doubleValue) End EventHandler
Property t As label
End Class
End Project

See also:

Feedback, Comments & Corrections

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




Links
MBS FileMaker Plugins