public override void Load() { m_form = new FormWidget("Scale Bar Legend"); m_form.Location = oDefaultLocation; m_form.ClientSize = new System.Drawing.Size(150, 60); m_form.Text = "Scale Bar Legend"; m_form.BackgroundColor = WidgetBackgroundColor; m_form.ParentWidget = DrawArgs.NewRootWidget; m_form.AutoHideHeader = true; m_form.VerticalScrollbarEnabled = false; m_form.HorizontalScrollbarEnabled = false; m_form.OnResizeEvent += new FormWidget.ResizeHandler(m_form_OnResizeEvent); m_form.OnVisibleChanged += new VisibleChangedHandler(m_form_OnVisibleChanged); m_form.BorderEnabled = false; m_scaleBar = new ScaleBarWidget(); m_scaleBar.Location = new System.Drawing.Point(5, 0); m_form_OnResizeEvent(m_form, m_form.WidgetSize); m_scaleBar.ParentWidget = m_form; m_form.ChildWidgets.Add(m_scaleBar); bool visibility = false; m_menuItem = new System.Windows.Forms.MenuItem("Scale Bar Legend"); m_menuItem.Click += new EventHandler(m_menuItem_Click); m_menuItem.Checked = visibility; m_form.Visible = visibility; //ParentApplication.ToolsMenu.MenuItems.Add(m_menuItem); DrawArgs.NewRootWidget.ChildWidgets.Add(m_form); base.Load(); }
public override void Load() { m_form = new FormWidget("Scale Bar Legend"); m_form.Location = new System.Drawing.Point(DrawArgs.ParentControl.Width - 300, DrawArgs.ParentControl.Height - 70); m_form.ClientSize = new System.Drawing.Size(150, 60); m_form.Text = "Scale Bar Legend"; m_form.BackgroundColor = World.Settings.WidgetBackgroundColor; m_form.ParentWidget = DrawArgs.NewRootWidget; m_form.AutoHideHeader = true; m_form.VerticalScrollbarEnabled = false; m_form.HorizontalScrollbarEnabled = false; m_form.OnResizeEvent += new FormWidget.ResizeHandler(m_form_OnResizeEvent); m_form.OnVisibleChanged += new VisibleChangedHandler(m_form_OnVisibleChanged); m_form.BorderEnabled = false; m_scaleBar = new ScaleBarWidget(); m_scaleBar.Location = new System.Drawing.Point(5, 0); m_form_OnResizeEvent(m_form, m_form.WidgetSize); m_scaleBar.ParentWidget = m_form; m_form.ChildWidgets.Add(m_scaleBar); bool visibility = false; m_menuItem = new System.Windows.Forms.MenuItem("Scale Bar Legend"); m_menuItem.Click += new EventHandler(m_menuItem_Click); m_menuItem.Checked = visibility; m_form.Visible = visibility; ParentApplication.ToolsMenu.MenuItems.Add(m_menuItem); DrawArgs.NewRootWidget.ChildWidgets.Add(m_form); base.Load(); }