Cruisers & Sailing Forums (http://www.cruisersforum.com/forums/)
-   OpenCPN (http://www.cruisersforum.com/forums/f134/)
-   -   Plugins and tool bar icons (http://www.cruisersforum.com/forums/f134/plugins-and-tool-bar-icons-133993.html)

Ptizef 03-10-2014 08:50

Plugins and tool bar icons
 
I want severals icons on the tool bar for the same plugin
I have no problem to create and use them, getting action from a click on one of them - no problem

But I would like to toggle visible/invisible them from the plugin and I was unable to do that.
There is a "SetToolbarToolViz( ... )" function but seems to do nothing

Have I missed something ?

Thanks
Jean Pierre

nohal 03-10-2014 09:17

Re: Plugins and tool bar icons
 
JP...
I'm not aware of anyone ever using it, so it might clearly be broken.

Pavel

rgleason 03-10-2014 10:30

Re: Plugins and tool bar icons
 
Prize Would this possibly be a solution to having the current(data) grib in one file and wind & pressure in another grib file. Such that wxrte can use both files?

Sent from my SCH-I545 using Cruisers Sailing Forum mobile app

rgleason 03-10-2014 10:31

Re: Plugins and tool bar icons
 
Sorry I meant ptizef. Spell correct un-corrected.

Sent from my SCH-I545 using Cruisers Sailing Forum mobile app

Ptizef 04-10-2014 00:48

Re: Plugins and tool bar icons
 
Pavel
yes the visibility function is broken (or more exactly not finished )
Although I'm not familiar with this stuff, I found a solution working in the patch here:

chart1.cpp
@@ -3085,6 +3085,7 @@ bool MyFrame::AddDefaultPositionPlugInTools( ocpnToolBarSimple *tb )

for( unsigned int i = 0; i < tool_array.GetCount(); i++ ) {
PlugInToolbarToolContainer *pttc = tool_array.Item( i );
+ if( !pttc->b_viz ) continue;
if( pttc->position == -1 ) // PlugIn has requested default positioning
{
wxBitmap *ptool_bmp;


pluginmanager.cpp
@@ -1364,6 +1364,7 @@ void PlugInManager::SetToolbarToolViz(int item, bool viz)
if(pttc->id == item)
{
pttc->b_viz = viz;
+ pParent->RequestNewToolbar();
break;
}
}


Jean Pierre


All times are GMT -7. The time now is 21:46.

Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2019, vBulletin Solutions, Inc.


ShowCase vBulletin Plugins by Drive Thru Online, Inc.