Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 03-10-2012, 10:57   #1
Registered User
 
phiggins's Avatar

Join Date: Nov 2004
Location: Davao, Philippines
Posts: 1,776
Send a message via Skype™ to phiggins
OpenCPN Plugin Icons

I just wrote a plugin for Ge2KAP to get the coordinates of the chart displayed on the OpenCPN display.

The only problem I have is trying to figure out how to create the icons displayed on the toolbar. I copied most the code from the Grib plugin and now my plugin displays the same icons as the grib plugin.

I was able to change the svg files from the grib plugin using Inkscape but how do I create the memory bit maps? There is a icons.sh file that seems like it does it but I am a Windows only system.

Thanks
__________________
Paul,
" One moment you are running along, the next you are no more." Dean Spanley
phiggins is offline   Reply With Quote
Old 03-10-2012, 11:59   #2
Registered User

Join Date: Dec 2008
Boat: Journeyman
Posts: 705
Re: OpenCPN Plugin Icons

It's a little bit my fault I think. When I converted all OpenCPN icons from XPM to PNG I cleaned out all the old XBM icon stuff from the tree. In that cleaning a small perl script used in the plugin build process was cleaned out too. This script takes a PNG image and creates C++ includeable source code to build the icon bitmap.

It's been put back in the tree if you have the latest master, otherwise it is here:

https://github.com/OpenCPN/OpenCPN/b...maps/png2wx.pl

A small tip if you want to create icons that work in all the new styles:
Do NOT include the button frame in your icon. Make the outer parts (maybe the outer 3 pixels of the 32x32) transparent, and use the inside area for your icon. Then all the rollover effects and such in the new styles will work for your icon too.
JesperWe is offline   Reply With Quote
Old 04-10-2012, 01:55   #3
Registered User
 
phiggins's Avatar

Join Date: Nov 2004
Location: Davao, Philippines
Posts: 1,776
Send a message via Skype™ to phiggins
Re: OpenCPN Plugin Icons

JesperWe,

Thanks for the response but I got the latest git and rebuilt OpenCPN and it did recreate my plugin dll but when I run it, I still get the same grib icons.

I must be doing something wrong?
__________________
Paul,
" One moment you are running along, the next you are no more." Dean Spanley
phiggins is offline   Reply With Quote
Old 04-10-2012, 03:47   #4
Registered User
 
phiggins's Avatar

Join Date: Nov 2004
Location: Davao, Philippines
Posts: 1,776
Send a message via Skype™ to phiggins
Re: OpenCPN Plugin Icons

OK I got it working by installing perl and running that png2wx.pl script. Then recompiling the new icons.cpp. Just have to figure out what you were saying about the transparent edges.
__________________
Paul,
" One moment you are running along, the next you are no more." Dean Spanley
phiggins is offline   Reply With Quote
Old 04-10-2012, 04:30   #5
Registered User

Join Date: Dec 2008
Boat: Journeyman
Posts: 705
Re: OpenCPN Plugin Icons

Consider the following image which is a magnification of the current dashboard icon on the left and a better way to do it on the right.



The current one is non-transparent and draws the button borders around the icon itself.
This disables the ability of the Style manager to show the icon in accordance with the current style.

A transparent icon like on the right lets the Style manager provide the looks of the button underneath the icon.
JesperWe is offline   Reply With Quote
Old 04-10-2012, 05:04   #6
Registered User
 
phiggins's Avatar

Join Date: Nov 2004
Location: Davao, Philippines
Posts: 1,776
Send a message via Skype™ to phiggins
Re: OpenCPN Plugin Icons

OK Thanks for your help
__________________
Paul,
" One moment you are running along, the next you are no more." Dean Spanley
phiggins is offline   Reply With Quote
Old 06-10-2012, 05:15   #7
Registered User
 
Gilletarom's Avatar

Join Date: Mar 2010
Location: France
Boat: 10.50 mètres
Posts: 2,988
Re: OpenCPN Plugin Icons

Hello dave, Hello JesperWe, Hello Paul,

I repeat the question I asked Paul. This plugin for Paul that facilitates the use of GE2KAP.

Simply activate this plugin is for GE2KAP can benefit. Thus, the icon of this plugin is not used much. If you click it, it seems that nothing happens.

And now you can not hide the icon. But I guess it will be improved.

This icon is needed?
B.R.

Gilletarom.
Gilletarom is offline   Reply With Quote
Old 06-10-2012, 06:15   #8
Registered User

Join Date: Dec 2008
Boat: Journeyman
Posts: 705
Re: OpenCPN Plugin Icons

No, sorry, the icon hiding feature does not handle plugins. Usually you hide the icon by disabling the plugin.

If the GE2KAP plugin does not have any windows that are show/hidden, then it probably does not need an icon at all.
JesperWe is offline   Reply With Quote
Old 06-10-2012, 10:28   #9
Registered User
 
phiggins's Avatar

Join Date: Nov 2004
Location: Davao, Philippines
Posts: 1,776
Send a message via Skype™ to phiggins
Re: OpenCPN Plugin Icons

The ge2kap plugin creates a hidden window that I use to communicate with GE2KAP via inter processor communication to retrieve the coordinates of the viewport displayed.

When the plugin is enabled it displays an icon in the toolbar. This is to tell the user the plugin is running. Clicking on the icon doesn't do anything because there is nothing for the user to do, its all done between the hidden window and GE2KAP. If you disable the plugin the icon will disappear and the hidden window is destroyed, this indicates the plugin is no longer running.

So unless there is some convention for plugin icons to say they must do something, I want to leave it they way it is: the icon indicates the plugin running, nothing else. I tell the GE2KAP users this when they install it.
__________________
Paul,
" One moment you are running along, the next you are no more." Dean Spanley
phiggins is offline   Reply With Quote
Old 06-10-2012, 13:05   #10
Registered User
 
Gilletarom's Avatar

Join Date: Mar 2010
Location: France
Boat: 10.50 mètres
Posts: 2,988
Re: OpenCPN Plugin Icons

Hello,

Quote:
Originally Posted by phiggins View Post
... I want to leave it they way it is: the icon indicates the plugin running, nothing else.... .
Why not..

It is only necessary that the icon is in the list of icons that can be hidden at the request of the user, as the other icons of the icon barr.

B.R.

Gilletarom.
Gilletarom is offline   Reply With Quote
Old 06-10-2012, 13:28   #11
Registered User
 
phiggins's Avatar

Join Date: Nov 2004
Location: Davao, Philippines
Posts: 1,776
Send a message via Skype™ to phiggins
Re: OpenCPN Plugin Icons

Gilletarom,

What is your point? Why do you object to something that seems obvious to me. Does it hurt to have the icon shown? How else will they know the plugin is running?
__________________
Paul,
" One moment you are running along, the next you are no more." Dean Spanley
phiggins is offline   Reply With Quote
Old 06-10-2012, 13:54   #12
Registered User
 
Gilletarom's Avatar

Join Date: Mar 2010
Location: France
Boat: 10.50 mètres
Posts: 2,988
Re: OpenCPN Plugin Icons

Paul

Do not get angry.

The question arises, of course, for the functioning of OpenCPN.

There are two other plug-ins that do not have icons: BSB4 and NV-Chart. And yet, they work well as soon as the plugin is enabled in the options of the "Toolbox".

For the rest, I only want to have the least amount of icon displayed on the screen OpenCPN. In version 3.1.919, it is now possible to hide the icons one by one. And without stopping the plug-in. This was a request from some users OpenCPN.

It would suffice that the icon of this plugin can be hidden in the sole discretion of the user. Each user could then, at its discretion, allow visible or hidden without calling into question the functioning of GE2KAP.

Best regards

Gilletarom.
Gilletarom is offline   Reply With Quote
Old 06-10-2012, 15:50   #13
Registered User
 
yachtvalhalla's Avatar

Join Date: Aug 2009
Location: Philippines
Boat: Formerly Fuji 32 Ketch
Posts: 1,017
Re: OpenCPN Plugin Icons

Quote:
Originally Posted by Gilletarom View Post
I only want to have the least amount of icon displayed on the screen OpenCPN. In version 3.1.919, it is now possible to hide the icons one by one.
Excellent points!

I suggest the Grib icon be added to the list of visible buttons as well as the GE2KAP one.


Terry
yachtvalhalla is offline   Reply With Quote
Old 06-10-2012, 16:02   #14
Registered User

Join Date: Dec 2008
Boat: Journeyman
Posts: 705
Re: OpenCPN Plugin Icons

Folks, I think you are confusing issues here:

- Standard icon visibility is controlled by the visibility context menu.

- Plugin icon visibility is controlled by the plugin, or by disabling the plugin.

...so if you don't want the grib icon, disable the grib plugin. You can't use it without the icon anyway.

GE2Kap seems special since it doesn't have any visible window, so it's up to phiggins how he wants his plugin to behave. OpenCPN core has no control over plugin icon visibility except by disabling the plugin.
JesperWe is offline   Reply With Quote
Old 06-10-2012, 18:42   #15
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,401
Re: OpenCPN Plugin Icons

Folks....

To be technically clear, Gilletarom is indeed correct. The PlugIn decides whether it needs or wants an icon on its initialization. PlugIns may choose to not have an icon if they so desire. PlugIns may also have a preferences dialog in which they may allow the user to control the PlugIn icon visibility.

paraphrasing jesperwe,

The core OpenCPN interface has the ability to hide only the inbuilt core icons. The core has no way to anticipate the icon needs of a PlugIn, so simply follows the directions of the activated PlugIn in this regard.

Dave
bdbcat is online now   Reply With Quote
Reply

Tags
opencpn


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Advertise Here


All times are GMT -7. The time now is 13:58.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.