PlugIns? (#2) - Toolbar button selection (#178) - Message List

Toolbar button selection

Is there a way to select the active Editor Toolbar button in code rather than by click select?

For example, Drawing Editor button is selected and the drawing editor toolbar is up on the right side of FalconView. I want to select the Moving Map Tool button from the Editor Toolbar (Select/Activate in code) to bring up the Moving Map Toolbar on the right side of FalconView, but do it in code, not by clicking the button.

Scrolling through the Overlay List Toolbar entries using either the drop down selections or the arrows will change the selected button, but again, I want to accomplish this in code.

Possibly setting the active overlay? But how to do this?

  • Message #315

    Am I correct in that you can get the GPS layer handle by calling

    gpsLayerHandle = gps.GetConnectedHandle?

    and that I should be able to call

    value = layer.MoveLayerToTop?(gpsLayerHandle)

    to move it to the top and make it's editor the currently active editor?

    This is what I am trying but

    layer.MoveLayerToTop?(gpsLayerHandle)

    is returning -1(failure). What could cause MoveLayerToTop? to return a failure?

    layer.MoveLayerToTop?(someDrawingLayerHandle)

    works and moves a drawing layer to the top making the drawing editor active. Can I not call this method on the gps layer?

    I verified the handle to the GPS layer is valid.

  • Message #335

    Here is a program that does what you want:

    #include <iostream>
    #import "fvw.tlb" no_namespace, named_guids
    #import "FalconViewOverlay.tlb" no_namespace, named_guids
    const long SUCCESS = 0;
    const GUID FVWID_Overlay_MovingMapTrail =
       { 0x9e30f658, 0x9d21, 0x417e, { 0xa1, 0xc5, 0xb4, 0x60, 0xc0, 0xe4, 0xf6, 0x37 } };
    int _tmain(int argc, _TCHAR* argv[])
    {
       ::CoInitialize(NULL);
       try
       {
          ILayer5Ptr spLayer5(CLSID_Layer5);
          IDispatchPtr spDispatch;
          if (spLayer5->GetFvOverlayManager(&spDispatch) == SUCCESS)
          {
             IFvOverlayManagerPtr spOverlayManager = spDispatch;
             spOverlayManager->SetCurrentEditor(FVWID_Overlay_MovingMapTrail);
          }
       }
       catch(_com_error& e)
       {
          // log error
          std::cout << "EXCEPTION: " << (char *)e.Description() << std::endl;
       }
       ::CoUninitialize();
       return 0;
    }

Subscriptions