Xojo Conferences
MBSOct2019CologneDE

Platforms to show: All Mac Windows Linux Cross-Platform

Next items

window.ActivateWindowMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Window MBS Util Plugin 19.2 Yes Yes No No No
Function: Activates the window.
Notes:
This function does more than just show. if the window has been minimized, it will restore it. Also the window is moved to front and made the current window for keyboard input.

Sadly windows limits which windows can go to front, so some windows may not come to front unless they are clicked on.

As activation can be asynchronously, the window may activate later, e.g. after current method ends.

For MacOS Cocoa apps, we simply bring the window to the front.

Feedback, Comments & Corrections

window.BackingScaleFactorMBS as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Window MBS Util Plugin 12.3 Yes No No No No
Function: Returns the scale factor representing the number of backing store pixels corresponding to each linear unit in window space on this window.
Notes:
This is generally only necessary when building a bitmap context or image whose resolution needs to match that of a particular Window. Note that a Window's backing scale factor can change over time, such as when the window moves from one display to another, or when a display's resolution changes, so clients should not cache the value returned by this function.

If platform does not support scaling factor, we return 1.0. (on Windows, Linux and older Mac OS X)
Supported for Carbon and Cocoa windows.

For apps which are not enabled for retina support, the function returns 1. So you only see 2 here if app is Cocoa, display is retina and info.plist has the NSHighResolutionCapable key.

Some examples which use this method:

Feedback, Comments & Corrections

window.CanBeVisibleWithoutLoginMBS as Boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Window MBS Util Plugin 8.1 Yes No No No No
Function: Whether this window can be visible before login.
Example:
window1.CanBeVisibleWithoutLoginMBS = true
Notes:
This window can be made visible prior to user login. By default, in Mac OS X 10.5 and later no windows can be visible before a user logs into the system; this protects the user against certain types of malicious use of insecure applications. However, some software, such as input methods or other accessibility software, may need to deliberately make windows available prior to user login. Such software should add this window attribute to its windows. Available for all windows in Mac OS X 10.5 and later.
(Read and Write computed property)

Feedback, Comments & Corrections

Window.CleanUpTransparentMBS(refValue as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Window MBS Util Plugin 5.0 Yes Yes Yes No No
Function: Cleans up transparency support for a Xojo window.
Example:
dim p as Integer // property on Windows

p = window1.MakeTransparentMBS

// later in close event

window1.CleanUpTransparentMBS p
Notes:
Call this in the close event of a window passing the value you got from the MakeTransparentMBS call.
Linux supported added with 14.0, but works only with Linux desktop which support alpha channel.

Feedback, Comments & Corrections

Window.CollapsableMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Window MBS Util Plugin Yes No No No No
Function: Returns true if this window can be collapsed.
Example:
MsgBox str(window1.CollapsableMBS)
Notes:
Collapseable windows are the normal document windows.
You can't collapse dialogs or floating windows well.
In Xojo 2005 and newer you need to use self. in front of the method as the propertyname alone is not accepted.

Added Cocoa support in plugin version 10.0.

Feedback, Comments & Corrections

Window.collapsedMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Window MBS Util Plugin Yes No No No No
Function: Returns true if this window is collapsed. You can set it.
Example:
mainwindow.collapsedMBS=false 'show window
Notes:
Collapseable windows are the normal document windows.
You can't collapse dialogs or floating windows well.
In Xojo 2005 and newer you need to use self. in front of the method as the propertyname alone is not accepted.

Added Cocoa support in plugin version 10.0.
(Read and Write computed property)

Some examples which use this property:

Feedback, Comments & Corrections

window.ConstrainWindowToScreenMBS(animate as boolean)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Window MBS Util Plugin 10.5 Yes No No No No
Function: Makes sure the window is on one screen visible.
Notes: Implemented on Mac for both Carbon and Cocoa.

Feedback, Comments & Corrections

window.GTKWindow as GTKWindowMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Window MBS Linux Plugin 13.0 No No Yes No No
Function: Queries a GTKWindow object for this window.
Notes:
Returns only a valid object on linux.
On other platforms, this function returns nil.

Feedback, Comments & Corrections

Window.HasborderMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Window MBS Util Plugin No Yes No No No
Function: Decides whether the window has a border.
Example:
mainwindow.HasborderMBS=false ' Remove border
Notes:
This property has only an effect on Windows. The window needs to be redrawn before the change is visible (for example move it). This option removes the title bar. HasCaptionMBS removes even more.

In Xojo 2005 and newer you need to use self. in front of the method as the propertyname alone is not accepted.
(Read and Write computed property)

Feedback, Comments & Corrections

window.HasCaptionMBS as Boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Window MBS Util Plugin 7.4 No Yes No No No
Function: Whether the window has a caption (a title bar)
Example:
Window1.HasCaptionMBS=false
Notes:
This property has only an effect on Windows. The window needs to be redrawn before the change is visible (for example move it).

In Xojo 2005 and newer you need to use self. in front of the method as the propertyname alone is not accepted.
(Read and Write computed property)

Feedback, Comments & Corrections

Window.HasCloseBoxMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Window MBS Util Plugin Yes No No No No
Function: Whether this window has a CloseBox.
Example:
mainwindow.HasCloseboxMBS=false 'remove closebox
Notes:
You can read the state on Mac Classic, but you can only change it on Mac Carbon.
Returns false on any error.

In Xojo 2005 and newer you need to use self. in front of the method as the propertyname alone is not accepted.
(Read and Write computed property)

Feedback, Comments & Corrections

Window.HasCollapseBoxMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Window MBS Util Plugin Yes No No No No
Function: Whether this window has a Collapsebox.
Example:
mainwindow.HasCollapseBoxMBS=false 'remove Collapsebox
Notes:
You can read the state on Mac Classic, but you can only change it on Mac Carbon.
Returns false on any error.

In Xojo 2005 and newer you need to use self. in front of the method as the propertyname alone is not accepted.
(Read and Write computed property)

Feedback, Comments & Corrections

Window.HasMaximizeBoxMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Window MBS Util Plugin No Yes No No No
Function: Returns true if this window has a Maximize Button.
Example:
mainwindow.HasMaximizeBoxMBS=false 'remove Maximize button
Notes:
This property has only an effect on Windows. The window needs to be redrawn before the change is visible (for example move it).

In Xojo 2005 and newer you need to use self. in front of the method as the propertyname alone is not accepted.
(Read and Write computed property)

Some examples which use this property:

Feedback, Comments & Corrections

Window.HasMinimizeBoxMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Window MBS Util Plugin No Yes No No No
Function: Returns true if this window has a Minimize Button.
Example:
mainwindow.HasMinimizeBoxMBS=false 'remove Minimize button
Notes:
This property has only an effect on Windows. The window needs to be redrawn before the change is visible (for example move it).

In Xojo 2005 and newer you need to use self. in front of the method as the propertyname alone is not accepted.
(Read and Write computed property)

Some examples which use this property:

Feedback, Comments & Corrections

Window.HasNoShadowMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Window MBS Util Plugin Yes No No No No
Function: Whether this window has no shadow.
Example:
mainwindow.HasNoShadowMBS=true 'remove shadow
Notes:
Available for all windows on Mac OS X. This attribute is automatically given to windows of kOverlayWindowClass.

Returns false on any error.

In Xojo 2005 and newer you need to use self. in front of the method as the propertyname alone is not accepted.

Added Cocoa support in plugin version 10.0.
(Read and Write computed property)

Feedback, Comments & Corrections

window.HasNoTitleBarMBS as Boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Window MBS Util Plugin 7.4 Yes No No No No
Function: For Document, Floating, and Utility windows, this attribute allows you to hide the title bar of a window.
Example:
window1.HasNoTitleBarMBS = true

// for Cocoa:
window1.HasCloseBoxMBS = false
window1.HasCollapseBoxMBS = false
window1.IsResizableMBS = false
window1.HasNoTitleBarMBS = true
This item is deprecated and should no longer be used. You can use NSWindowMBS for Cocoa instead.
Notes:
For Mac OS X 10.4 or later.

You can read the state on Mac Classic, but you can only change it on Mac Carbon.
Returns false on any error.

In Xojo 2005 and newer you need to use self. in front of the method as the propertyname alone is not accepted.

Added Cocoa support in Plugin version 10.4.
(Read and Write computed property)

Feedback, Comments & Corrections

window.HasSystemMenuMBS as Boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Window MBS Util Plugin 7.4 No Yes No No No
Function: Whether the window has a system menu inside the title bar.
Example:
Window1.HasSystemMenuMBS=false
Notes:
This property has only an effect on Windows. It will disable the system menu and also the minimize, maximize and close buttons. The window needs to be redrawn before the change is visible (for example move it).

In Xojo 2005 and newer you need to use self. in front of the method as the propertyname alone is not accepted.
(Read and Write computed property)

Feedback, Comments & Corrections

Window.HasToolbarButtonMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Window MBS Util Plugin Yes No No No No
Function: Whether this window has a toolbar button.
Example:
mainwindow.HasToolbarButtonMBS=true 'shows Toolbar Button
Notes:
You can read the state on Mac Classic, but you can only change it on Mac Carbon.
The Button is shown on next redraw of the window frame.

Use the CarbonWindowsEventsMBS class to receive events when the button is pressed.

Returns false on any error.

In Xojo 2005 and newer you need to use self. in front of the method as the propertyname alone is not accepted.
(Read and Write computed property)

Some examples which use this property:

Feedback, Comments & Corrections

Window.IgnoreClicksMBS as Boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Window MBS Util Plugin 3.2 Yes No No No No
Function: Can be used to control whether mouse clicks are ignored for this window.
Example:
Window1.IgnoreClicksMBS=true
Notes:
Whether this window never receives mouse events, even in areas that are opaque. Instead, clicks on the window will be passed through to windows beneath it. Available for all windows on Mac OS X 10.2 and later.

You can read the state on Mac Classic, but you can only change it on Mac Carbon.
Returns false on any error.

In Xojo 2005 and newer you need to use self. in front of the method as the propertyname alone is not accepted.

Added Cocoa support in plugin version 10.0.
(Read and Write computed property)

Feedback, Comments & Corrections

window.InvalidateShadowMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Window MBS MacOSX Plugin 8.7 Yes No No No No
Function: This method causes a window's shadow to be recalculated.
Notes:
InvalidateShadowMBS is not typically used by applications. However, it may be useful for applications with customized window frames that change shape dynamically; in this case, after the application has drawn the new window shape, the window shadow must be recalculated to follow the new window shape.

This method causes the window shadow to be immediately recalculated and redrawn based on the current contents of the window's back buffer. For best performance and visual appearance, you should follow these steps when invalidating a window shadow: disable updates with DisableScreenUpdatesMBS, draw, flush, invalidate the shadow, and enable updates. For a compositing window, after invalidating any views that should be redrawn, you will need to explicitly draw and flush using HIWindowFlush, rather than waiting for the event loop to draw and flush the window, because you cannot disable updates or invalidate the window shadow if drawing is done via the event loop.

Requires Mac OS X 10.4 and should do nothing on 10.3.

Feedback, Comments & Corrections

Window.IsIconicMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Window MBS Util Plugin No Yes No No No
Function: Returns true if this window is inside the taskbar.
Example:
MsgBox str(window1.IsIconicMBS)
Notes:
If you set IsIconic to true the window is minimized and if you set it to false the window size and position is restored.
In Xojo 2005 and newer you need to use self. in front of the method as the propertyname alone is not accepted.
(Read and Write computed property)

Some examples which use this property:

Feedback, Comments & Corrections

window.IsMetalWindowMBS as Boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Window MBS Util Plugin 7.4 Yes No No No No
Function: Whether this window uses the Metal appearance.
Example:
if window1.Frame = window.FrameTypeMetal then
MsgBox "Window is metal. "+str(window1.IsMetalWindowMBS)
else
MsgBox "Window is not metal. "+str(window1.IsMetalWindowMBS)
end if
Notes:
Available for document windows on Mac OS X 10.2 and later, and for floating windows on Mac OS X 10.3 and later. Drawers can also be metal, but dynamically adjust their appearance based on their parent window's appearance; it is not necessary to specify this attribute for a metal drawer.

You can read the state on Mac Classic, but you can only change it on Mac Carbon.
Returns false on any error.

In Xojo 2005 and newer you need to use self. in front of the method as the propertyname alone is not accepted.
(Read and Write computed property)

Feedback, Comments & Corrections

window.IsResizableMBS as Boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Window MBS Util Plugin 7.4 Yes No No No No
Function: Whether this window is resizeable.
Example:
Window1.IsResizableMBS=false
Notes:
You can read the state on Mac Classic, but you can only change it on Mac Carbon.
Returns false on any error.

Use GrowBoxTransparentMBS on Composite Mac OS X windows to enable the transparent grow box.

In Xojo 2005 and newer you need to use self. in front of the method as the propertyname alone is not accepted.

Works in Cocoa.
(Read and Write computed property)

Feedback, Comments & Corrections

Window.IsZoomedMacMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Window MBS Util Plugin 3.2 Yes No No No No
Function: Returns true if the window is zoomed.
Example:
MsgBox str(window1.IsZoomedMacMBS)
Notes:
Requires Mac OS 8.5 or newer.
Seems not to work correctly on RB 5.5.
In Xojo 2005 and newer you need to use self. in front of the method as the propertyname alone is not accepted.

Added Cocoa support in plugin version 10.0.
(Read and Write computed property)

Feedback, Comments & Corrections

Window.IsZoomedMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Window MBS Util Plugin No Yes No No No
Function: Returns true if this window has been maximized.
Example:
MsgBox str(window1.IsZoomedMBS)
Notes:
If you set IsZoomed to true the window is maximized and if you set it to false the window size and position is restored.
In Xojo 2005 and newer you need to use self. in front of the method as the propertyname alone is not accepted.

Works on Cocoa.
(Read and Write computed property)

Some examples which use this property:

Feedback, Comments & Corrections

Window.MakeTransparentMBS as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Window MBS Util Plugin 5.0 Yes Yes Yes No No
Function: Installs transparency support to a Xojo window.
Example:
dim p as Integer // property on Windows

p = window1.MakeTransparentMBS

// later in close event

window1.CleanUpTransparentMBS p
Notes:
Will return non zero value if successfull.
The window doesn't change if you don't use the CGContextMBS property.

Requires Mac OS X, Windows 2000 or Windows XP to work. The window must be a document window.

Set MacProcID of the window to 1104 and you can make it transparent without a title bar. (on Mac OS X)

With plugin version 11.1, we now return a value which should store with the window. Later in the Close event, you call CleanUpTransparentMBS passing this value.

Added Cocoa support in 11.3 plugins.
Linux supported added with 14.0, but works only with Linux desktop which support alpha channel. Calls to MakeTransparentMBS and CleanUpTransparentMBS are not required for Linux.

Some examples which use this method:

Feedback, Comments & Corrections

Window.ModifiedMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Window MBS Util Plugin Yes No No No No
Function: You can set or get the value of the modified state.
Example:
mainwindow.modifiedMBS=true
Notes:
Requires Mac OS 8.5 or newer.
As long as you don't set modified to false the window keeps to tell you that it's modified. Not sure why, so just set modified to false early in creating the window.

Added Cocoa support in plugin version 10.0.
(Read and Write computed property)

Feedback, Comments & Corrections

Window.SetTransparencyMBS(value as Integer) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Window MBS Util Plugin 5.0 Yes Yes Yes No No
Function: Your window can have transparency on Mac OS X.
Example:
if window1.SetTransparencyMBS(127) then
'fine
else
'error
end if
Notes:
Use values between 0 and 255.
Requires Mac OS X, Windows 2000 or Windows XP to work.
May be limited to simple windows like normal document windows.
You need to call MakeTransparent before to install transparency.
(this function was replaced in v4.4)
Linux supported added with 14.0, but works only with Linux desktop which support alpha channel.

Feedback, Comments & Corrections

Window.SetWindowFeedbackSettingMBS(Feedback as Integer, value as Variant) as Boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Window MBS Win Plugin 17.5 Yes No No No No
Function: Sets the feedback configuration for a window.
Example:
const FEEDBACK_TOUCH_CONTACTVISUALIZATION = 1
const FEEDBACK_PEN_BARRELVISUALIZATION = 2
const FEEDBACK_PEN_TAP = 3
const FEEDBACK_PEN_DOUBLETAP = 4
const FEEDBACK_PEN_PRESSANDHOLD = 5
const FEEDBACK_PEN_RIGHTTAP = 6
const FEEDBACK_TOUCH_TAP = 7
const FEEDBACK_TOUCH_DOUBLETAP = 8
const FEEDBACK_TOUCH_PRESSANDHOLD = 9
const FEEDBACK_TOUCH_RIGHTTAP = 10
const FEEDBACK_GESTURE_PRESSANDTAP = 11


dim r as Boolean = self.SetWindowFeedbackSettingMBS(FEEDBACK_TOUCH_TAP, true)

if r then
dim value as Boolean
dim b as Boolean = self.WindowFeedbackSettingMBS(FEEDBACK_TOUCH_TAP, value)
if b then
MsgBox "WindowFeedbackSettingMBS: "+str(value)
end if
end if
Notes:
Returns true if successful; otherwise, returns false.

Value can be nil to reset value. Or true/false to set it.
Requires Windows 8 or Windows Server 2012 in desktop apps only.

Constant NameValueDescription
FEEDBACK_TOUCH_CONTACTVISUALIZATION1Feedback for a touch contact event.
FEEDBACK_PEN_BARRELVISUALIZATION2Feedback for a pen barrel-button event.
FEEDBACK_PEN_TAP3Feedback for a pen tap event.
FEEDBACK_PEN_DOUBLETAP4Feedback for a pen double-tap event.
FEEDBACK_PEN_PRESSANDHOLD5Feedback for a pen press-and-hold event.
FEEDBACK_PEN_RIGHTTAP6Feedback for a pen right-tap event.
FEEDBACK_TOUCH_TAP7Feedback for a touch tap event.
FEEDBACK_TOUCH_DOUBLETAP8Feedback for a touch double-tap event.
FEEDBACK_TOUCH_PRESSANDHOLD9Feedback for a touch press-and-hold event.
FEEDBACK_TOUCH_RIGHTTAP10Feedback for a touch right-tap event.
FEEDBACK_GESTURE_PRESSANDTAP11Feedback for a press-and-tap gesture.

Feedback, Comments & Corrections

Next items

The items on this page are in the following plugins: MBS Linux Plugin, MBS MacOSX Plugin, MBS Util Plugin, MBS Win Plugin.




Links
MBS Xojo PDF Plugins