Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 13-12-2011, 05: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, 07:38   #2
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,018
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, 03: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

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 10:36
Domestic Water Hose Size ? Saltyhog Plumbing Systems and Fixtures 1 14-11-2011 11:01
Cranking Over After Oil Change Dockhead Engines and Propulsion Systems 39 09-10-2011 22:54



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 02:31.


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.