public override void Load() { /////////////////// WidgetForm m_form = new WidgetForm("Scale Bar Legend"); m_form.Location = new System.Drawing.Point(DrawArgs.Instance.ScreenWidth - 300, DrawArgs.Instance.ScreenHeight - 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 = this.Viewer.CurrentWorld.OverlayList; m_form.AutoHideHeader = true; m_form.VerticalScrollbarEnabled = false; m_form.HorizontalScrollbarEnabled = false; m_form.BorderEnabled = false; m_form.HeaderEnabled = false; ScaleBarWidget m_scaleBar = new ScaleBarWidget(); m_scaleBar.Location = new System.Drawing.Point(5, 0); m_scaleBar.ParentWidget = m_form; m_scaleBar.ClientSize = new System.Drawing.Size(m_form.WidgetSize.Width - 10, m_form.WidgetSize.Height - 20); m_form.ChildWidgets.Add(m_scaleBar); this.Viewer.CurrentWorld.OverlayList.Add(m_form); OverLayer.Control.WidgetMenuButton m_compasstoolbar = new R.Earth.OverLayer.Control.WidgetMenuButton ("比例尺", Config.EarthSetting.IconSourcePath + "\\compass.png", m_form); this.Viewer.MenuBar.AddToolsMenuButton(m_compasstoolbar); }
public override void Load() { m_compass = new WidgetForm("PlaceFinder"); m_compass.ClientSize = new System.Drawing.Size(320, 120); m_compass.Location = new System.Drawing.Point(200, 200); m_compass.BackgroundColor = System.Drawing.Color.Wheat; m_compass.ParentWidget = this.Viewer.CurrentWorld.OverlayList; m_compass.AutoHideHeader = true; m_compass.VerticalScrollbarEnabled = true; m_compass.HorizontalScrollbarEnabled = true; m_compass.BorderEnabled = true; m_compass.HeaderEnabled = true; m_compass.Visible = false; m_compass.OnResizeEvent += new WidgetForm.ResizeHandler(m_compass_OnResizeEvent); TEX = new WidgetTextBox(); TEX.ClientSize = new System.Drawing.Size(50, 50); TEX.ClientLocation = new System.Drawing.Point(10, 30); TEX.Visible = true; TEX.Text = "wHAT'S THIS"; TEX.ForeColor = System.Drawing.Color.Red; TEX.ParentWidget = m_compass; m_compass.ChildWidgets.Add(TEX); this.Viewer.CurrentWorld.OverlayList.Add(m_compass); OverLayer.Control.WidgetMenuButton m_compasstoolbar = new R.Earth.OverLayer.Control.WidgetMenuButton ("PlaceFinder", Config.EarthSetting.IconSourcePath + "\\search.png", m_compass); this.Viewer.MenuBar.AddToolsMenuButton(m_compasstoolbar); }
public override void Load() { /////////////////////////// WidgetForm m_compass = new WidgetForm("Compass"); m_compass.ClientSize = new System.Drawing.Size(200, 200); m_compass.Location = new System.Drawing.Point(0, 400); m_compass.BackgroundColor = World.Settings.WidgetBackgroundColor; m_compass.ParentWidget = this.Viewer.CurrentWorld.OverlayList; m_compass.AutoHideHeader = true; m_compass.VerticalScrollbarEnabled = false; m_compass.HorizontalScrollbarEnabled = false; m_compass.BorderEnabled = false; m_compass.HeaderEnabled = false; Compass3DWidget m_compasswidget = new Compass3DWidget(); m_compasswidget.Location = new System.Drawing.Point(5, 0); m_compasswidget.Font = new System.Drawing.Font("Ariel", 10.0f, System.Drawing.FontStyle.Bold); m_compasswidget.ParentWidget = m_compass; m_compass.ChildWidgets.Add(m_compasswidget); this.Viewer.CurrentWorld.OverlayList.Add(m_compass); OverLayer.Control.WidgetMenuButton m_compasstoolbar = new R.Earth.OverLayer.Control.WidgetMenuButton ("Compass", Config.EarthSetting.IconSourcePath + "\\compass.png", m_compass); this.Viewer.MenuBar.AddToolsMenuButton(m_compasstoolbar); }
public WidgetNotifyIcon(List <WidgetForm> forms) { _notifyIcon = new NotifyIcon(); ContextMenuStrip contextMenu = new ContextMenuStrip(); for (int i = 0; i < forms.Count; i++) { contextMenu.Items.Add(AddWidget(forms[i])); } ToolStripMenuItem addWidgetToolStripMenuItem = new ToolStripMenuItem(); addWidgetToolStripMenuItem.Text = @"Add Widget"; addWidgetToolStripMenuItem.Click += (sender, e) => { //MultiWidgetContext.AddForms(); //WidgetForm form = new WidgetForm(new Settings()); WidgetForm form = new WidgetForm(ref _appSettings, new Settings()); MultiWidgetContext.AddForm(form); contextMenu.Items.Insert(0, AddWidget(form)); form.Show(); }; contextMenu.Items.Add(addWidgetToolStripMenuItem); ToolStripMenuItem exitToolStripMenuItem = new ToolStripMenuItem(); exitToolStripMenuItem.Text = @"Exit"; exitToolStripMenuItem.Click += (sender, e) => { System.Environment.Exit(0); }; contextMenu.Items.Add(exitToolStripMenuItem); _notifyIcon.ContextMenuStrip = contextMenu; }
private void m_form_OnResizeEvent(WidgetForm m_form, Size size) { this.worldViewer1.ResetSize(); }