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 04-06-2012, 23:00   #16
Registered User

Join Date: Jan 2011
Location: Martigues, FRANCE
Boat: GibSea 28Q
Posts: 40
Re: Developers: Need Help on v2.5.0 to Change Fade Tool Bar to Hide

Hello Jesper,

This is working!

Just one thing, when the toolbar appear after mooving the mousse, actually it not desapear again after a delay, because the Fade timer is not re-triggering
Code:
 m_fade_timer.Start(5000)
and also it need to set
Code:
m_opacity = 255;
.

The class ocpnFloatingToolbarDialog from m_fade_timer.Start() come is not know in chcanv.cpp.

What is the right method to do this job?

(I am sorry, I know C but just a little C++ and my lake made me the job difficult without your help, because I don't master class concept..:-/ )

Thx

Emmanuel
manuprenlair is offline   Reply With Quote
Old 05-06-2012, 06:11   #17
Registered User

Join Date: Dec 2008
Boat: Journeyman
Posts: 705
Re: Developers: Need Help on v2.5.0 to Change Fade Tool Bar to Hide

I suggest you put that code into the MyFrame::SurfaceToolbar() method in chart1.cpp, otherwise you will need a lot of modifications to be able to reach the toolbar object from chcanv.cpp.
/j
JesperWe is offline   Reply With Quote
Old 07-06-2012, 12:54   #18
Registered User

Join Date: Jan 2011
Location: Martigues, FRANCE
Boat: GibSea 28Q
Posts: 40
Re: Developers: Need Help on v2.5.0 to Change Fade Tool Bar to Hide

Hello Jesper.

Like version 3.0.0 is release, I decide to port the "hide toolbar" on it.
So what I did:

I modify the chcanv.cpp like you told me (line 7698):

Code:
        }
//EFI: This is for Hide-ToolBar modification
        gFrame->SurfaceToolbar();
#endif



        //  Send the current cursor lat/lon to all PlugIns requesting it
        if(g_pi_manager)
then I modify chart1.cpp:

Code:
void ocpnFloatingToolbarDialog::FadeTimerEvent(wxTimerEvent& event)
{
      if(g_bTransparentToolbar && !g_bopengl)
      {
            DoFade(128);
//EFI: This is for Hide-ToolBar modification
                Submerge();
      }

      m_fade_timer.Start(5000);           // retrigger the continuous timer
}
So I made only basic modification you gave.
What's happend:

I start OpenCPN and dont touch the mouse:
The tool bar appear
then 5s latter the tool bar desappear ( it's what we want)

Then I move the mouse:
The tool bar appear, but icon are no draw.
Then 1s latter the tool bar disappear.

I move the mouse but the tool bar never appear again ..

So ... what's append

Hope you could help me

Emmanuel
manuprenlair is offline   Reply With Quote
Old 08-06-2012, 03:27   #19
Registered User

Join Date: Dec 2008
Boat: Journeyman
Posts: 705
Re: Developers: Need Help on v2.5.0 to Change Fade Tool Bar to Hide

You haven't removed the code that tries to make the toolbar transparent, maybe that's why it's not drawing properly. (If your system doesn't support transparency).

When you get that working, I would also suggest that you only call SurfaceToolbar() if the toolbar is actually hidden. As you have it now, the toolbar is redrawn on every mouse move, which is inefficient and unnecessary.
/j
JesperWe is offline   Reply With Quote
Old 08-06-2012, 04:12   #20
Registered User

Join Date: Jan 2011
Location: Martigues, FRANCE
Boat: GibSea 28Q
Posts: 40
Re: Developers: Need Help on v2.5.0 to Change Fade Tool Bar to Hide

Héhé Jesper

The problem came from the fact I call SurfaceToolbar at each mouse event!
You'are right!
I think about that this mornig and I just test it at work
It's work now!
And I just read your post with the same idea.

The transparency was not the problem 'cause I test modification on a system where it's work.

Well, now I need to put all modification I made on 2.5.0 code on 3.0.0.

Thanks Jesper for your help
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


Advertise Here


All times are GMT -7. The time now is 17:05.


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.