Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

[MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu? (MBS Xojo Plugin Mailinglist archive)

Back to the thread list
Previous thread: [MBS] How to use QTMovieExporterMBS to export h264 without dialog
Next thread: [MBS] [ANN] 13.1pr12


Re: [MBS] PortAudio bug?   -   Garth Hjelte
  [MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu?   -   Osswald Oliver
   Re: [MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu?   -   Christian Schmitz
   Re: [MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu?   -   Osswald Oliver
   Re: [MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu?   -   Osswald Oliver
   Re: [MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu?   -   Christian Schmitz
   Re: [MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu?   -   Christian Schmitz
   Re: [MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu?   -   Marnaud
   Re: [MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu?   -   Osswald Oliver
   Re: [MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu?   -   Osswald Oliver
   Re: [MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu?   -   Christian Schmitz
   Re: [MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu?   -   Christian Schmitz
   Re: [MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu?   -   Osswald Oliver

[MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu?
Date: 08.04.13 08:49 (Mon, 8 Apr 2013 09:49:53 +0200)
From: Osswald Oliver
I'm using CustomNSToolbarMBS based on this example project :
http://www.monkeybreadsoftware.net/example-cocoa-toolbarbuttons-toolbarbuttons.shtml

This toolbar comes with a context menu 'Use small size', which in my case results in somewhat squashed looking icons. I want to entirely remove this menu option and not allow for using small toolbar icons.

How can I remove that menu option (and in this context: how does one add menu options to the toolbars context menu?)

Oliver
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu?
Date: 09.04.13 10:05 (Tue, 9 Apr 2013 11:05:50 +0200)
From: Christian Schmitz

Am 09.04.2013 um 08:10 schrieb Osswald Oliver <<email address removed>>:

>> I add an event allowSizeMode. You can use it like this to get rid of small mode:
>
> I'm stuck with this : where do I find this event handler?
>
> I'm using CustomNSToolbarMBS

You need a new plugin which has that event there.

Greetings
Christian

-

Re: [MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu?
Date: 09.04.13 07:11 (Tue, 9 Apr 2013 08:11:43 +0200)
From: Osswald Oliver
> The selector name is: "toggleUsingSmallToolbarIcons:"

> I also add two methods to find it easier:
>
> itemWithSelector(selector as string) as NSMenuItemMBS
> indexOfItemWithSelector(selector as string) as integer

Thanks a lot, works like a charm
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu?
Date: 09.04.13 07:10 (Tue, 9 Apr 2013 08:10:42 +0200)
From: Osswald Oliver
> I add an event allowSizeMode. You can use it like this to get rid of small mode:

I'm stuck with this : where do I find this event handler?

I'm using CustomNSToolbarMBS ...

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu?
Date: 08.04.13 20:54 (Mon, 8 Apr 2013 21:54:12 +0200)
From: Christian Schmitz

Am 08.04.2013 um 17:33 schrieb Osswald Oliver <<email address removed>>:

> However: On the CustomizeToolbar Window, there is also a checkbox "Use small size".
>
> Is there a way I can get rid of it as well?

I add an event allowSizeMode. You can use it like this to get rid of small mode:

Function allowsSizeMode(mode as integer, SuperAllows as boolean) As boolean
#if DebugBuild then
System.DebugLog CurrentMethodName+" "+str(SuperAllows)
#endif

if mode = me.NSToolbarSizeModeSmall then
Return false
else
Return SuperAllows
end if

End Function


Greetings
Christian

Re: [MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu?
Date: 08.04.13 20:53 (Mon, 8 Apr 2013 21:53:23 +0200)
From: Christian Schmitz

Am 08.04.2013 um 20:38 schrieb Marnaud <<email address removed>>:

>> Dim i As NSMenuItemMBS = m.Item(5) // use small size
>> i.isHidden=True
>
> What if, on another OS version or configuration, the item 5 is another one? Your code could break.

I'll add ActionSelector to NSMenuItemMBS so you can query the selector name. THis is more unlikely to change than the title or the index.

The selector name is: "toggleUsingSmallToolbarIcons:"

I also add two methods to find it easier:

itemWithSelector(selector as string) as NSMenuItemMBS
indexOfItemWithSelector(selector as string) as integer

Greetings
Christian

Re: [MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu?
Date: 08.04.13 19:38 (Mon, 08 Apr 2013 20:38:18 +0200)
From: Marnaud
Le 8 avr. 2013 à 17:33, Osswald Oliver a écrit:

> With this code I can now hide the "small size" menuitem from the toolbar menu:
>
> // Hide Small Size Option of Menu
> Dim v As NSViewMBS = Self.NSWindowMBS.toolbarView
> Dim m As NSMenuMBS = v.menu
> Dim i As NSMenuItemMBS = m.Item(5) // use small size
> i.isHidden=True

What if, on another OS version or configuration, the item 5 is another one? Your code could break.
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu?
Date: 08.04.13 16:33 (Mon, 8 Apr 2013 17:33:55 +0200)
From: Osswald Oliver
Thanks, the test plugin works!

With this code I can now hide the "small size" menuitem from the toolbar menu:

// Hide Small Size Option of Menu
Dim v As NSViewMBS = Self.NSWindowMBS.toolbarView
Dim m As NSMenuMBS = v.menu
Dim i As NSMenuItemMBS = m.Item(5) // use small size
i.isHidden=True

However: On the CustomizeToolbar Window, there is also a checkbox "Use small size".

Is there a way I can get rid of it as well?

Oliver
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu?
Date: 08.04.13 12:32 (Mon, 8 Apr 2013 13:32:01 +0200)
From: Osswald Oliver
>
> I'll add a new toolbarView method to NSWindowMBS to get the NSViewMBS for the toolbar.
>
> dim v as NSViewMBS = self.NSWindowMBS.toolbarview
> dim m as NSMenuMBS = v.Menu
> dim i as NSMenuItemMBS = m.Item(0)
> MsgBox i.title
>
> And on the toolbar view you can ask for the menu and change it.
>
> Greetings
> Christian

Great! Thanks a lot,
Oliver
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu?
Date: 08.04.13 12:27 (Mon, 8 Apr 2013 13:27:23 +0200)
From: Christian Schmitz

Am 08.04.2013 um 09:49 schrieb Osswald Oliver <<email address removed>>:

> How can I remove that menu option (and in this context: how does one add menu options to the toolbars context menu?)

I'll add a new toolbarView method to NSWindowMBS to get the NSViewMBS for the toolbar.

dim v as NSViewMBS = self.NSWindowMBS.toolbarview
dim m as NSMenuMBS = v.Menu
dim i as NSMenuItemMBS = m.Item(0)
MsgBox i.title

And on the toolbar view you can ask for the menu and change it.

Greetings
Christian

Re: [MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu?
Date: 14.04.13 09:31 (Sun, 14 Apr 2013 10:31:11 +0200)
From: Christian Schmitz

Am 14.04.2013 um 06:33 schrieb Osswald Oliver <<email address removed>>:

> I just installed plugins 13.1pr13 and CustomNSToolbarMBS.allowsSizeMode event is not listed.

The event is there for me.

> And other events seem to have disappeared as well - I cannot catch keyUp in CustomNSSearchFieldMBS anymore.
>
> We run into this issue regularly, after plugin updates: Is there a way you could make sure that those custom classes are not getting lost on the way?

Well, I optimized constructors. And I forgot the little difference there.
I'll fix that now.

Greetings
Christian

Re: [MBS] CustomNSToolbarMBS : Remove 'use small size' from context menu?
Date: 14.04.13 05:33 (Sun, 14 Apr 2013 06:33:36 +0200)
From: Osswald Oliver
I just installed plugins 13.1pr13 and CustomNSToolbarMBS.allowsSizeMode event is not listed.

(I did clear cache of IDE 13.1b13 before restarting with the new plugins)

And other events seem to have disappeared as well - I cannot catch keyUp in CustomNSSearchFieldMBS anymore.

We run into this issue regularly, after plugin updates: Is there a way you could make sure that those custom classes are not getting lost on the way?

Regards, Oliver

On 09.04.2013, at 11:05, Christian Schmitz <<email address removed>> wrote:

>
> Am 09.04.2013 um 08:10 schrieb Osswald Oliver <<email address removed>>:
>
>>> I add an event allowSizeMode. You can use it like this to get rid of small mode:
>>
>> I'm stuck with this : where do I find this event handler?
>>
>> I'm using CustomNSToolbarMBS
>
>
> You need a new plugin which has that event there.
>
> Greetings
> Christian

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info