/// <summary> Additional constructor for convenience in creating menu items
        /// </summary>
        /// <param name="Name"> Name of the menu item (display string)
        /// </param>
        /// <param name="Enabled"> Flag for whether the menu item should be "enabled" in the menu
        /// </param>
        /// <param name="Checked"> Flag for whether the menu item should have a check mark next to it in the menu
        /// </param>
        public FVContextMenuItem(FvOverlay theOverlay, string Name, MenuItemEntryType MenuItemType, object theObject,
                                 bool Enabled, bool Checked)
        {
            m_MenuItemName = Name;
            m_MenuItemEnabled = Enabled;
            m_MenuItemChecked = Checked;

            m_TheOverlay = theOverlay;
            m_MenuItemType = MenuItemType;
            m_MyDataItem = theObject;
        }
Ejemplo n.º 2
0
        /// <summary> Called when the property page is created by the overlay options dialog. 
        /// </summary>
        /// <param name="propertyPageGuid"> uid specifed in the property pages config file
        /// </param>
        /// <param name="pMapView"> The Current Map View object
        /// </param>
        /// <param name="hWndParent"> the HWND of the parent window in the overlay options 
        /// dialog box. The property page should be created as a child of this window
        /// </param>
        /// <param name="pEvents"> can implement IMapChangeNotifyEvents, IDisplayChangeNotifyEvents, and IFvPropertyPageEvents
        /// </param>
        public void OnCreate(Guid propertyPageGuid, FalconViewOverlayLib.IFvMapView pMapView, int hWndParent, object pEvents)
        {
            // The GUID of the property page that is being requested.  i.e. "this" provides several configurations of the
            // property control (itself).

            // Save aside the callback objects for use
            m_MapView = pMapView;
            m_MapChangeNotifyEvents = pEvents as FalconViewOverlayLib.IMapChangeNotifyEvents;
            m_DisplayChangeNotifyEvents = pEvents as FalconViewOverlayLib.IDisplayChangeNotifyEvents;

            m_PropertyPageNotifyEvents = pEvents as FalconViewOverlayLib.IPropertyPageNotifyEvents;

            // Critical step to get the draw notification
            SetParent(Handle, new IntPtr(hWndParent));

            int OverlayOnTop = m_MapView.OverlayManager.SelectByOverlayDescGuid(new Guid("f9109e69-faa5-4144-9b74-aaf6fd933d7d"));

            if (OverlayOnTop == 1)
            {
                m_TheOverlay = m_MapView.OverlayManager.CurrentOverlay as FvOverlay;
            }
            else
            {
                do
                {
                    int result = m_MapView.OverlayManager.MoveNext();
                    if (result == 0)
                        break;

                    m_TheOverlay = m_MapView.OverlayManager.CurrentOverlay as FvOverlay;
                } while (m_TheOverlay == null);
            }

            PreferenceClass thePrefs = null;

            if (m_TheOverlay != null)
                thePrefs = PreferenceClass.CreateFromString(m_TheOverlay.GetPreferences());
            else
                thePrefs = new PreferenceClass();

            SetSelectedItem(thePrefs.m_HideAbove, m_HideAboveCB);
            SetSelectedItem(thePrefs.m_HideLabelsAbove, m_HideLabelsAboveCB);

            m_OverlayBannerCk.Checked = thePrefs.m_ShowBanner;

            RBBlueIcons.Checked = thePrefs.m_UseBlueIcons;
            RBRedIcons.Checked = !thePrefs.m_UseBlueIcons;
        }