svipxu / winforms-geplugin-control-library

Automatically exported from code.google.com/p/winforms-geplugin-control-library
GNU General Public License v3.0
0 stars 0 forks source link

VB 2010: GeToolStrip does no reflect enabled layers and GEOptions #108

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use VB 2010
2. Add GeWebBrowser and GeToolStrip to a form
3. Code:

    Private Sub GeWebBrowser1_PluginReady(sender As Object, e As FC.GEPluginCtrls.GEEventArgs) Handles GeWebBrowser1.PluginReady

        _ge = e.ApiObject ' reference to the Google Earth Plugin object

        GeToolStrip1.SetBrowserInstance(GeWebBrowser1)

        'Layers
        GEHelpers.EnableLayer(_ge, Layer.Borders, True)

        'Options
        options = New GEOptions(_ge)
        options.ScaleLegendVisibility = True
        options.StatusBarVisibility = True

    End Sub

What is the expected output? What do you see instead?

The map shows the "Borders" correctly. The scale and status bar are visible. 
However, in the GeToolStrip "Layers" dropdown, the "Borders" layer is not 
selected. In the "Options" drop down, the "Scale" and "Status Bar" is not 
selected.

What version of the product are you using? On what operating system?

DLL v3 - Commit 533. Windows 7 64 Bit

Please provide any additional information below.

Original issue reported on code.google.com by nhi...@vt.edu on 16 Jul 2013 at 7:41

GoogleCodeExporter commented 8 years ago
Simply move the call to GeToolStrip1.SetBrowserInstance(GeWebBrowser1) to after 
you have set up the layers. This way the options will be synchronized.

'Layers
GEHelpers.EnableLayer(_ge, Layer.Borders, True)
GeToolStrip1.SetBrowserInstance(GeWebBrowser1)

Original comment by fraser.c...@gmail.com on 16 Jul 2013 at 8:16

GoogleCodeExporter commented 8 years ago
I tried that and the toolstrip is still not synchronized.

Original comment by nhi...@vt.edu on 16 Jul 2013 at 8:33

GoogleCodeExporter commented 8 years ago
Ah OK I see the problem and I can reproduce this issue. I will fix it asap. 

Sorry about that 

Note to self: getInheritedVisibility()

Original comment by fraser.c...@gmail.com on 17 Jul 2013 at 3:15

GoogleCodeExporter commented 8 years ago
Ok, disregard what I first said about the order of calling the methods. To 
update the GEToolStrip to reflect the current plugin settings simply call 
Refesh on it.

i.e. 

   Private Sub GeWebBrowser1_PluginReady(sender As Object, e As FC.GEPluginCtrls.GEEventArgs) Handles GeWebBrowser1.PluginReady

        _ge = e.ApiObject ' reference to the Google Earth Plugin object

        GeToolStrip1.SetBrowserInstance(GeWebBrowser1)

        'Layers
        GEHelpers.EnableLayer(_ge, Layer.Borders, True)

        'Options
        options = New GEOptions(_ge)
        options.ScaleLegendVisibility = True
        options.StatusBarVisibility = True

        GeToolStrip1.Refresh(); 
    End Sub

Original comment by fraser.c...@gmail.com on 17 Jul 2013 at 5:42

GoogleCodeExporter commented 8 years ago
It is still not working for me.

Original comment by nhi...@vt.edu on 17 Jul 2013 at 6:09

GoogleCodeExporter commented 8 years ago
Have you down loaded and rebuilt the library and made sure you have replaced 
any existing version?

Original comment by fraser.c...@gmail.com on 17 Jul 2013 at 6:56

GoogleCodeExporter commented 8 years ago
Thanks. It works now. I didn't realize that you had updated the DLL. I thought 
I just needed to add the Refresh() method.

Original comment by nhi...@vt.edu on 17 Jul 2013 at 7:50