Наследование: MonoBehaviour
Пример #1
0
        public override void InitializeControls()
        {
            var lb = new ListBox(new Rectangle(0, 0, 800, 600),
                                 ScreenManager.Content.Load<APNGTexture>(@"images\eagss.png"),
                                 ScreenManager.Content.Load<APNGTexture>(@"images\thumb.png"));
            lb.Items.Add(new ListBoxItem(""));

            AddControl(lb);

            var s = new Slider(new Vector3(300, 100, 400), false,
                               ScreenManager.Content.Load<APNGTexture>(@"images\thumb.png"),
                               ScreenManager.Content.Load<APNGTexture>(@"images\thumb_hover.png"))
                        {
                            ThumbLocation = 1f,
                        };

            s.OnDrag += sender =>
                            {
                                DebugScreen.Output(sender.ThumbLocation.ToString());
                            };

            AddControl(s);

            base.InitializeControls();
        }
Пример #2
0
	public MainForm ()
	{
		// 
		// _listBox
		// 
		_listBox = new ListBox ();
		_listBox.DisplayMember = "Name";
		_listBox.Location = new Point (8, 8);
		_listBox.Size = new Size (100, 60);
		_listBox.ValueMember = "Value";
		Controls.Add (_listBox);
		// 
		// 
		// 
		_clearButton = new Button ();
		_clearButton.Location = new Point (140, 30);
		_clearButton.Text = "Clear";
		_clearButton.Click += new EventHandler (ClearButton_Click);
		Controls.Add (_clearButton);
		// 
		// MainForm
		// 
		ClientSize = new Size (240, 80);
		Location = new Point (300, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #81788";
		Load += new EventHandler (MainForm_Load);
	}
Пример #3
0
        private void ToolsListBox_SelectedItemChanged(object sender, ListBox<ListBoxItem>.SelectedItemEventArgs e)
        {
            if (selectedTool != null)
            {
                selectedTool.OnDeselected();
                //if (selectedTool.ControlPanels != null)
                //    foreach (var pane in selectedTool.ControlPanels)
                //    {
                //        foreach (var control in pane.Controls)
                //        {
                //            Remove(control);
                //        }
                //    }
            }

            if (e.Item != null)
            {
                selectedTool = (ITool)e.Item;
                EditorConsoleManager.ToolName = selectedTool.Title;

                //EditorConsoleManager.AllowKeyboardToMoveConsole = true;

                Panels.CharacterPickPanel.SharedInstance.HideCharacter = false;
                Panels.CharacterPickPanel.SharedInstance.HideForeground = false;
                Panels.CharacterPickPanel.SharedInstance.HideBackground = false;

                selectedTool.OnSelected();
                Panels.CharacterPickPanel.SharedInstance.Reset();
            }
        }
Пример #4
0
	public MainForm ()
	{
		SuspendLayout ();
		// 
		// _groupBox
		// 
		_groupBox = new GroupBox ();
		_groupBox.AllowDrop = true;
		_groupBox.Dock = DockStyle.Top;
		_groupBox.Height = 100;
		_groupBox.TabIndex = 0;
		_groupBox.TabStop = false;
		_groupBox.Text = "Drop a file here";
		_groupBox.DragDrop += new DragEventHandler (GroupBox_DragDrop);
		_groupBox.DragEnter += new DragEventHandler (GroupBox_DragEnter);
		Controls.Add (_groupBox);
		// 
		// _filesListBox
		// 
		_filesListBox = new ListBox ();
		_filesListBox.Dock = DockStyle.Bottom;
		_filesListBox.Height = 150;
		Controls.Add (_filesListBox);
		// 
		// MainForm
		// 
		ClientSize = new Size (400, 265);
		Location = new Point (200, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #324251";
		Load += new EventHandler (MainForm_Load);
		ResumeLayout (false);
	}
 protected void cargarLista(ListBox lista)
 {
     lista.DataSource = CursoDao.ObtenerTodo();
     lista.DataValueField = "id_curso";
     lista.DataTextField = "nombre";
     lista.DataBind();
 }
 public static string ShowDialog(string baseSite,string text, string caption)
 {
     Form prompt = new Form();
     string resultURL="";
     prompt.Width = 600;
     prompt.Height = 420;
     prompt.Text = caption;
     
     Label textLabel = new Label() { Left = 10, Top=10, Width=580, Text=text };
     ListBox lbCounty = new ListBox() { Left = 10, Top=40, Width=250, Height = 340, DisplayMember = "Label" };
     Button confirmation = new Button() { Text = "Ok", Left=370, Width=100, Top=350 };
     Button cancel = new Button() { Text = "Cancel", Left=480, Width=100, Top=350 };
     
     confirmation.Click += (sender, e) => {
             if(lbCounty.SelectedItem!=null) {resultURL=lbCounty.SelectedItem.ToString();}
             prompt.Close();
         };
     lbCounty.DoubleClick += (sender, e) => { confirmation.PerformClick();};
     cancel.Click += (sender, e) => { resultURL = "";prompt.Close(); };
     
     prompt.Controls.Add(confirmation);
     prompt.Controls.Add(cancel);
     prompt.Controls.Add(textLabel);
     prompt.Controls.Add(lbCounty);
     
     FillLbCounty(lbCounty,baseSite);
     
     prompt.ShowDialog();
     return resultURL;
 }
Пример #7
0
        public void DataContexts_Should_Be_Correctly_Set()
        {
            using (UnitTestApplication.Start(TestServices.MockPlatformRenderInterface))
            {
                var items = new object[]
                {
                    "Foo",
                    new Item("Bar"),
                    new TextBlock { Text = "Baz" },
                    new ListBoxItem { Content = "Qux" },
                };

                var target = new ListBox
                {
                    Template = ListBoxTemplate(),
                    DataContext = "Base",
                    DataTemplates = new DataTemplates
                {
                    new FuncDataTemplate<Item>(x => new Button { Content = x })
                },
                    Items = items,
                };

                Prepare(target);

                var dataContexts = target.Presenter.Panel.Children
                    .Cast<Control>()
                    .Select(x => x.DataContext)
                    .ToList();

                Assert.Equal(
                    new object[] { items[0], items[1], "Base", "Base" },
                    dataContexts);
            }
        }
Пример #8
0
        protected override void Initialize()
        {
            base.Initialize();

            //create a bunch of UI elements and link them to the state
            ScrollPanel panel = new ScrollPanel(0, 0, 0, 400, 640, this);
            panel.SetBackgroundColor(Color4.Red);
            ScrollPanel panel2 = new ScrollPanel(420, 10, 0, 350, 500, this);

            panel.SetContentDimensions(800, 800);
            panel2.SetContentDimensions(400, 400);

            Button button = new Button(10, 50, 0, 100, 100, "button.png", "button", this);
            TextField field = new TextField(10, 10, 0, 100, this);
            ListBox listBox = new ListBox(120, 10, 0, 200, 150, 10, this);

            DropDownBox dropDown = new DropDownBox(50, 420, 0, 100, this);

            TextBox textBox = new TextBox(10, 10, 0, 400, 400, this);
            RadioButton radio = new RadioButton(200, 420, 0, this);

            panel.AddControl(panel2);

            panel.AddControl(dropDown);
            panel.AddControl(textBox);
            panel.AddControl(radio);

            panel2.AddControl(button);
            panel2.AddControl(field);
            panel2.AddControl(listBox);

            this.AddControl(panel);
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        sysManager = new SystemExerciseManager();
        routManager = new routineManager();
        logManager = new LoggedExerciseManager();

        lb = (ListBox)this.Parent.FindControl("lbRoutines");

        if (Session["loggedExerciseID"] != null)
        {
            loggedExerciseID = (int)Session["loggedExerciseID"];
        }

        if (!IsPostBack)
        {
            Session.Abandon();
            pnlSets.Visible = false;
        }

        if (lb != null && lb.SelectedIndex > -1)
        {
            routineID = Convert.ToInt32(lb.SelectedItem.Value);
            GridView1.DataSource = routManager.getLoggedExercises(userID, routineID);
            GridView1.DataBind();
            pnlSets.Visible = false;
        }
    }
    public string GetListBoxSelValueInComma(ListBox Listbox1)
    {
        string selectedItem = "";
        if (Listbox1.Items.Count > 0)
        {
            if (Listbox1.SelectedValue.ToString() == "0")
            {
                for (int i = 0; i < Listbox1.Items.Count; i++)
                {
                    if (selectedItem == "")
                        selectedItem = Listbox1.Items[i].Value;
                    else
                        selectedItem += "\",\"" + Listbox1.Items[i].Value;
                }
            }
            else
            {
                for (int i = 0; i < Listbox1.Items.Count; i++)
                {
                    if (Listbox1.Items[i].Selected)
                    {
                        if (selectedItem == "")
                            selectedItem = Listbox1.Items[i].Value;
                        else
                            selectedItem += "\",\"" + Listbox1.Items[i].Value;
                    }

                }
            }
        }
        selectedItem = "\"" + selectedItem + "\"";
        return selectedItem;
    }
Пример #11
0
    public HelloForm()
    {
        this.Text = "Hello Form";
        this.StartPosition = FormStartPosition.CenterScreen;
        this.FormBorderStyle = FormBorderStyle.FixedDialog;
        this.ControlBox = true;
        this.MaximizeBox = false;
        this.MinimizeBox = false;
        this.BackColor = Color.Red;

        lb = new ListBox();
        lb.Left = 5;
        lb.Width = this.Width - 20;
        lb.Top = this.Height/6;
        lb.Font = new Font(lb.Font, FontStyle.Bold);

        for (int i = 0; i < strLines.Length; ++i)
        {
            lb.Items.Add(strLines[i]);
        }

        lb2 = new ListBox();
        lb2.Left = 5;
        lb2.Width = this.Width - 20;
        lb2.Top = this.Height - 140;
        lb2.Font = new Font(lb.Font, FontStyle.Bold);
        _items.Add("One"); // <-- Add these
        _items.Add("Two");
        _items.Add("Three");

        lb2.DataSource = _items;

        this.Controls.Add(lb);
        this.Controls.Add(lb2);
    }
Пример #12
0
        public void DataContexts_Should_Be_Correctly_Set()
        {
            var items = new object[]
            {
                "Foo",
                new Item("Bar"),
                new TextBlock { Text = "Baz" },
                new ListBoxItem { Content = "Qux" },
            };

            var target = new ListBox
            {
                Template = new FuncControlTemplate(CreateListBoxTemplate),
                DataContext = "Base",
                DataTemplates = new DataTemplates
                {
                    new FuncDataTemplate<Item>(x => new Button { Content = x })
                },
                Items = items,
            };

            target.ApplyTemplate();

            var dataContexts = target.Presenter.Panel.Children
                .Cast<Control>()
                .Select(x => x.DataContext)
                .ToList();

            Assert.Equal(
                new object[] { items[0], items[1], "Base", "Base" },
                dataContexts);
        }
    public ListWithListBoxItems()
    {
        Title = "List with ListBoxItem";

        ListBox lstbox = new ListBox();
        lstbox.Height = 150;
        lstbox.Width = 150;
        lstbox.SelectionChanged += ListBoxOnSelectionChanged;
        Content = lstbox;

        PropertyInfo[] props = typeof(Colors).GetProperties();

        foreach (PropertyInfo prop in props)
        {
            Color clr = (Color)prop.GetValue(null, null);
            bool isBlack = .222 * clr.R + .707 * clr.G + .071 * clr.B > 128;

            ListBoxItem item = new ListBoxItem();
            item.Content = prop.Name;
            item.Background = new SolidColorBrush(clr);
            item.Foreground = isBlack ? Brushes.Black : Brushes.White;
            item.HorizontalContentAlignment = HorizontalAlignment.Center;
            item.Padding = new Thickness(2);
            lstbox.Items.Add(item);
        }
    }
Пример #14
0
        public mnuHelpTopics(string name)
            : base(name)
        {
            this.Size = new Size(185, 220);
            this.MenuDirection = Enums.MenuDirection.Vertical;
            this.Location = new Point(10, 40);

            lblHelpTopics = new Label("lblHelpTopics");
            lblHelpTopics.Location = new Point(20, 0);
            lblHelpTopics.Font = FontManager.LoadFont("PMU", 36);
            lblHelpTopics.AutoSize = true;
            lblHelpTopics.Text = "Help Topics";
            lblHelpTopics.ForeColor = Color.WhiteSmoke;

            lstHelpTopics = new ListBox("lstHelpTopics");
            lstHelpTopics.Location = new Point(10, 50);
            lstHelpTopics.Size = new Size(this.Width - lstHelpTopics.X * 2, this.Height - lstHelpTopics.Y - 10 - 30);
            lstHelpTopics.BackColor = Color.Transparent;
            lstHelpTopics.BorderStyle = SdlDotNet.Widgets.BorderStyle.None;

            btnShowHelp = new Button("btnShowHelp");
            btnShowHelp.Location = new Point(10, lstHelpTopics.Y + lstHelpTopics.Height + 5);
            btnShowHelp.Size = new Size(100, 30);
            btnShowHelp.Text = "Load Topic";
            Skins.SkinManager.LoadButtonGui(btnShowHelp);
            btnShowHelp.Click += new EventHandler<MouseButtonEventArgs>(btnShowHelp_Click);

            this.AddWidget(lblHelpTopics);
            this.AddWidget(lstHelpTopics);
            this.AddWidget(btnShowHelp);

            LoadHelpTopics();
        }
Пример #15
0
    public RemoteSwitchGUI()
    {
        Text = "Remote Switch GUI 1.0.1";
        Size = new Size(300, 500);
        MinimumSize = new Size(260, 200);

        panel = new Panel();
        panel.Parent = this;
        panel.Height = 40;
        panel.Dock = DockStyle.Top;

        listBox = new ListBox();
        listBox.Parent = this;
        listBox.Dock = DockStyle.Fill;
        listBox.BringToFront();

        buttonAOn  = CreateButton("A On",   10, (1 << 0) | (1 << 2));
        buttonAOff = CreateButton("A Off",  70, (1 << 0) | (1 << 3));
        buttonBOn  = CreateButton("B On",  130, (1 << 1) | (1 << 2));
        buttonBOff = CreateButton("B Off", 190, (1 << 1) | (1 << 3));

        Load += delegate(object sender, System.EventArgs e)
        {
            Thread thread = new Thread(delegate() { Connect(); });
            thread.IsBackground = true;
            thread.Start();
        };
    }
Пример #16
0
	public MainForm ()
	{
		// 
		// _contextMenu
		//
		_contextMenu = new ContextMenu ();
		_contextMenu.MenuItems.Add (new MenuItem ("Close"));
		//
		// _customControl
		//
		_customControl = new CustomControl ();
		_customControl.Dock = DockStyle.Fill;
		_customControl.BackColor = Color.LightBlue;
		_customControl.ContextMenu = _contextMenu;
		Controls.Add (_customControl);
		// 
		// _listBox
		//
		_listBox = new ListBox ();
		_listBox.Dock = DockStyle.Bottom;
		_listBox.Height = 150;
		_customControl.ListBox = _listBox;
		Controls.Add (_listBox);
		// 
		// MainForm
		// 
		ClientSize = new Size (300, 200);
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #325535";
		Load += new EventHandler (MainForm_Load);
	}
 public static void FillLbCounty(ListBox lb,string baseSite)
 {
     using (System.Net.WebClient wc = new System.Net.WebClient()) {
         string html = wc.DownloadString(baseSite+"state_link_page.html");
         //Check if page is meant to contain archived caches
         Regex ar = new Regex(@"archived-GLX");
         if (ar.IsMatch(html)) {
             //parse country/county name and link to glx, both terms separated by non-greedy match .*?
             //previous version: @"cachelink[^>]+href[^>]+\.html[^>]+>([^<]*)<.*?<a[^>]+href=""([^""]*\.glx)""",
             Regex rgc = new Regex(
                     @"<tr(?:\n|.)*?<td.*?CacheList.*?(?:\n|.)*?/td>(?:\n|.)*?<td[^>]*>([^<]*)</td>(?:\n|.)*?<a[^>]*cachelink[^>]+href[^>]+\.html[^>]+>(?:\n|.)*?<a[^>]+href=""([^""]*\.glx)"""
                     ,RegexOptions.Singleline);
             MatchCollection mc = rgc.Matches(html);
             
             foreach (Match m in mc) {
                 //htmldecode translates html entities 
                 LbLink cl = new LbLink(m.Groups[2].Value,
                                     System.Net.WebUtility.HtmlDecode(m.Groups[1].Value));
                 lb.Items.Add(cl);
             }
             if (lb.Items.Count>0) {
                 lb.SelectedIndex=0;
             }
         } else {
             System.Windows.Forms.MessageBox.Show("Sorry: The directory of archived Caches on xylanthrop.de is of unknown format.");
         }
     }
 }
        public static void Initialize()
        {
            notificationbox = new ListBox(P._Canvas);
            notificationbox.SetBounds(4, 2 * P.ScreenSize.Y / 3 + 16, P.ScreenSize.X - 8, P.ScreenSize.Y - (2 * P.ScreenSize.Y / 3 + 16) - 24);
            notificationbox.EnableScroll(false, true);

            AddNotification("           -----Notifications Show Up Here-----");
        }
Пример #19
0
        public mnuChangeWeather(string name, int price)
            : base(name)
        {
            this.price = price;

            this.Size = new Size(250, 250);
            this.MenuDirection = Enums.MenuDirection.Vertical;
            this.Location = Client.Logic.Graphics.DrawingSupport.GetCenter(Windows.WindowSwitcher.GameWindow.MapViewer.Size, this.Size);

            lblAddTile = new Label("lblAddTile");
            lblAddTile.Location = new Point(25, 15);
            lblAddTile.AutoSize = false;
            lblAddTile.Size = new System.Drawing.Size(this.Width - lblAddTile.X * 2, 20);
            lblAddTile.Text = "Choose a weather condition:";
            lblAddTile.ForeColor = Color.WhiteSmoke;

            lstSound = new ListBox("lstSound");
            lstSound.Location = new Point(lblAddTile.X, lblAddTile.Y + lblAddTile.Height);
            lstSound.Size = new Size(180, 120);

                SdlDotNet.Graphics.Font font = Logic.Graphics.FontManager.LoadFont("PMDCP", 18);
                //string[] sfxFiles = System.IO.Directory.GetFiles(IO.Paths.SfxPath);
                for (int i = 1; i < 12; i++) {
                    if ((Enums.Weather)i != Enums.Weather.DiamondDust) {
                        lstSound.Items.Add(new ListBoxTextItem(font, ((Enums.Weather)i).ToString()));
                    }
                }
                lstSound.SelectedIndex = 0;

            lblPrice = new Label("lblPrice");
            lblPrice.Location = new Point(lblAddTile.X, lstSound.Y + lstSound.Height + 10);
            lblPrice.AutoSize = false;
            lblPrice.Size = new System.Drawing.Size(180, 30);
            lblPrice.Text = "Changing the weather will cost " + price + " " + Items.ItemHelper.Items[1].Name + ".";
            lblPrice.ForeColor = Color.WhiteSmoke;

            btnAccept = new Button("btnAccept");
            btnAccept.Location = new Point(lblAddTile.X, lblPrice.Y + lblPrice.Height + 10);
            btnAccept.Size = new Size(80, 30);
            btnAccept.Text = "Set Weather";
            btnAccept.Font = FontManager.LoadFont("tahoma", 10);
            Skins.SkinManager.LoadButtonGui(btnAccept);
            btnAccept.Click += new EventHandler<MouseButtonEventArgs>(btnAccept_Click);

            btnCancel = new Button("btnCancel");
            btnCancel.Location = new Point(btnAccept.X + btnAccept.Width, lblPrice.Y + lblPrice.Height + 10);
            btnCancel.Size = new Size(80, 30);
            btnCancel.Text = "Cancel";
            btnCancel.Font = FontManager.LoadFont("tahoma", 10);
            Skins.SkinManager.LoadButtonGui(btnCancel);
            btnCancel.Click += new EventHandler<MouseButtonEventArgs>(btnCancel_Click);

            this.AddWidget(lblAddTile);
            this.AddWidget(lstSound);
            this.AddWidget(lblPrice);
            this.AddWidget(btnAccept);
            this.AddWidget(btnCancel);
        }
Пример #20
0
        public HotspotToolPanel()
        {
            Title = "Hotspots";

            hotspotsListbox = new ListBox<HotspotListBoxItem>(Consoles.ToolPane.PanelWidthControls, 7);
            createButton = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            editButton = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            deleteButton = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            exportListButton = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            cloneHotspot = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            importListButton = new Button(Consoles.ToolPane.PanelWidthControls, 1);

            hotspotsListbox.SelectedItemChanged += hotspotsListbox_SelectedItemChanged;
            createButton.ButtonClicked += _createNewObjectButton_ButtonClicked;
            editButton.ButtonClicked += _editObjectButton_ButtonClicked;
            deleteButton.ButtonClicked += _deleteObjectButton_ButtonClicked;
            exportListButton.ButtonClicked += _exportListButton_ButtonClicked;
            cloneHotspot.ButtonClicked += CloneHotspot_ButtonClicked;
            importListButton.ButtonClicked += ImportListButton_ButtonClicked;

            editButton.IsEnabled = false;
            deleteButton.IsEnabled = false;
            cloneHotspot.IsEnabled = false;

            hotspotsListbox.HideBorder = true;

            createButton.Text = "Define New";
            editButton.Text = "Edit";
            deleteButton.Text = "Delete";
            exportListButton.Text = "Export";
            cloneHotspot.Text = "Clone";
            importListButton.Text = "Import";

            drawHotspotsCheckbox = new CheckBox(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            drawHotspotsCheckbox.IsSelected = true;
            drawHotspotsCheckbox.Text = "Draw hotspots";

            Controls = new ControlBase[] { createButton, null, hotspotsListbox, null, editButton, cloneHotspot, deleteButton, null, exportListButton, importListButton, null, drawHotspotsCheckbox };

            // Load the known object types.
            //if (System.IO.File.Exists(Settings.FileObjectTypes))
            //{
            //    using (var fileObject = System.IO.File.OpenRead(Settings.FileObjectTypes))
            //    {
            //        var serializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(typeof(GameObject[]));

            //        var gameObjects = serializer.ReadObject(fileObject) as GameObject[];

            //        foreach (var item in gameObjects)
            //        {
            //            var newItem = new GameObjectMeta(item, true);
            //            hotspotsListbox.Items.Add(newItem);
            //        }
            //    }
            //}

            exportListButton.IsEnabled = hotspotsListbox.Items.Count != 0;
        }
Пример #21
0
        public KeyValueEditPopup(Dictionary<string, string> settings)
            : base(55, 18)
        {
            Title = "Settings";

            // Setting controls of the game object
            objectSettingsListbox = new ListBox(25, 10);
            settingNameInput = new InputBox(25);
            settingValueInput = new InputBox(25);
            objectSettingsListbox.HideBorder = true;

            objectSettingsListbox.Position = new Point(2, 3);
            settingNameInput.Position = new Point(objectSettingsListbox.Bounds.Right + 1, objectSettingsListbox.Bounds.Top);
            settingValueInput.Position = new Point(objectSettingsListbox.Bounds.Right + 1, settingNameInput.Bounds.Bottom + 2);

            addFieldButton = new Button(14, 1);
            addFieldButton.Text = "Add/Update";
            addFieldButton.Position = new Point(settingValueInput.Bounds.Left, settingValueInput.Bounds.Bottom + 1);

            removeFieldButton = new Button(14, 1);
            removeFieldButton.Text = "Remove";
            removeFieldButton.Position = new Point(objectSettingsListbox.Bounds.Left, objectSettingsListbox.Bounds.Bottom + 1);
            removeFieldButton.IsEnabled = false;

            objectSettingsListbox.SelectedItemChanged += _objectSettingsListbox_SelectedItemChanged;
            addFieldButton.ButtonClicked += _addFieldButton_ButtonClicked;
            removeFieldButton.ButtonClicked += _removeFieldButton_ButtonClicked;

            Add(objectSettingsListbox);
            Add(settingNameInput);
            Add(settingValueInput);
            Add(addFieldButton);
            Add(removeFieldButton);

            // Save/close buttons
            saveButton = new Button(10, 1);
            cancelButton = new Button(10, 1);

            saveButton.Text = "Save";
            cancelButton.Text = "Cancel";

            saveButton.ButtonClicked += _saveButton_ButtonClicked;
            cancelButton.ButtonClicked += (o, e) => { DialogResult = false; Hide(); };

            saveButton.Position = new Point(textSurface.Width - 12, 16);
            cancelButton.Position = new Point(2, 16);

            Add(saveButton);
            Add(cancelButton);

            // Read the settings
            foreach (var item in settings)
                objectSettingsListbox.Items.Add(new SettingKeyValue() { Key = item.Key, Value = item.Value });

            SettingsDictionary = settings;

            Redraw();
        }
Пример #22
0
 public override ConsVisitor visit_Cons_cdr()
 {
     if (car.value is SpecialForm) {
         return base.visit_Cons_cdr();
     } else {
         m_appl_args = new ListBox();
         return new ArgsInterpreter(m_env, m_loc, m_appl_args);
     }
 }
 public void Remove(ListBox display)
 {
     if (display.SelectedIndex > -1)
     {
         TileUpdateManager.CreateTileUpdaterForApplication().GetScheduledTileNotifications().Where(
             p => p.Id.Equals(((Item)display.SelectedItem).Id)).SingleOrDefault();
         display.Items.RemoveAt(display.SelectedIndex);
     }
 }
 public virtual void GetItemsHostForListBox()
 {
     ListBox control = new ListBox { ItemsSource = new[] { 1, 2, 3, 4 } };
     Panel host = null;
     TestAsync(
         control,
         () => host = control.GetItemsHost(),
         () => Assert.IsNotNull(host, "ItemsHost not found!"));
 }
 private void PopulateListBox(ListBox listBox)
 {
     listBox.Items.Clear();
     XmlNodeList nodes = _xmlDocument.SelectNodes("listboxes/" + listBox.ClientID + "/option");
     foreach (XmlNode node in nodes)
     {
         listBox.Items.Add(new ListItem(HttpUtility.UrlDecode(node["key"].InnerText), HttpUtility.UrlDecode(node["value"].InnerText)));
     }
 }
Пример #26
0
        public mnuAddSound(string name, int price)
            : base(name)
        {
            this.price = price;

            this.Size = new Size(250, 250);
            this.MenuDirection = Enums.MenuDirection.Vertical;
            this.Location = Client.Logic.Graphics.DrawingSupport.GetCenter(Windows.WindowSwitcher.GameWindow.MapViewer.Size, this.Size);

            lblAddTile = new Label("lblAddTile");
            lblAddTile.Location = new Point(25, 15);
            lblAddTile.AutoSize = false;
            lblAddTile.Size = new System.Drawing.Size(this.Width - lblAddTile.X * 2, 20);
            lblAddTile.Text = "Choose a sound to play:";
            lblAddTile.ForeColor = Color.WhiteSmoke;

            lstSound = new ListBox("lstSound");
            lstSound.Location = new Point(lblAddTile.X, lblAddTile.Y + lblAddTile.Height);
            lstSound.Size = new Size(180, 120);

                SdlDotNet.Graphics.Font font = Logic.Graphics.FontManager.LoadFont("PMU", 18);
                string[] sfxFiles = System.IO.Directory.GetFiles(IO.Paths.SfxPath);
                for (int i = 0; i < sfxFiles.Length; i++) {
                    lstSound.Items.Add(new ListBoxTextItem(font, System.IO.Path.GetFileName(sfxFiles[i])));
                }
            lstSound.ItemSelected +=new EventHandler(lstSound_ItemSelected);

            lblPrice = new Label("lblPrice");
            lblPrice.Location = new Point(lblAddTile.X, lstSound.Y + lstSound.Height + 10);
            lblPrice.AutoSize = false;
            lblPrice.Size = new System.Drawing.Size(120, 30);
            lblPrice.Text = "Placing this tile will cost " + price + " " + Items.ItemHelper.Items[1].Name + ".";
            lblPrice.ForeColor = Color.WhiteSmoke;

            btnAccept = new Button("btnAccept");
            btnAccept.Location = new Point(lblAddTile.X, lblPrice.Y + lblPrice.Height + 10);
            btnAccept.Size = new Size(80, 30);
            btnAccept.Text = "Place Sound";
            btnAccept.Font = FontManager.LoadFont("tahoma", 10);
            Skins.SkinManager.LoadButtonGui(btnAccept);
            btnAccept.Click += new EventHandler<MouseButtonEventArgs>(btnAccept_Click);

            btnCancel = new Button("btnCancel");
            btnCancel.Location = new Point(btnAccept.X + btnAccept.Width, lblPrice.Y + lblPrice.Height + 10);
            btnCancel.Size = new Size(80, 30);
            btnCancel.Text = "Cancel";
            btnCancel.Font = FontManager.LoadFont("tahoma", 10);
            Skins.SkinManager.LoadButtonGui(btnCancel);
            btnCancel.Click += new EventHandler<MouseButtonEventArgs>(btnCancel_Click);

            this.AddWidget(lblAddTile);
            this.AddWidget(lstSound);
            this.AddWidget(lblPrice);
            this.AddWidget(btnAccept);
            this.AddWidget(btnCancel);
        }
Пример #27
0
        public override void LoadContent()
        {
            base.LoadContent();

            smallFont = ContentManager.Load<SpriteFont>(@"Fonts\KootenaySmall");

            var grid = new Grid();
            grid.Width = Size.Fill();
            grid.Height = Size.Fill();
            grid.Rows.Add(Size.Fixed(60));
            grid.Rows.Add(Size.Fill());
            grid.Rows.Add(Size.Fixed(60));
            grid.Rows.Add(Size.Fixed(60));
            grid.Rows.Add(Size.Fixed(80));
            grid.Columns.Add(Size.Fill());
            grid.Columns.Add(Size.Fill());
            grid.Columns.Add(Size.Fill());
            Controls.Add(grid);

            grid.Cells[0, 1].Add(new Label { Text = Bind(() => currentActor.Name) });
            grid.Cells[1, 0].Add(new Label { Font = smallFont, Foreground = Color.LightGreen, Text = Bind(() => VictoryScreen.GetStatisticsString(currentActor.CurrentStatistics, currentActor.ResourceType, false)) });

            equipmentListBox = AddListBox<Item>(grid.Cells[1, 1], Vector2.Zero, 400, 500);
            equipmentListBox.ZIndex = 0.2f;
            equipmentListBox.Font = smallFont;
            UpdateEquipmentList();

            inventoryListBox = AddListBox<Item>(grid.Cells[1, 2], Vector2.Zero, 400, 500);
            inventoryListBox.ZIndex = 0.2f;
            inventoryListBox.Font = smallFont;
            UpdateInventoryList();

            var prevActorButton = CreateButton("<", Vector2.Zero);
            prevActorButton.Click += prevActorButton_Click;
            grid.Cells[0, 0].Add(prevActorButton);

            var nextActorButton = CreateButton(">", Vector2.Zero);
            nextActorButton.Click += nextActorButton_Click;
            grid.Cells[0, 2].Add(nextActorButton);

            var unequipButton = CreateButton("Unequip", Vector2.Zero);
            unequipButton.Click += unequipButton_Click;
            grid.Cells[2, 1].Add(unequipButton);

            var equipButton = CreateButton("Equip", Vector2.Zero);
            equipButton.Click += equipButton_Click;
            grid.Cells[2, 2].Add(equipButton);

            var deleteButton = CreateButton("Delete", Vector2.Zero);
            deleteButton.Click += deleteButton_Click;
            grid.Cells[3, 2].Add(deleteButton);

            var okButton = CreateButton("Close", Vector2.Zero);
            okButton.Click += okButton_Click;
            grid.Cells[4, 1].Add(okButton);
        }
Пример #28
0
Файл: test.cs Проект: mono/gert
	static int Main ()
	{
		ListBox l = new ListBox ();
		for (int Height = 0; Height < 100; Height++) {
			l.Height = Height;
			if (l.Height != Height)
				return 1;
		}
		return 0;
	}
Пример #29
0
        /// <summary>
        /// Initialize a new instance of the class.
        /// </summary>
        public FormPlotDefineBitmask(ref ListBox listBox)
        {
            InitializeComponent();

            m_ListBox = listBox;
            if (m_ListBox.SelectedItems.Count != 1)
            {
                throw new Exception(Resources.EMListBoxMultipleSelectionNotSupported);
            }

            m_OldIdentifier = ((WatchItem_t)m_ListBox.SelectedItem).OldIdentifier;
            m_DisplayMask = ((WatchItem_t)m_ListBox.SelectedItem).DisplayMask;
            try
            {
                m_WatchVariable = Lookup.WatchVariableTableByOldIdentifier.Items[m_OldIdentifier];
                if (m_WatchVariable == null)
                {
                    throw new ArgumentException(Resources.MBTWatchVariableNotDefined);
                }
            }
            catch (Exception)
            {
                throw new ArgumentException(Resources.MBTWatchVariableNotDefined);
            }

            Debug.Assert(m_WatchVariable.VariableType == VariableType.Bitmask, "FormPlotDefineBitmask.Ctor() - [m_WatchVariable.VariableType == VariableType.Bitmask]");

            Text = m_WatchVariable.Name;

            #region - [ICheckBoxUInt32] -
            m_ICheckBoxUInt32 = new CheckBoxUInt32();
            CheckBox[] checkBoxes;
            ConfigureCheckBoxes(out checkBoxes);
            m_ICheckBoxUInt32.CheckBoxes = checkBoxes;
            m_ICheckBoxUInt32.SetText(m_OldIdentifier);
            m_ICheckBoxUInt32.SetChecked((uint)m_DisplayMask);
            #endregion - [ICheckBoxUInt32] -

            m_GroupBoxCurrentValue.Visible = false;
            m_GroupBoxNewValue.Visible = false;
            m_GroupBoxFormat.Visible = false;

            // OK, Cancel, Apply
            m_ButtonOK.Location = m_ButtonCancel.Location;
            m_ButtonCancel.Location = m_ButtonApply.Location;
            m_ButtonApply.Visible = false;

            // Now that the display has been initialized, disable the apply button. This will only be re-enabled when the user has modified one or more Checked 
            // properties.
            m_ButtonApply.Enabled = false;

            // Set the default DialogResult value.
            DialogResult = DialogResult.No;
        }
Пример #30
0
 public static object[] tour(object graph, List<string> ns, Dictionary<string, string> aliases)
 {
     Guide guide = new Guide();
     AtomBox outbox = new AtomBox();
     ListBox collection = new ListBox();
     Dictionary<object, object> symtab = new Dictionary<object, object>();
     add_namespace_directives(ns, aliases, collection);
     ConstructSiteseer construct = new ConstructSiteseer(outbox, collection, ns, symtab, aliases);
     guide.tour(graph, construct);
     return ((object[])outbox.value);
 }
Пример #31
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConfigureInterlinDialog));
     this.label1         = new System.Windows.Forms.Label();
     this.label2         = new System.Windows.Forms.Label();
     this.optionsList    = new System.Windows.Forms.ListBox();
     this.label3         = new System.Windows.Forms.Label();
     this.wsCombo        = new SIL.FieldWorks.Common.Controls.FwOverrideComboBox();
     this.moveDownButton = new System.Windows.Forms.Button();
     this.imageList1     = new System.Windows.Forms.ImageList(this.components);
     this.moveUpButton   = new System.Windows.Forms.Button();
     this.removeButton   = new System.Windows.Forms.Button();
     this.addButton      = new System.Windows.Forms.Button();
     this.helpButton     = new System.Windows.Forms.Button();
     this.cancelButton   = new System.Windows.Forms.Button();
     this.currentList    = new System.Windows.Forms.ListView();
     this.LineColumn     = new System.Windows.Forms.ColumnHeader();
     this.InfoColumn     = new System.Windows.Forms.ColumnHeader();
     this.label4         = new System.Windows.Forms.Label();
     this.okButton       = new System.Windows.Forms.Button();
     this.SuspendLayout();
     //
     // label1
     //
     resources.ApplyResources(this.label1, "label1");
     this.label1.Name = "label1";
     //
     // label2
     //
     resources.ApplyResources(this.label2, "label2");
     this.label2.Name = "label2";
     //
     // optionsList
     //
     resources.ApplyResources(this.optionsList, "optionsList");
     this.optionsList.DrawMode     = System.Windows.Forms.DrawMode.OwnerDrawFixed;
     this.optionsList.Name         = "optionsList";
     this.optionsList.DrawItem    += new System.Windows.Forms.DrawItemEventHandler(this.optionsList_DrawItem);
     this.optionsList.DoubleClick += new System.EventHandler(this.addButton_Click);
     //
     // label3
     //
     resources.ApplyResources(this.label3, "label3");
     this.label3.Name = "label3";
     //
     // wsCombo
     //
     this.wsCombo.AllowSpaceInEditBox = false;
     resources.ApplyResources(this.wsCombo, "wsCombo");
     this.wsCombo.Name = "wsCombo";
     this.wsCombo.SelectedIndexChanged += new System.EventHandler(this.wsCombo_SelectedIndexChanged);
     //
     // moveDownButton
     //
     resources.ApplyResources(this.moveDownButton, "moveDownButton");
     this.moveDownButton.ImageList = this.imageList1;
     this.moveDownButton.Name      = "moveDownButton";
     this.moveDownButton.Click    += new System.EventHandler(this.moveDownButton_Click);
     //
     // imageList1
     //
     this.imageList1.ImageStream      = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
     this.imageList1.TransparentColor = System.Drawing.Color.Fuchsia;
     this.imageList1.Images.SetKeyName(0, "LargeUpArrow.bmp");
     this.imageList1.Images.SetKeyName(1, "LargeDownArrow.bmp");
     //
     // moveUpButton
     //
     resources.ApplyResources(this.moveUpButton, "moveUpButton");
     this.moveUpButton.ImageList = this.imageList1;
     this.moveUpButton.Name      = "moveUpButton";
     this.moveUpButton.Click    += new System.EventHandler(this.moveUpButton_Click);
     //
     // removeButton
     //
     resources.ApplyResources(this.removeButton, "removeButton");
     this.removeButton.Name   = "removeButton";
     this.removeButton.Click += new System.EventHandler(this.removeButton_Click);
     //
     // addButton
     //
     resources.ApplyResources(this.addButton, "addButton");
     this.addButton.Name   = "addButton";
     this.addButton.Click += new System.EventHandler(this.addButton_Click);
     //
     // helpButton
     //
     resources.ApplyResources(this.helpButton, "helpButton");
     this.helpButton.Name   = "helpButton";
     this.helpButton.Click += new System.EventHandler(this.helpButton_Click);
     //
     // cancelButton
     //
     resources.ApplyResources(this.cancelButton, "cancelButton");
     this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
     this.cancelButton.Name         = "cancelButton";
     //
     // currentList
     //
     resources.ApplyResources(this.currentList, "currentList");
     this.currentList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
         this.LineColumn,
         this.InfoColumn
     });
     this.currentList.FullRowSelect    = true;
     this.currentList.HeaderStyle      = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
     this.currentList.HideSelection    = false;
     this.currentList.MultiSelect      = false;
     this.currentList.Name             = "currentList";
     this.currentList.OwnerDraw        = true;
     this.currentList.ShowItemToolTips = true;
     this.currentList.UseCompatibleStateImageBehavior = false;
     this.currentList.View         = System.Windows.Forms.View.Details;
     this.currentList.DrawItem    += new System.Windows.Forms.DrawListViewItemEventHandler(this.currentList_DrawItem);
     this.currentList.DoubleClick += new System.EventHandler(this.removeButton_Click);
     //
     // LineColumn
     //
     resources.ApplyResources(this.LineColumn, "LineColumn");
     //
     // InfoColumn
     //
     resources.ApplyResources(this.InfoColumn, "InfoColumn");
     //
     // label4
     //
     resources.ApplyResources(this.label4, "label4");
     this.label4.Name = "label4";
     //
     // okButton
     //
     resources.ApplyResources(this.okButton, "okButton");
     this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
     this.okButton.Name         = "okButton";
     //
     // ConfigureInterlinDialog
     //
     this.AcceptButton = this.okButton;
     resources.ApplyResources(this, "$this");
     this.CancelButton = this.cancelButton;
     this.Controls.Add(this.label3);
     this.Controls.Add(this.wsCombo);
     this.Controls.Add(this.moveDownButton);
     this.Controls.Add(this.moveUpButton);
     this.Controls.Add(this.removeButton);
     this.Controls.Add(this.addButton);
     this.Controls.Add(this.helpButton);
     this.Controls.Add(this.cancelButton);
     this.Controls.Add(this.currentList);
     this.Controls.Add(this.label4);
     this.Controls.Add(this.okButton);
     this.Controls.Add(this.optionsList);
     this.Controls.Add(this.label2);
     this.Controls.Add(this.label1);
     this.Name = "ConfigureInterlinDialog";
     this.ResumeLayout(false);
 }
Пример #32
0
        public StackPanel Print()
        {
            var      stackPanel = new StackPanel();
            Expander exp;

            //Сообщение
            if (!string.IsNullOrEmpty(Message))
            {
                stackPanel.Children.Add(new Label {
                    Content = Message
                });
            }
            //Связи
            if (Connections.Count > 0)
            {
                var lb = new ListBox {
                    ItemsSource = Connections
                };
                lb.MouseDoubleClick += (sender, args) => ExecuteSimilarQuery(lb.SelectedItem.ToString());
                exp = new Expander {
                    Header = "Связи между понятиями", Content = lb
                };
                stackPanel.Children.Add(exp);
            }
            //Совместные результаты
            if (JointResult.Count > 0)
            {
                var lb = new ListBox {
                    ItemsSource = JointResult
                };
                lb.MouseDoubleClick += (sender, args) => ExecuteSimilarQuery(lb.SelectedItem.ToString());
                exp = new Expander {
                    Header = "Результат поиска", Content = lb
                };
                stackPanel.Children.Add(exp);
            }
            else
            {
                //Результаты для отдельных слов
                for (int i = EveryWordResult.Count - 1; i >= 0; i--)
                {
                    if (EveryWordResult[i] != null)
                    {
                        stackPanel.Children.Add(EveryWordResult[i].Print());
                    }
                }
            }
            //Обобщённые результаты
            if (GeneralResult.Count > 0)
            {
                var lb = new ListBox {
                    ItemsSource = GeneralResult
                };
                lb.MouseDoubleClick += (sender, args) => ExecuteSimilarQuery(lb.SelectedItem.ToString());
                exp = new Expander {
                    Header = "Обобщённые результаты", Content = lb
                };
                stackPanel.Children.Add(exp);
            }
            // Многозначность
            if (PolysemanticResult.Count > 0)
            {
                foreach (var res in PolysemanticResult)
                {
                    stackPanel.Children.Add(res.Print());
                }
            }
            return(stackPanel);
        }
Пример #33
0
        private void listBox2_DrawItem(object sender, DrawItemEventArgs e)
        {
            if (e.Index == -1)
            {
                return;
            }

            // Get the ListBox and the item.
            ListBox lst = sender as ListBox;

            DataRowView SaveDR = (DataRowView)lst.Items[e.Index];

            if (SaveDR.Row.RowState == DataRowState.Detached)
            {
                return;
            }

            string txt = "";

            // Draw the background.
            e.DrawBackground();

            // See if the item is selected.
            Brush br;

            if ((e.State & DrawItemState.Selected) == DrawItemState.Selected)
            {
                br = SystemBrushes.HighlightText;
            }
            else
            {
                br = new SolidBrush(e.ForeColor);
            }

            //Draw area
            float x      = e.Bounds.Left + ItemMargin;
            float y      = e.Bounds.Top + ItemMargin;
            float width  = e.Bounds.Width - ItemMargin * 2;
            float height = (e.Bounds.Height - ItemMargin * 2) / 2;

            RectangleF layout_rect = new RectangleF(x, y, width, height);

            //Original name
            txt = SaveDR["saveName"].ToString();// + "\r\n" ;

            Font OriginalNameFnt = new Font(Font, FontStyle.Regular);

            // Draw the text.
            e.Graphics.DrawString(txt, OriginalNameFnt, br, layout_rect);

            //New name
            string SaveName      = "";
            int    decimalLength = listBox2.Items.Count.ToString("D").Length;

            if (radioButtonNamesOriginal.Checked)
            {
                SaveName = SaveDR[1].ToString();
            }
            else if (radioButtonNamesCustom.Checked && textBoxCustomName.Text != "")
            {
                if (exportState)
                {
                    SaveName = textBoxCustomName.Text + (e.Index + 1).ToString("D" + decimalLength.ToString());
                }
                else
                {
                    if (listBox2.SelectionMode == SelectionMode.One)
                    {
                        SaveName = textBoxCustomName.Text + (e.Index + 1).ToString("D" + decimalLength.ToString());
                    }
                    else if (listBox2.SelectionMode == SelectionMode.MultiSimple)
                    {
                        if (listBox2.SelectedIndices.Contains(e.Index))
                        {
                            decimalLength = listBox2.SelectedIndices.Count.ToString("D").Length;
                            int indexInd = listBox2.SelectedIndices.IndexOf(e.Index);
                            SaveName = textBoxCustomName.Text + (indexInd + 1).ToString("D" + decimalLength.ToString());
                        }
                        else
                        {
                            SaveName = "";
                        }
                    }
                }
            }
            else if (radioButtonNamesNone.Checked)
            {
                SaveName = "";
            }

            SaveDR["NewName"] = SaveName;
            //listBox2.DataBindings
            //lst.Items[e.Index]

            txt = SaveName;

            Font NewNameFnt = new Font(Font.FontFamily, Font.Size, FontStyle.Bold);

            y           = e.Bounds.Top + (OriginalNameFnt.SizeInPoints + ItemMargin * 4);
            layout_rect = new RectangleF(x, y, width, height);
            // Draw the text.
            e.Graphics.DrawString(txt, NewNameFnt, br, layout_rect);

            // Draw the focus rectangle if appropriate.
            e.DrawFocusRectangle();
        }
Пример #34
0
        public static void Add(ListBox l)
        {
            try
            {
                l.Items.Add(l.Items.Count + 1);
                switch (Settings.EditorID)
                {
                case 1:
                    Data <CharColor> .CharColorList.Add(new CharColor("0000", "", "0000", "0000", "0000"));

                    break;

                case 2:
                    Data <ClassBase> .ClassBaseList.Add(new ClassBase("0000", "0.0", "0.0", "0.0", "0.0", "0.0", "0.0", ""));

                    break;

                case 3:
                    Data <DyingItems> .DyingItemsList.Add(new DyingItems("0000", "0000", "0000", "0000", "0000", "0000", " 0000",
                                                                         "0000", "0000", "0000", "0000", "0000",
                                                                         "0000", "0000", "0000", "0000", "0000", "0000", "0000",
                                                                         "0000", "0000", "0000", "0000", "0000", "0000", "0000"));

                    break;

                case 4:
                    Data <Adventureroad> .AdventureRoadList.Add(new Adventureroad("0000", "0000", "0000", "0000", "0000", "0000", "0000", "0000", "0000", "0000", "0000", "0000", "0000"));

                    break;

                case 5:
                    Data <Pvp> .PvpList.Add(new Pvp("0000", "0000", "0000", "0000", "0000", "0000", "0000", "0000", "0000"));

                    break;

                case 6:
                    Data <Fight> .FightList.Add(new Fight("0000", "0000", "0000", "0000", "0000", "0000", " 0000",
                                                          "0000", "0000", "0000", "0000", "0000",
                                                          "0000", "0000", "0000", "0000", "0000", "0000", "0000",
                                                          "0000", "0000", "0000", "0000", "0000", "0000", "0000", "0000", "0000", "0000"));

                    break;

                case 7:
                    Data <Mage> .MageList.Add(new Mage("0000", "0000", "0000", "0000", "0000", "0000", " 0000",
                                                       "0000", "0000", "0000", "0000", "0000",
                                                       "0000", "0000", "0000", "0000", "0000", "0000", "0000",
                                                       "0000", "0000", "0000"));

                    break;

                case 8:
                    Data <PartnerGrow> .PartnerGrowList.Add(new PartnerGrow("0000", "0000", "0000", "0000", "0000", "0000", " 0000",
                                                                            "0000", "0000", "0000", "0000", "0000",
                                                                            "0000", "0000", "0000", "0000", "0000", "0000", "0000",
                                                                            "0000", "0000", "0000", "0000", "0000", "0000", "0000", "0000", "0000", " 0000",
                                                                            "0000", "0000", "0000", "0000", "0000",
                                                                            "0000", "0000", "0000", "0000", "0000", "0000", "0000",
                                                                            "0000", "0000", "0000", "0000", "0000", "0000", "0000", "0000", "0000", " 0000",
                                                                            "0000", "0000", "0000", "0000", "0000",
                                                                            "0000", "0000", "0000", "0000", "0000"));

                    break;

                case 9:
                    Data <PartnerTalk> .PartnerTalkList.Add(new PartnerTalk("0000", "0000", "0000", "0000", "0000", "0000", "0000"));

                    break;

                case 10: Data <Growequip> .GrowEquipList.Add(new Growequip("0000", "0000", "0000", "0000", "0000", "0000", "0000", "000", "0000", "0000", "0000", "0000", "0000", "0000", "0000"));

                    break;

                case 11: Data <Dialogue> .DialogList.Add(new Dialogue("0000", "0000"));

                    break;

                case 12: Data <Level> .LevelList.Add(new Level("0000", "0000", "0000", "0000", "0000", "0000", " 0000",
                                                               "0000", "0000", "0000", "0000", "0000",
                                                               "0000", "0000", "0000", "0000", "0000", "0000", "0000",
                                                               "0000", "0000", "0000", "0000", "0000", "0000", "0000", "0000", "0000", " 0000",
                                                               "0000", "0000", "0000", "0000", "0000",
                                                               "0000", "0000", "0000", "0000", "0000", "0000", "0000", "0000"));

                    break;
                }
                l.SelectedIndex = 0;
            }
            catch (InvalidOperationException)
            {
                Console.WriteLine("Something went wrong.");
            }
        }
Пример #35
0
        public static void Remove(ListBox l)
        {
            try
            {
                int selected = l.SelectedIndex;
                Console.WriteLine(selected);
                switch (Settings.EditorID)
                {
                case 1: Data <CharColor> .CharColorList.RemoveAt(selected);

                    break;

                case 2: Data <ClassBase> .ClassBaseList.RemoveAt(selected);

                    break;

                case 3: Data <DyingItems> .DyingItemsList.RemoveAt(selected);

                    break;

                case 4: Data <Adventureroad> .AdventureRoadList.RemoveAt(selected);

                    break;

                case 5: Data <Pvp> .PvpList.RemoveAt(selected);

                    break;

                case 6: Data <Fight> .FightList.RemoveAt(selected);

                    break;

                case 7: Data <Mage> .MageList.RemoveAt(selected);

                    break;

                case 8: Data <PartnerGrow> .PartnerGrowList.RemoveAt(selected);

                    break;

                case 9: Data <PartnerTalk> .PartnerTalkList.RemoveAt(selected);

                    break;

                case 10: Data <Growequip> .GrowEquipList.RemoveAt(selected);

                    break;

                case 11: Data <Dialogue> .DialogList.RemoveAt(selected);

                    break;

                case 12: Data <Level> .LevelList.RemoveAt(selected);

                    break;
                }

                l.Items.RemoveAt(selected);
                l.SelectedIndex = 0;
                l.ScrollIntoView(l.Items.GetItemAt(0));
            }
            catch (InvalidOperationException)
            {
                Console.WriteLine("invalid Operation");
            }
            catch (ArgumentOutOfRangeException e)
            {
                Console.WriteLine(e.Message);
            }
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public Instrument_Editor()
        {
            pnlInstruments   = new Fancy_Panel(Language.T("Instruments"));
            pnlProperties    = new Fancy_Panel(Language.T("Instrument Properties"));
            pnlAddInstrument = new Fancy_Panel(Language.T("Add an Instrument"));

            // Instruments' controls
            lbxInstruments = new ListBox();
            btnDelete      = new Button();
            btnUp          = new Button();
            btnDown        = new Button();

            // Properties' controls
            lblPropSymbol      = new Label();
            lblPropType        = new Label();
            lblPropComment     = new Label();
            lblPropDigits      = new Label();
            lblPropPoint       = new Label();
            lblPropLots        = new Label();
            lblPropSpread      = new Label();
            lblPropSwap        = new Label();
            lblPropCommission  = new Label();
            lblPropSlippage    = new Label();
            lblPropPriceIn     = new Label();
            lblPropAccountIn   = new Label();
            lblPropAccountRate = new Label();
            lblPropFileName    = new Label();
            lblPropDataFiles   = new Label();

            tbxPropSymbol      = new TextBox();
            tbxPropType        = new TextBox();
            tbxPropComment     = new TextBox();
            tbxPropPoint       = new TextBox();
            tbxPropSpread      = new TextBox();
            tbxPropSlippage    = new TextBox();
            tbxPropPriceIn     = new TextBox();
            tbxPropAccountIn   = new TextBox();
            tbxPropAccountRate = new TextBox();
            tbxPropFileName    = new TextBox();

            cbxPropSwap       = new ComboBox();
            cbxPropCommission = new ComboBox();
            cbxPropCommScope  = new ComboBox();
            cbxPropCommTime   = new ComboBox();

            nudPropDigits      = new NumericUpDown();
            nudPropLotSize     = new NumericUpDown();
            nudPropSpread      = new NumericUpDown();
            nudPropSwapLong    = new NumericUpDown();
            nudPropSwapShort   = new NumericUpDown();
            nudPropCommission  = new NumericUpDown();
            nudPropSlippage    = new NumericUpDown();
            nudPropAccountRate = new NumericUpDown();

            btnAccept = new Button();

            // Add an Instrument's controls
            lblAddInstrSymbol = new Label();
            lblAddInstrType   = new Label();
            tbxAddInstrSymbol = new TextBox();
            cbxAddInstrType   = new ComboBox();
            btnAddInstrAdd    = new Button();

            btnClose = new Button();

            font          = this.Font;
            fontCaption   = new Font(Font.FontFamily, 9);
            captionHeight = (float)Math.Max(fontCaption.Height, 18);
            colorText     = LayoutColors.ColorControlText;
            bNeedReset    = false;

            MaximizeBox     = false;
            MinimizeBox     = false;
            ShowInTaskbar   = false;
            Icon            = Data.Icon;
            BackColor       = LayoutColors.ColorFormBack;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            AcceptButton    = btnAccept;
            Text            = Language.T("Instrument Editor");
            FormClosing    += new FormClosingEventHandler(Instrument_Editor_FormClosing);

            // pnlInstruments
            pnlInstruments.Parent = this;

            // pnlProperties
            pnlProperties.Parent = this;

            // pnlAddInstrument
            pnlAddInstrument.Parent = this;

            // lbxInstruments
            lbxInstruments.Parent    = pnlInstruments;
            lbxInstruments.BackColor = LayoutColors.ColorControlBack;
            //lbxInstruments.BorderStyle = BorderStyle.None;
            lbxInstruments.ForeColor = colorText;
            lbxInstruments.Items.AddRange(Instruments.SymbolList);

            // Button UP
            btnUp.Parent = pnlInstruments;
            btnUp.Text   = Language.T("Up");
            btnUp.UseVisualStyleBackColor = true;
            btnUp.Click += new EventHandler(BtnUp_Click);

            // Button Down
            btnDown.Parent = pnlInstruments;
            btnDown.Text   = Language.T("Down");
            btnDown.UseVisualStyleBackColor = true;
            btnDown.Click += new EventHandler(BtnDown_Click);

            // Button Delete
            btnDelete.Parent = pnlInstruments;
            btnDelete.Text   = Language.T("Delete");
            btnDelete.UseVisualStyleBackColor = true;
            btnDelete.Click += new EventHandler(BtnDelete_Click);

            // lblAddInstrSymbol
            lblAddInstrSymbol.Parent    = pnlAddInstrument;
            lblAddInstrSymbol.ForeColor = colorText;
            lblAddInstrSymbol.BackColor = Color.Transparent;
            lblAddInstrSymbol.AutoSize  = false;
            lblAddInstrSymbol.TextAlign = ContentAlignment.MiddleRight;
            lblAddInstrSymbol.Text      = Language.T("Symbol");

            // tbxAddInstrSymbol
            tbxAddInstrSymbol.Parent    = pnlAddInstrument;
            tbxAddInstrSymbol.ForeColor = colorText;

            // lblAddInstrType
            lblAddInstrType.Parent    = pnlAddInstrument;
            lblAddInstrType.ForeColor = colorText;
            lblAddInstrType.BackColor = Color.Transparent;
            lblAddInstrType.AutoSize  = false;
            lblAddInstrType.TextAlign = ContentAlignment.MiddleRight;
            lblAddInstrType.Text      = Language.T("Type");

            // cbxAddInstrType
            cbxAddInstrType.Parent        = pnlAddInstrument;
            cbxAddInstrType.Name          = "cbxAddInstrType";
            cbxAddInstrType.DropDownStyle = ComboBoxStyle.DropDownList;
            cbxAddInstrType.Items.AddRange(Enum.GetNames(typeof(Instrumet_Type)));
            cbxAddInstrType.SelectedIndex = 0;

            // btnAddInstrAdd
            btnAddInstrAdd.Parent = pnlAddInstrument;
            btnAddInstrAdd.Name   = "btnAddInstrAdd";
            btnAddInstrAdd.Text   = Language.T("Add");
            btnAddInstrAdd.UseVisualStyleBackColor = true;
            btnAddInstrAdd.Click += new EventHandler(BtnAddInstrAdd_Click);

            // pnlProperties
            lblPropSymbol.Parent    = pnlProperties;
            lblPropSymbol.ForeColor = colorText;
            lblPropSymbol.BackColor = Color.Transparent;
            lblPropSymbol.AutoSize  = false;
            lblPropSymbol.TextAlign = ContentAlignment.MiddleRight;
            lblPropSymbol.Text      = Language.T("Symbol");

            // lblPropType
            lblPropType.Parent    = pnlProperties;
            lblPropType.ForeColor = colorText;
            lblPropType.BackColor = Color.Transparent;
            lblPropType.AutoSize  = false;
            lblPropType.TextAlign = ContentAlignment.MiddleRight;
            lblPropType.Text      = Language.T("Type");

            // lblPropComment
            lblPropComment.Parent    = pnlProperties;
            lblPropComment.ForeColor = colorText;
            lblPropComment.BackColor = Color.Transparent;
            lblPropComment.AutoSize  = false;
            lblPropComment.TextAlign = ContentAlignment.MiddleRight;
            lblPropComment.Text      = Language.T("Comment");

            // lblPropDigits
            lblPropDigits.Parent    = pnlProperties;
            lblPropDigits.ForeColor = colorText;
            lblPropDigits.BackColor = Color.Transparent;
            lblPropDigits.AutoSize  = false;
            lblPropDigits.TextAlign = ContentAlignment.MiddleRight;
            lblPropDigits.Text      = Language.T("Digits");

            // lblPropPoint
            lblPropPoint.Parent    = pnlProperties;
            lblPropPoint.ForeColor = colorText;
            lblPropPoint.BackColor = Color.Transparent;
            lblPropPoint.AutoSize  = false;
            lblPropPoint.TextAlign = ContentAlignment.MiddleRight;
            lblPropPoint.Text      = Language.T("Point value");

            // lblPropLots
            lblPropLots.Parent    = pnlProperties;
            lblPropLots.ForeColor = colorText;
            lblPropLots.BackColor = Color.Transparent;
            lblPropLots.AutoSize  = false;
            lblPropLots.TextAlign = ContentAlignment.MiddleRight;
            lblPropLots.Text      = Language.T("Lot size");

            // lblPropSpread
            lblPropSpread.Parent    = pnlProperties;
            lblPropSpread.ForeColor = colorText;
            lblPropSpread.BackColor = Color.Transparent;
            lblPropSpread.AutoSize  = false;
            lblPropSpread.TextAlign = ContentAlignment.MiddleRight;
            lblPropSpread.Text      = Language.T("Spread in");

            // lblPropSwap
            lblPropSwap.Parent    = pnlProperties;
            lblPropSwap.ForeColor = colorText;
            lblPropSwap.BackColor = Color.Transparent;
            lblPropSwap.AutoSize  = false;
            lblPropSwap.TextAlign = ContentAlignment.MiddleRight;
            lblPropSwap.Text      = Language.T("Swap in");

            // lblPropCommission
            lblPropCommission.Parent    = pnlProperties;
            lblPropCommission.ForeColor = colorText;
            lblPropCommission.BackColor = Color.Transparent;
            lblPropCommission.AutoSize  = false;
            lblPropCommission.TextAlign = ContentAlignment.MiddleRight;
            lblPropCommission.Text      = Language.T("Commission in");

            // lblPropSlippage
            lblPropSlippage.Parent    = pnlProperties;
            lblPropSlippage.ForeColor = colorText;
            lblPropSlippage.BackColor = Color.Transparent;
            lblPropSlippage.AutoSize  = false;
            lblPropSlippage.TextAlign = ContentAlignment.MiddleRight;
            lblPropSlippage.Text      = Language.T("Slippage in");

            // lblPropPriceIn
            lblPropPriceIn.Parent    = pnlProperties;
            lblPropPriceIn.ForeColor = colorText;
            lblPropPriceIn.BackColor = Color.Transparent;
            lblPropPriceIn.AutoSize  = false;
            lblPropPriceIn.TextAlign = ContentAlignment.MiddleRight;
            lblPropPriceIn.Text      = Language.T("Price in");

            // lblPropAccountIn
            lblPropAccountIn.Parent    = pnlProperties;
            lblPropAccountIn.ForeColor = colorText;
            lblPropAccountIn.BackColor = Color.Transparent;
            lblPropAccountIn.AutoSize  = false;
            lblPropAccountIn.TextAlign = ContentAlignment.MiddleRight;
            lblPropAccountIn.Text      = Language.T("Account in");

            // lblPropAccountRate
            lblPropAccountRate.Parent    = pnlProperties;
            lblPropAccountRate.ForeColor = colorText;
            lblPropAccountRate.BackColor = Color.Transparent;
            lblPropAccountRate.AutoSize  = false;
            lblPropAccountRate.TextAlign = ContentAlignment.MiddleRight;
            lblPropAccountRate.Text      = Language.T("Account exchange rate");

            // lblPropFileName
            lblPropFileName.Parent    = pnlProperties;
            lblPropFileName.BackColor = Color.Transparent;
            lblPropFileName.ForeColor = colorText;
            lblPropFileName.AutoSize  = false;
            lblPropFileName.TextAlign = ContentAlignment.MiddleRight;
            lblPropFileName.Text      = Language.T("Base name of the data files");

            // lblPropDataFiles
            lblPropDataFiles.Parent    = pnlProperties;
            lblPropDataFiles.BackColor = Color.Transparent;
            lblPropDataFiles.ForeColor = colorText;
            lblPropDataFiles.AutoSize  = false;
            lblPropDataFiles.TextAlign = ContentAlignment.TopLeft;
            lblPropDataFiles.Text      = "";

            // tbxPropSymbol
            tbxPropSymbol.Parent    = pnlProperties;
            tbxPropSymbol.BackColor = LayoutColors.ColorControlBack;
            tbxPropSymbol.ForeColor = colorText;
            tbxPropSymbol.Enabled   = false;

            // tbxPropType
            tbxPropType.Parent    = pnlProperties;
            tbxPropType.BackColor = LayoutColors.ColorControlBack;
            tbxPropType.ForeColor = colorText;
            tbxPropType.Enabled   = false;

            // tbxPropComment
            tbxPropComment.Parent    = pnlProperties;
            tbxPropComment.BackColor = LayoutColors.ColorControlBack;
            tbxPropComment.ForeColor = colorText;

            // tbxPropPoint
            tbxPropPoint.Parent    = pnlProperties;
            tbxPropPoint.BackColor = LayoutColors.ColorControlBack;
            tbxPropPoint.ForeColor = colorText;
            tbxPropPoint.Enabled   = false;

            // tbxPropSpread
            tbxPropSpread.Parent    = pnlProperties;
            tbxPropSpread.BackColor = LayoutColors.ColorControlBack;
            tbxPropSpread.ForeColor = colorText;
            tbxPropSpread.Enabled   = false;
            tbxPropSpread.Text      = Language.T("pips");

            // tbxPropSlippage
            tbxPropSlippage.Parent    = pnlProperties;
            tbxPropSlippage.BackColor = LayoutColors.ColorControlBack;
            tbxPropSlippage.ForeColor = colorText;
            tbxPropSlippage.Enabled   = false;
            tbxPropSlippage.Text      = Language.T("pips");

            // tbxPropPriceIn
            tbxPropPriceIn.Parent       = pnlProperties;
            tbxPropPriceIn.BackColor    = LayoutColors.ColorControlBack;
            tbxPropPriceIn.ForeColor    = colorText;
            tbxPropPriceIn.TextChanged += new EventHandler(TbxPropPriceIn_TextChanged);

            // tbxPropAccountIn
            tbxPropAccountIn.Parent    = pnlProperties;
            tbxPropAccountIn.BackColor = LayoutColors.ColorControlBack;
            tbxPropAccountIn.ForeColor = colorText;
            tbxPropAccountIn.Enabled   = false;
            tbxPropAccountIn.Text      = Configs.AccountCurrency;

            // tbxPropAccountRate
            tbxPropAccountRate.Parent    = pnlProperties;
            tbxPropAccountRate.BackColor = LayoutColors.ColorControlBack;
            tbxPropAccountRate.ForeColor = colorText;
            tbxPropAccountRate.Enabled   = false;
            tbxPropAccountRate.Text      = "Deal price";

            // tbxPropFileName
            tbxPropFileName.Parent       = pnlProperties;
            tbxPropFileName.BackColor    = LayoutColors.ColorControlBack;
            tbxPropFileName.ForeColor    = colorText;
            tbxPropFileName.TextChanged += new EventHandler(TbxPropFileName_TextChanged);

            // cbxPropSwap
            cbxPropSwap.Parent        = pnlProperties;
            cbxPropSwap.Name          = "cbxPropSwap";
            cbxPropSwap.DropDownStyle = ComboBoxStyle.DropDownList;
            cbxPropSwap.Items.AddRange(new string[] { Language.T("pips"), Language.T("percent"), Language.T("money") });
            cbxPropSwap.SelectedIndex = 0;

            // cbxPropCommission
            cbxPropCommission.Parent        = pnlProperties;
            cbxPropCommission.Name          = "cbxPropCommission";
            cbxPropCommission.DropDownStyle = ComboBoxStyle.DropDownList;
            cbxPropCommission.Items.AddRange(new string[] { Language.T("pips"), Language.T("percent"), Language.T("money") });
            cbxPropCommission.SelectedIndex         = 0;
            cbxPropCommission.SelectedIndexChanged += new EventHandler(CbxPropCommission_SelectedIndexChanged);

            // cbxPropCommScope
            cbxPropCommScope.Parent        = pnlProperties;
            cbxPropCommScope.Name          = "cbxPropCommScope";
            cbxPropCommScope.DropDownStyle = ComboBoxStyle.DropDownList;
            cbxPropCommScope.Items.AddRange(new string[] { Language.T("per lot"), Language.T("per deal") });
            cbxPropCommScope.SelectedIndex = 0;

            // cbxPropCommTime
            cbxPropCommTime.Parent        = pnlProperties;
            cbxPropCommTime.Name          = "cbxPropCommTime";
            cbxPropCommTime.DropDownStyle = ComboBoxStyle.DropDownList;
            cbxPropCommTime.Items.AddRange(new string[] { Language.T("at opening"), Language.T("at open/close") });
            cbxPropCommTime.SelectedIndex = 0;

            // NumericUpDown Digits
            nudPropDigits.BeginInit();
            nudPropDigits.Parent        = pnlProperties;
            nudPropDigits.Name          = "nudPropDigits";
            nudPropDigits.Minimum       = 0;
            nudPropDigits.Maximum       = 5;
            nudPropDigits.Increment     = 1;
            nudPropDigits.Value         = 4;
            nudPropDigits.TextAlign     = HorizontalAlignment.Center;
            nudPropDigits.ValueChanged += new EventHandler(NudPropDigits_ValueChanged);
            nudPropDigits.EndInit();

            // nudPropLotSize
            nudPropLotSize.BeginInit();
            nudPropLotSize.Parent    = pnlProperties;
            nudPropLotSize.Name      = "nudPropLotSize";
            nudPropLotSize.Minimum   = 0;
            nudPropLotSize.Maximum   = 100000;
            nudPropLotSize.Increment = 1;
            nudPropLotSize.Value     = 10000;
            nudPropLotSize.TextAlign = HorizontalAlignment.Center;
            nudPropLotSize.EndInit();

            // nudPropSpread
            nudPropSpread.BeginInit();
            nudPropSpread.Parent        = pnlProperties;
            nudPropSpread.Name          = "nudPropSpread";
            nudPropSpread.TextAlign     = HorizontalAlignment.Center;
            nudPropSpread.Minimum       = 0;
            nudPropSpread.Maximum       = 500;
            nudPropSpread.Increment     = 0.01M;
            nudPropSpread.DecimalPlaces = 2;
            nudPropSpread.Value         = 4;
            nudPropSpread.EndInit();
            toolTip.SetToolTip(nudPropSpread, Language.T("Difference between Bid and Ask prices."));

            // NumericUpDown Swap Long
            nudPropSwapLong.BeginInit();
            nudPropSwapLong.Parent        = pnlProperties;
            nudPropSwapLong.Name          = "nudPropSwapLong";
            nudPropSwapLong.TextAlign     = HorizontalAlignment.Center;
            nudPropSwapLong.Minimum       = -500;
            nudPropSwapLong.Maximum       = 500;
            nudPropSwapLong.Increment     = 0.01M;
            nudPropSwapLong.DecimalPlaces = 2;
            nudPropSwapLong.Value         = 1;
            nudPropSwapLong.EndInit();
            toolTip.SetToolTip(nudPropSwapLong, Language.T("Swap number for a long position rollover") + Environment.NewLine + Language.T("A positive value decreases your profit."));

            // NumericUpDown Swap Short
            nudPropSwapShort.BeginInit();
            nudPropSwapShort.Parent        = pnlProperties;
            nudPropSwapShort.Name          = "nudPropSwapShort";
            nudPropSwapShort.TextAlign     = HorizontalAlignment.Center;
            nudPropSwapShort.Minimum       = -500;
            nudPropSwapShort.Maximum       = 500;
            nudPropSwapShort.Increment     = 0.01M;
            nudPropSwapShort.DecimalPlaces = 2;
            nudPropSwapShort.Value         = -1;
            nudPropSwapShort.EndInit();
            toolTip.SetToolTip(nudPropSwapShort, Language.T("Swap number for a short position rollover") + Environment.NewLine + Language.T("A negative value decreases your profit."));

            // NumericUpDown nudPropCommission
            nudPropCommission.BeginInit();
            nudPropCommission.Parent        = pnlProperties;
            nudPropCommission.Name          = "nudPropCommission";
            nudPropCommission.TextAlign     = HorizontalAlignment.Center;
            nudPropCommission.Minimum       = -500;
            nudPropCommission.Maximum       = 500;
            nudPropCommission.Increment     = 0.01M;
            nudPropCommission.DecimalPlaces = 2;
            nudPropCommission.Value         = 0;
            nudPropCommission.EndInit();

            // NumericUpDown nudPropSlippage
            nudPropSlippage.BeginInit();
            nudPropSlippage.Parent        = pnlProperties;
            nudPropSlippage.Name          = "nudPropSlippage";
            nudPropSlippage.TextAlign     = HorizontalAlignment.Center;
            nudPropSlippage.Minimum       = 0;
            nudPropSlippage.Maximum       = 200;
            nudPropSlippage.Increment     = 1;
            nudPropSlippage.DecimalPlaces = 0;
            nudPropSlippage.Value         = 0;
            nudPropSlippage.EndInit();
            toolTip.SetToolTip(nudPropSlippage, Language.T("Number of pips you lose due to an inaccurate order execution."));

            // NumericUpDown nudPropAccountRate
            nudPropAccountRate.BeginInit();
            nudPropAccountRate.Parent        = pnlProperties;
            nudPropAccountRate.Name          = "nudPropAccountRate";
            nudPropAccountRate.TextAlign     = HorizontalAlignment.Center;
            nudPropAccountRate.Minimum       = 0;
            nudPropAccountRate.Maximum       = 100000;
            nudPropAccountRate.Increment     = 0.0001M;
            nudPropAccountRate.DecimalPlaces = 4;
            nudPropAccountRate.Value         = 1;
            nudPropAccountRate.ValueChanged += new EventHandler(nudPropAccountRate_ValueChanged);
            nudPropAccountRate.EndInit();

            // Button Accept
            btnAccept.Parent = pnlProperties;
            btnAccept.Name   = "btnAccept";
            btnAccept.Text   = Language.T("Accept");
            btnAccept.Click += new EventHandler(BtnAccept_Click);
            btnAccept.UseVisualStyleBackColor = true;

            //Button Close
            btnClose.Parent                  = this;
            btnClose.Text                    = Language.T("Close");
            btnClose.DialogResult            = DialogResult.Cancel;
            btnClose.UseVisualStyleBackColor = true;
        }
Пример #37
0
        Label lblStatus;        // The status label that appears in ACT's Plugin tab

        private void InitializeComponent()
        {
            this.components               = new System.ComponentModel.Container();
            this.textBoxZone              = new System.Windows.Forms.TextBox();
            this.dataGridView1            = new System.Windows.Forms.DataGridView();
            this.contextMenuStripXml      = new System.Windows.Forms.ContextMenuStrip(this.components);
            this.copyXMLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.richTextBox1             = new System.Windows.Forms.RichTextBox();
            this.listBoxDeaths            = new System.Windows.Forms.ListBox();
            this.panel1                        = new System.Windows.Forms.Panel();
            this.panel2                        = new System.Windows.Forms.Panel();
            this.checkBoxZoneOnly              = new System.Windows.Forms.CheckBox();
            this.label2                        = new System.Windows.Forms.Label();
            this.labelWhoDied                  = new System.Windows.Forms.Label();
            this.panel4                        = new System.Windows.Forms.Panel();
            this.splitter1                     = new System.Windows.Forms.Splitter();
            this.panel3                        = new System.Windows.Forms.Panel();
            this.label6                        = new System.Windows.Forms.Label();
            this.panel5                        = new System.Windows.Forms.Panel();
            this.label1                        = new System.Windows.Forms.Label();
            this.treeView1                     = new System.Windows.Forms.TreeView();
            this.contextMenuStripMob           = new System.Windows.Forms.ContextMenuStrip(this.components);
            this.addToTrackedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.groupBox2                     = new System.Windows.Forms.GroupBox();
            this.comboBoxMini                  = new System.Windows.Forms.ComboBox();
            this.buttonShowMini                = new System.Windows.Forms.Button();
            this.groupBox1                     = new System.Windows.Forms.GroupBox();
            this.comboBoxAnnounce              = new System.Windows.Forms.ComboBox();
            this.textBoxMultDelay              = new System.Windows.Forms.TextBox();
            this.checkBoxWarnings              = new System.Windows.Forms.CheckBox();
            this.label7                        = new System.Windows.Forms.Label();
            this.label5                        = new System.Windows.Forms.Label();
            this.textBoxDelay                  = new System.Windows.Forms.TextBox();
            this.label8                        = new System.Windows.Forms.Label();
            this.textBoxEncounterZone          = new System.Windows.Forms.TextBox();
            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
            this.contextMenuStripXml.SuspendLayout();
            this.panel1.SuspendLayout();
            this.panel2.SuspendLayout();
            this.panel4.SuspendLayout();
            this.panel3.SuspendLayout();
            this.panel5.SuspendLayout();
            this.contextMenuStripMob.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.groupBox1.SuspendLayout();
            this.SuspendLayout();
            //
            // textBoxZone
            //
            this.textBoxZone.BackColor   = System.Drawing.SystemColors.Window;
            this.textBoxZone.Cursor      = System.Windows.Forms.Cursors.IBeam;
            this.textBoxZone.Location    = new System.Drawing.Point(102, 248);
            this.textBoxZone.Name        = "textBoxZone";
            this.textBoxZone.ReadOnly    = true;
            this.textBoxZone.Size        = new System.Drawing.Size(427, 20);
            this.textBoxZone.TabIndex    = 3;
            this.textBoxZone.MouseHover += new System.EventHandler(this.textBoxZone_MouseHover);
            //
            // dataGridView1
            //
            this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.dataGridView1.ContextMenuStrip            = this.contextMenuStripXml;
            this.dataGridView1.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.dataGridView1.Location = new System.Drawing.Point(0, 0);
            this.dataGridView1.Name     = "dataGridView1";
            this.dataGridView1.Size     = new System.Drawing.Size(725, 66);
            this.dataGridView1.TabIndex = 0;
            this.dataGridView1.CellContextMenuStripNeeded += new System.Windows.Forms.DataGridViewCellContextMenuStripNeededEventHandler(this.dataGridView1_CellContextMenuStripNeeded);
            this.dataGridView1.UserAddedRow   += new System.Windows.Forms.DataGridViewRowEventHandler(this.dataGridView1_UserAddedRow);
            this.dataGridView1.UserDeletedRow += new System.Windows.Forms.DataGridViewRowEventHandler(this.dataGridView1_UserDeletedRow);
            this.dataGridView1.MouseHover     += new System.EventHandler(this.dataGridView1_MouseHover);
            //
            // contextMenuStripXml
            //
            this.contextMenuStripXml.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                this.copyXMLToolStripMenuItem
            });
            this.contextMenuStripXml.Name = "contextMenuStrip1";
            this.contextMenuStripXml.Size = new System.Drawing.Size(130, 26);
            //
            // copyXMLToolStripMenuItem
            //
            this.copyXMLToolStripMenuItem.Name   = "copyXMLToolStripMenuItem";
            this.copyXMLToolStripMenuItem.Size   = new System.Drawing.Size(129, 22);
            this.copyXMLToolStripMenuItem.Text   = "Copy XML";
            this.copyXMLToolStripMenuItem.Click += new System.EventHandler(this.copyXMLToolStripMenuItem_Click);
            //
            // richTextBox1
            //
            this.richTextBox1.Dock        = System.Windows.Forms.DockStyle.Fill;
            this.richTextBox1.Location    = new System.Drawing.Point(0, 0);
            this.richTextBox1.Name        = "richTextBox1";
            this.richTextBox1.Size        = new System.Drawing.Size(725, 94);
            this.richTextBox1.TabIndex    = 0;
            this.richTextBox1.Text        = "Hover the mouse over a control for help.";
            this.richTextBox1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.richTextBox1_MouseClick);
            this.richTextBox1.MouseMove  += new System.Windows.Forms.MouseEventHandler(this.richTextBox1_MouseMove);
            //
            // listBoxDeaths
            //
            this.listBoxDeaths.FormattingEnabled = true;
            this.listBoxDeaths.Location          = new System.Drawing.Point(230, 20);
            this.listBoxDeaths.Name              = "listBoxDeaths";
            this.listBoxDeaths.Size              = new System.Drawing.Size(137, 186);
            this.listBoxDeaths.TabIndex          = 9;
            this.listBoxDeaths.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.listBoxDeaths_MouseDoubleClick);
            this.listBoxDeaths.MouseDown        += new System.Windows.Forms.MouseEventHandler(this.listBoxDeaths_MouseDown);
            this.listBoxDeaths.MouseHover       += new System.EventHandler(this.listBoxDeaths_MouseHover);
            //
            // panel1
            //
            this.panel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
            this.panel1.Controls.Add(this.richTextBox1);
            this.panel1.Dock     = System.Windows.Forms.DockStyle.Bottom;
            this.panel1.Location = new System.Drawing.Point(0, 104);
            this.panel1.Name     = "panel1";
            this.panel1.Size     = new System.Drawing.Size(725, 94);
            this.panel1.TabIndex = 10;
            //
            // panel2
            //
            this.panel2.AutoScroll   = true;
            this.panel2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
            this.panel2.Controls.Add(this.dataGridView1);
            this.panel2.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.panel2.Location = new System.Drawing.Point(0, 28);
            this.panel2.Name     = "panel2";
            this.panel2.Size     = new System.Drawing.Size(725, 66);
            this.panel2.TabIndex = 11;
            //
            // checkBoxZoneOnly
            //
            this.checkBoxZoneOnly.AutoSize = true;
            this.checkBoxZoneOnly.Location = new System.Drawing.Point(113, 7);
            this.checkBoxZoneOnly.Name     = "checkBoxZoneOnly";
            this.checkBoxZoneOnly.Size     = new System.Drawing.Size(142, 17);
            this.checkBoxZoneOnly.TabIndex = 1;
            this.checkBoxZoneOnly.Text     = "Show Current Zone Only";
            this.checkBoxZoneOnly.UseVisualStyleBackColor = true;
            this.checkBoxZoneOnly.CheckedChanged         += new System.EventHandler(this.checkBoxZoneOnly_CheckedChanged);
            this.checkBoxZoneOnly.MouseHover += new System.EventHandler(this.checkBoxZoneOnly_MouseHover);
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(16, 9);
            this.label2.Name     = "label2";
            this.label2.Size     = new System.Drawing.Size(83, 13);
            this.label2.TabIndex = 0;
            this.label2.Text     = "Tracked Names";
            //
            // labelWhoDied
            //
            this.labelWhoDied.AutoSize = true;
            this.labelWhoDied.Location = new System.Drawing.Point(227, 3);
            this.labelWhoDied.Name     = "labelWhoDied";
            this.labelWhoDied.Size     = new System.Drawing.Size(55, 13);
            this.labelWhoDied.TabIndex = 8;
            this.labelWhoDied.Text     = "Who Died";
            //
            // panel4
            //
            this.panel4.Controls.Add(this.panel2);
            this.panel4.Controls.Add(this.splitter1);
            this.panel4.Controls.Add(this.panel1);
            this.panel4.Controls.Add(this.panel3);
            this.panel4.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.panel4.Location = new System.Drawing.Point(0, 277);
            this.panel4.Name     = "panel4";
            this.panel4.Size     = new System.Drawing.Size(725, 198);
            this.panel4.TabIndex = 16;
            //
            // splitter1
            //
            this.splitter1.Dock     = System.Windows.Forms.DockStyle.Bottom;
            this.splitter1.Location = new System.Drawing.Point(0, 94);
            this.splitter1.Name     = "splitter1";
            this.splitter1.Size     = new System.Drawing.Size(725, 10);
            this.splitter1.TabIndex = 1;
            this.splitter1.TabStop  = false;
            //
            // panel3
            //
            this.panel3.Controls.Add(this.label2);
            this.panel3.Controls.Add(this.checkBoxZoneOnly);
            this.panel3.Dock     = System.Windows.Forms.DockStyle.Top;
            this.panel3.Location = new System.Drawing.Point(0, 0);
            this.panel3.Name     = "panel3";
            this.panel3.Size     = new System.Drawing.Size(725, 28);
            this.panel3.TabIndex = 0;
            //
            // label6
            //
            this.label6.AutoSize = true;
            this.label6.Location = new System.Drawing.Point(24, 252);
            this.label6.Name     = "label6";
            this.label6.Size     = new System.Drawing.Size(72, 13);
            this.label6.TabIndex = 2;
            this.label6.Text     = "Current Zone:";
            //
            // panel5
            //
            this.panel5.Controls.Add(this.label1);
            this.panel5.Controls.Add(this.treeView1);
            this.panel5.Controls.Add(this.groupBox2);
            this.panel5.Controls.Add(this.groupBox1);
            this.panel5.Controls.Add(this.label8);
            this.panel5.Controls.Add(this.textBoxZone);
            this.panel5.Controls.Add(this.label6);
            this.panel5.Controls.Add(this.textBoxEncounterZone);
            this.panel5.Controls.Add(this.listBoxDeaths);
            this.panel5.Controls.Add(this.labelWhoDied);
            this.panel5.Dock     = System.Windows.Forms.DockStyle.Top;
            this.panel5.Location = new System.Drawing.Point(0, 0);
            this.panel5.Name     = "panel5";
            this.panel5.Size     = new System.Drawing.Size(725, 277);
            this.panel5.TabIndex = 17;
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(9, 3);
            this.label1.Name     = "label1";
            this.label1.Size     = new System.Drawing.Size(61, 13);
            this.label1.TabIndex = 29;
            this.label1.Text     = "Encounters";
            //
            // treeView1
            //
            this.treeView1.ContextMenuStrip = this.contextMenuStripMob;
            this.treeView1.DrawMode         = System.Windows.Forms.TreeViewDrawMode.OwnerDrawText;
            this.treeView1.HideSelection    = false;
            this.treeView1.Location         = new System.Drawing.Point(12, 20);
            this.treeView1.Name             = "treeView1";
            this.treeView1.Size             = new System.Drawing.Size(212, 183);
            this.treeView1.TabIndex         = 28;
            this.treeView1.BeforeExpand    += new System.Windows.Forms.TreeViewCancelEventHandler(this.treeView1_BeforeExpand);
            this.treeView1.DrawNode        += new System.Windows.Forms.DrawTreeNodeEventHandler(this.treeView1_DrawNode);
            this.treeView1.AfterSelect     += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect);
            this.treeView1.NodeMouseClick  += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeView1_NodeMouseClick);
            this.treeView1.MouseHover      += new System.EventHandler(this.treeView1_MouseHover);
            //
            // contextMenuStripMob
            //
            this.contextMenuStripMob.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                this.addToTrackedToolStripMenuItem
            });
            this.contextMenuStripMob.Name = "contextMenuStripMob";
            this.contextMenuStripMob.Size = new System.Drawing.Size(155, 26);
            //
            // addToTrackedToolStripMenuItem
            //
            this.addToTrackedToolStripMenuItem.Name   = "addToTrackedToolStripMenuItem";
            this.addToTrackedToolStripMenuItem.Size   = new System.Drawing.Size(154, 22);
            this.addToTrackedToolStripMenuItem.Text   = "Add To Tracked";
            this.addToTrackedToolStripMenuItem.Click += new System.EventHandler(this.addToTrackedToolStripMenuItem_Click);
            //
            // groupBox2
            //
            this.groupBox2.Controls.Add(this.comboBoxMini);
            this.groupBox2.Controls.Add(this.buttonShowMini);
            this.groupBox2.Location = new System.Drawing.Point(376, 133);
            this.groupBox2.Name     = "groupBox2";
            this.groupBox2.Size     = new System.Drawing.Size(154, 78);
            this.groupBox2.TabIndex = 27;
            this.groupBox2.TabStop  = false;
            this.groupBox2.Text     = "Mini Overlay Form";
            //
            // comboBoxMini
            //
            this.comboBoxMini.DropDownStyle     = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.comboBoxMini.FormattingEnabled = true;
            this.comboBoxMini.Items.AddRange(new object[] {
                "Auto show all",
                "Auto show tracked",
                "Disable auto show"
            });
            this.comboBoxMini.Location              = new System.Drawing.Point(6, 19);
            this.comboBoxMini.Name                  = "comboBoxMini";
            this.comboBoxMini.Size                  = new System.Drawing.Size(141, 21);
            this.comboBoxMini.TabIndex              = 30;
            this.comboBoxMini.SelectedIndexChanged += new System.EventHandler(this.comboBoxMini_SelectedIndexChanged);
            this.comboBoxMini.MouseHover           += new System.EventHandler(this.comboBoxMini_MouseHover);
            //
            // buttonShowMini
            //
            this.buttonShowMini.Location = new System.Drawing.Point(36, 46);
            this.buttonShowMini.Name     = "buttonShowMini";
            this.buttonShowMini.Size     = new System.Drawing.Size(75, 23);
            this.buttonShowMini.TabIndex = 12;
            this.buttonShowMini.Text     = "Show Mini";
            this.buttonShowMini.UseVisualStyleBackColor = true;
            this.buttonShowMini.Click      += new System.EventHandler(this.buttonShowMini_Click);
            this.buttonShowMini.MouseHover += new System.EventHandler(this.buttonShowMini_MouseHover);
            //
            // groupBox1
            //
            this.groupBox1.Controls.Add(this.comboBoxAnnounce);
            this.groupBox1.Controls.Add(this.textBoxMultDelay);
            this.groupBox1.Controls.Add(this.checkBoxWarnings);
            this.groupBox1.Controls.Add(this.label7);
            this.groupBox1.Controls.Add(this.label5);
            this.groupBox1.Controls.Add(this.textBoxDelay);
            this.groupBox1.Location = new System.Drawing.Point(376, 3);
            this.groupBox1.Name     = "groupBox1";
            this.groupBox1.Size     = new System.Drawing.Size(153, 124);
            this.groupBox1.TabIndex = 25;
            this.groupBox1.TabStop  = false;
            this.groupBox1.Text     = "Announcements";
            //
            // comboBoxAnnounce
            //
            this.comboBoxAnnounce.DropDownStyle     = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.comboBoxAnnounce.FormattingEnabled = true;
            this.comboBoxAnnounce.Items.AddRange(new object[] {
                "Announce All",
                "Announce Tracked",
                "No Announcements"
            });
            this.comboBoxAnnounce.Location              = new System.Drawing.Point(9, 19);
            this.comboBoxAnnounce.Name                  = "comboBoxAnnounce";
            this.comboBoxAnnounce.Size                  = new System.Drawing.Size(138, 21);
            this.comboBoxAnnounce.TabIndex              = 31;
            this.comboBoxAnnounce.SelectedIndexChanged += new System.EventHandler(this.comboBoxAnnounce_SelectedIndexChanged);
            this.comboBoxAnnounce.MouseHover           += new System.EventHandler(this.comboBoxAnnounce_MouseHover);
            //
            // textBoxMultDelay
            //
            this.textBoxMultDelay.Location     = new System.Drawing.Point(9, 72);
            this.textBoxMultDelay.Name         = "textBoxMultDelay";
            this.textBoxMultDelay.Size         = new System.Drawing.Size(38, 20);
            this.textBoxMultDelay.TabIndex     = 23;
            this.textBoxMultDelay.Text         = "2500";
            this.textBoxMultDelay.TextAlign    = System.Windows.Forms.HorizontalAlignment.Right;
            this.textBoxMultDelay.TextChanged += new System.EventHandler(this.textBoxMultDelay_TextChanged);
            this.textBoxMultDelay.MouseHover  += new System.EventHandler(this.textBoxMultDelay_MouseHover);
            //
            // checkBoxWarnings
            //
            this.checkBoxWarnings.AutoSize = true;
            this.checkBoxWarnings.Location = new System.Drawing.Point(9, 100);
            this.checkBoxWarnings.Name     = "checkBoxWarnings";
            this.checkBoxWarnings.Size     = new System.Drawing.Size(123, 17);
            this.checkBoxWarnings.TabIndex = 5;
            this.checkBoxWarnings.Text     = "Announce Warnings";
            this.checkBoxWarnings.UseVisualStyleBackColor = true;
            this.checkBoxWarnings.CheckedChanged         += new System.EventHandler(this.checkBoxWarnings_CheckedChanged);
            this.checkBoxWarnings.MouseHover += new System.EventHandler(this.checkBoxWarnings_MouseHover);
            //
            // label7
            //
            this.label7.AutoSize = true;
            this.label7.Location = new System.Drawing.Point(51, 76);
            this.label7.Name     = "label7";
            this.label7.Size     = new System.Drawing.Size(92, 13);
            this.label7.TabIndex = 22;
            this.label7.Text     = "msec Mutiple Gap";
            //
            // label5
            //
            this.label5.AutoSize = true;
            this.label5.Location = new System.Drawing.Point(51, 50);
            this.label5.Name     = "label5";
            this.label5.Size     = new System.Drawing.Size(87, 13);
            this.label5.TabIndex = 6;
            this.label5.Text     = "msec Single Gap";
            //
            // textBoxDelay
            //
            this.textBoxDelay.Location     = new System.Drawing.Point(9, 46);
            this.textBoxDelay.Name         = "textBoxDelay";
            this.textBoxDelay.Size         = new System.Drawing.Size(38, 20);
            this.textBoxDelay.TabIndex     = 7;
            this.textBoxDelay.Text         = "1500";
            this.textBoxDelay.TextAlign    = System.Windows.Forms.HorizontalAlignment.Right;
            this.textBoxDelay.TextChanged += new System.EventHandler(this.textBoxDelay_TextChanged);
            this.textBoxDelay.MouseHover  += new System.EventHandler(this.textBoxDelay_MouseHover);
            //
            // label8
            //
            this.label8.AutoSize = true;
            this.label8.Location = new System.Drawing.Point(9, 227);
            this.label8.Name     = "label8";
            this.label8.Size     = new System.Drawing.Size(87, 13);
            this.label8.TabIndex = 24;
            this.label8.Text     = "Encounter Zone:";
            //
            // textBoxEncounterZone
            //
            this.textBoxEncounterZone.BackColor   = System.Drawing.SystemColors.Window;
            this.textBoxEncounterZone.Location    = new System.Drawing.Point(102, 223);
            this.textBoxEncounterZone.Name        = "textBoxEncounterZone";
            this.textBoxEncounterZone.ReadOnly    = true;
            this.textBoxEncounterZone.Size        = new System.Drawing.Size(428, 20);
            this.textBoxEncounterZone.TabIndex    = 19;
            this.textBoxEncounterZone.MouseHover += new System.EventHandler(this.textBoxEncounterZone_MouseHover);
            //
            // DeathCount
            //
            this.Controls.Add(this.panel4);
            this.Controls.Add(this.panel5);
            this.Name        = "DeathCount";
            this.Size        = new System.Drawing.Size(725, 475);
            this.MouseHover += new System.EventHandler(this.DeathCount_MouseHover);
            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
            this.contextMenuStripXml.ResumeLayout(false);
            this.panel1.ResumeLayout(false);
            this.panel2.ResumeLayout(false);
            this.panel4.ResumeLayout(false);
            this.panel3.ResumeLayout(false);
            this.panel3.PerformLayout();
            this.panel5.ResumeLayout(false);
            this.panel5.PerformLayout();
            this.contextMenuStripMob.ResumeLayout(false);
            this.groupBox2.ResumeLayout(false);
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.ResumeLayout(false);
        }
Пример #38
0
 // view all the playlists
 public static void goToPlaylists(ListBox list)
 {
     ProcessDirectoryJson(getPlaylistsPath(), list);
 }
Пример #39
0
        public override void PopulateDetailsDialog(QuestionView QuestionView, ProvisioningClient ProvisioningClient)
        {
            StackPanel Details = QuestionView.Details;
            TextBlock  TextBlock;
            ListBox    ListBox;
            Button     Button;

            this.client       = ProvisioningClient;
            this.questionView = QuestionView;

            Details.Children.Add(new TextBlock()
            {
                FontSize   = 18,
                FontWeight = FontWeights.Bold,
                Text       = "Allowed to control?"
            });

            Details.Children.Add(TextBlock = new TextBlock()
            {
                TextWrapping = TextWrapping.Wrap,
                Margin       = new Thickness(0, 6, 0, 6)
            });

            TextBlock.Inlines.Add("Device: ");
            this.AddJidName(this.JID, ProvisioningClient, TextBlock);

            this.AddNodeInfo(Details);

            Details.Children.Add(TextBlock = new TextBlock()
            {
                TextWrapping = TextWrapping.Wrap,
                Margin       = new Thickness(0, 6, 0, 6)
            });

            TextBlock.Inlines.Add("Caller: ");
            this.AddJidName(this.RemoteJID, ProvisioningClient, TextBlock);


            Details.Children.Add(new Label()
            {
                Content = "Parameter restriction:",
                Margin  = new Thickness(0, 6, 0, 0)
            });

            Details.Children.Add(ListBox = new ListBox()
            {
                MaxHeight     = 150,
                SelectionMode = SelectionMode.Multiple,
                Margin        = new Thickness(0, 0, 0, 6)
            });

            this.parametersListBox = ListBox;

            if (this.availableParameterNames is null)
            {
                if (this.parameterNames != null)
                {
                    foreach (string ParameterName in this.parameterNames)
                    {
                        ListBox.Items.Add(new ListBoxItem()
                        {
                            Content    = ParameterName,
                            IsSelected = true,
                            Tag        = ParameterName
                        });
                    }
                }
            }
            else
            {
                foreach (string ParameterName in this.availableParameterNames)
                {
                    ListBox.Items.Add(new ListBoxItem()
                    {
                        Content    = ParameterName,
                        IsSelected = (this.parameterNames is null || Array.IndexOf <string>(this.parameterNames, ParameterName) >= 0),
                        Tag        = ParameterName
                    });
 public static bool ColumnsNotSelected(ListBox col1, ListBox col2)
 {
     return(col1.SelectedItem is null || col2.SelectedItem is null);
 }
Пример #41
0
        public void GenerateListData(ref ListBox inputListBox, Player player, List <Player> playerList)
        {
            // Tar in alla levels en spelare har spelar på
            // Och skriv ut all info i en listbox

            int nummberOfMovesDone     = 0;
            int nummberOfMovesAccepted = 0;

            inputListBox.Items.Clear();

            string playerName = "========  " + player.Name + "  ========";

            inputListBox.Items.Add(playerName);

            for (int i = 0; i != player.Scores.Count(); i++)
            {
                int indexBestPlayer = 0;
                int bestMoveCount   = player.Scores[i].AmountOfMovesUsed;

                for (int x = 0; x != playerList.Count; x++)
                {
                    for (int z = 0; z != playerList[x].Scores.Count; z++)
                    {
                        if (player.Scores[i].Levels == playerList[x].Scores[z].Levels)
                        {
                            if (bestMoveCount >= playerList[x].Scores[z].AmountOfMovesUsed)
                            {
                                indexBestPlayer = x;
                                bestMoveCount   = playerList[x].Scores[z].AmountOfMovesUsed;
                            }
                        }
                    }
                }


                ItemsControl tempItemControlLevelData = new ItemsControl();

                tempItemControlLevelData.Height = 150;
                tempItemControlLevelData.Width  = 221;

                nummberOfMovesDone     += player.Scores[i].AmountOfMovesUsed;
                nummberOfMovesAccepted += player.Scores[i].Levels.AmountOfMoves;


                Label tempInfoLabelData = new Label();


                tempInfoLabelData.Content  = "Level : " + player.Scores[i].Levels.Name + "\r\n";
                tempInfoLabelData.Content += "Moves made : " + player.Scores[i].AmountOfMovesUsed + "\r\n";
                tempInfoLabelData.Content += "Moves left : " + (player.Scores[i].Levels.AmountOfMoves - player.Scores[i].AmountOfMovesUsed) + "\r\n";
                tempInfoLabelData.Content += "Moves available : " + player.Scores[i].Levels.AmountOfMoves + "\r\n\r\n";
                tempInfoLabelData.Content += "Best Player : " + playerList[indexBestPlayer].Name + "\r\n";
                tempInfoLabelData.Content += "Best Moves : " + bestMoveCount + "\r\n";
                tempInfoLabelData.Content += "Best Player Moves Left : " + (player.Scores[i].Levels.AmountOfMoves - bestMoveCount) + "\r\n";
                tempInfoLabelData.Content += "-------------------------------";


                tempItemControlLevelData.Items.Add(tempInfoLabelData);
                inputListBox.Items.Add(tempItemControlLevelData);
            }

            ItemsControl tempItemControlStats = new ItemsControl();

            tempItemControlStats.Height = 70;
            tempItemControlStats.Width  = 150;

            Label tempInfoLabel = new Label();


            tempInfoLabel.Content += "Total moves made : " + nummberOfMovesDone + "\r\n";
            tempInfoLabel.Content += "Total moves left : " + (nummberOfMovesAccepted - nummberOfMovesDone) + "\r\n";
            tempInfoLabel.Content += "Total moves available : " + nummberOfMovesAccepted;


            tempItemControlStats.Items.Add(tempInfoLabel);
            inputListBox.Items.Add(tempItemControlStats);
        }
Пример #42
0
 public ListBoxManager(ListBox lstview)
 {
     AttachTo(lstview);
 }
Пример #43
0
        public winNPCPanel()
            : base("winNPCPanel")
        {
            this.Windowed             = true;
            this.ShowInWindowSwitcher = false;
            this.Size        = new System.Drawing.Size(200, 270);
            this.Location    = new System.Drawing.Point(210, WindowSwitcher.GameWindow.ActiveTeam.Y + WindowSwitcher.GameWindow.ActiveTeam.Height + 0);
            this.AlwaysOnTop = true;
            this.TitleBar.CloseButton.Visible = true;
            this.TitleBar.Font = Graphics.FontManager.LoadFont("tahoma", 10);
            this.TitleBar.Text = "NPC Panel";

            pnlNPCList           = new Panel("pnlNPCList");
            pnlNPCList.Size      = new System.Drawing.Size(200, 270);
            pnlNPCList.Location  = new Point(0, 0);
            pnlNPCList.BackColor = Color.White;
            pnlNPCList.Visible   = true;

            pnlNPCEditor           = new Panel("pnlNPCEditor");
            pnlNPCEditor.Size      = new System.Drawing.Size(300, 460);
            pnlNPCEditor.Location  = new Point(0, 0);
            pnlNPCEditor.BackColor = Color.White;
            pnlNPCEditor.Visible   = false;

            #region NPC Selector

            lbxNPCList          = new ListBox("lbxNPCList");
            lbxNPCList.Location = new Point(10, 10);
            lbxNPCList.Size     = new Size(180, 140);
            for (int i = 0; i < 10; i++)
            {
                ListBoxTextItem lbiNPC = new ListBoxTextItem(Graphics.FontManager.LoadFont("tahoma", 10), (i + 1) + ": " + Npc.NpcHelper.Npcs[(i + 1) + 10 * currentTen].Name);
                lbxNPCList.Items.Add(lbiNPC);
            }

            btnBack          = new Button("btnBack");
            btnBack.Location = new Point(10, 160);
            btnBack.Font     = Graphics.FontManager.LoadFont("tahoma", 10);
            btnBack.Size     = new System.Drawing.Size(64, 16);
            btnBack.Visible  = true;
            btnBack.Text     = "<--";
            btnBack.Click   += new EventHandler <MouseButtonEventArgs>(btnBack_Click);

            btnForward          = new Button("btnForward");
            btnForward.Location = new Point(126, 160);
            btnForward.Font     = Graphics.FontManager.LoadFont("tahoma", 10);
            btnForward.Size     = new System.Drawing.Size(64, 16);
            btnForward.Visible  = true;
            btnForward.Text     = "-->";
            btnForward.Click   += new EventHandler <MouseButtonEventArgs>(btnForward_Click);

            btnEdit          = new Button("btnEdit");
            btnEdit.Location = new Point(10, 190);
            btnEdit.Font     = Graphics.FontManager.LoadFont("tahoma", 10);
            btnEdit.Size     = new System.Drawing.Size(64, 16);
            btnEdit.Visible  = true;
            btnEdit.Text     = "Edit";
            btnEdit.Click   += new EventHandler <MouseButtonEventArgs>(btnEdit_Click);

            btnCancel          = new Button("btnCancel");
            btnCancel.Location = new Point(126, 190);
            btnCancel.Font     = Graphics.FontManager.LoadFont("tahoma", 10);
            btnCancel.Size     = new System.Drawing.Size(64, 16);
            btnCancel.Visible  = true;
            btnCancel.Text     = "Cancel";
            btnCancel.Click   += new EventHandler <MouseButtonEventArgs>(btnCancel_Click);

            #endregion

            #region NPC Editor

            lblName          = new Label("lblName");
            lblName.Font     = Graphics.FontManager.LoadFont("Tahoma", 10);
            lblName.Text     = "NPC Name:";
            lblName.AutoSize = true;
            lblName.Location = new Point(10, 5);

            txtName          = new TextBox("txtName");
            txtName.Size     = new Size(200, 15);
            txtName.Location = new Point(75, 5);
            txtName.Font     = Graphics.FontManager.LoadFont("Tahoma", 12);
            txtName.Text     = "";

            lblAttackSay          = new Label("lblAttackSay");
            lblAttackSay.Font     = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
            lblAttackSay.Text     = "Attack Say:";
            lblAttackSay.AutoSize = true;
            lblAttackSay.Location = new Point(10, 25);

            txtAttackSay          = new TextBox("txtAttackSay");
            txtAttackSay.Size     = new System.Drawing.Size(200, 15);
            txtAttackSay.Location = new Point(75, 25);
            txtAttackSay.Font     = Logic.Graphics.FontManager.LoadFont("tahoma", 12);

            lblAttackSay2          = new Label("lblAttackSay2");
            lblAttackSay2.Font     = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
            lblAttackSay2.Text     = "Attack Say2:";
            lblAttackSay2.AutoSize = true;
            lblAttackSay2.Location = new Point(10, 45);

            txtAttackSay2          = new TextBox("txtAttackSay2");
            txtAttackSay2.Size     = new System.Drawing.Size(200, 15);
            txtAttackSay2.Location = new Point(75, 45);
            txtAttackSay2.Font     = Logic.Graphics.FontManager.LoadFont("tahoma", 12);

            lblAttackSay3          = new Label("lblAttackSay3");
            lblAttackSay3.Font     = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
            lblAttackSay3.Text     = "Attack Say3:";
            lblAttackSay3.AutoSize = true;
            lblAttackSay3.Location = new Point(10, 65);

            txtAttackSay3          = new TextBox("txtAttackSay3");
            txtAttackSay3.Size     = new System.Drawing.Size(200, 15);
            txtAttackSay3.Location = new Point(75, 65);
            txtAttackSay3.Font     = Logic.Graphics.FontManager.LoadFont("tahoma", 12);

            lblForm          = new Label("lblForm");
            lblForm.Font     = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
            lblForm.Text     = "Form:";
            lblForm.AutoSize = true;
            lblForm.Location = new Point(10, 85);

            nudForm               = new NumericUpDown("nudForm");
            nudForm.Maximum       = 1000;
            nudForm.Location      = new Point(75, 85);
            nudForm.Size          = new System.Drawing.Size(200, 15);
            nudForm.ValueChanged += new EventHandler <ValueChangedEventArgs>(nudForm_ValueChanged);

            lblSpecies          = new Label("lblSpecies");
            lblSpecies.Font     = Graphics.FontManager.LoadFont("tahoma", 10);
            lblSpecies.Text     = "Species:";
            lblSpecies.AutoSize = true;
            lblSpecies.Location = new Point(10, 105);

            nudSpecies            = new NumericUpDown("nudSpecies");
            nudSpecies.Location   = new Point(75, 105);
            nudSpecies.Size       = new System.Drawing.Size(200, 15);
            nudSpecies.Minimum    = -1;
            nudSpecies.Maximum    = 1000;
            nudForm.ValueChanged += new EventHandler <ValueChangedEventArgs>(nudSpecies_ValueChanged);

            lblRange          = new Label("lblRange");
            lblRange.Font     = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
            lblRange.Text     = "Shiny:";
            lblRange.AutoSize = true;
            lblRange.Location = new Point(10, 125);

            nudShinyChance          = new NumericUpDown("nudShinyChance");
            nudShinyChance.Location = new Point(75, 125);
            nudShinyChance.Size     = new System.Drawing.Size(200, 15);
            nudShinyChance.Maximum  = Int32.MaxValue;
            nudShinyChance.Minimum  = 0;

            chkSpawnsAtDawn          = new CheckBox("chkSpawnsAtDawn");
            chkSpawnsAtDawn.Size     = new Size(60, 17);
            chkSpawnsAtDawn.Location = new Point(75, 145);
            chkSpawnsAtDawn.Font     = Graphics.FontManager.LoadFont("tahoma", 10);
            chkSpawnsAtDawn.Text     = "Dawn";

            chkSpawnsAtDay          = new CheckBox("chkSpawnsAtDay");
            chkSpawnsAtDay.Size     = new Size(60, 17);
            chkSpawnsAtDay.Location = new Point(175, 145);
            chkSpawnsAtDay.Font     = Graphics.FontManager.LoadFont("tahoma", 10);
            chkSpawnsAtDay.Text     = "Day";

            chkSpawnsAtDusk          = new CheckBox("chkSpawnsAtDusk");
            chkSpawnsAtDusk.Size     = new Size(60, 17);
            chkSpawnsAtDusk.Location = new Point(75, 165);
            chkSpawnsAtDusk.Font     = Graphics.FontManager.LoadFont("tahoma", 10);
            chkSpawnsAtDusk.Text     = "Dusk";

            chkSpawnsAtNight          = new CheckBox("chkSpawnsAtNight");
            chkSpawnsAtNight.Size     = new Size(60, 17);
            chkSpawnsAtNight.Location = new Point(175, 165);
            chkSpawnsAtNight.Font     = Graphics.FontManager.LoadFont("tahoma", 10);
            chkSpawnsAtNight.Text     = "Night";

            lblBehaviour          = new Label("lblBehaviour");
            lblBehaviour.Font     = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
            lblBehaviour.Text     = "Behaviour:";
            lblBehaviour.AutoSize = true;
            lblBehaviour.Location = new Point(10, lblRange.Y + 60);

            cmbBehaviour          = new ComboBox("cmbBehaviour");
            cmbBehaviour.Location = new Point(75, lblBehaviour.Y);
            cmbBehaviour.Size     = new System.Drawing.Size(200, 15);
            for (int i = 0; i < Enum.GetNames(typeof(Enums.NpcBehavior)).Length; i++)
            {
                cmbBehaviour.Items.Add(new ListBoxTextItem(Graphics.FontManager.LoadFont("tahoma", 10), Enum.GetName(typeof(Enums.NpcBehavior), i)));
            }

            lblRecruitRate          = new Label("lblRecruitRate");
            lblRecruitRate.Font     = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
            lblRecruitRate.Text     = "Recruit Rate:";
            lblRecruitRate.AutoSize = true;
            lblRecruitRate.Location = new Point(10, lblBehaviour.Y + 20);

            nudRecruitRate          = new NumericUpDown("nudRecruitRate");
            nudRecruitRate.Location = new Point(85, lblRecruitRate.Y);
            nudRecruitRate.Size     = new System.Drawing.Size(190, 15);
            nudRecruitRate.Minimum  = -1000;
            nudRecruitRate.Maximum  = 1000;

            lblMove     = new Label[4];
            lblMoveInfo = new Label[4];
            nudMove     = new NumericUpDown[4];
            for (int i = 0; i < lblMove.Length; i++)
            {
                lblMove[i]               = new Label("lblMove" + i);
                lblMoveInfo[i]           = new Label("lblMoveInfo" + i);
                nudMove[i]               = new NumericUpDown("nudMove" + i);
                nudMove[i].ValueChanged += new EventHandler <ValueChangedEventArgs>(winNPCPanel_ValueChanged);

                lblMove[i].Font     = Graphics.FontManager.LoadFont("tahoma", 10);
                lblMove[i].Text     = "Move " + (i + 1) + ":";
                lblMove[i].AutoSize = true;
                lblMove[i].Location = new Point(10, (lblRecruitRate.Y + 20) + (20 * i));

                nudMove[i].Location = new Point(75, (lblRecruitRate.Y + 20) + (20 * i));
                nudMove[i].Size     = new Size(150, 15);
                nudMove[i].Minimum  = -1;
                nudMove[i].Maximum  = MaxInfo.MaxMoves;

                lblMoveInfo[i].Font     = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                lblMoveInfo[i].AutoSize = true;
                lblMoveInfo[i].Location = new Point(230, (lblRecruitRate.Y + 20) + (20 * i));
            }

            lblDropSelector          = new Label("lblDropSelector");
            lblDropSelector.Font     = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
            lblDropSelector.AutoSize = true;
            lblDropSelector.Text     = "Drop #:";
            lblDropSelector.Location = new Point(10, lblMove[lblMove.Length - 1].Y + 20);

            nudDropSelector               = new NumericUpDown("nudDropSelector");
            nudDropSelector.Location      = new Point(75, lblDropSelector.Y);
            nudDropSelector.Size          = new System.Drawing.Size(200, 15);
            nudDropSelector.Minimum       = 1;
            nudDropSelector.Maximum       = MaxInfo.MAX_NPC_DROPS;
            nudDropSelector.ValueChanged += new EventHandler <ValueChangedEventArgs>(nudDropSelector_ValueChanged);

            lblDropItemNum          = new Label("lblDropItemNum");
            lblDropItemNum.Font     = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
            lblDropItemNum.AutoSize = true;
            lblDropItemNum.Text     = "Drop Item #:";
            lblDropItemNum.Location = new Point(10, lblDropSelector.Y + 20);

            nudDropItemNum               = new NumericUpDown("nudDropItemNum");
            nudDropItemNum.Location      = new Point(75, lblDropItemNum.Y);
            nudDropItemNum.Size          = new System.Drawing.Size(200, 15);
            nudDropItemNum.Minimum       = 0;
            nudDropItemNum.Maximum       = MaxInfo.MaxItems;
            nudDropItemNum.ValueChanged += new EventHandler <ValueChangedEventArgs>(nudDropItemNum_ValueChanged);

            lblDropItemAmount          = new Label("lblDropItemAmount");
            lblDropItemAmount.Font     = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
            lblDropItemAmount.AutoSize = true;
            lblDropItemAmount.Text     = "Drop Amount:";
            lblDropItemAmount.Location = new Point(10, lblDropItemNum.Y + 20);

            nudDropItemAmount               = new NumericUpDown("nudDropItemAmount");
            nudDropItemAmount.Location      = new Point(85, lblDropItemAmount.Y);
            nudDropItemAmount.Size          = new System.Drawing.Size(190, 15);
            nudDropItemAmount.Minimum       = 1;
            nudDropItemAmount.Maximum       = Int32.MaxValue;
            nudDropItemAmount.ValueChanged += new EventHandler <ValueChangedEventArgs>(nudDropItemAmount_ValueChanged);

            lblDropItemChance          = new Label("lblDropItemChance");
            lblDropItemChance.Font     = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
            lblDropItemChance.AutoSize = true;
            lblDropItemChance.Text     = "Drop Chance:";
            lblDropItemChance.Location = new Point(10, lblDropItemAmount.Y + 20);

            nudDropItemChance               = new NumericUpDown("nudDropItemChance");
            nudDropItemChance.Location      = new Point(85, lblDropItemChance.Y);
            nudDropItemChance.Size          = new System.Drawing.Size(190, 15);
            nudDropItemChance.Minimum       = 1;
            nudDropItemChance.Maximum       = 100;
            nudDropItemChance.ValueChanged += new EventHandler <ValueChangedEventArgs>(nudDropItemChance_ValueChanged);

            lblDropItemTag          = new Label("lblDropItemTag");
            lblDropItemTag.Font     = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
            lblDropItemTag.AutoSize = true;
            lblDropItemTag.Text     = "Item Tag:";
            lblDropItemTag.Location = new Point(10, lblDropItemChance.Y + 20);

            txtDropItemTag              = new TextBox("nudDropItemTag");
            txtDropItemTag.Location     = new Point(85, lblDropItemTag.Y);
            txtDropItemTag.Size         = new System.Drawing.Size(190, 15);
            txtDropItemTag.Font         = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
            txtDropItemTag.TextChanged += new EventHandler(txtDropItemTag_TextChanged);



            #endregion

            btnEditorCancel          = new Button("btnEditorCancel");
            btnEditorCancel.Location = new Point(20, lblDropItemTag.Y + 20);
            btnEditorCancel.Font     = Graphics.FontManager.LoadFont("tahoma", 10);
            btnEditorCancel.Size     = new System.Drawing.Size(64, 16);
            btnEditorCancel.Visible  = true;
            btnEditorCancel.Text     = "Cancel";
            btnEditorCancel.Click   += new EventHandler <MouseButtonEventArgs>(btnEditorCancel_Click);

            btnEditorOK          = new Button("btnEditorOK");
            btnEditorOK.Location = new Point(120, lblDropItemTag.Y + 20);
            btnEditorOK.Font     = Graphics.FontManager.LoadFont("tahoma", 10);
            btnEditorOK.Size     = new System.Drawing.Size(64, 16);
            btnEditorOK.Visible  = true;
            btnEditorOK.Text     = "OK";
            btnEditorOK.Click   += new EventHandler <MouseButtonEventArgs>(btnEditorOK_Click);

            #region NPC Selector

            pnlNPCList.AddWidget(lbxNPCList);
            pnlNPCList.AddWidget(btnBack);
            pnlNPCList.AddWidget(btnForward);
            pnlNPCList.AddWidget(btnEdit);
            pnlNPCList.AddWidget(btnCancel);

            #endregion

            #region NPC Editor

            pnlNPCEditor.AddWidget(lblName);
            pnlNPCEditor.AddWidget(txtName);
            pnlNPCEditor.AddWidget(lblAttackSay);
            pnlNPCEditor.AddWidget(txtAttackSay);
            pnlNPCEditor.AddWidget(lblAttackSay2);
            pnlNPCEditor.AddWidget(txtAttackSay2);
            pnlNPCEditor.AddWidget(lblAttackSay3);
            pnlNPCEditor.AddWidget(txtAttackSay3);
            pnlNPCEditor.AddWidget(lblForm);
            pnlNPCEditor.AddWidget(nudForm);
            pnlNPCEditor.AddWidget(lblSpecies);
            pnlNPCEditor.AddWidget(nudSpecies);
            pnlNPCEditor.AddWidget(lblRange);
            pnlNPCEditor.AddWidget(nudShinyChance);
            pnlNPCEditor.AddWidget(chkSpawnsAtDawn);
            pnlNPCEditor.AddWidget(chkSpawnsAtDay);
            pnlNPCEditor.AddWidget(chkSpawnsAtDusk);
            pnlNPCEditor.AddWidget(chkSpawnsAtNight);
            pnlNPCEditor.AddWidget(lblBehaviour);
            pnlNPCEditor.AddWidget(cmbBehaviour);
            pnlNPCEditor.AddWidget(lblRecruitRate);
            pnlNPCEditor.AddWidget(nudRecruitRate);

            for (int i = 0; i < lblMove.Length; i++)
            {
                pnlNPCEditor.AddWidget(lblMove[i]);
                pnlNPCEditor.AddWidget(nudMove[i]);
                pnlNPCEditor.AddWidget(lblMoveInfo[i]);
            }

            pnlNPCEditor.AddWidget(lblDropSelector);
            pnlNPCEditor.AddWidget(nudDropSelector);
            pnlNPCEditor.AddWidget(lblDropItemNum);
            pnlNPCEditor.AddWidget(nudDropItemNum);
            pnlNPCEditor.AddWidget(lblDropItemAmount);
            pnlNPCEditor.AddWidget(nudDropItemAmount);
            pnlNPCEditor.AddWidget(lblDropItemChance);
            pnlNPCEditor.AddWidget(nudDropItemChance);
            pnlNPCEditor.AddWidget(lblDropItemTag);
            pnlNPCEditor.AddWidget(txtDropItemTag);
            pnlNPCEditor.AddWidget(btnEditorCancel);
            pnlNPCEditor.AddWidget(btnEditorOK);

            #endregion

            this.AddWidget(pnlNPCList);
            this.AddWidget(pnlNPCEditor);

            RefreshNPCList();
            this.LoadComplete();
        }
Пример #44
0
 public ChartManager(CartesianChart ChartLeft, CartesianChart ChartRight, ListBox Chooser)
 {
     this.Left  = new ChartInstance(ChartLeft, Chooser);
     this.Right = new ChartInstance(ChartRight, Chooser);
 }
Пример #45
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context != null && provider != null && context.Instance != null && context.PropertyDescriptor != null)
            {
                IWindowsFormsEditorService service = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
                if (service != null)
                {
                    int rate;
                    try
                    {
                        rate = (int)value;
                    }
                    catch
                    {
                        rate = 22050;
                    }
                    ListBox list = new ListBox();
                    list.Items.Add("8 kHz");
                    list.Items.Add("11.025 kHz");
                    list.Items.Add("22.05 kHz");
                    list.Items.Add("44.1 kHz");
                    if (rate == 8000)
                    {
                        list.SelectedIndex = 0;
                    }
                    else if (rate == 11025)
                    {
                        list.SelectedIndex = 1;
                    }
                    else if (rate == 22050)
                    {
                        list.SelectedIndex = 2;
                    }
                    else if (rate == 44100)
                    {
                        list.SelectedIndex = 3;
                    }

                    list.Tag       = service;
                    list.Click    += new EventHandler(list_Click);
                    list.KeyPress += new KeyPressEventHandler(list_KeyPress);
                    service.DropDownControl(list);
                    if (list.SelectedIndex >= 0)
                    {
                        if (list.SelectedIndex == 0)
                        {
                            value = 8000;
                        }
                        else if (list.SelectedIndex == 1)
                        {
                            value = 11025;
                        }
                        else if (list.SelectedIndex == 2)
                        {
                            value = 22050;
                        }
                        else if (list.SelectedIndex == 3)
                        {
                            value = 44100;
                        }
                    }
                }
            }
            return(value);
        }
Пример #46
0
        public static Random rand = new Random();//Random number generator
        //************************************************************************************************************************

        /// <summary>
        /// Creates a new monster in the bag
        /// </summary>
        /// <param name="player">User</param>
        /// <param name="name">Name of users monster</param>
        /// <param name="typeMonster">Boogey, BoogeyBoy, Slender, SlenderChild</param>
        public static void CreatePlayerMonster(ref Player player, string name, string typeMonster, ref ListBox lb) //Creates monster and related actions
        {
            lb.Height += lb.ItemHeight;
            player.MonsterCount++;//increases ammount of monsters.
            switch (typeMonster)
            {
            case "Boogey":
                player.bagMonsters[player.MonsterCount - 1] = new Boogey(name);
                break;

            case "Boogey Boy":
                player.bagMonsters[player.MonsterCount - 1] = new BoogeyChild(name);
                break;

            case "Slender":
                player.bagMonsters[player.MonsterCount - 1] = new Slender(name);
                break;

            case "Slender Girl":
                player.bagMonsters[player.MonsterCount - 1] = new SlenderGirl(name);
                break;
            }



            lb.Items.Add(player.bagMonsters[player.MonsterCount - 1].Type);// new monster in the bag
        }
Пример #47
0
 public Client(ListBox listbox, StreamWriter sw)
 {
     this.listbox = listbox;
     this.sw      = sw;
 }
Пример #48
0
        //LOAD CART METHOD
        private void loadCart(string orderID, string orderNumber)
        {
            ListBox totalPrice = new ListBox();
            string  item;
            double  sum = 0;

            try
            {
                connection();

                cmd            = new MySqlCommand("SELECT list_item_id, product_id, product_name, quantity_sold, price FROM list_item_view WHERE order_id = '" + orderID + "' AND order_number = '" + orderNumber + "'", con);
                cmd.Connection = con;
                dr             = cmd.ExecuteReader();

                //CHECK DATA READER FOR ROWS

                string tableData = "";
                int    i         = 0;

                while (dr.Read())
                {
                    totalPrice.Items.Add(dr["price"].ToString());


                    //POPULATE TABLE WITH DATA FROM DB
                    tableData += "<tr>";
                    tableData += "<td class=" + "'text-center'" + ">" + dr["product_name"].ToString() + "</td>";
                    tableData += "<td class=" + "'text-center'" + ">" + dr["quantity_sold"].ToString() + "</td>";
                    tableData += "<td class=" + "'text-center'" + ">" + dr["price"].ToString() + "</td>";

                    //ENCRYPT DATA IN URL
                    string strURLData = EncryptQueryString(string.Format("itemID={0}&OrderID={1}&OrderNumber={2}&ProductID={3}&OrderQuantity={4}", dr["list_item_id"], lblOrderID.Text, lblSubOrderNum.Text,
                                                                         dr["product_id"].ToString(), dr["quantity_sold"].ToString()));
                    string delURLData = EncryptQueryString(string.Format("itemID={0}&OrderID={1}&OrderNumber={2}&ProductName={3}", dr["list_item_id"], lblOrderID.Text, lblSubOrderNum.Text,
                                                                         dr["product_name"].ToString()));

                    tableData += "      <td class=" + "'text-center'" + ">";
                    tableData += "          <a class=" + "'btn btn-primary'" + " href=edit-order-item.aspx?" + strURLData + " title=" + "'Edit Order Item'" + " > ";
                    tableData += "              <i class=" + "'glyph-icon icon-pencil'" + "></i>";
                    tableData += "          </a>";
                    tableData += "          <a class=" + "'btn btn-danger'" + " href=delete-order-item.aspx?" + delURLData + " title=" + "'Delete Order Item'" + ">";
                    tableData += "              <i class=" + "'glyph-icon icon-trash-o'" + "></i>";
                    tableData += "          </a>";
                    tableData += "      </td>";

                    tableData += "</tr>";
                    tblOrderItems.InnerHtml = tableData;
                    i += 1;
                }

                //COUNT NUMBER OF ITEMS IN CART
                int orderCount = totalPrice.Items.Count;

                //SET CSS CLASS AND INNER HTML OF CART BOX HEADER & ORDER COUNT BADGE
                string spanData = "";
                spanData += "<i class=" + "'glyph-icon icon-shopping-cart'" + "></i>";
                spanData += "Cart";

                if (orderCount != 0)
                {
                    spanData += "<span class=" + "'bs-badge badge-info float-right'" + ">";
                    spanData += orderCount.ToString();
                    spanData += "</span>";
                }

                boxHeader.InnerHtml = spanData;

                //LOOP THROUGH LISTBOX ITEMS AND CALCULATE THE TOTAL COST OF ORDER
                for (int j = 0; j < totalPrice.Items.Count; j++)
                {
                    item = totalPrice.Items[j].ToString();
                    sum += Convert.ToDouble(item);
                }

                lblSum.Text = sum.ToString("#,0.00");

                lblTotalCost.Text = "TOTAL: GHȻ " + sum.ToString("#,0.00");


                //CHECK IF TOTAL COST LABEL CONTAINS TEXT AND SHOW DIV
                if (lblTotalCost.Text != "TOTAL: GHȻ 0.00")
                {
                    divCheckOut.Visible = true;
                }
                else
                {
                    divCheckOut.Visible = false;
                }
            }
            catch (Exception ex)
            {
                alertErrorPanel.Visible = true;
                alertErrorTitle.Text    = Utils.errorTitle;
                alertErrorMessage.Text  = ex.Message;
            }
            finally
            {
                con.Close();
            }
        }
Пример #49
0
 public static void Flush(ListBox l, List <T> list)
 {
     list.Clear();
     l.Items.Clear();
     l.Items.Refresh();
 }
Пример #50
0
 public AddRecipesWindow(PantryManager PantryM, ListBox MyRecipe)
 {
     InitializeComponent();
     PM = PantryM;
     MR = MyRecipe;
 }
Пример #51
0
        private void listBox1_DrawItem(object sender, DrawItemEventArgs e)
        {
            if (e.Index == -1)
            {
                return;
            }

            // Get the ListBox and the item.
            ListBox lst = sender as ListBox;
            string  txt = "";

            // Draw the background.
            e.DrawBackground();

            // See if the item is selected.
            Brush br;

            if ((e.State & DrawItemState.Selected) == DrawItemState.Selected && lst.SelectionMode != SelectionMode.None)
            {
                br = SystemBrushes.HighlightText;
            }
            else
            {
                //test
                e.Graphics.FillRectangle(Brushes.White, e.Bounds);
                br = new SolidBrush(ForeColor);
                //br = new SolidBrush(e.ForeColor);
            }

            //Draw area
            float x      = e.Bounds.Left + ItemMargin;
            float y      = e.Bounds.Top + ItemMargin;
            float width  = e.Bounds.Width - ItemMargin * 2;
            float height = Font.Height;// (e.Bounds.Height - ItemMargin * 2) / 2;

            RectangleF layout_rect = new RectangleF(x, y, width, height);

            DataRowView SaveDR = (DataRowView)lst.Items[e.Index];

            //Original name
            txt = SaveDR["saveName"].ToString();

            FontStyle NameFS = FontStyle.Regular;

            if ((byte)SaveDR["saveType"] == 2)
            {
                NameFS = FontStyle.Bold;
            }
            else if ((byte)SaveDR["saveType"] == 4)
            {
                NameFS = FontStyle.Bold | FontStyle.Strikeout;
            }

            Font NameFnt = new Font(Font, NameFS);

            //Size size = TextRenderer.MeasureText(txt, NameFnt);
            ///.ItemHeight = (int)(ItemHeight / 2 + 2 * ItemMargin);

            // Draw the text.
            e.Graphics.DrawString(txt, NameFnt, br, layout_rect);

            y           = y + height + ItemMargin;
            layout_rect = new RectangleF(x, y, width, height);
            NameFnt     = new Font(NameFnt.FontFamily, NameFnt.Size - 1);

            e.Graphics.DrawString(SaveDR["saveDateTime"].ToString(), NameFnt, br, layout_rect);

            // Draw the focus rectangle if appropriate.
            e.DrawFocusRectangle();
        }
Пример #52
0
 private EventDimensionSelector GetDimensionSelectorByListBox(ListBox listBox)
 {
     return(_listOfDimensionSelectors.FirstOrDefault(dimSelector =>
                                                     Equals(dimSelector.DimensionContentFilter, listBox)));
 }
Пример #53
0
        public ImportViewModel(UIElement element, UIElement productsUI, UIElement selectedUI, StackPanel spProductTypeList, ScrollViewer scrollViewerProducts, ListBox lbSelectedList, UniformGrid ugRequest)
        {
            this._element    = element;
            this._selectedUI = selectedUI;

            this.Products = new ProductsViewModel(productsUI, spProductTypeList, scrollViewerProducts, true);
            this.Products.ProductChange           = ProductChange;
            this.Products.DetectProductIsSelected = DetectProductIsSelected;
            this.Products.Operate = OperateDetails;


            this.Selected          = new SelectedViewModel(selectedUI, lbSelectedList);
            this.Selected.Save     = Save;
            this.Selected.Checkout = Checkout;
            this.Selected.IsImport = true;


            this.Request         = new RequestViewModel(element, ugRequest);
            this._lbSelectedList = lbSelectedList;

            this.ChangePrice = new ChangePriceViewModel(element, ReCalc);
            this.ChangeCount = new ChangeCountViewModel(element, ReCalc);

            this.Search = new SearchViewModel(element, AddProduct);


            // 添加处理事件
            this._element.AddHandler(PublicEvents.BoxEvent, new RoutedEventHandler(HandleBox), true);
        }
Пример #54
0
        public async Task BtnNewPod(string url, ComboBox comboFrekvens, ComboBox comboCategory, ListView podcast, ListBox lbAvsnitt, TextBox txtBoxURL)
        {
            try
            {
                var serializer = new Serializer();
                var validation = new Validation();
                if (validation.tfInteTomt(txtBoxURL))
                {
                    lbAvsnitt.Items.Clear();
                    var syndicationFeed = LoadFeed(CreateXmlReader(url));
                    int i = Count(syndicationFeed);

                    //subitems varje listviewitem har, vissa som url osv är osynliga i listviewen men kan ändå hämtas
                    string[] row = { i.ToString(),                          syndicationFeed.Title.Text, comboFrekvens.SelectedItem.ToString(),
                                     comboCategory.SelectedItem.ToString(), url,                        DateTime.Now.ToString() };

                    await Task.Delay(50);

                    //adda row samt serializera den
                    AddContent(podcast, AddContent(row));
                    serializer.EveryRow(serializer.SerializeListView(row), serializer.FeedFile);
                    CreateXmlReader(url).Close();
                    txtBoxURL.Clear();
                }
            }
            catch (System.IO.FileNotFoundException)
            {
                MessageBox.Show("Vänligen skriv in en giltig rss fil");
                txtBoxURL.Clear();
            }
            catch (NullReferenceException)
            {
                MessageBox.Show("Vänligen välj en giltig kategori");
            }
        }
Пример #55
0
        private void ButtonAddDiceType_Click(object sender, EventArgs e)
        {
            ButtonNewLocations(offset);

            // Set the Settings for new widgets.
            comboBox = new ComboBox
            {
                Name      = "ComboBoxDiceSides" + Convert.ToString(addDiceTypeCount),
                BackColor = ComboBoxDiceSides.BackColor,
                Font      = new Font(ComboBoxDiceSides.Font.Name, ComboBoxDiceSides.Font.Size),
                Text      = ComboBoxDiceSides.Text,
                Size      = ComboBoxDiceSides.Size,
                Location  = new Point(ComboBoxDiceSides.Location.X, ComboBoxDiceSides.Location.Y + multiplicatorLocationY)
            };

            textBox = new TextBox
            {
                Name        = "TextboxDiceAmount" + Convert.ToString(addDiceTypeCount),
                BackColor   = TextboxDiceAmount.BackColor,
                BorderStyle = TextboxDiceAmount.BorderStyle,
                Font        = new Font(TextboxDiceAmount.Font.Name, 16F),
                TextAlign   = TextboxDiceAmount.TextAlign,
                Anchor      = TextboxDiceAmount.Anchor,
                Size        = TextboxDiceAmount.Size,
                Location    = new Point(TextboxDiceAmount.Location.X, ComboBoxDiceSides.Location.Y + multiplicatorLocationY)
            };

            listBox = new ListBox
            {
                Name        = "ListboxResultOutput" + Convert.ToString(addDiceTypeCount),
                BackColor   = ListboxResultOutput.BackColor,
                ForeColor   = ListboxResultOutput.ForeColor,
                BorderStyle = ListboxResultOutput.BorderStyle,
                Font        = new Font(ListboxResultOutput.Font.Name, ListboxResultOutput.Font.Size),
                Size        = new Size(ListboxResultOutput.Size.Width, 30),
                Location    = new Point(ListboxResultOutput.Location.X, ListboxResultOutput.Location.Y + multiplicatorLocationY)
            };

            // Add items for the 'newComboBox'.
            for (int i = 0; i < ComboBoxDiceSides.Items.Count; i++)
            {
                comboBox.Items.Add(ComboBoxDiceSides.Items[i]);
            }

            // Add widgets.
            Controls.Add(comboBox);
            Controls.Add(textBox);
            Controls.Add(listBox);

            // Set new moving position for widgets.
            addDiceTypeCount++;
            multiplicatorLocationY += offset;

            // By one dice type, disable remove button. By four dice type, disable add button. Otherwise enable all buttons.
            diceTypes++;

            if (diceTypes == 1)
            {
                ButtonRemoveDiceType.Enabled = false;
            }
            else if (diceTypes == 5)
            {
                ButtonAddDiceType.Enabled = false;
            }
            else
            {
                ButtonRemoveDiceType.Enabled = true;
                ButtonAddDiceType.Enabled    = true;
            }
        }
Пример #56
0
        public void Description(string url, SyndicationFeed syndicationFeed, ListView podcast, ListBox lbAvsnitt, TextBox txtBoxDescription)
        {
            //ta url från selecteditem, loada urlen i ett xmldocument
            url = podcast.SelectedItems[0].SubItems[4].Text;
            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.Load(url);
            //gå ner till description taggen
            XmlNodeList description = xmlDocument.SelectNodes("//rss/channel/item/description");

            var i = lbAvsnitt.SelectedIndex;

            txtBoxDescription.Clear();
            //skriv ut description taggen baserat på selectedindex i avsnitt, regex pga <p> kom med först
            txtBoxDescription.Text = (Regex.Replace(description[i].InnerText, @"<.*?>", ""));
        }
Пример #57
0
 public static void RefreshItems(this ListBox lb)
 {
     typeof(ListBox).InvokeMember("RefreshItems", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.InvokeMethod, null, lb, new object[] { });
 }
Пример #58
0
 public Internallogger(ListBox log)
 {
     _log = log;
 }
Пример #59
0
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources        = new System.ComponentModel.ComponentResourceManager(typeof(TextForm));
            Syncfusion.Windows.Forms.MetroColorTable       metroColorTabel1 = new Syncfusion.Windows.Forms.MetroColorTable();
            this.richTextBox1          = new System.Windows.Forms.RichTextBox();
            this.childFrameBarManager1 = new Syncfusion.Windows.Forms.Tools.XPMenus.ChildFrameBarManager(this);
            this.bar1                   = new Syncfusion.Windows.Forms.Tools.XPMenus.Bar(this.childFrameBarManager1, "Edit");
            this.barItem1               = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem();
            this.barItem2               = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem();
            this.barItem3               = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem();
            this.barItem4               = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem();
            this.barItem5               = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem();
            this.bar2                   = new Syncfusion.Windows.Forms.Tools.XPMenus.Bar(this.childFrameBarManager1, "Format");
            this.comboBoxBarItem1       = new Syncfusion.Windows.Forms.Tools.XPMenus.ComboBoxBarItem();
            this.dropDownBarItem1       = new Syncfusion.Windows.Forms.Tools.XPMenus.DropDownBarItem();
            this.popupControlContainer1 = new Syncfusion.Windows.Forms.PopupControlContainer();
            this.colorUIControl1        = new Syncfusion.Windows.Forms.ColorUIControl();
            this.comboBoxBarItem2       = new Syncfusion.Windows.Forms.Tools.XPMenus.ComboBoxBarItem();
            this.bar3                   = new Syncfusion.Windows.Forms.Tools.XPMenus.Bar(this.childFrameBarManager1, "MainMenu");
            this.parentBarItem1         = new Syncfusion.Windows.Forms.Tools.XPMenus.ParentBarItem();
            this.parentBarItem2         = new Syncfusion.Windows.Forms.Tools.XPMenus.ParentBarItem();
            this.comboBoxBarItem3       = new Syncfusion.Windows.Forms.Tools.XPMenus.ComboBoxBarItem();
            this.listBox1               = new System.Windows.Forms.ListBox();
            this.imageList1             = new System.Windows.Forms.ImageList(this.components);
            this.parentBarItem3         = new Syncfusion.Windows.Forms.Tools.XPMenus.ParentBarItem();
            this.popupMenusManager1     = new Syncfusion.Windows.Forms.Tools.XPMenus.PopupMenusManager(this.components);
            this.popupMenu2             = new Syncfusion.Windows.Forms.Tools.XPMenus.PopupMenu(this.components);
            ((System.ComponentModel.ISupportInitialize)(this.childFrameBarManager1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.comboBoxBarItem1)).BeginInit();
            this.popupControlContainer1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.comboBoxBarItem2)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.comboBoxBarItem3)).BeginInit();
            this.SuspendLayout();
            //
            // richTextBox1
            //
            this.richTextBox1.Dock      = System.Windows.Forms.DockStyle.Fill;
            this.richTextBox1.Font      = new System.Drawing.Font("Calibri", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.richTextBox1.ForeColor = System.Drawing.Color.Crimson;
            this.richTextBox1.Location  = new System.Drawing.Point(0, 0);
            this.richTextBox1.Name      = "richTextBox1";
            this.richTextBox1.Size      = new System.Drawing.Size(442, 440);
            this.richTextBox1.TabIndex  = 14;
            this.richTextBox1.Text      = resources.GetString("richTextBox1.Text");
            this.popupMenusManager1.SetXPContextMenu(this.richTextBox1, this.popupMenu2);
            //
            // childFrameBarManager1
            //
#if !NETCORE
            this.childFrameBarManager1.BarPositionInfo = ((System.IO.MemoryStream)(resources.GetObject("childFrameBarManager1.BarPositionInfo")));
#endif
            this.childFrameBarManager1.Bars.Add(this.bar1);
            this.childFrameBarManager1.Bars.Add(this.bar2);
            this.childFrameBarManager1.Bars.Add(this.bar3);
            this.childFrameBarManager1.Categories.Add("Edit");
            this.childFrameBarManager1.Categories.Add("Format");
            this.childFrameBarManager1.Categories.Add("Popups");
            this.childFrameBarManager1.CategoriesToIgnoreInCustDialog.AddRange(new int[] {
                0
            });
            this.childFrameBarManager1.CurrentBaseFormType = "System.Windows.Forms.Form";
            this.childFrameBarManager1.Form      = this;
            this.childFrameBarManager1.ImageList = this.imageList1;
            this.childFrameBarManager1.Items.AddRange(new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem[] {
                this.parentBarItem3,
                this.comboBoxBarItem1,
                this.barItem1,
                this.barItem2,
                this.barItem3,
                this.barItem4,
                this.barItem5,
                this.comboBoxBarItem2,
                this.dropDownBarItem1,
                this.parentBarItem1,
                this.parentBarItem2,
                this.comboBoxBarItem3
            });
            this.childFrameBarManager1.Style = Syncfusion.Windows.Forms.VisualStyle.Metro;
            //
            // bar1
            //
            this.bar1.BarName  = "Edit";
            this.bar1.BarStyle = ((Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle)((((Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle.AllowQuickCustomizing | Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle.RotateWhenVertical)
                                                                                      | Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle.Visible)
                                                                                     | Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle.DrawDragBorder)));
            this.bar1.Caption = "Edit";
            this.bar1.Items.AddRange(new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem[] {
                this.barItem1,
                this.barItem2,
                this.barItem3,
                this.barItem4,
                this.barItem5
            });
            this.bar1.Manager = this.childFrameBarManager1;
            //
            // barItem1
            //
            this.barItem1.BarName            = "barItem1";
            this.barItem1.CategoryIndex      = 0;
            this.barItem1.CustomTextFont     = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.barItem1.ID                 = "biCut";
            this.barItem1.ImageIndex         = 3;
            this.barItem1.ShowToolTipInPopUp = false;
            this.barItem1.SizeToFit          = true;
            this.barItem1.Text               = "Cu&t";
            //
            // barItem2
            //
            this.barItem2.BarName            = "barItem2";
            this.barItem2.CategoryIndex      = 0;
            this.barItem2.CustomTextFont     = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.barItem2.ID                 = "biCopy";
            this.barItem2.ImageIndex         = 4;
            this.barItem2.ShowToolTipInPopUp = false;
            this.barItem2.SizeToFit          = true;
            this.barItem2.Text               = "&Copy";
            //
            // barItem3
            //
            this.barItem3.BarName            = "barItem3";
            this.barItem3.CategoryIndex      = 0;
            this.barItem3.CustomTextFont     = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.barItem3.ID                 = "biPaste";
            this.barItem3.ImageIndex         = 5;
            this.barItem3.ShowToolTipInPopUp = false;
            this.barItem3.SizeToFit          = true;
            this.barItem3.Text               = "&Paste";
            //
            // barItem4
            //
            this.barItem4.BarName            = "barItem4";
            this.barItem4.CategoryIndex      = 0;
            this.barItem4.CustomTextFont     = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.barItem4.ID                 = "biUndo";
            this.barItem4.ImageIndex         = 6;
            this.barItem4.ShowToolTipInPopUp = false;
            this.barItem4.SizeToFit          = true;
            this.barItem4.Text               = "&Undo";
            //
            // barItem5
            //
            this.barItem5.BarName            = "barItem5";
            this.barItem5.CategoryIndex      = 0;
            this.barItem5.CustomTextFont     = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.barItem5.ID                 = "biRedo";
            this.barItem5.ImageIndex         = 7;
            this.barItem5.ShowToolTipInPopUp = false;
            this.barItem5.SizeToFit          = true;
            this.barItem5.Text               = "&Redo";
            //
            // bar2
            //
            this.bar2.BarName  = "Format";
            this.bar2.BarStyle = ((Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle)((((Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle.AllowQuickCustomizing | Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle.RotateWhenVertical)
                                                                                      | Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle.Visible)
                                                                                     | Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle.DrawDragBorder)));
            this.bar2.Caption = "Format";
            this.bar2.Items.AddRange(new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem[] {
                this.comboBoxBarItem1,
                this.dropDownBarItem1,
                this.comboBoxBarItem2
            });
            this.bar2.Manager = this.childFrameBarManager1;
            //
            // comboBoxBarItem1
            //
            this.comboBoxBarItem1.BarName            = "comboBoxBarItem1";
            this.comboBoxBarItem1.CategoryIndex      = 1;
            this.comboBoxBarItem1.CustomTextFont     = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.comboBoxBarItem1.ID                 = "Editable";
            this.comboBoxBarItem1.ShowToolTipInPopUp = false;
            this.comboBoxBarItem1.SizeToFit          = true;
            this.comboBoxBarItem1.Text               = "Editable";
            //
            // dropDownBarItem1
            //
            this.dropDownBarItem1.BarName               = "dropDownBarItem1";
            this.dropDownBarItem1.CategoryIndex         = 1;
            this.dropDownBarItem1.CustomTextFont        = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.dropDownBarItem1.ID                    = "Font DropDown";
            this.dropDownBarItem1.ImageIndex            = 8;
            this.dropDownBarItem1.PopupControlContainer = this.popupControlContainer1;
            this.dropDownBarItem1.ShowToolTipInPopUp    = false;
            this.dropDownBarItem1.SizeToFit             = true;
            this.dropDownBarItem1.Text                  = "Font DropDown";
            //
            // popupControlContainer1
            //
            this.popupControlContainer1.Controls.Add(this.colorUIControl1);
            this.popupControlContainer1.Location = new System.Drawing.Point(192, 120);
            this.popupControlContainer1.Name     = "popupControlContainer1";
            this.popupControlContainer1.Size     = new System.Drawing.Size(208, 200);
            this.popupControlContainer1.TabIndex = 15;
            this.popupControlContainer1.Visible  = false;
            //
            // colorUIControl1
            //
            this.colorUIControl1.BackColor             = System.Drawing.SystemColors.Control;
            this.colorUIControl1.Dock                  = System.Windows.Forms.DockStyle.Fill;
            this.colorUIControl1.Flag                  = false;
            this.colorUIControl1.Font                  = new System.Drawing.Font("Calibri", 9.75F);
            this.colorUIControl1.Location              = new System.Drawing.Point(0, 0);
            this.colorUIControl1.MetroColor            = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(158)))), ((int)(((byte)(218)))));
            this.colorUIControl1.MetroForeColor        = System.Drawing.Color.White;
            this.colorUIControl1.Name                  = "colorUIControl1";
            metroColorTabel1.ArrowChecked              = System.Drawing.Color.Black;
            metroColorTabel1.ArrowNormal               = System.Drawing.Color.Gray;
            metroColorTabel1.ArrowPushed               = System.Drawing.Color.Black;
            metroColorTabel1.ScrollerBackground        = System.Drawing.Color.White;
            metroColorTabel1.ThumbChecked              = System.Drawing.Color.Black;
            metroColorTabel1.ThumbNormal               = System.Drawing.Color.Gray;
            metroColorTabel1.ThumbPushed               = System.Drawing.Color.Black;
            this.colorUIControl1.ScrollMetroColorTable = metroColorTabel1;
            this.colorUIControl1.SelectedColorGroup    = Syncfusion.Windows.Forms.ColorUISelectedGroup.CustomColors;
            this.colorUIControl1.Size                  = new System.Drawing.Size(208, 200);
            this.colorUIControl1.TabIndex              = 1;
            this.colorUIControl1.Text                  = "colorUIControl1";
            //
            // comboBoxBarItem2
            //
            this.comboBoxBarItem2.BarName            = "comboBoxBarItem2";
            this.comboBoxBarItem2.CategoryIndex      = 1;
            this.comboBoxBarItem2.CustomTextFont     = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.comboBoxBarItem2.ID                 = "ChoiceList";
            this.comboBoxBarItem2.ShowToolTipInPopUp = false;
            this.comboBoxBarItem2.SizeToFit          = true;
            this.comboBoxBarItem2.Text               = "ChoiceList";
            //
            // bar3
            //
            this.bar3.BarName  = "MainMenu";
            this.bar3.BarStyle = ((Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle)((((Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle.AllowQuickCustomizing | Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle.IsMainMenu)
                                                                                      | Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle.Visible)
                                                                                     | Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle.DrawDragBorder)));
            this.bar3.Caption = "MainMenu";
            this.bar3.Items.AddRange(new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem[] {
                this.parentBarItem1,
                this.parentBarItem2,
                this.comboBoxBarItem3
            });
            this.bar3.Manager = this.childFrameBarManager1;
            //
            // parentBarItem1
            //
            this.parentBarItem1.BarName        = "parentBarItem1";
            this.parentBarItem1.CategoryIndex  = 2;
            this.parentBarItem1.CustomTextFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.parentBarItem1.ID             = "Edit";
            this.parentBarItem1.Items.AddRange(new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem[] {
                this.barItem1,
                this.barItem2,
                this.barItem3,
                this.barItem4,
                this.barItem5
            });
            this.parentBarItem1.MergeOrder         = 1;
            this.parentBarItem1.MetroColor         = System.Drawing.Color.LightSkyBlue;
            this.parentBarItem1.ShowToolTipInPopUp = false;
            this.parentBarItem1.SizeToFit          = true;
            this.parentBarItem1.Style = Syncfusion.Windows.Forms.VisualStyle.Metro;
            this.parentBarItem1.Text  = "Edit";
            //
            // parentBarItem2
            //
            this.parentBarItem2.BarName        = "parentBarItem2";
            this.parentBarItem2.CategoryIndex  = 2;
            this.parentBarItem2.CustomTextFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.parentBarItem2.ID             = "Format";
            this.parentBarItem2.Items.AddRange(new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem[] {
                this.comboBoxBarItem1,
                this.comboBoxBarItem2,
                this.dropDownBarItem1
            });
            this.parentBarItem2.MergeOrder         = 3;
            this.parentBarItem2.MetroColor         = System.Drawing.Color.LightSkyBlue;
            this.parentBarItem2.ShowToolTipInPopUp = false;
            this.parentBarItem2.SizeToFit          = true;
            this.parentBarItem2.Style = Syncfusion.Windows.Forms.VisualStyle.Metro;
            this.parentBarItem2.Text  = "Format";
            //
            // comboBoxBarItem3
            //
            this.comboBoxBarItem3.BarName       = "comboBoxBarItem3";
            this.comboBoxBarItem3.CategoryIndex = 1;
            this.comboBoxBarItem3.ChoiceList.AddRange(new string[] {
                "Default",
                "Office2003",
                "VS2005",
                "Office2007Blue",
                "Office2007Black",
                "Office2007Silver",
                "Office2007Managed",
                "Offic2007Outlook",
                "Metro"
            });
            this.comboBoxBarItem3.ID                 = "BarItem_1";
            this.comboBoxBarItem3.ListBox            = this.listBox1;
            this.comboBoxBarItem3.MinWidth           = 120;
            this.comboBoxBarItem3.ShowToolTipInPopUp = false;
            this.comboBoxBarItem3.SizeToFit          = true;
            this.comboBoxBarItem3.Text               = "ContextMenuStyle";
            //
            // listBox1
            //
            this.listBox1.FormattingEnabled = true;
            this.listBox1.Items.AddRange(new object[] {
                "Default",
                "Office2003",
                "VS2005",
                "Office2007Blue",
                "Office2007Black",
                "Office2007Silver",
                "Office2007Managed",
                "Offic2007Outlook",
                "Metro"
            });
            this.listBox1.Location = new System.Drawing.Point(0, 0);
            this.listBox1.Name     = "listBox1";
            this.listBox1.Size     = new System.Drawing.Size(199, 95);
            this.listBox1.TabIndex = 20;
            //
            // imageList1
            //
            this.imageList1.ImageStream      = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
            this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
            this.imageList1.Images.SetKeyName(0, "");
            this.imageList1.Images.SetKeyName(1, "");
            this.imageList1.Images.SetKeyName(2, "");
            this.imageList1.Images.SetKeyName(3, "");
            this.imageList1.Images.SetKeyName(4, "");
            this.imageList1.Images.SetKeyName(5, "");
            this.imageList1.Images.SetKeyName(6, "");
            this.imageList1.Images.SetKeyName(7, "");
            this.imageList1.Images.SetKeyName(8, "");
            //
            // parentBarItem3
            //
            this.parentBarItem3.BarName            = "parentBarItem3";
            this.parentBarItem3.CategoryIndex      = 0;
            this.parentBarItem3.ID                 = "BarItem";
            this.parentBarItem3.MetroColor         = System.Drawing.Color.LightSkyBlue;
            this.parentBarItem3.ShowToolTipInPopUp = false;
            this.parentBarItem3.SizeToFit          = true;
            this.parentBarItem3.Text               = "Edit";
            //
            // popupMenusManager1
            //
            this.popupMenusManager1.ParentForm = this;
            //
            // popupMenu2
            //
            this.popupMenu2.ParentBarItem = this.parentBarItem1;
            this.popupMenu2.BeforePopup  += new Syncfusion.Windows.Forms.CancelMouseEventHandler(this.popupMenu2_BeforePopup);
            //
            // TextForm
            //
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize        = new System.Drawing.Size(442, 440);
            this.Controls.Add(this.listBox1);
            this.Controls.Add(this.popupControlContainer1);
            this.Controls.Add(this.richTextBox1);
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.Name = "TextForm";
            this.Text = "Textpad";
            ((System.ComponentModel.ISupportInitialize)(this.childFrameBarManager1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.comboBoxBarItem1)).EndInit();
            this.popupControlContainer1.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.comboBoxBarItem2)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.comboBoxBarItem3)).EndInit();
            this.ResumeLayout(false);
        }
 public static bool NoItemSelected(ListBox lstBx)
 {
     return(lstBx.SelectedItem is null);
 }