I'm designing a window that uses a full window design like Music, App Store, Messages, etc. but I need to prevent window dragging only on certain parts of the transparent titlebar. There will be buttons there, and currently clicking on them still allows the window to be moved despite returning true from MouseDown, because the I assume the window gets the click before Xojo does.
Here's an example, I want to allow normal behavior in the green areas, prevent dragging in the red areas.
MBS is an option for this. I've tried setting NSWindowMBS.Movable to false in MouseDown, which would have been awful if it worked, but it doesn't. I suspect MouseDown is too late in the chain. I've tried getting the event With NSWindwoMBS.CurrentEvent and that works, but I don't have a way to cancel the event. I don't think that's the right call anyway, I believe I would need to return nil from a subclass' overridden method.
Anybody have any advice?
If it helps, this is how I get the window looking the way it does.
#if TargetMacOS Var Win As NSWindowMBS = Self.NSWindowMBS Win.StyleMask = Win.StyleMask Or NSWindowMBS.NSFullSizeContentViewWindowMask Win.TitlebarAppearsTransparent = True Win.TitleVisibility = NSWindowMBS.NSWindowTitleHidden Var Toolbar As New NSToolbarMBS("com.thezaz.beacon.mainwindow.toolbar") Toolbar.sizeMode = NSToolbarMBS.NSToolbarDisplayModeIconOnly Toolbar.showsBaselineSeparator = False Self.mToolbar = Toolbar Win.toolbar = Toolbar #endif