Platforms to show: All Mac Windows Linux Cross-Platform
Required plugins for this example: MBS Win Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Win/Window Mask
This example is the version from Sun, 10th Dec 2016.
Project "Window Mask.xojo_binary_project"
Class Window1 Inherits Window
Control Rectangle1 Inherits Rectangle
ControlInstance Rectangle1 Inherits Rectangle
End Control
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action()
setmask
End EventHandler
End Control
Control PushButton2 Inherits PushButton
ControlInstance PushButton2 Inherits PushButton
EventHandler Sub Action()
quit
End EventHandler
End Control
EventHandler Function MouseDown(X As Integer, Y As Integer) As Boolean
lastx=x
lasty=y
Return true
End EventHandler
EventHandler Sub MouseDrag(X As Integer, Y As Integer)
left=left+(x-lastx)
top=top+(y-lasty)
End EventHandler
Sub setmask()
dim borderwidth as integer
dim p as Picture
borderwidth=WindowsSystemMetricsMBS(7) // thickness of window border
p = new Picture(Width+borderwidth,Height+30,32)
p.Graphics.ForeColor=rgb(0,0,0)
p.Graphics.FillOval borderwidth,30,Width,Height
if not self.SetWindowMaskMBS(p,true, rgb(255,255,255)) then
Beep
end if
End Sub
Property Protected lastpx As integer
Property Protected lastpy As integer
Property Protected lastx As integer
Property Protected lasty As integer
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
See also:
The items on this page are in the following plugins: MBS Win Plugin.