What is KVR Audio? | Submit News | Advertise | Developer Account

Options (Affects News & Product results only):

OS:
Format:
Include:
Quick Search KVR

"Quick Search" KVR Audio's Product Database, News Items, Developer Listings, Forum Topics and videos here. For advanced Product Database searching please use the full product search. For the forum you can use the phpBB forum search.

To utilize the power of Google you can use the integrated Google Site Search.

Products 0

Developers 0

News 0

Forum 0

Videos 0

Search  

Cocoa/NSPopupButton y-coordinate weirdness

DSP, Plug-in and Host development discussion.

Moderator: Moderators (Main)

KVRAF
 
8367 posts since 11 Apr, 2003, from now on the flat
 

Postby duncanparsons; Fri Feb 22, 2013 6:18 am Cocoa/NSPopupButton y-coordinate weirdness

afternoon...

In our sparkly new Cocoa implementation there's an issue with the popupmenus..

We have popups attached to voice and patch selectors, and when needed they are invoked thus:
Code: Select all
   NSWindow* theWindow = (NSWindow*)mContext->GetWindow();
   NSView* contentView = NULL;
   if(theWindow){
      contentView = theWindow.contentView;
   }else{
      contentView = mContext->GetViewControl();
   }
   NSRect bounds = [macStuff->mPopupButton frame];
   bounds.origin.x = inLocation.x;
//folk of KvR, it's this next line..
   bounds.origin.y = contentView.bounds.size.height - inLocation.y;
//yes, that one just above
   [contentView addSubview:macStuff->mPopupButton];
   [contentView setNeedsDisplay:YES]; // needed
   [macStuff->mPopupButton setFrame:bounds];
   bounds = [macStuff->mPopupButton frame];


Now...

On all hosts /but/ Cubase, that subtraction is needed to get the popup to appear in the right place. With it there, all is well, apart from Cubase (version 7, to be exact, prior to this our Carbon implementation kicks in). However, to get Cubase looking as it should means removing the subtraction, which fouls up all the other hosts.

So... It strikes me that we must have /something/ wrong somewhere, I can't believe that hosts are using differing co-orinate systems; and anyway all other clicks are being interpreted properly/controls working/even the controls that the popups are attached to are getting the correct clicks.

What am I missing? I'm sure it's something very straightforward, but woods, trees..
Image
KVRer
 
9 posts since 6 Mar, 2012
 

Postby Bremmers; Fri Feb 22, 2013 7:29 am

duncanparsons wrote:I can't believe that hosts are using differing co-orinate systems

Hey, it's Apple :wink:

Have a look at NSView::isFlipped.
KVRAF
 
8367 posts since 11 Apr, 2003, from now on the flat
 

Postby duncanparsons; Fri Feb 22, 2013 7:38 am

oh, you're kidding.. I suppose with iOS, that would make some sense..

right, I'll check that out, thank you :-)
Image

Moderator: Moderators (Main)

Return to DSP and Plug-in Development