Cruisers Forum
 

Go Back   Cruisers & Sailing Forums > Seamanship, Navigation & Boat Handling > OpenCPN
Cruiser Wiki Click Here to Login
Register Vendors FAQ Community Calendar Today's Posts Log in

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 13-12-2011, 04:08   #1
Registered User

Join Date: Jan 2011
Location: Martigues, FRANCE
Boat: GibSea 28Q
Posts: 40
how to change the size of the Toolbar Button?

Hello all!

My project to make an Open Hardware plateforme to run OpenCPN is in a good way. I will talk about soon.

But for now I am under test with a tactil screen of 7".
And I want to be able to have bigger button on the tools bar. (to use it with my finger)

Is it possible without modify the code ?


Could I have some help to do that (even if I need to re-compile the code)?

Best Regards

Emmanuel
From Martigues, France
manuprenlair is offline   Reply With Quote
Old 13-12-2011, 06:38   #2
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,211
Re: how to change the size of the Toolbar Button?

Manu...
It's not possible to do it without touching the code a little bit. Good news is that it's very simple.
Lets say you want the icons 50% larger (48x48 pixels instead of the default 32x32) and don't mind that the enlarged icons will not be as smooth:
In chart1.cpp (line 1586 in the current 2.6 beta code from git):
Change
Code:
m_ptoolbar->SetToolBitmapSize(wxSize(32,32));
to
Code:
m_ptoolbar->SetToolBitmapSize(wxSize(48,48));
in bitmaps/icons.cpp (in function initialize_images()):
Change all lines like
Code:
_img_WHATEVER= new wxBitmap(wxImage(sm));
to
Code:
_img_WHATEVER = new wxBitmap(wxImage(sm).Scale(48,48));
If you want a different size for the icons, just use other number instead of 48...

Then rebuild opencpn.

Or you can regenerate the icons from the SVG sources to be the size you need and look pretty - If you are on Linux and have Inkscape and perl, read the create_all.sh script in src/bitmaps

Hope it's clear

Pavel
nohal is offline   Reply With Quote
Old 16-12-2011, 02:13   #3
Registered User

Join Date: Jan 2011
Location: Martigues, FRANCE
Boat: GibSea 28Q
Posts: 40
Re: how to change the size of the Toolbar Button?

Perfect and concise answer, I will try this.

Thanks Pavel

Emmanuel
manuprenlair is offline   Reply With Quote
Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
What Size Auxiliary / Kicker ? Waterjack Engines and Propulsion Systems 3 09-12-2011 09:36
Domestic Water Hose Size ? Saltyhog Plumbing Systems and Fixtures 1 14-11-2011 10:01
Cranking Over After Oil Change Dockhead Engines and Propulsion Systems 39 09-10-2011 21:54

Advertise Here


All times are GMT -7. The time now is 09:14.


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.