nscolorpanel

NSColorPanel blocking mouse up events

吃可爱长大的小学妹 提交于 2020-01-23 11:21:41
问题 I am using a NSColorWell which is set to continuously update. I need to know when the user is done editing the control (mouse up) from the color picker in the color panel. I installed an event monitor and am successfully receiving mouse down and mouse moved messages, however NSColorPanel appears to block mouse up. The bottom line is that I want to add the final selected color to my undo stack without all the intermediate colors generated while the user is choosing their selection. Is there a

Add opacity slider to the color panel for one color well but not others

北城以北 提交于 2019-12-23 07:29:21
问题 I'd like to add a opacity slider to the NSColorPanel that is shown for 1 specific NSColorWell. All other color wells should not show the opacity slider. I know I can set this for the sharedColorPanel like so: [[NSColorPanel sharedColorPanel] setShowsAlpha:YES]; But how do I do this when I only want this behavior for a single color well? I tried adding an IBAction, but this IBAction is not called when you click the color well. (So I can't make any changes before the panel is displayed). It is

NSButton subclass as colorwell & preventing NSColorPanel from touching the first responder

只愿长相守 提交于 2019-12-08 07:38:59
问题 I followed some examples for making an NSButton subclass work as an NSColorWell (since our NSButton subclass already gives us the appearance behavior we need), however I've noticed that after using the button to invoke the panel and changing the color, it's also changing the color of selected text in our document. If I instead subclassed NSColorWell with our appearance customizations, would it not have this problem? However, I'm still hoping for a work-around that avoids that & still lets us

NSButton subclass as colorwell & preventing NSColorPanel from touching the first responder

末鹿安然 提交于 2019-12-07 11:25:41
I followed some examples for making an NSButton subclass work as an NSColorWell (since our NSButton subclass already gives us the appearance behavior we need), however I've noticed that after using the button to invoke the panel and changing the color, it's also changing the color of selected text in our document. If I instead subclassed NSColorWell with our appearance customizations, would it not have this problem? However, I'm still hoping for a work-around that avoids that & still lets us use our button subclass. I've seen discussion threads suggest letting the button itself become the