Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/Util/Current Mode
Function:
Required plugins for this example: MBS Util Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Util/Current Mode
This example is the version from Sun, 17th Mar 2012.
Project "Current Mode.rbp"
Class Main 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 StaticText5 Inherits Label
ControlInstance StaticText5 Inherits Label
End Control
Control dw Inherits Label
ControlInstance dw Inherits Label
End Control
Control dh Inherits Label
ControlInstance dh Inherits Label
End Control
Control dd Inherits Label
ControlInstance dd Inherits Label
End Control
Control StaticText6 Inherits Label
ControlInstance StaticText6 Inherits Label
End Control
Control df Inherits Label
ControlInstance df Inherits Label
End Control
Control StaticText7 Inherits Label
ControlInstance StaticText7 Inherits Label
End Control
Control dl Inherits Label
ControlInstance dl Inherits Label
End Control
Control StaticText8 Inherits Label
ControlInstance StaticText8 Inherits Label
End Control
Control dt Inherits Label
ControlInstance dt Inherits Label
End Control
Control StaticText9 Inherits Label
ControlInstance StaticText9 Inherits Label
End Control
Control StaticText10 Inherits Label
ControlInstance StaticText10 Inherits Label
End Control
Control StaticText11 Inherits Label
ControlInstance StaticText11 Inherits Label
End Control
Control rw Inherits Label
ControlInstance rw Inherits Label
End Control
Control rh Inherits Label
ControlInstance rh Inherits Label
End Control
Control rd Inherits Label
ControlInstance rd Inherits Label
End Control
Control StaticText15 Inherits Label
ControlInstance StaticText15 Inherits Label
End Control
Control rf Inherits Label
ControlInstance rf Inherits Label
End Control
Control StaticText17 Inherits Label
ControlInstance StaticText17 Inherits Label
End Control
Control rl Inherits Label
ControlInstance rl Inherits Label
End Control
Control StaticText19 Inherits Label
ControlInstance StaticText19 Inherits Label
End Control
Control rt Inherits Label
ControlInstance rt Inherits Label
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action() update false End EventHandler
End Control
Control PopupMenu1 Inherits PopupMenu
ControlInstance PopupMenu1 Inherits PopupMenu
EventHandler Sub Change() if me.ListIndex>=0 then StaticText1.text = "The current display mode from display "+str(me.ListIndex+1)+":" StaticText5.text = "The current resolution from display "+str(me.ListIndex+1)+":" d = PopupMenu1.RowTag(PopupMenu1.ListIndex) update false end if End EventHandler
End Control
EventHandler Sub Open() dim u as integer = DisplayCountMBS-1 for i as integer = 0 to u dim dis as DisplayMBS = GetDisplayMBS(i) PopupMenu1.AddRow "Display "+str(i+1) PopupMenu1.RowTag(i)=dis next d=GetDisplayMBS(0) update true End EventHandler
Sub update(first as boolean) dim r as ResolutionMBS if d<>nil then if not first then d.update end if dh.text=str(d.Height) dw.text=str(d.Width) dd.text=str(d.Depth) df.text=str(d.Hz) dl.text=str(d.left) dt.text=str(d.top) r=d.GetCurrentResolution if r<>nil then rh.text=str(r.Height) rw.text=str(r.Width) rd.text=str(r.Depth) rf.text=str(r.Hz) rl.text=str(r.left) rt.text=str(r.top) end if end if End Sub
Property Protected d As displayMBS
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
End Class
End Project

Feedback, Comments & Corrections

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




Links
MBS Xojo Plugins