Ejemplo n.º 1
1
	public InstructionsForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Location = new Point (8, 8);
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Expected result on start-up:{0}{0}" +
			"1. The background color of the Form is blue and does not show " +
			"any distortions.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// InstructionsForm
		// 
		ClientSize = new Size (330, 120);
		Location = new Point (600, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "Instructions - bug #81721";
	}
        public PageLocomotiveProperties(Locomotive locomotive)
        {
            this.locomotive = locomotive;

            StackPanel panel = new StackPanel(Orientation.Vertical);
            Child = panel;

            tabs = new TabControl();
            tabs.AddTab(CreateTabCommon());
            tabs.AddTab(CreateTabFunctions());
            panel.Children.Add(tabs);

            StackPanel panelBottom = new StackPanel(Orientation.Horizontal);
            panelBottom.HorizontalAlignment = HorizontalAlignment.Center;
            panel.Children.Add(panelBottom);

            Button btnSave = new Button(Program.FontRegular, "Сохранить", Resources.GetBitmap(Resources.BitmapResources.Save), Program.ButtonTextColor);
            btnSave.SetMargin(2);
            btnSave.VerticalAlignment = VerticalAlignment.Bottom;
            btnSave.HorizontalAlignment = HorizontalAlignment.Center;
            btnSave.Background = Program.ButtonBackground;
            btnSave.Clicked += new EventHandler(btnSave_Clicked);
            panelBottom.Children.Add(btnSave);

            tabs.Height = panel.Parent.Height - btnSave.Height - 8;

            ucWriteBlock writeBlock = new ucWriteBlock();
            writeBlock.VerticalAlignment = VerticalAlignment.Bottom;
            writeBlock.HorizontalAlignment = HorizontalAlignment.Center;
            writeBlock.SetMargin(5, 0, 0, 0);
            writeBlock.WriteClicked += new EventHandler(writeBlock_WriteClicked);
            panelBottom.Children.Add(writeBlock);

            LoadValues();
        }
Ejemplo n.º 3
0
	public InstructionsForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Steps to execute:{0}{0}" +
			"1. Select an item in the combobox.{0}{0}" +
			"Expected result:{0}{0}" +
			"1. A new form is displayed.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// InstructionsForm
		// 
		ClientSize = new Size (300, 150);
		Location = new Point (600, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "Instructions - bug #352830";
	}
Ejemplo n.º 4
0
	public InstructionsForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Steps to execute:{0}{0}" +
			"1. Resize the form both horizontally and vertically.{0}{0}" +
			"Expected result:{0}{0}" +
			"1. The textbox resizes both horizontally and vertically.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// InstructionsForm
		// 
		ClientSize = new Size (300, 140);
		Location = new Point (600, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "Instructions - bug #82549";
	}
Ejemplo n.º 5
0
	public InstructionsForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Steps to execute:{0}{0}" +
			"1. Press the Alt+F4 key.{0}{0}" +
			"Expected result:{0}{0}" +
			"1. The application exits.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// InstructionsForm
		// 
		ClientSize = new Size (300, 140);
		Location = new Point (600, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "Instructions - bug #358340";
	}
Ejemplo n.º 6
0
	public InstructionsForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Steps to execute:{0}{0}" +
			"1. Type \"12345\" and the hit the Enter key.{0}{0}" +
			"Expected result:{0}{0}" +
			"1. The character \"3\" and the Enter key are ignored.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// InstructionsForm
		// 
		ClientSize = new Size (300, 155);
		Location = new Point (600, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "Instructions - bug #340078";
	}
Ejemplo n.º 7
0
	public InstructionsForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Expected result on start-up:{0}{0}" +
			"1. The text \"2\" is displayed.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// InstructionsForm
		// 
		ClientSize = new Size (400, 90);
		Location = new Point (550, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "Instructions - bug #80792";
	}
Ejemplo n.º 8
0
	public InstructionsForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Expected result on start-up:{0}{0}" +
			"1. The form icon and the text \"My Computer\" are " +
			"displayed as content of the first panel in the " +
			"StatusBar.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// InstructionsForm
		// 
		ClientSize = new Size (300, 100);
		Location = new Point (600, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "Instructions - bug #82487";
	}
Ejemplo n.º 9
0
    public static void AddPage(TabControl tabControl, string tapName, Page page, bool maxSize = true)
    {
        if (maxSize)
        {
            page.Width = double.NaN;
            page.Height = double.NaN;
            page.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
            page.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
        }

        Frame frame = new Frame();
        if (maxSize)
        {
            frame.Width = double.NaN;
            frame.Height = double.NaN;
            frame.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
            frame.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
        }

        frame.Content = page;
        TabItem tabItem = new TabItem();
        tabItem.Header = tapName;
        tabItem.Content = frame;
        tabControl.Items.Add(tabItem);
    }
Ejemplo n.º 10
0
	public InstructionsForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Expected result on start-up:{0}{0}" +
			"1. A window measuring 400x600 pixels is displayed at {{X=100,Y=100}}.{0}{0}" +
			"2. The background is possibly messed-up.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// InstructionsForm
		// 
		ClientSize = new Size (400, 120);
		Location = new Point (550, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "Instructions - bug #80817";
	}
Ejemplo n.º 11
0
        private void Update()
        {
            if (Views.Count == 0) Content = null;
            else
            {
                if(Views.Count == 1)
                {
                    var viewKey = Views.Keys.First();
                    Content = Views[viewKey];
                }
                if(Views.Count > 1)
                {
                    var tabControl = new TabControl();
                    foreach(var key in Views.Keys)
                    {
                        var view = Views[key];
                        tabControl.Items.Add(new TabItem { Header = key.ToString(), Content = view });
                    }
                    Content = tabControl;
                }
            }

            foreach(var key in Views.Keys)
            {
                Views[key].DataContext = DataContext;
            }
        }
Ejemplo n.º 12
0
	public InstructionsForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Expected result on startup:{0}{0}" +
			"1. A star-like shape is drawn.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// InstructionsForm
		// 
		ClientSize = new Size (310, 100);
		Location = new Point (600, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "Instructions - bug #338233";
	}
Ejemplo n.º 13
0
    public static void AddPages(TabControl tabControl, string tabName, bool maxSize, params Page[] pages)
    {
        Grid grid = new Grid();
        grid.Width = double.NaN;
        grid.Height = double.NaN;
        grid.Margin = new Thickness(0);
        grid.VerticalAlignment = VerticalAlignment.Top;

        if (maxSize)
        {
            grid.HorizontalAlignment = HorizontalAlignment.Stretch;
            grid.VerticalAlignment = VerticalAlignment.Stretch;
        }

        int index = 0;
        foreach (var item in pages)
        {
            ColumnDefinition col = new ColumnDefinition();
            col.Width = GridLength.Auto;
            grid.ColumnDefinitions.Add(col);
            SetPageToGrid(item, grid, 0, index);
            index++;
        }

        TabItem tabItem = new TabItem();
        tabItem.Header = tabName;
        tabItem.Content = grid;
        tabControl.Items.Add(tabItem);
    }
Ejemplo n.º 14
0
	public InstructionsForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Steps to execute:{0}{0}" +
			"1. Click the Invalidate button twice.{0}{0}" +
			"Expected result:{0}{0}" +
			"1. The color of the ellipse changes on each click.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// InstructionsForm
		// 
		ClientSize = new Size (300, 140);
		Location = new Point (600, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "Instructions - bug #82838";
	}
Ejemplo n.º 15
0
	public MainForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _tabGeneral
		// 
		_tabGeneral = new TabPage ();
		_tabGeneral.TabIndex = 0;
		_tabGeneral.Text = "General";
		_tabControl.Controls.Add (_tabGeneral);
		// 
		// _tabAlerts
		// 
		_tabAlerts = new TabPage ();
		_tabAlerts.TabIndex = 1;
		_tabAlerts.Text = "Alerts";
		_tabControl.Controls.Add (_tabAlerts);
		// 
		// MainForm
		// 
		ClientSize = new Size (300, 100);
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #82229";
		Load += new EventHandler (MainForm_Load);
	}
Ejemplo n.º 16
0
	public InstructionsForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Expected result on start-up:{0}{0}" +
			"1. The application hardly uses any processor time.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// InstructionsForm
		// 
		ClientSize = new Size (320, 90);
		Location = new Point (600, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "Instructions - bug #79265";
	}
Ejemplo n.º 17
0
	public InstructionsForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Expected result on start-up:{0}{0}" +
			"1. The main form is displayed fullscreen, and has no " +
			"borders or titlebar.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// InstructionsForm
		// 
		ClientSize = new Size (320, 100);
		Location = new Point (600, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "Instructions - bug #349571";
		TopMost = true;
	}
Ejemplo n.º 18
0
        public ChatWindow()
        {
            Style = "window";
            Resizable = false;
            Size = new Point(512, 140);
            MinSize = new Point(512, 140);
            MaxSize = new Point(786, 512);

            handle = new Button {
                Size = new Point(16, 16),
                Position = new Point(512 - 16, 0),
                Style = "handleNE",
                Anchor = AnchorStyles.Top | AnchorStyles.Right,
                Cursor = Cursors.SizeNESW
            };
            handle.MouseDown += handle_OnMouseDown;
            handle.MousePress += handle_OnMousePress;
            Elements.Add(handle);

            input = new TextBox {Size = new Point(100, 35), Dock = DockStyle.Bottom};
            input.TextCommit += Input_OnTextCommit;
            input.Style = "textbox";
            input.Margin = new Margin(2);
            Controls.Add(input);

            tabs = new TabControl {Dock = DockStyle.Fill};
            tabs.ButtonFrame.Size = new Point(28, 28);
            Controls.Add(tabs);

            GeneralChat = AddPage("General");
            CombatChat = AddPage("Combat");
        }
Ejemplo n.º 19
0
        public void First_Tab_Should_Be_Selected_By_Default()
        {
            TabItem selected;
            var target = new TabControl
            {
                Template = new FuncControlTemplate<TabControl>(CreateTabControlTemplate),
                Items = new[]
                {
                    (selected = new TabItem
                    {
                        Name = "first",
                        Content = "foo",
                    }),
                    new TabItem
                    {
                        Name = "second",
                        Content = "bar",
                    },
                }
            };

            target.ApplyTemplate();

            Assert.Equal(0, target.SelectedIndex);
            Assert.Equal(selected, target.SelectedItem);
        }
Ejemplo n.º 20
0
        public void TabItemIsEnabledPropertyUpdateTest()
        {
            TabControl tabControl = new TabControl();

            TabItem tabItem1 = new TabItem();
            TabItem tabItem2 = new TabItem();

            tabControl.Items.Add(tabItem1);
            tabControl.Items.Add(tabItem2);

            CreateAsyncTask(tabControl,
                () => Assert.IsTrue(tabControl.IsEnabled),
                () => Assert.IsTrue(tabItem1.IsEnabled),
                () => Assert.IsTrue(tabItem2.IsEnabled),

                () => tabItem1.IsEnabled = false,
                () => tabControl.IsEnabled = false,
                () => Assert.IsFalse(tabItem1.IsEnabled),
                () => Assert.IsFalse(tabItem2.IsEnabled),

                () => tabControl.IsEnabled = true,
                () => Assert.IsFalse(tabItem1.IsEnabled),
                () => Assert.IsTrue(tabItem2.IsEnabled)
            );

            EnqueueTestComplete();
        }
Ejemplo n.º 21
0
	public InstructionsForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Expected result on start-up:{0}{0}" +
			"1. The left checkbox is a \"normal\" checkbox.{0}{0}" +
			"1. The right checkbox is a \"button\" checkbox.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// InstructionsForm
		// 
		ClientSize = new Size (300, 110);
		Location = new Point (600, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "Instructions - bug #82657";
	}
Ejemplo n.º 22
0
        public GuiTester()
        {
            mainNavigationTabControl = new TabControl(Orientation.Vertical);

            mainNavigationTabControl.AddTab(new MenuPage(), "MenuPage");
#if true
            mainNavigationTabControl.AddTab(new TextEditPage(), "TextEditPage");
            mainNavigationTabControl.AddTab(new SplitterPage(), "SplitterPage");
            mainNavigationTabControl.AddTab(new LayoutPage(), "LayoutPage");
            mainNavigationTabControl.AddTab(new ButtonsPage(), "ButtonsPage");

            mainNavigationTabControl.AddTab(new ScrollableWidgetTestPage(), "ScrollableWidgetTestPage");
            mainNavigationTabControl.AddTab(new AnchorCenterButtonsTestPAge(), "AnchorCenterButtonsTestPAge");
            mainNavigationTabControl.AddTab(new TabPagesPage(), "TabPagesPage");
            mainNavigationTabControl.AddTab(new ListBoxPage(), "ListBoxPage");
            mainNavigationTabControl.AddTab(new ButtonAnchorTestPage(), "ButtonAnchorTestPage");

            
            mainNavigationTabControl.AddTab(new AnchorTestsPage(), "AnchorTestsPage");
            mainNavigationTabControl.AddTab(new WindowPage(), "WindowPage");

            mainNavigationTabControl.AddTab(new SliderControlsPage(), "SliderControlsPage");
            mainNavigationTabControl.AddTab(new TabPage(new FontInfoWidget(), "Fonts"), "Fonts");
#endif
            this.AddChild(mainNavigationTabControl);

            AnchorAll();
        }
Ejemplo n.º 23
0
        public void Setting_SelectedItem_Should_Set_SelectedTab()
        {
            var target = new TabControl
            {
                Template = new ControlTemplate<TabControl>(CreateTabControlTemplate),
                Items = new[]
                {
                    new TabItem
                    {
                        Name = "first",
                        Content = "foo",
                    },
                    new TabItem
                    {
                        Name = "second",
                        Content = "bar",
                    },
                }
            };

            target.ApplyTemplate();
            target.SelectedItem = target.Items.Cast<TabItem>().ElementAt(1);

            Assert.Same(target.SelectedTab, target.SelectedItem);
        }
Ejemplo n.º 24
0
	public InstructionsForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Expected result on startup:{0}{0}" +
			"1. A message box is displayed with:{0}{0}" +
			"   * several lines of 'a' characters{0}" +
			"   * a horizontally centered OK button.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// InstructionsForm
		// 
		ClientSize = new Size (300, 140);
		Location = new Point (600, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "Instructions - bug #343364";
	}
Ejemplo n.º 25
0
	public InstructionsForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Expected result on startup:{0}{0}" +
			"1. The different lines of text are displayed with " +
			"the font style they describe.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// InstructionsForm
		// 
		ClientSize = new Size (310, 100);
		Location = new Point (690, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "Instructions - bug #338207";
	}
Ejemplo n.º 26
0
	public InstructionsForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Steps to execute:{0}{0}" +
			"1. Click the Open File button.{0}{0}" +
			"Expected result:{0}{0}" +
			"1. The directory of which the files are displayed, is selected " +
			"in the \"Look in\" combobox.{0}{0}" +
			"2. In the \"Look in\" combobox, that directory is nested under " +
			"its parent directories.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// _bugDescriptionText2
		// 
		_bugDescriptionText2 = new TextBox ();
		_bugDescriptionText2.Dock = DockStyle.Fill;
		_bugDescriptionText2.Multiline = true;
		_bugDescriptionText2.Text = string.Format (CultureInfo.InvariantCulture,
			"Steps to execute:{0}{0}" +
			"1. Click the Save File button.{0}{0}" +
			"Expected result:{0}{0}" +
			"1. The directory of which the files are displayed, is selected " +
			"in the \"Save in\" combobox.{0}{0}" +
			"2. In the \"Save in\" combobox, that directory is nested under " +
			"its parent directories.",
			Environment.NewLine);
		// 
		// _tabPage2
		// 
		_tabPage2 = new TabPage ();
		_tabPage2.Text = "#2";
		_tabPage2.Controls.Add (_bugDescriptionText2);
		_tabControl.Controls.Add (_tabPage2);
		// 
		// InstructionsForm
		// 
		ClientSize = new Size (300, 200);
		Location = new Point (600, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "Instructions - bug #82385";
	}
Ejemplo n.º 27
0
	public InstructionsForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Expected result on start-up:{0}{0}" +
			"1. The background-color of the top part of the form " +
			"is blue.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// InstructionsForm
		// 
		ClientSize = new Size (300, 90);
		Location = new Point (600, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "Instructions - bug #328681";
	}
Ejemplo n.º 28
0
	public InstructionsForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Expected result on start-up:{0}{0}" +
			"1. Both parts of the form are identical.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// InstructionsForm
		// 
		ClientSize = new Size (360, 80);
		Location = new Point (600, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "Instructions - bug #81915";
	}
Ejemplo n.º 29
0
	public InstructionsForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Expected result at start-up:{0}{0}" +
			"1. A source listing with proper identation is displayed in the " +
			"RichTextBox (top) and TextBox (bottom).",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// InstructionsForm
		// 
		ClientSize = new Size (300, 150);
		Location = new Point (600, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "Instructions - bug #81482";
	}
Ejemplo n.º 30
0
	public InstructionsForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Expected result on start-up:{0}{0}" +
			"1. The label is horizontally centered at the bottom " +
			"of the form.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// InstructionsForm
		// 
		ClientSize = new Size (300, 100);
		Location = new Point (600, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "Instructions - bug #82605";
	}
Ejemplo n.º 31
0
 public TextDisplayController(TabControl tabControl)
 {
     this.tabControl = tabControl;
     Services.UserSettings.Changed += new SettingsEventHandler(UserSettings_Changed);
 }
Ejemplo n.º 32
0
        protected virtual void InitialiseControls(ICollection <Competitor> tabsToShow)
        {
            InitialiseToolStrip();

            int leftPosition = LeftBuffer;
            int topPosition  = TopBuffer;

            selectSortType = new ComboBox
            {
                Left          = leftPosition,
                Top           = topPosition,
                Width         = 125,
                FlatStyle     = global::MyFlowLayout.Properties.Settings.Default.FlatStyle,
                DropDownStyle = ComboBoxStyle.DropDownList
            };
            foreach (var sortingType in (SortType[])Enum.GetValues(typeof(SortType)))
            {
                selectSortType.Items.Add(sortingType);
            }
            selectSortType.SelectedIndex         = (int)Statistic.DefaultSortType;
            selectSortType.SelectedIndexChanged += sortType_SelectedIndexChanged;
            leftPosition += selectSortType.Width + 10;

            selectSortOrder = new ComboBox
            {
                Left          = leftPosition,
                Top           = topPosition,
                Width         = 125,
                FlatStyle     = global::MyFlowLayout.Properties.Settings.Default.FlatStyle,
                DropDownStyle = ComboBoxStyle.DropDownList
            };
            selectSortOrder.Items.AddRange(new object[] { OrderType.Ascending, OrderType.Descending });
            selectSortOrder.SelectedIndex         = (int)Statistic.DefaultOrderType;
            selectSortOrder.SelectedIndexChanged += selectSortOrder_SelectedIndexChanged;
            leftPosition += selectSortOrder.Width + 10;

            selectDisplayType = new ComboBox
            {
                Left          = leftPosition,
                Top           = topPosition,
                Width         = 125,
                FlatStyle     = global::MyFlowLayout.Properties.Settings.Default.FlatStyle,
                DropDownStyle = ComboBoxStyle.DropDownList
            };
            selectDisplayType.Items.AddRange(new object[] { DisplayType.Value, DisplayType.Percentage });
            selectDisplayType.SelectedIndex         = (int)Statistic.DefaultDisplayType;
            selectDisplayType.SelectedIndexChanged += selectDisplayType_SelectedIndexChanged;

            topPosition += selectSortType.Height + ControlSpacing;

            driverTeamResults = new TabControl
            {
                Left   = LeftBuffer,
                Top    = topPosition,
                Width  = this.Width - LeftBuffer - LeftBuffer,
                Height = this.Height - topPosition - 10,
            };

            dataTabs = new Dictionary <Statistics.Competitor, TabPage>();
            foreach (Competitor competitor in tabsToShow)
            {
                dataTabs[competitor] = new TabPage
                {
                    Text      = competitor.ToString(),
                    BackColor = Color.White
                };
            }

            driverTeamResults.SelectedIndex         = (int)Statistic.DefaultDisplayCompetitor;
            driverTeamResults.SelectedIndexChanged += driverTeamResults_SelectedIndexChanged;

            topPosition       = 10;
            leftPosition      = LeftBuffer;
            rankings          = new Label[Data.NumberOfDrivers];
            competitorNumbers = new Label[Data.NumberOfDrivers];
            competitorNames   = new Label[Data.NumberOfDrivers];
            statValues        = new Label[Data.NumberOfDrivers];

            for (int positionIndex = 0; positionIndex < Data.NumberOfDrivers; positionIndex++)
            {
                rankings[positionIndex] = new Label
                {
                    Width = 30
                };
                competitorNumbers[positionIndex] = new Label
                {
                    Width = 30
                };
                competitorNames[positionIndex] = new Label
                {
                    Width = 100
                };
                statValues[positionIndex] = new Label
                {
                    Width = 50
                };
            }
        }
Ejemplo n.º 33
0
        private void btnDesigner_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (cmbScript.Items.Count > 0)
                {
                    if (cmbScript.SelectedItem != null)
                    {
                        if (cnv == null)
                        {
                            cnv = new Canvas();

                            tbc = new TabControl();

                            tbc.Height = 768;
                            tbc.Width  = 1024;
                            tbc.SetValue(Canvas.LeftProperty, 0.0);
                            tbc.SetValue(Canvas.TopProperty, 0.0);

                            cnv.Height = 768;
                            cnv.Width  = 1024;
                            cnv.SetValue(Canvas.LeftProperty, 0.0);
                            cnv.SetValue(Canvas.TopProperty, 0.0);
                            //ctlDesigner = new ctlCRMDesigner(((ListBoxItem)(cmbScript.SelectedItem)).Content.ToString());
                            //ctlDesigner = new ctlCRMDesigner.FunCRMDesigner(((ListBoxItem)(cmbScript.SelectedItem)).Content.ToString());
                            ctlDesigner = new ctlCRMDesigner(((ListBoxItem)(cmbScript.SelectedItem)).Content.ToString());

                            ctlDesigner.SctiptID = int.Parse(((ListBoxItem)(cmbScript.SelectedItem)).Tag.ToString());


                            ctlDesigner.GetQuestions();


                            cnv.Children.Add(ctlDesigner);

                            cnvMain.Children.Add(cnv);

                            if (c != null)
                            {
                                c.Visibility = Visibility.Collapsed;
                            }
                        }
                        else
                        {
                            cnv.Children.Clear();
                            cnv        = new Canvas();
                            cnv.Height = 768;
                            cnv.Width  = 1024;
                            cnv.SetValue(Canvas.LeftProperty, 0.0);
                            cnv.SetValue(Canvas.TopProperty, 0.0);
                            ctlDesigner = new ctlCRMDesigner(((ListBoxItem)(cmbScript.SelectedItem)).Content.ToString());
                            ctlDesigner.GetQuestions();
                            cnv.Children.Add(ctlDesigner);
                            cnvMain.Children.Add(cnv);

                            if (c != null)
                            {
                                c.Visibility = Visibility.Collapsed;
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show("Please Select the CRM first", "-> Designer", MessageBoxButton.OK, MessageBoxImage.Information);
                    }
                }
                else
                {
                    MessageBox.Show("Currently there are no CRMs");
                }
                //NavigationService.GetNavigationService(this).Navigate(new Uri("pgDesigner.xaml", UriKind.RelativeOrAbsolute));
            }
            catch (Exception exp)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(exp, "btnDesigner_Click()", "CtlQuestionAns.xaml.cs");
            }
        }
Ejemplo n.º 34
0
 private void InitializeComponent()
 {
     this.components     = new System.ComponentModel.Container();
     this.splitter1      = new System.Windows.Forms.Splitter();
     this.panel1         = new System.Windows.Forms.Panel();
     this.tabControl1    = new System.Windows.Forms.TabControl();
     this.tabPage1       = new System.Windows.Forms.TabPage();
     this.CollapseButton = new Findwise.SolutionManager.Controls.NoFocusButton();
     this.toolTip1       = new System.Windows.Forms.ToolTip(this.components);
     this.tabControl1.SuspendLayout();
     this.SuspendLayout();
     //
     // splitter1
     //
     this.splitter1.Location   = new System.Drawing.Point(0, 0);
     this.splitter1.Name       = "splitter1";
     this.splitter1.Size       = new System.Drawing.Size(3, 3);
     this.splitter1.TabIndex   = 0;
     this.splitter1.TabStop    = false;
     this.splitter1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.splitter1_MouseDown);
     this.splitter1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.splitter1_MouseMove);
     this.splitter1.MouseUp   += new System.Windows.Forms.MouseEventHandler(this.splitter1_MouseUp);
     //
     // panel1
     //
     this.panel1.AutoScroll = true;
     this.panel1.Dock       = System.Windows.Forms.DockStyle.Fill;
     this.panel1.Location   = new System.Drawing.Point(0, 0);
     this.panel1.Name       = "panel1";
     this.panel1.Size       = new System.Drawing.Size(200, 100);
     this.panel1.TabIndex   = 0;
     //
     // tabControl1
     //
     this.tabControl1.Controls.Add(this.tabPage1);
     this.tabControl1.Dock          = System.Windows.Forms.DockStyle.Fill;
     this.tabControl1.Location      = new System.Drawing.Point(0, 0);
     this.tabControl1.Name          = "tabControl1";
     this.tabControl1.SelectedIndex = 0;
     this.tabControl1.Size          = new System.Drawing.Size(200, 100);
     this.tabControl1.TabIndex      = 0;
     //
     // tabPage1
     //
     this.tabPage1.Location = new System.Drawing.Point(4, 22);
     this.tabPage1.Name     = "tabPage1";
     this.tabPage1.Padding  = new System.Windows.Forms.Padding(3);
     this.tabPage1.Size     = new System.Drawing.Size(192, 74);
     this.tabPage1.TabIndex = 0;
     this.tabPage1.UseVisualStyleBackColor = true;
     //
     // CollapseButton
     //
     this.CollapseButton.AutoSizeMode            = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     this.CollapseButton.Location                = new System.Drawing.Point(0, 0);
     this.CollapseButton.Name                    = "CollapseButton";
     this.CollapseButton.Size                    = new System.Drawing.Size(21, 21);
     this.CollapseButton.TabIndex                = 0;
     this.CollapseButton.Text                    = "📌";
     this.CollapseButton.UseVisualStyleBackColor = true;
     this.CollapseButton.Click                  += new System.EventHandler(this.CollapseButton_Click);
     this.tabControl1.ResumeLayout(false);
     this.ResumeLayout(false);
 }
Ejemplo n.º 35
0
        private void UpdateEdit(ref sconnSite site)
        {
            if (site.siteCfg != null)
            {
                int sites = site.siteCfg.deviceNo;
                this.Children.Clear();
                _siteEditPanel.Children.Clear();
                TabControl siteTabView = new TabControl();

                /************* Global site config *******************/
                if (site.siteCfg.globalConfig.memCFG != null)
                {
                    TabItem globalTabItem = new TabItem();
                    globalTabItem.Header = "Site";

                    StackPanel globalCfgPanel = new StackPanel();
                    globalCfgPanel.Width  = SconnView.ViewWidth;
                    globalCfgPanel.Height = SconnView.ViewHeight;
                    globalCfgPanel.HorizontalAlignment = HorizontalAlignment.Stretch;
                    globalCfgPanel.VerticalAlignment   = VerticalAlignment.Stretch;

                    SolidColorBrush panelBrush  = new SolidColorBrush(Colors.LightBlue);
                    SolidColorBrush deviceBrush = new SolidColorBrush(Colors.SkyBlue);
                    globalCfgPanel.Background = panelBrush;

                    GroupBox siteGlobalCfgGroup = new GroupBox();
                    siteGlobalCfgGroup.Header = "Global config";

                    Grid             siteCfgGrid = new Grid();
                    ColumnDefinition colDef1     = new ColumnDefinition();
                    ColumnDefinition colDef2     = new ColumnDefinition();
                    siteCfgGrid.ColumnDefinitions.Add(colDef1);
                    siteCfgGrid.ColumnDefinitions.Add(colDef2);
                    siteCfgGrid.Background = deviceBrush;

                    string[] configFieldNames =
                    {
                        "Device Number",
                        "Config 2",
                        "Config 3",
                        "Config 4",
                        "Config 5",
                        "Config 6",
                        "Config 7",
                        "Config 8"
                    };

                    for (int k = 0; k < configFieldNames.GetLength(0); k++)
                    {
                        RowDefinition rowDef1 = new RowDefinition();
                        siteCfgGrid.RowDefinitions.Add(rowDef1);
                    }

                    for (int i = 0; i < configFieldNames.GetLength(0); i++)
                    {
                        Label globallabelDesc = new Label();
                        globallabelDesc.Content = configFieldNames[i];
                        Grid.SetRow(globallabelDesc, i);
                        Grid.SetColumn(globallabelDesc, 0);
                        siteCfgGrid.Children.Add(globallabelDesc);


                        TextBox globalTextBox = new TextBox();
                        globalTextBox.Text = site.siteCfg.globalConfig.memCFG[ipcDefines.mAdrGlobalConfig + i].ToString();
                        Grid.SetRow(globalTextBox, i);
                        Grid.SetColumn(globalTextBox, 1);
                        siteCfgGrid.Children.Add(globalTextBox);
                    }



                    Button changePassButton = new Button();
                    changePassButton.Content = "Change password";
                    Grid.SetRow(changePassButton, 7);
                    Grid.SetColumn(changePassButton, 0);
                    changePassButton.Click += new RoutedEventHandler((sender, e) => ChangePasswordClick(sender, e));
                    siteCfgGrid.Children.Add(changePassButton);


                    Button saveButton = new Button();
                    saveButton.Content = "Save ";
                    Grid.SetRow(saveButton, 7);
                    Grid.SetColumn(saveButton, 1);
                    saveButton.Click += new RoutedEventHandler((sender, e) => SaveGlobalConfigClick(sender, e));
                    siteCfgGrid.Children.Add(saveButton);



                    /******* GSM CONFIG *********/
                    Grid             gsmCfgGrid = new Grid();
                    ColumnDefinition gsmcolDef1 = new ColumnDefinition();
                    ColumnDefinition gsmcolDef2 = new ColumnDefinition();
                    ColumnDefinition gsmcolDef3 = new ColumnDefinition();
                    gsmCfgGrid.ColumnDefinitions.Add(gsmcolDef1);
                    gsmCfgGrid.ColumnDefinitions.Add(gsmcolDef2);
                    gsmCfgGrid.ColumnDefinitions.Add(gsmcolDef3);
                    gsmCfgGrid.Background = deviceBrush;

                    GroupBox siteGsmCfgGroup = new GroupBox();
                    siteGsmCfgGroup.Header = "GSM config";

                    //TODO
                    if (site.siteCfg.GsmConfig != null)
                    {
                        for (int k = 0; k < ipcDefines.RAM_SMS_RECP_NO + 1; k++)
                        {
                            RowDefinition rowDef1 = new RowDefinition();
                            gsmCfgGrid.RowDefinitions.Add(rowDef1);
                        }

                        for (int i = 0; i < ipcDefines.RAM_SMS_RECP_NO; i++)
                        {
                            Label globallabelDesc = new Label();
                            globallabelDesc.Content = "Recipient " + i.ToString();
                            Grid.SetRow(globallabelDesc, i);
                            Grid.SetColumn(globallabelDesc, 0);
                            gsmCfgGrid.Children.Add(globallabelDesc);

                            CheckBox enBox = new CheckBox();
                            enBox.Content = "Enabled";
                            Grid.SetRow(enBox, i);
                            Grid.SetColumn(enBox, 1);
                            //TODO
                            //enBox.IsChecked = site.siteCfg.gsmRcpts[i].Enabled;
                            gsmCfgGrid.Children.Add(enBox);
                            this._editViewControls.Add("RecipientEn" + i, enBox);

                            TextBox globalTextBox = new TextBox();
                            //GlobalTextBox.Text = site.siteCfg.gsmRcpts[i].NumberE164;
                            Grid.SetRow(globalTextBox, i);
                            Grid.SetColumn(globalTextBox, 2);
                            gsmCfgGrid.Children.Add(globalTextBox);
                            this._editViewControls.Add("Recipient" + i, globalTextBox);
                        }


                        Button saveGsmButton = new Button();
                        saveGsmButton.Content = "Save";
                        Grid.SetRow(saveGsmButton, ipcDefines.RAM_SMS_RECP_NO);
                        Grid.SetColumn(saveGsmButton, 0);
                        saveGsmButton.Click += new RoutedEventHandler((sender, e) => SaveGsmConfigClick(sender, e));
                        gsmCfgGrid.Children.Add(saveGsmButton);
                    }

                    siteGlobalCfgGroup.Content = siteCfgGrid;
                    globalCfgPanel.Children.Add(siteGlobalCfgGroup);


                    GbxConfigureSiteNames namesGrp = new GbxConfigureSiteNames(site.siteCfg.GlobalNameConfig);
                    globalCfgPanel.Children.Add(namesGrp);
                    this._editViewControls.Add("GlobalNames", namesGrp);

                    //TODO
                    if (site.siteCfg.GsmConfig != null)
                    {
                        siteGsmCfgGroup.Content = gsmCfgGrid;
                        globalCfgPanel.Children.Add(siteGsmCfgGroup);
                    }

                    globalTabItem.Content = globalCfgPanel;
                    siteTabView.Items.Add(globalTabItem);
                }



                /************ Device  configs    *****************/
                for (int i = 0; i < sites; i++)
                {
                    TabItem deviceTabItem = new TabItem();
                    deviceTabItem.Header = "Dev " + site.siteCfg.deviceConfigs[i].memCFG[ipcDefines.mAdrDevID];

                    StackPanel deviceCfgPanel = new StackPanel();
                    deviceCfgPanel.Width  = SconnView.ViewWidth;
                    deviceCfgPanel.Height = SconnView.ViewHeight;
                    deviceCfgPanel.HorizontalAlignment = HorizontalAlignment.Stretch;
                    deviceCfgPanel.VerticalAlignment   = VerticalAlignment.Stretch;

                    SolidColorBrush panelBrush  = new SolidColorBrush(Colors.LightBlue);
                    SolidColorBrush deviceBrush = new SolidColorBrush(Colors.SkyBlue);
                    deviceCfgPanel.Background = panelBrush;

                    GroupBox deviceGlobalCfgGroup = new GroupBox();
                    deviceGlobalCfgGroup.Header = "Device global config";

                    Grid             siteCfgGrid = new Grid();
                    ColumnDefinition colDef1     = new ColumnDefinition();
                    ColumnDefinition colDef2     = new ColumnDefinition();
                    siteCfgGrid.Background = deviceBrush;
                    siteCfgGrid.ColumnDefinitions.Add(colDef1);
                    siteCfgGrid.ColumnDefinitions.Add(colDef2);

                    string[] deviceConfigFields =
                    {
                        "Device ID : ",
                        "Device Domain : ",
                        "Device Revision :",
                        "Device Type : ",
                        "Inputs : ",
                        "Outputs : ",
                        "Relays : ",
                        "Keypad : ",
                        "Temperature : ",
                        "Humidity : ",
                        "Pressure : "
                    };

                    for (int k = 0; k < deviceConfigFields.GetLength(0); k++)
                    {
                        RowDefinition rowDef1 = new RowDefinition();
                        siteCfgGrid.RowDefinitions.Add(rowDef1);
                    }

                    for (int j = 0; j < deviceConfigFields.GetLength(0); j++)
                    {
                        Label fieldlabelDesc = new Label();
                        fieldlabelDesc.Content = deviceConfigFields[j];
                        Grid.SetRow(fieldlabelDesc, j);
                        Grid.SetColumn(fieldlabelDesc, 0);
                        siteCfgGrid.Children.Add(fieldlabelDesc);

                        Label fieldlabelVal = new Label();
                        fieldlabelVal.Content = site.siteCfg.deviceConfigs[i].memCFG[j].ToString();
                        Grid.SetRow(fieldlabelVal, j);
                        Grid.SetColumn(fieldlabelVal, 1);
                        siteCfgGrid.Children.Add(fieldlabelVal);
                    }
                    deviceGlobalCfgGroup.Content = siteCfgGrid;


                    /******** names **********/
                    GroupBox deviceNamesCfgGroup = new GroupBox();
                    deviceNamesCfgGroup.Header = "Device names config";

                    Grid siteNamesCfgGrid = new Grid();
                    siteNamesCfgGrid.Background = deviceBrush;
                    ColumnDefinition nameCol1 = new ColumnDefinition();
                    ColumnDefinition nameCol2 = new ColumnDefinition();
                    siteNamesCfgGrid.ColumnDefinitions.Add(nameCol1);
                    siteNamesCfgGrid.ColumnDefinitions.Add(nameCol2);


                    int inputsNo  = site.siteCfg.deviceConfigs[i].memCFG[ipcDefines.mAdrInputsNO];
                    int outputsNo = site.siteCfg.deviceConfigs[i].memCFG[ipcDefines.mAdrOutputsNO];
                    int relayNo   = site.siteCfg.deviceConfigs[i].memCFG[ipcDefines.mAdrRelayNO];


                    string[] deviceNamesConfigFields =
                    {
                        "Device Name : ",
                        "Input names : ",
                        "Output names :",
                        "Relay names : ",
                    };

                    if (site.siteCfg.deviceConfigs[i].NamesCFG != null)
                    {
                        int totalrows = site.siteCfg.deviceConfigs[i].memCFG[ipcDefines.mAdrInputsNO] +
                                        site.siteCfg.deviceConfigs[i].memCFG[ipcDefines.mAdrOutputsNO] +
                                        site.siteCfg.deviceConfigs[i].memCFG[ipcDefines.mAdrRelayNO] +
                                        deviceConfigFields.GetLength(0) +
                                        1; //save;
                        for (int k = 0; k < totalrows; k++)
                        {
                            RowDefinition rowDef1 = new RowDefinition();
                            siteNamesCfgGrid.RowDefinitions.Add(rowDef1);
                        }

                        Label fieldDevlabelDesc = new Label();
                        fieldDevlabelDesc.Content = deviceNamesConfigFields[0];
                        Grid.SetRow(fieldDevlabelDesc, 0);
                        Grid.SetColumn(fieldDevlabelDesc, 0);
                        siteNamesCfgGrid.Children.Add(fieldDevlabelDesc);

                        TextBox fieldDevlabelVal = new TextBox();
                        if (site.siteCfg.deviceConfigs[i].NamesCFG != null)
                        {
                            fieldDevlabelVal.Text = site.siteCfg.deviceConfigs[i].GetDeviceNameAt(0);
                        }

                        fieldDevlabelVal.MaxLength = 16;
                        Grid.SetRow(fieldDevlabelVal, 0);
                        Grid.SetColumn(fieldDevlabelVal, 1);
                        siteNamesCfgGrid.Children.Add(fieldDevlabelVal);
                        this._editViewControls.Add("Device" + i.ToString(), fieldDevlabelVal);


                        //Inputs
                        Label fieldDevInputlabelDesc = new Label();
                        fieldDevInputlabelDesc.Content = deviceNamesConfigFields[1];
                        Grid.SetRow(fieldDevInputlabelDesc, 1);
                        Grid.SetColumn(fieldDevInputlabelDesc, 0);
                        siteNamesCfgGrid.Children.Add(fieldDevInputlabelDesc);
                        for (int o = 0; o < inputsNo; o++)
                        {
                            TextBox fieldDevInputlabelVal = new TextBox();
                            if (site.siteCfg.deviceConfigs[i].NamesCFG != null)
                            {
                                fieldDevInputlabelVal.Text = site.siteCfg.deviceConfigs[i].GetDeviceNameAt(o + 1);
                            }

                            fieldDevInputlabelVal.MaxLength = 16;
                            Grid.SetRow(fieldDevInputlabelVal, 1 + o);
                            Grid.SetColumn(fieldDevInputlabelVal, 1);
                            siteNamesCfgGrid.Children.Add(fieldDevInputlabelVal);
                            this._editViewControls.Add("Input" + i + "." + o, fieldDevInputlabelVal);
                        }


                        //outputs
                        Label fieldDevOutputlabelDesc = new Label();
                        fieldDevOutputlabelDesc.Content = deviceNamesConfigFields[2];
                        Grid.SetRow(fieldDevOutputlabelDesc, 2 + inputsNo);
                        Grid.SetColumn(fieldDevOutputlabelDesc, 0);
                        siteNamesCfgGrid.Children.Add(fieldDevOutputlabelDesc);
                        for (int o = 0; o < outputsNo; o++)
                        {
                            TextBox fieldDevOutputlabelVal = new TextBox();
                            if (site.siteCfg.deviceConfigs[i].NamesCFG != null)
                            {
                                fieldDevOutputlabelVal.Text = site.siteCfg.deviceConfigs[i].GetDeviceNameAt(o + ipcDefines.mAddr_NAMES_Outputs_Pos);
                            }

                            fieldDevOutputlabelVal.MaxLength = 16;
                            Grid.SetRow(fieldDevOutputlabelVal, 3 + inputsNo + o);
                            Grid.SetColumn(fieldDevOutputlabelVal, 1);
                            siteNamesCfgGrid.Children.Add(fieldDevOutputlabelVal);
                            this._editViewControls.Add("Output" + i + "." + o, fieldDevOutputlabelVal);
                        }

                        //relays
                        Label fieldDevRelaylabelDesc = new Label();
                        fieldDevRelaylabelDesc.Content = deviceNamesConfigFields[3];
                        Grid.SetRow(fieldDevRelaylabelDesc, 3 + inputsNo + outputsNo);
                        Grid.SetColumn(fieldDevRelaylabelDesc, 0);
                        siteNamesCfgGrid.Children.Add(fieldDevRelaylabelDesc);
                        for (int o = 0; o < relayNo; o++)
                        {
                            TextBox fieldDevRelaylabelVal = new TextBox();
                            if (site.siteCfg.deviceConfigs[i].NamesCFG != null)
                            {
                                fieldDevRelaylabelVal.Text = site.siteCfg.deviceConfigs[i].GetDeviceNameAt(o + ipcDefines.mAddr_NAMES_Relays_Pos);
                            }

                            fieldDevRelaylabelVal.MaxLength = 16;
                            Grid.SetRow(fieldDevRelaylabelVal, 4 + inputsNo + outputsNo + o);
                            Grid.SetColumn(fieldDevRelaylabelVal, 1);
                            siteNamesCfgGrid.Children.Add(fieldDevRelaylabelVal);
                            this._editViewControls.Add("Relay" + i + "." + o, fieldDevRelaylabelVal);
                        }
                        deviceNamesCfgGroup.Content = siteNamesCfgGrid;
                    }


                    /********** Output types ************/
                    GbxConfigureOutputsGroup gbxOutputConfig = new GbxConfigureOutputsGroup(site.siteCfg.deviceConfigs[i].memCFG, site.siteCfg.deviceConfigs[i].NamesCFG, outputsNo);
                    this._editViewControls.Add("Output_Cfg" + i, gbxOutputConfig);


                    /********** Input types ************/
                    GbxConfigureInputsGroup gbxInputConfig = new GbxConfigureInputsGroup(site.siteCfg.deviceConfigs[i].memCFG, site.siteCfg.deviceConfigs[i].NamesCFG, inputsNo);
                    this._editViewControls.Add("Input_Cfg" + i, gbxInputConfig);


                    /********** Relay types ************/

                    /********** Schedules  ************/
                    GbxConfigureSchedulesGroup gbxScheduleConfig = new GbxConfigureSchedulesGroup(site.siteCfg.deviceConfigs[i].ScheduleCFG, ipcDefines.RAM_DEV_SCHED_NO);
                    this._editViewControls.Add("Sched_Cfg" + i, gbxScheduleConfig);
                    if (site.siteCfg.deviceConfigs[i].ScheduleCFG != null)
                    {
                        gbxScheduleConfig = new GbxConfigureSchedulesGroup(site.siteCfg.deviceConfigs[i].ScheduleCFG, ipcDefines.RAM_DEV_SCHED_NO);
                        gbxScheduleConfig.ConfigChanged += GbxScheduleConfig_ConfigChanged;
                    }


                    Button saveButton = new Button();
                    saveButton.Content = "Save ";
                    saveButton.SetValue(SiteId, i);
                    saveButton.Click += new RoutedEventHandler((sender, e) => SaveDeviceConfigClick(sender, e, (int)saveButton.GetValue(SiteId)));



                    /**********  Authorized system devices  ************/
                    GbxConfigureAuthDevicesGroup authcfgConfig = new GbxConfigureAuthDevicesGroup();
                    this._editViewControls.Add("Device authorization " + i, authcfgConfig);



                    /*********** Network config **********/
                    GroupBox deviceNetCfgGroup = new GroupBox();
                    deviceNetCfgGroup.Header = "Network config";
                    Grid             siteNetCfgGrid = new Grid();
                    ColumnDefinition netCol         = new ColumnDefinition();
                    siteNetCfgGrid.Background = deviceBrush;
                    siteNetCfgGrid.ColumnDefinitions.Add(netCol);
                    RowDefinition netRow = new RowDefinition();
                    siteNetCfgGrid.RowDefinitions.Add(netRow);

                    DeviceNetworkConfig networkConfigPanel = new DeviceNetworkConfig(site.siteCfg.deviceConfigs[i].NetworkConfig);
                    this._editViewControls.Add("Net_Cfg" + i, networkConfigPanel);
                    networkConfigPanel = new DeviceNetworkConfig(site.siteCfg.deviceConfigs[i].NetworkConfig);

                    Grid.SetRow(networkConfigPanel, 0);
                    Grid.SetColumn(networkConfigPanel, 0);
                    siteNetCfgGrid.Children.Add(networkConfigPanel);

                    deviceNetCfgGroup.Content = siteNetCfgGrid;


                    deviceCfgPanel.Children.Add(deviceGlobalCfgGroup);
                    deviceCfgPanel.Children.Add(deviceNamesCfgGroup);
                    deviceCfgPanel.Children.Add(gbxOutputConfig);
                    deviceCfgPanel.Children.Add(gbxInputConfig);
                    deviceCfgPanel.Children.Add(gbxScheduleConfig);
                    deviceCfgPanel.Children.Add(deviceNetCfgGroup);
                    deviceCfgPanel.Children.Add(authcfgConfig);
                    deviceCfgPanel.Children.Add(saveButton);
                    deviceTabItem.Content = deviceCfgPanel;
                    siteTabView.Items.Add(deviceTabItem);
                }

                SolidColorBrush panelBrush2 = new SolidColorBrush(Colors.DeepSkyBlue);
                _siteEditPanel.Background = panelBrush2;

                _siteEditPanel.Width  = (double)SconnView.ViewWidth;
                _siteEditPanel.Height = (double)SconnView.ViewHeight;
                _siteEditPanel.HorizontalAlignment = HorizontalAlignment.Stretch;
                _siteEditPanel.VerticalAlignment   = VerticalAlignment.Stretch;
                _siteEditPanel.Children.Add(siteTabView);

                this.Children.Add(_siteEditPanel);
            } //config is init
            else
            {
            }
        }
Ejemplo n.º 36
0
        protected override Size ArrangeOverride(Size finalSize)
        {
            bool       width;
            bool       height;
            double     num        = 0;
            double     num1       = 0;
            bool       flag       = false;
            bool       flag1      = false;
            bool       width1     = false;
            int        num2       = -1;
            int        num3       = 0;
            TabControl tabControl = this.FindAncestor <TabControl>();
            UIElement  item       = null;

            if (tabControl.SelectedIndex >= 0 && tabControl.SelectedIndex < base.InternalChildren.Count)
            {
                item = base.InternalChildren[tabControl.SelectedIndex];
            }
            else if (base.InternalChildren.Count > 0)
            {
                tabControl.SelectedIndex = 0;
                item = base.InternalChildren[0];
            }
            foreach (UIElement internalChild in base.InternalChildren)
            {
                TabItem tabItem = internalChild as TabItem;
                num2++;
                if (!this.HasLogicalOrientation || this.LogicalOrientation != Orientation.Vertical)
                {
                    if (flag)
                    {
                        width = true;
                    }
                    else
                    {
                        Size desiredSize = internalChild.DesiredSize;
                        width = num + desiredSize.Width > finalSize.Width;
                    }
                    flag = width;
                    if (item != null)
                    {
                        Size size = item.DesiredSize;
                        width1 = num + size.Width <= finalSize.Width;
                    }
                }
                else
                {
                    if (flag)
                    {
                        height = true;
                    }
                    else
                    {
                        Size desiredSize1 = internalChild.DesiredSize;
                        height = num1 + desiredSize1.Height > finalSize.Height;
                    }
                    flag = height;
                    if (item != null)
                    {
                        Size size1 = item.DesiredSize;
                        width1 = num1 + size1.Height <= finalSize.Height;
                    }
                }
                if (width1)
                {
                    num3 = num2;
                }
                if (!flag)
                {
                    internalChild.Visibility = Visibility.Visible;
                    if (!this.HasLogicalOrientation || this.LogicalOrientation != Orientation.Vertical)
                    {
                        double width2 = internalChild.DesiredSize.Width;
                        internalChild.Arrange(new Rect(num, num1, width2, finalSize.Height));
                        num = num + width2;
                    }
                    else
                    {
                        double height1 = internalChild.DesiredSize.Height;
                        internalChild.Arrange(new Rect(num, num1, finalSize.Width, height1));
                        num1 = num1 + height1;
                    }
                }
                else
                {
                    internalChild.Visibility = Visibility.Hidden;
                    if (tabControl.SelectedItem != tabItem.Content)
                    {
                        continue;
                    }
                    flag1 = true;
                }
            }
            Size height2 = new Size();

            if (!this.HasLogicalOrientation || this.LogicalOrientation != Orientation.Vertical)
            {
                height2.Width  = num;
                height2.Height = finalSize.Height;
            }
            else
            {
                height2.Width  = finalSize.Width;
                height2.Height = num1;
            }
            this.HasHiddenItems = flag;
            if (flag1)
            {
                this.RaiseSelectedElementHidden(tabControl, num3);
            }
            return(height2);
        }
Ejemplo n.º 37
0
 private void RaiseSelectedElementHidden(TabControl parent, int lastVisiblePosition)
 {
     base.RaiseEvent(new SelectedItemHiddenEventArgs(DocumentTabPanel.SelectedItemHiddenEvent, parent, lastVisiblePosition));
 }
Ejemplo n.º 38
0
        public void createNewFile(TabControl tabControl, FastColoredTextBox rchtxt)
        {
            TabPage newTab = OpenCodeTab(tabControl, rchtxt);

            tabControl.SelectedTab = newTab;
        }
Ejemplo n.º 39
0
        public WidescreenPanel()
            : base()
        {
            PrinterCommunication.Instance.ActivePrinterChanged.RegisterEvent(LoadSettingsOnPrinterChanged, ref unregisterEvents);

            // do the front panel stuff
            {
                // first add the print progress bar
                this.Panel1.AddChild(new PrintProgressBar());

                // construct the main controls tab control
                mainControlsTabControl = new TabControl();
                mainControlsTabControl.TabBar.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
                mainControlsTabControl.TabBar.BorderColor     = new RGBA_Bytes(0, 0, 0, 0);
                mainControlsTabControl.TabBar.Margin          = new BorderDouble(0, 0);
                mainControlsTabControl.TabBar.Padding         = new BorderDouble(0, 2);

                QueueTabPage = new TabPage(new QueueControlsWidget(), "Queue");
                NumQueueItemsChanged(this, null);

                mainControlsTabControl.AddTab(new SimpleTextTabWidget(QueueTabPage, 18,
                                                                      ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes()));
                //mainControlsTabControl.AddTab(new SimpleTextTabWidget(new TabPage(new GuiWidget(), "History"), 18,
                //        ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes()));
                mainControlsTabControl.AddTab(new SimpleTextTabWidget(new TabPage(new PrintLibraryWidget(), "Library"), 18,
                                                                      ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes()));

                AboutTabPage = new TabPage(new AboutPage(), "About");
                aboutTabView = new SimpleTextTabWidget(AboutTabPage, 18,
                                                       ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes());
                mainControlsTabControl.AddTab(aboutTabView);


                advancedControlsButtonFactory.normalTextColor  = RGBA_Bytes.White;
                advancedControlsButtonFactory.hoverTextColor   = RGBA_Bytes.White;
                advancedControlsButtonFactory.pressedTextColor = RGBA_Bytes.White;
                advancedControlsButtonFactory.fontSize         = 10;

                advancedControlsButtonFactory.disabledTextColor   = RGBA_Bytes.LightGray;
                advancedControlsButtonFactory.disabledFillColor   = ActiveTheme.Instance.PrimaryBackgroundColor;
                advancedControlsButtonFactory.disabledBorderColor = ActiveTheme.Instance.PrimaryBackgroundColor;

                advancedControlsButtonFactory.invertImageLocation = true;
                Button advancedControlsLinkButton = advancedControlsButtonFactory.Generate("Advanced\nControls", "icon_arrow_right_32x32.png");
                advancedControlsLinkButton.Margin            = new BorderDouble(right: 3);
                advancedControlsLinkButton.VAnchor           = VAnchor.ParentBottom;
                advancedControlsLinkButton.Cursor            = Cursors.Hand;
                advancedControlsLinkButton.Click            += new ButtonBase.ButtonEventHandler(AdvancedControlsButton_Click);
                advancedControlsLinkButton.MouseEnterBounds += new EventHandler(onMouseEnterBoundsAdvancedControlsLink);
                advancedControlsLinkButton.MouseLeaveBounds += new EventHandler(onMouseLeaveBoundsAdvancedControlsLink);

                GuiWidget hSpacer = new GuiWidget();
                hSpacer.HAnchor = HAnchor.ParentLeftRight;

                mainControlsTabControl.TabBar.AddChild(hSpacer);
                //mainControlsTabControl.TabBar.AddChild(advancedControlsLinkButton);
                // and add it
                this.Panel1.AddChild(mainControlsTabControl);

                SetUpdateNotification(this, null);
            }

            // do the back panel
            {
                advancedControlsTabControl = CreateNewAdvancedControlsTab(new SliceSettingsWidget.UiState());
                this.Panel2.AddChild(advancedControlsTabControl);
                //this.Panel2.AddChild(new PrintProgressBar());
            }



            AddHandlers();
        }
Ejemplo n.º 40
0
 public static void CloseCurrentTab(TabControl tabControl)
 {
     tabControl.TabPages.Remove(tabControl.SelectedTab);
 }
Ejemplo n.º 41
0
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.tbControl = (TabControl)target;
                return;

            case 2:
                this.tabTwitter = (TabItem)target;
                return;

            case 3:
                this.switchTwitter            = (ToggleButton)target;
                this.switchTwitter.Checked   += new RoutedEventHandler(this.switchTwitter_Checked);
                this.switchTwitter.Unchecked += new RoutedEventHandler(this.switchTwitter_Checked);
                return;

            case 4:
                this.gvTwitter = (DataGrid)target;
                this.gvTwitter.SelectionChanged     += new SelectionChangedEventHandler(this.gvTwitter_SelectionChanged);
                this.gvTwitter.AutoGeneratingColumn += new EventHandler <DataGridAutoGeneratingColumnEventArgs>(this.gvTwitter_AutoGeneratingColumn);
                this.gvTwitter.AutoGeneratedColumns += new EventHandler(this.gvTwitter_AutoGeneratedColumns);
                return;

            case 5:
                this.btnTestTwitter        = (Button)target;
                this.btnTestTwitter.Click += new RoutedEventHandler(this.btnTestTwitter_Click);
                return;

            case 6:
                this.tabSlack = (TabItem)target;
                return;

            case 7:
                this.switchSlack            = (ToggleButton)target;
                this.switchSlack.Checked   += new RoutedEventHandler(this.switchSlack_Checked);
                this.switchSlack.Unchecked += new RoutedEventHandler(this.switchSlack_Checked);
                return;

            case 8:
                this.gvSlack = (DataGrid)target;
                this.gvSlack.SelectionChanged     += new SelectionChangedEventHandler(this.gvSlack_SelectionChanged);
                this.gvSlack.AutoGeneratingColumn += new EventHandler <DataGridAutoGeneratingColumnEventArgs>(this.gvSlack_AutoGeneratingColumn);
                this.gvSlack.AutoGeneratedColumns += new EventHandler(this.gvSlack_AutoGeneratedColumns);
                return;

            case 9:
                this.btnTestSlack        = (Button)target;
                this.btnTestSlack.Click += new RoutedEventHandler(this.btnTestSlack_Click);
                return;

            case 10:
                this.tabSms = (TabItem)target;
                return;

            case 11:
                this.switchSms            = (ToggleButton)target;
                this.switchSms.Checked   += new RoutedEventHandler(this.switchSms_Checked);
                this.switchSms.Unchecked += new RoutedEventHandler(this.switchSms_Checked);
                return;

            case 12:
                this.gvSms = (DataGrid)target;
                this.gvSms.SelectionChanged     += new SelectionChangedEventHandler(this.gvSms_SelectionChanged);
                this.gvSms.AutoGeneratingColumn += new EventHandler <DataGridAutoGeneratingColumnEventArgs>(this.gvSms_AutoGeneratingColumn);
                this.gvSms.AutoGeneratedColumns += new EventHandler(this.gvSms_AutoGeneratedColumns);
                return;

            case 13:
                this.btnTestSms        = (Button)target;
                this.btnTestSms.Click += new RoutedEventHandler(this.btnTestSms_Click);
                return;

            case 14:
                this.tabDiscord = (TabItem)target;
                return;

            case 15:
                this.switchDiscord            = (ToggleButton)target;
                this.switchDiscord.Checked   += new RoutedEventHandler(this.switchDiscord_Checked);
                this.switchDiscord.Unchecked += new RoutedEventHandler(this.switchDiscord_Checked);
                return;

            case 0x10:
                this.gvDiscord = (DataGrid)target;
                this.gvDiscord.SelectionChanged     += new SelectionChangedEventHandler(this.gvDiscord_SelectionChanged);
                this.gvDiscord.AutoGeneratingColumn += new EventHandler <DataGridAutoGeneratingColumnEventArgs>(this.gvDiscord_AutoGeneratingColumn);
                this.gvDiscord.AutoGeneratedColumns += new EventHandler(this.gvDiscord_AutoGeneratedColumns);
                return;

            case 0x11:
                this.btnTestDiscord        = (Button)target;
                this.btnTestDiscord.Click += new RoutedEventHandler(this.btnTestDiscord_Click);
                return;
            }
            this._contentLoaded = true;
        }
Ejemplo n.º 42
0
 /// <summary>
 /// Método necesario para admitir el Diseñador. No se puede modificar
 /// el contenido del método con el editor de código.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GenerationDialog));
     this.btnAceptar      = new System.Windows.Forms.Button();
     this.pic             = new System.Windows.Forms.PictureBox();
     this.BgWorker        = new System.ComponentModel.BackgroundWorker();
     this.tabControl1     = new System.Windows.Forms.TabControl();
     this.tabPage1        = new System.Windows.Forms.TabPage();
     this.txtLog          = new System.Windows.Forms.TextBox();
     this.tabPage2        = new System.Windows.Forms.TabPage();
     this.btnErrorDetails = new System.Windows.Forms.Button();
     this.lstErrors       = new System.Windows.Forms.ListBox();
     ((System.ComponentModel.ISupportInitialize)(this.pic)).BeginInit();
     this.tabControl1.SuspendLayout();
     this.tabPage1.SuspendLayout();
     this.tabPage2.SuspendLayout();
     this.SuspendLayout();
     //
     // btnAceptar
     //
     this.btnAceptar.Anchor            = System.Windows.Forms.AnchorStyles.Bottom;
     this.btnAceptar.Image             = ((System.Drawing.Image)(resources.GetObject("btnAceptar.Image")));
     this.btnAceptar.ImageAlign        = System.Drawing.ContentAlignment.MiddleRight;
     this.btnAceptar.Location          = new System.Drawing.Point(243, 390);
     this.btnAceptar.Name              = "btnAceptar";
     this.btnAceptar.Size              = new System.Drawing.Size(173, 40);
     this.btnAceptar.TabIndex          = 0;
     this.btnAceptar.Text              = "Cancel";
     this.btnAceptar.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
     this.btnAceptar.Click            += new System.EventHandler(this.btnAceptar_Click);
     //
     // pic
     //
     this.pic.Anchor   = System.Windows.Forms.AnchorStyles.Bottom;
     this.pic.Location = new System.Drawing.Point(181, 390);
     this.pic.Name     = "pic";
     this.pic.Size     = new System.Drawing.Size(56, 40);
     this.pic.TabIndex = 3;
     this.pic.TabStop  = false;
     //
     // bgWorker
     //
     this.BgWorker.WorkerReportsProgress      = true;
     this.BgWorker.WorkerSupportsCancellation = true;
     this.BgWorker.DoWork             += new System.ComponentModel.DoWorkEventHandler(this.bgWorker_DoWork);
     this.BgWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.bgWorker_RunWorkerCompleted);
     this.BgWorker.ProgressChanged    += new System.ComponentModel.ProgressChangedEventHandler(this.bgWorker_ProgressChanged);
     //
     // tabControl1
     //
     this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                      | System.Windows.Forms.AnchorStyles.Left)
                                                                     | System.Windows.Forms.AnchorStyles.Right)));
     this.tabControl1.Controls.Add(this.tabPage1);
     this.tabControl1.Controls.Add(this.tabPage2);
     this.tabControl1.Location      = new System.Drawing.Point(12, 12);
     this.tabControl1.Name          = "tabControl1";
     this.tabControl1.SelectedIndex = 0;
     this.tabControl1.Size          = new System.Drawing.Size(635, 372);
     this.tabControl1.TabIndex      = 4;
     //
     // tabPage1
     //
     this.tabPage1.Controls.Add(this.txtLog);
     this.tabPage1.Location = new System.Drawing.Point(4, 22);
     this.tabPage1.Name     = "tabPage1";
     this.tabPage1.Padding  = new System.Windows.Forms.Padding(3);
     this.tabPage1.Size     = new System.Drawing.Size(553, 337);
     this.tabPage1.TabIndex = 0;
     this.tabPage1.Text     = "Log";
     this.tabPage1.UseVisualStyleBackColor = true;
     //
     // txtLog
     //
     this.txtLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                 | System.Windows.Forms.AnchorStyles.Left)
                                                                | System.Windows.Forms.AnchorStyles.Right)));
     this.txtLog.Font       = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.txtLog.Location   = new System.Drawing.Point(6, 6);
     this.txtLog.Multiline  = true;
     this.txtLog.Name       = "txtLog";
     this.txtLog.ReadOnly   = true;
     this.txtLog.ScrollBars = System.Windows.Forms.ScrollBars.Both;
     this.txtLog.Size       = new System.Drawing.Size(541, 325);
     this.txtLog.TabIndex   = 5;
     //
     // tabPage2
     //
     this.tabPage2.Controls.Add(this.btnErrorDetails);
     this.tabPage2.Controls.Add(this.lstErrors);
     this.tabPage2.Location = new System.Drawing.Point(4, 22);
     this.tabPage2.Name     = "tabPage2";
     this.tabPage2.Padding  = new System.Windows.Forms.Padding(3);
     this.tabPage2.Size     = new System.Drawing.Size(627, 346);
     this.tabPage2.TabIndex = 1;
     this.tabPage2.Text     = "Errors";
     this.tabPage2.UseVisualStyleBackColor = true;
     //
     // btnErrorDetails
     //
     this.btnErrorDetails.Anchor   = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.btnErrorDetails.Location = new System.Drawing.Point(6, 317);
     this.btnErrorDetails.Name     = "btnErrorDetails";
     this.btnErrorDetails.Size     = new System.Drawing.Size(127, 23);
     this.btnErrorDetails.TabIndex = 1;
     this.btnErrorDetails.Text     = "Show error details";
     this.btnErrorDetails.UseVisualStyleBackColor = true;
     this.btnErrorDetails.Click += new System.EventHandler(this.btnErrorDetails_Click);
     //
     // lstErrors
     //
     this.lstErrors.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                    | System.Windows.Forms.AnchorStyles.Left)
                                                                   | System.Windows.Forms.AnchorStyles.Right)));
     this.lstErrors.FormattingEnabled   = true;
     this.lstErrors.HorizontalScrollbar = true;
     this.lstErrors.Location            = new System.Drawing.Point(6, 6);
     this.lstErrors.Name              = "lstErrors";
     this.lstErrors.Size              = new System.Drawing.Size(615, 290);
     this.lstErrors.TabIndex          = 0;
     this.lstErrors.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lstErrors_MouseDoubleClick);
     //
     // GenerationDialog
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(659, 442);
     this.Controls.Add(this.tabControl1);
     this.Controls.Add(this.pic);
     this.Controls.Add(this.btnAceptar);
     this.MinimizeBox   = false;
     this.Name          = "GenerationDialog";
     this.ShowIcon      = false;
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text          = "chmProcessor  - Generating help...";
     ((System.ComponentModel.ISupportInitialize)(this.pic)).EndInit();
     this.tabControl1.ResumeLayout(false);
     this.tabPage1.ResumeLayout(false);
     this.tabPage1.PerformLayout();
     this.tabPage2.ResumeLayout(false);
     this.ResumeLayout(false);
 }
Ejemplo n.º 43
0
        public Control GetControl()
        {
            var maps = _goldBoxFile.GetMaps();

            tab = new TabControl {
                Dock = DockStyle.Fill
            };
            tab.Invalidated += InvalidateMap;

            foreach (var geoMapRecord in maps)
            {
                var newFPViewPos = new FpViewPos();

                selected_dax_id = geoMapRecord.DaxId;
                var page = new TabPage(geoMapRecord.Name)
                {
                    Size = new Size(FullMapWidth + FPViewWidth, Math.Max(FPViewHeight, FullMapHeight))
                };
                page.Tag = newFPViewPos;
                var panel = ViewerHelper.CreatePanel();
                panel.Name = "mapPanel";
                var exportButton = ViewerHelper.CreateButton();
                exportButton.Text        = "export map to image";
                exportButton.MouseClick += geoImageExportForm;

                var movementButtonPanel = ViewerHelper.CreatePanel();
                movementButtonPanel.Width = 50;
                movementButtonPanel.Name  = "Movement Button Panel";
                movementButtonPanel.Dock  = DockStyle.Bottom;
                var forwardButton = ViewerHelper.CreateButton();
                forwardButton.Text        = "Forward";
                forwardButton.Width       = 40;
                forwardButton.MouseClick += moveCursorForwards;
                forwardButton.Dock        = DockStyle.Top;
                var movementRow3 = ViewerHelper.CreateRow();
                movementRow3.Controls.Add(forwardButton);

                var backwardButton = ViewerHelper.CreateButton();
                backwardButton.Text        = "Back";
                backwardButton.Width       = 40;
                backwardButton.MouseClick += moveCursorBackwards;
                backwardButton.Dock        = DockStyle.Bottom;
                var movementRow1 = ViewerHelper.CreateRow();
                movementRow1.Controls.Add(backwardButton);

                var leftButton = ViewerHelper.CreateButton();
                leftButton.Text        = "Left";
                backwardButton.Width   = 40;
                leftButton.MouseClick += rotateCursorLeft;
                leftButton.Dock        = DockStyle.Left;


                var rightButton = ViewerHelper.CreateButton();
                rightButton.Text        = "Right";
                rightButton.Width       = 40;
                rightButton.MouseClick += rotateCursorRight;
                rightButton.Dock        = DockStyle.Fill;

                var movementRow2 = ViewerHelper.CreateRow();
                movementRow2.Controls.Add(rightButton);
                movementRow2.Controls.Add(leftButton);

                var fpViewPanel = ViewerHelper.CreatePanel();
                fpViewPanel.Dock   = DockStyle.Left;
                fpViewPanel.Width  = FPViewWidth;
                fpViewPanel.Height = FPViewHeight;
                fpViewPanel.Name   = "FPViewPanel";
                //     var mapPanel = ViewerHelper.CreatePanel();
                var fpViewBox = new PictureBox();
                fpViewBox.Dock        = DockStyle.Fill;
                fpViewBox.BorderStyle = BorderStyle.Fixed3D;

                var pictureBox = new PictureBox();
                pictureBox.Dock        = DockStyle.Left;
                pictureBox.MouseClick += mouseClickOnMap;

                movementButtonPanel.Controls.Add(movementRow1);
                movementButtonPanel.Controls.Add(movementRow2);
                movementButtonPanel.Controls.Add(movementRow3);


                var bitmap = new Bitmap(FullMapWidth, FullMapHeight);
                DrawMap(bitmap, geoMapRecord.Walls, newFPViewPos);

                pictureBox.Name     = "map";
                pictureBox.Image    = bitmap;
                pictureBox.SizeMode = PictureBoxSizeMode.Zoom;

                pictureBox.Size = new Size(FullMapWidth, FullMapHeight);

                var fpvbitmap = new Bitmap(FPViewWidth, FPViewHeight);
                Drawfpview(fpvbitmap, geoMapRecord.Walls, newFPViewPos);

                fpViewBox.Name     = "3d view";
                fpViewBox.Image    = fpvbitmap;
                fpViewBox.SizeMode = PictureBoxSizeMode.Zoom;

                fpViewBox.Size = new Size(FPViewWidth, FPViewHeight + 60);


                fpViewPanel.Controls.Add(fpViewBox);
                fpViewPanel.Controls.Add(movementButtonPanel);
                panel.Controls.Add(fpViewPanel);
                panel.Controls.Add(pictureBox);
                panel.Controls.Add(exportButton);

                page.AutoScroll = true;
                page.Controls.Add(panel);

                tab.TabPages.Add(page);
            }

            return(tab);
        }
Ejemplo n.º 44
0
        /// <summary>
        /// インスタンスを生成します。
        /// </summary>
        /// <param name="screen"></param>
        public PredefinedColorDialog(Screen screen)
            : base(screen)
        {
            PredefinedColors = new List <PredefinedColor>();
            PredefinedColors.AddRange(PredefinedColor.PredefinedColors);
            PredefinedColors.Sort((x, y) => x.Name.CompareTo(y.Name));

            // 開く際に openAnimation で Width を設定するので 0 で初期化します。
            Width        = 0;
            ShadowOffset = new Vector2(4);
            Padding      = new Thickness(16);

            var stackPanel = new StackPanel(screen)
            {
                Orientation         = Orientation.Vertical,
                HorizontalAlignment = HorizontalAlignment.Stretch
            };

            Content = stackPanel;

            tab = new TabControl(screen)
            {
                SelectedIndex = 0
            };
            stackPanel.Children.Add(tab);

            predefinedColorGrid = new PredefinedColorGrid(screen, this)
            {
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment   = VerticalAlignment.Stretch
            };
            tab.Items.Add(predefinedColorGrid);

            predefinedColorList = new PredefinedColorList(screen, this)
            {
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment   = VerticalAlignment.Stretch
            };
            tab.Items.Add(predefinedColorList);

            var separator = ControlUtil.CreateDefaultSeparator(screen);

            stackPanel.Children.Add(separator);

            viewModeButton        = ControlUtil.CreateDefaultDialogButton(screen, "List View");
            viewModeButton.Click += OnViewModeButtonClick;
            stackPanel.Children.Add(viewModeButton);

            var sortByNameButton = ControlUtil.CreateDefaultDialogButton(screen, "Sort by Name");

            sortByNameButton.Click += OnSortByNameClick;
            stackPanel.Children.Add(sortByNameButton);

            var sortByColorButton = ControlUtil.CreateDefaultDialogButton(screen, "Sort by Color");

            sortByColorButton.Click += OnSortByColorClick;
            stackPanel.Children.Add(sortByColorButton);

            cancelButton        = ControlUtil.CreateDefaultDialogButton(screen, "Cancel");
            cancelButton.Click += (Control s, ref RoutedEventContext c) => Close();
            stackPanel.Children.Add(cancelButton);

            const float windowWidth = 400;

            openAnimation = new FloatLerpAnimation
            {
                Action   = (current) => { Width = current; },
                From     = 0,
                To       = windowWidth,
                Duration = TimeSpan.FromSeconds(0.1f)
            };
            Animations.Add(openAnimation);

            // 閉じる場合には closeAnimation を実行し、その完了で完全に閉じます。
            closeAnimation = new FloatLerpAnimation
            {
                Action   = (current) => { Width = current; },
                From     = windowWidth,
                To       = 0,
                Duration = TimeSpan.FromSeconds(0.1f)
            };
            closeAnimation.Completed += (s, e) => base.Close();
            Animations.Add(closeAnimation);
        }
Ejemplo n.º 45
0
        private void LoadToPanel <TBindValue>(
            Control dest,
            string controllerName,
            IReadOnlyCollection <string> controllerButtons,
            Dictionary <string, string> categoryLabels,
            IDictionary <string, Dictionary <string, TBindValue> > settingsBlock,
            TBindValue defaultValue,
            PanelCreator <TBindValue> createPanel
            )
        {
            if (!settingsBlock.TryGetValue(controllerName, out var settings))
            {
                settings = new Dictionary <string, TBindValue>();
                settingsBlock[controllerName] = settings;
            }

            // check to make sure that the settings object has all of the appropriate bool buttons
            foreach (var button in controllerButtons)
            {
                if (!settings.Keys.Contains(button))
                {
                    settings[button] = defaultValue;
                }
            }

            if (controllerButtons.Count == 0)
            {
                return;
            }

            // split the list of all settings into buckets by player number, or supplied category
            // the order that buttons appeared in determines the order of the tabs
            var orderedBuckets = new List <KeyValuePair <string, List <string> > >();
            var buckets        = new Dictionary <string, List <string> >();

            // by iterating through only the controller's active buttons, we're silently
            // discarding anything that's not on the controller right now.  due to the way
            // saving works, those entries will still be preserved in the config file, tho
            foreach (var button in controllerButtons)
            {
                Match  m;
                string categoryLabel;
                if (categoryLabels.ContainsKey(button))
                {
                    categoryLabel = categoryLabels[button];
                }
                else if ((m = ButtonMatchesPlayer.Match(button)).Success)
                {
                    categoryLabel = $"Player {m.Groups[1].Value}";
                }
                else
                {
                    categoryLabel = "Console";                     // anything that wants not console can set it in the categorylabels
                }

                if (!buckets.ContainsKey(categoryLabel))
                {
                    var l = new List <string>();
                    buckets.Add(categoryLabel, l);
                    orderedBuckets.Add(new KeyValuePair <string, List <string> >(categoryLabel, l));
                }

                buckets[categoryLabel].Add(button);
            }

            if (orderedBuckets.Count == 1)
            {
                // everything went into bucket 0, so make no tabs at all
                dest.Controls.Add(createPanel(settings, controllerButtons.ToList(), dest.Size));
            }
            else
            {
                // create multiple tabs
                var tt = new TabControl {
                    Dock = DockStyle.Fill
                };
                dest.Controls.Add(tt);
                int pageIdx = 0;
                foreach (var kvp in orderedBuckets)
                {
                    string tabName = kvp.Key;
                    tt.TabPages.Add(tabName);
                    tt.TabPages[pageIdx++].Controls.Add(createPanel(settings, kvp.Value, tt.Size));
                }
            }
        }
Ejemplo n.º 46
0
 public SearchForm(TabControl target)
 {
     InitializeComponent();
     targetTabber = target;
 }
Ejemplo n.º 47
0
        private void InitializeComponent()
        {
            this.DCLbl       = new Label();
            this.Pages       = new TabControl();
            this.DetailsPage = new TabPage();
            this.DetailsBox  = new TextBox();
            this.OKBtn       = new Button();
            this.CancelBtn   = new Button();
            this.DCBox       = new NumericUpDown();
            this.Pages.SuspendLayout();
            this.DetailsPage.SuspendLayout();
            ((ISupportInitialize)this.DCBox).BeginInit();
            base.SuspendLayout();
            this.DCLbl.AutoSize = true;
            this.DCLbl.Location = new Point(12, 14);
            this.DCLbl.Name     = "DCLbl";
            this.DCLbl.Size     = new System.Drawing.Size(47, 13);
            this.DCLbl.TabIndex = 0;
            this.DCLbl.Text     = "Skill DC:";
            this.Pages.Anchor   = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
            this.Pages.Controls.Add(this.DetailsPage);
            this.Pages.Location      = new Point(12, 38);
            this.Pages.Name          = "Pages";
            this.Pages.SelectedIndex = 0;
            this.Pages.Size          = new System.Drawing.Size(291, 137);
            this.Pages.TabIndex      = 2;
            this.DetailsPage.Controls.Add(this.DetailsBox);
            this.DetailsPage.Location = new Point(4, 22);
            this.DetailsPage.Name     = "DetailsPage";
            this.DetailsPage.Padding  = new System.Windows.Forms.Padding(3);
            this.DetailsPage.Size     = new System.Drawing.Size(283, 111);
            this.DetailsPage.TabIndex = 0;
            this.DetailsPage.Text     = "Details";
            this.DetailsPage.UseVisualStyleBackColor = true;
            this.DetailsBox.AcceptsReturn            = true;
            this.DetailsBox.AcceptsTab             = true;
            this.DetailsBox.Dock                   = DockStyle.Fill;
            this.DetailsBox.Location               = new Point(3, 3);
            this.DetailsBox.Multiline              = true;
            this.DetailsBox.Name                   = "DetailsBox";
            this.DetailsBox.ScrollBars             = ScrollBars.Vertical;
            this.DetailsBox.Size                   = new System.Drawing.Size(277, 105);
            this.DetailsBox.TabIndex               = 0;
            this.OKBtn.Anchor                      = AnchorStyles.Bottom | AnchorStyles.Right;
            this.OKBtn.DialogResult                = System.Windows.Forms.DialogResult.OK;
            this.OKBtn.Location                    = new Point(147, 181);
            this.OKBtn.Name                        = "OKBtn";
            this.OKBtn.Size                        = new System.Drawing.Size(75, 23);
            this.OKBtn.TabIndex                    = 3;
            this.OKBtn.Text                        = "OK";
            this.OKBtn.UseVisualStyleBackColor     = true;
            this.OKBtn.Click                      += new EventHandler(this.OKBtn_Click);
            this.CancelBtn.Anchor                  = AnchorStyles.Bottom | AnchorStyles.Right;
            this.CancelBtn.DialogResult            = System.Windows.Forms.DialogResult.Cancel;
            this.CancelBtn.Location                = new Point(228, 181);
            this.CancelBtn.Name                    = "CancelBtn";
            this.CancelBtn.Size                    = new System.Drawing.Size(75, 23);
            this.CancelBtn.TabIndex                = 4;
            this.CancelBtn.Text                    = "Cancel";
            this.CancelBtn.UseVisualStyleBackColor = true;
            this.DCBox.Anchor                      = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            NumericUpDown dCBox = this.DCBox;

            int[] numArray = new int[] { 5, 0, 0, 0 };
            dCBox.Increment     = new decimal(numArray);
            this.DCBox.Location = new Point(65, 12);
            NumericUpDown num = this.DCBox;

            int[] numArray1 = new int[] { 10, 0, 0, 0 };
            num.Minimum         = new decimal(numArray1);
            this.DCBox.Name     = "DCBox";
            this.DCBox.Size     = new System.Drawing.Size(238, 20);
            this.DCBox.TabIndex = 1;
            NumericUpDown numericUpDown = this.DCBox;

            int[] numArray2 = new int[] { 10, 0, 0, 0 };
            numericUpDown.Value      = new decimal(numArray2);
            base.AcceptButton        = this.OKBtn;
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
            base.CancelButton        = this.CancelBtn;
            base.ClientSize          = new System.Drawing.Size(315, 216);
            base.Controls.Add(this.DCBox);
            base.Controls.Add(this.CancelBtn);
            base.Controls.Add(this.OKBtn);
            base.Controls.Add(this.Pages);
            base.Controls.Add(this.DCLbl);
            base.MaximizeBox   = false;
            base.MinimizeBox   = false;
            base.Name          = "OptionInformationForm";
            base.ShowIcon      = false;
            base.ShowInTaskbar = false;
            base.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
            base.StartPosition = FormStartPosition.CenterParent;
            this.Text          = "Feature";
            this.Pages.ResumeLayout(false);
            this.DetailsPage.ResumeLayout(false);
            this.DetailsPage.PerformLayout();
            ((ISupportInitialize)this.DCBox).EndInit();
            base.ResumeLayout(false);
            base.PerformLayout();
        }
 public override void OnApplyTemplate()
 {
     base.OnApplyTemplate();
     AddPage     = AddPageTabControl;
     _tabControl = (TabControl)Template.FindName("PART_CustomTabControl", this);
 }
Ejemplo n.º 49
0
        ///////////////////////////////////////////

        protected override void OnAttach()
        {
            base.OnAttach();

            ComboBox  comboBox;
            ScrollBar scrollBar;
            CheckBox  checkBox;

            window = ControlDeclarationManager.Instance.CreateControl("Gui\\OptionsWindow.gui");
            Controls.Add(window);

            tabControl = (TabControl)window.Controls["TabControl"];

            BackColor  = new ColorValue(0, 0, 0, .5f);
            MouseCover = true;

            //load Engine.config
            TextBlock engineConfigBlock = LoadEngineConfig();
            TextBlock rendererBlock     = null;

            if (engineConfigBlock != null)
            {
                rendererBlock = engineConfigBlock.FindChild("Renderer");
            }

            //page buttons
            pageButtons[0] = (Button)window.Controls["ButtonVideo"];
            pageButtons[1] = (Button)window.Controls["ButtonShadows"];
            pageButtons[2] = (Button)window.Controls["ButtonSound"];
            pageButtons[3] = (Button)window.Controls["ButtonControls"];
            pageButtons[4] = (Button)window.Controls["ButtonLanguage"];
            foreach (Button pageButton in pageButtons)
            {
                pageButton.Click += new Button.ClickDelegate(pageButton_Click);
            }

            //Close button
            ((Button)window.Controls["Close"]).Click += delegate(Button sender)
            {
                SetShouldDetach();
            };

            //pageVideo
            {
                Control pageVideo = tabControl.Controls["Video"];

                Vec2I currentMode = EngineApp.Instance.VideoMode;

                //screenResolutionComboBox
                comboBox           = (ComboBox)pageVideo.Controls["ScreenResolution"];
                comboBox.Enable    = !EngineApp.Instance.MultiMonitorMode;
                comboBoxResolution = comboBox;

                if (EngineApp.Instance.MultiMonitorMode)
                {
                    comboBox.Items.Add(string.Format("{0}x{1} (multi-monitor)", currentMode.X,
                                                     currentMode.Y));
                    comboBox.SelectedIndex = 0;
                }
                else
                {
                    foreach (Vec2I mode in DisplaySettings.VideoModes)
                    {
                        if (mode.X < 640)
                        {
                            continue;
                        }

                        comboBox.Items.Add(string.Format("{0}x{1}", mode.X, mode.Y));

                        if (mode == currentMode)
                        {
                            comboBox.SelectedIndex = comboBox.Items.Count - 1;
                        }
                    }

                    comboBox.SelectedIndexChange += delegate(ComboBox sender)
                    {
                        ChangeVideoMode();
                    };
                }

                //gamma
                scrollBar              = (ScrollBar)pageVideo.Controls["Gamma"];
                scrollBar.Value        = GameEngineApp._Gamma;
                scrollBar.Enable       = true;
                scrollBar.ValueChange += delegate(ScrollBar sender)
                {
                    float value = float.Parse(sender.Value.ToString("F1"));
                    GameEngineApp._Gamma = value;
                    pageVideo.Controls["GammaValue"].Text = value.ToString("F1");
                };
                pageVideo.Controls["GammaValue"].Text = GameEngineApp._Gamma.ToString("F1");

                //MaterialScheme
                {
                    comboBox = (ComboBox)pageVideo.Controls["MaterialScheme"];
                    foreach (MaterialSchemes materialScheme in
                             Enum.GetValues(typeof(MaterialSchemes)))
                    {
                        comboBox.Items.Add(materialScheme.ToString());

                        if (GameEngineApp.MaterialScheme == materialScheme)
                        {
                            comboBox.SelectedIndex = comboBox.Items.Count - 1;
                        }
                    }
                    comboBox.SelectedIndexChange += delegate(ComboBox sender)
                    {
                        if (sender.SelectedIndex != -1)
                        {
                            GameEngineApp.MaterialScheme = (MaterialSchemes)sender.SelectedIndex;
                        }
                    };
                }

                //fullScreen
                checkBox                = (CheckBox)pageVideo.Controls["FullScreen"];
                checkBox.Enable         = !EngineApp.Instance.MultiMonitorMode;
                checkBox.Checked        = EngineApp.Instance.FullScreen;
                checkBox.CheckedChange += delegate(CheckBox sender)
                {
                    EngineApp.Instance.FullScreen = sender.Checked;
                };

                //RenderTechnique
                {
                    comboBox = (ComboBox)pageVideo.Controls["RenderTechnique"];
                    comboBox.Items.Add(new ComboBoxItem("RecommendedSetting", Translate("Recommended setting")));
                    comboBox.Items.Add(new ComboBoxItem("Standard", Translate("Low Dynamic Range (Standard)")));
                    comboBox.Items.Add(new ComboBoxItem("HDR", Translate("High Dynamic Range (HDR)")));

                    string renderTechnique = "";
                    if (rendererBlock != null && rendererBlock.IsAttributeExist("renderTechnique"))
                    {
                        renderTechnique = rendererBlock.GetAttribute("renderTechnique");
                    }

                    for (int n = 0; n < comboBox.Items.Count; n++)
                    {
                        ComboBoxItem item = (ComboBoxItem)comboBox.Items[n];
                        if (item.Identifier == renderTechnique)
                        {
                            comboBox.SelectedIndex = n;
                        }
                    }
                    if (comboBox.SelectedIndex == -1)
                    {
                        comboBox.SelectedIndex = 0;
                    }

                    comboBox.SelectedIndexChange += comboBoxRenderTechnique_SelectedIndexChange;
                }

                //Filtering
                {
                    comboBox = (ComboBox)pageVideo.Controls["Filtering"];

                    Type enumType = typeof(RendererWorld.FilteringModes);
                    LocalizedEnumConverter enumConverter = new LocalizedEnumConverter(enumType);

                    RendererWorld.FilteringModes filtering = RendererWorld.FilteringModes.RecommendedSetting;
                    //get value from Engine.config.
                    if (rendererBlock != null && rendererBlock.IsAttributeExist("filtering"))
                    {
                        try
                        {
                            filtering = (RendererWorld.FilteringModes)Enum.Parse(enumType, rendererBlock.GetAttribute("filtering"));
                        }
                        catch { }
                    }

                    RendererWorld.FilteringModes[] values = (RendererWorld.FilteringModes[])Enum.GetValues(enumType);
                    for (int n = 0; n < values.Length; n++)
                    {
                        RendererWorld.FilteringModes value = values[n];
                        string valueStr = enumConverter.ConvertToString(value);
                        comboBox.Items.Add(new ComboBoxItem(value.ToString(), Translate(valueStr)));
                        if (filtering == value)
                        {
                            comboBox.SelectedIndex = comboBox.Items.Count - 1;
                        }
                    }
                    if (comboBox.SelectedIndex == -1)
                    {
                        comboBox.SelectedIndex = 0;
                    }

                    comboBox.SelectedIndexChange += comboBoxFiltering_SelectedIndexChange;
                }

                //DepthBufferAccess
                {
                    checkBox = (CheckBox)pageVideo.Controls["DepthBufferAccess"];
                    checkBoxDepthBufferAccess = checkBox;

                    bool depthBufferAccess = true;
                    //get value from Engine.config.
                    if (rendererBlock != null && rendererBlock.IsAttributeExist("depthBufferAccess"))
                    {
                        depthBufferAccess = bool.Parse(rendererBlock.GetAttribute("depthBufferAccess"));
                    }
                    checkBox.Checked = depthBufferAccess;

                    checkBox.CheckedChange += checkBoxDepthBufferAccess_CheckedChange;
                }

                //FSAA
                {
                    comboBox             = (ComboBox)pageVideo.Controls["FSAA"];
                    comboBoxAntialiasing = comboBox;

                    UpdateComboBoxAntialiasing();

                    string fullSceneAntialiasing = "";
                    if (rendererBlock != null && rendererBlock.IsAttributeExist("fullSceneAntialiasing"))
                    {
                        fullSceneAntialiasing = rendererBlock.GetAttribute("fullSceneAntialiasing");
                    }
                    for (int n = 0; n < comboBoxAntialiasing.Items.Count; n++)
                    {
                        ComboBoxItem item = (ComboBoxItem)comboBoxAntialiasing.Items[n];
                        if (item.Identifier == fullSceneAntialiasing)
                        {
                            comboBoxAntialiasing.SelectedIndex = n;
                        }
                    }

                    comboBoxAntialiasing.SelectedIndexChange += comboBoxAntialiasing_SelectedIndexChange;
                }

                //VerticalSync
                {
                    checkBox = (CheckBox)pageVideo.Controls["VerticalSync"];

                    bool verticalSync = RendererWorld.InitializationOptions.VerticalSync;
                    //get value from Engine.config.
                    if (rendererBlock != null && rendererBlock.IsAttributeExist("verticalSync"))
                    {
                        verticalSync = bool.Parse(rendererBlock.GetAttribute("verticalSync"));
                    }
                    checkBox.Checked = verticalSync;

                    checkBox.CheckedChange += checkBoxVerticalSync_CheckedChange;
                }

                //VideoRestart
                {
                    Button button = (Button)pageVideo.Controls["VideoRestart"];
                    button.Click += buttonVideoRestart_Click;
                }

                //waterReflectionLevel
                comboBox = (ComboBox)pageVideo.Controls["WaterReflectionLevel"];
                foreach (WaterPlane.ReflectionLevels level in Enum.GetValues(
                             typeof(WaterPlane.ReflectionLevels)))
                {
                    comboBox.Items.Add(level);
                    if (GameEngineApp.WaterReflectionLevel == level)
                    {
                        comboBox.SelectedIndex = comboBox.Items.Count - 1;
                    }
                }
                comboBox.SelectedIndexChange += delegate(ComboBox sender)
                {
                    GameEngineApp.WaterReflectionLevel = (WaterPlane.ReflectionLevels)sender.SelectedItem;
                };

                //showDecorativeObjects
                checkBox                = (CheckBox)pageVideo.Controls["ShowDecorativeObjects"];
                checkBox.Checked        = GameEngineApp.ShowDecorativeObjects;
                checkBox.CheckedChange += delegate(CheckBox sender)
                {
                    GameEngineApp.ShowDecorativeObjects = sender.Checked;
                };

                //showSystemCursorCheckBox
                checkBox                = (CheckBox)pageVideo.Controls["ShowSystemCursor"];
                checkBox.Checked        = GameEngineApp._ShowSystemCursor;
                checkBox.CheckedChange += delegate(CheckBox sender)
                {
                    GameEngineApp._ShowSystemCursor = sender.Checked;
                    sender.Checked = GameEngineApp._ShowSystemCursor;
                };

                //showFPSCheckBox
                checkBox                = (CheckBox)pageVideo.Controls["ShowFPS"];
                checkBox.Checked        = GameEngineApp._DrawFPS;
                checkBox.CheckedChange += delegate(CheckBox sender)
                {
                    GameEngineApp._DrawFPS = sender.Checked;
                    sender.Checked         = GameEngineApp._DrawFPS;
                };
            }

            //pageShadows
            {
                Control pageShadows = tabControl.Controls["Shadows"];

                //ShadowTechnique
                {
                    comboBox = (ComboBox)pageShadows.Controls["ShadowTechnique"];

                    comboBox.Items.Add(new ShadowTechniqueItem(ShadowTechniques.None, "None"));
                    comboBox.Items.Add(new ShadowTechniqueItem(ShadowTechniques.ShadowmapLow, "Shadowmap Low"));
                    comboBox.Items.Add(new ShadowTechniqueItem(ShadowTechniques.ShadowmapMedium, "Shadowmap Medium"));
                    comboBox.Items.Add(new ShadowTechniqueItem(ShadowTechniques.ShadowmapHigh, "Shadowmap High"));
                    comboBox.Items.Add(new ShadowTechniqueItem(ShadowTechniques.ShadowmapLowPSSM, "PSSMx3 Low"));
                    comboBox.Items.Add(new ShadowTechniqueItem(ShadowTechniques.ShadowmapMediumPSSM, "PSSMx3 Medium"));
                    comboBox.Items.Add(new ShadowTechniqueItem(ShadowTechniques.ShadowmapHighPSSM, "PSSMx3 High"));
                    comboBox.Items.Add(new ShadowTechniqueItem(ShadowTechniques.Stencil, "Stencil"));

                    for (int n = 0; n < comboBox.Items.Count; n++)
                    {
                        ShadowTechniqueItem item = (ShadowTechniqueItem)comboBox.Items[n];
                        if (item.Technique == GameEngineApp.ShadowTechnique)
                        {
                            comboBox.SelectedIndex = n;
                        }
                    }

                    comboBox.SelectedIndexChange += delegate(ComboBox sender)
                    {
                        if (sender.SelectedIndex != -1)
                        {
                            ShadowTechniqueItem item = (ShadowTechniqueItem)sender.SelectedItem;
                            GameEngineApp.ShadowTechnique = item.Technique;
                        }
                        UpdateShadowControlsEnable();
                    };
                    UpdateShadowControlsEnable();
                }

                //ShadowUseMapSettings
                {
                    checkBox                = (CheckBox)pageShadows.Controls["ShadowUseMapSettings"];
                    checkBox.Checked        = GameEngineApp.ShadowUseMapSettings;
                    checkBox.CheckedChange += delegate(CheckBox sender)
                    {
                        GameEngineApp.ShadowUseMapSettings = sender.Checked;
                        if (sender.Checked && Map.Instance != null)
                        {
                            GameEngineApp.ShadowPSSMSplitFactors = Map.Instance.InitialShadowPSSMSplitFactors;
                            GameEngineApp.ShadowFarDistance      = Map.Instance.InitialShadowFarDistance;
                            GameEngineApp.ShadowColor            = Map.Instance.InitialShadowColor;
                        }

                        UpdateShadowControlsEnable();

                        if (sender.Checked)
                        {
                            ((ScrollBar)pageShadows.Controls["ShadowFarDistance"]).Value =
                                GameEngineApp.ShadowFarDistance;

                            pageShadows.Controls["ShadowFarDistanceValue"].Text =
                                ((int)GameEngineApp.ShadowFarDistance).ToString();

                            ColorValue color = GameEngineApp.ShadowColor;
                            ((ScrollBar)pageShadows.Controls["ShadowColor"]).Value =
                                (color.Red + color.Green + color.Blue) / 3;
                        }
                    };
                }

                //ShadowPSSMSplitFactor1
                scrollBar              = (ScrollBar)pageShadows.Controls["ShadowPSSMSplitFactor1"];
                scrollBar.Value        = GameEngineApp.ShadowPSSMSplitFactors[0];
                scrollBar.ValueChange += delegate(ScrollBar sender)
                {
                    GameEngineApp.ShadowPSSMSplitFactors = new Vec2(
                        sender.Value, GameEngineApp.ShadowPSSMSplitFactors[1]);
                    pageShadows.Controls["ShadowPSSMSplitFactor1Value"].Text =
                        (GameEngineApp.ShadowPSSMSplitFactors[0].ToString("F2")).ToString();
                };
                pageShadows.Controls["ShadowPSSMSplitFactor1Value"].Text =
                    (GameEngineApp.ShadowPSSMSplitFactors[0].ToString("F2")).ToString();

                //ShadowPSSMSplitFactor2
                scrollBar              = (ScrollBar)pageShadows.Controls["ShadowPSSMSplitFactor2"];
                scrollBar.Value        = GameEngineApp.ShadowPSSMSplitFactors[1];
                scrollBar.ValueChange += delegate(ScrollBar sender)
                {
                    GameEngineApp.ShadowPSSMSplitFactors = new Vec2(
                        GameEngineApp.ShadowPSSMSplitFactors[0], sender.Value);
                    pageShadows.Controls["ShadowPSSMSplitFactor2Value"].Text =
                        (GameEngineApp.ShadowPSSMSplitFactors[1].ToString("F2")).ToString();
                };
                pageShadows.Controls["ShadowPSSMSplitFactor2Value"].Text =
                    (GameEngineApp.ShadowPSSMSplitFactors[1].ToString("F2")).ToString();

                //ShadowFarDistance
                scrollBar              = (ScrollBar)pageShadows.Controls["ShadowFarDistance"];
                scrollBar.Value        = GameEngineApp.ShadowFarDistance;
                scrollBar.ValueChange += delegate(ScrollBar sender)
                {
                    GameEngineApp.ShadowFarDistance = sender.Value;
                    pageShadows.Controls["ShadowFarDistanceValue"].Text =
                        ((int)GameEngineApp.ShadowFarDistance).ToString();
                };
                pageShadows.Controls["ShadowFarDistanceValue"].Text =
                    ((int)GameEngineApp.ShadowFarDistance).ToString();

                //ShadowColor
                scrollBar       = (ScrollBar)pageShadows.Controls["ShadowColor"];
                scrollBar.Value = (GameEngineApp.ShadowColor.Red + GameEngineApp.ShadowColor.Green +
                                   GameEngineApp.ShadowColor.Blue) / 3;
                scrollBar.ValueChange += delegate(ScrollBar sender)
                {
                    float color = sender.Value;
                    GameEngineApp.ShadowColor = new ColorValue(color, color, color, color);
                };

                //ShadowDirectionalLightTextureSize
                {
                    comboBox = (ComboBox)pageShadows.Controls["ShadowDirectionalLightTextureSize"];
                    for (int value = 256, index = 0; value <= 8192; value *= 2, index++)
                    {
                        comboBox.Items.Add(value);
                        if (GameEngineApp.ShadowDirectionalLightTextureSize == value)
                        {
                            comboBox.SelectedIndex = index;
                        }
                    }
                    comboBox.SelectedIndexChange += delegate(ComboBox sender)
                    {
                        GameEngineApp.ShadowDirectionalLightTextureSize = (int)sender.SelectedItem;
                    };
                }

                ////ShadowDirectionalLightMaxTextureCount
                //{
                //   comboBox = (EComboBox)pageVideo.Controls[ "ShadowDirectionalLightMaxTextureCount" ];
                //   for( int n = 0; n < 3; n++ )
                //   {
                //      int count = n + 1;
                //      comboBox.Items.Add( count );
                //      if( count == GameEngineApp.ShadowDirectionalLightMaxTextureCount )
                //         comboBox.SelectedIndex = n;
                //   }
                //   comboBox.SelectedIndexChange += delegate( EComboBox sender )
                //   {
                //      GameEngineApp.ShadowDirectionalLightMaxTextureCount = (int)sender.SelectedItem;
                //   };
                //}

                //ShadowSpotLightTextureSize
                {
                    comboBox = (ComboBox)pageShadows.Controls["ShadowSpotLightTextureSize"];
                    for (int value = 256, index = 0; value <= 8192; value *= 2, index++)
                    {
                        comboBox.Items.Add(value);
                        if (GameEngineApp.ShadowSpotLightTextureSize == value)
                        {
                            comboBox.SelectedIndex = index;
                        }
                    }
                    comboBox.SelectedIndexChange += delegate(ComboBox sender)
                    {
                        GameEngineApp.ShadowSpotLightTextureSize = (int)sender.SelectedItem;
                    };
                }

                //ShadowSpotLightMaxTextureCount
                {
                    comboBox = (ComboBox)pageShadows.Controls["ShadowSpotLightMaxTextureCount"];
                    for (int n = 0; n < 4; n++)
                    {
                        comboBox.Items.Add(n);
                        if (n == GameEngineApp.ShadowSpotLightMaxTextureCount)
                        {
                            comboBox.SelectedIndex = n;
                        }
                    }
                    comboBox.SelectedIndexChange += delegate(ComboBox sender)
                    {
                        GameEngineApp.ShadowSpotLightMaxTextureCount = (int)sender.SelectedItem;
                    };
                }

                //ShadowPointLightTextureSize
                {
                    comboBox = (ComboBox)pageShadows.Controls["ShadowPointLightTextureSize"];
                    for (int value = 256, index = 0; value <= 8192; value *= 2, index++)
                    {
                        comboBox.Items.Add(value);
                        if (GameEngineApp.ShadowPointLightTextureSize == value)
                        {
                            comboBox.SelectedIndex = index;
                        }
                    }
                    comboBox.SelectedIndexChange += delegate(ComboBox sender)
                    {
                        GameEngineApp.ShadowPointLightTextureSize = (int)sender.SelectedItem;
                    };
                }

                //ShadowPointLightMaxTextureCount
                {
                    comboBox = (ComboBox)pageShadows.Controls["ShadowPointLightMaxTextureCount"];
                    for (int n = 0; n < 4; n++)
                    {
                        comboBox.Items.Add(n);
                        if (n == GameEngineApp.ShadowPointLightMaxTextureCount)
                        {
                            comboBox.SelectedIndex = n;
                        }
                    }
                    comboBox.SelectedIndexChange += delegate(ComboBox sender)
                    {
                        GameEngineApp.ShadowPointLightMaxTextureCount = (int)sender.SelectedItem;
                    };
                }
            }

            //pageSound
            {
                bool enabled = SoundWorld.Instance.DriverName != "NULL";

                Control pageSound = tabControl.Controls["Sound"];

                //soundVolumeCheckBox
                scrollBar              = (ScrollBar)pageSound.Controls["SoundVolume"];
                scrollBar.Value        = enabled ? GameEngineApp.SoundVolume : 0;
                scrollBar.Enable       = enabled;
                scrollBar.ValueChange += delegate(ScrollBar sender)
                {
                    GameEngineApp.SoundVolume = sender.Value;
                };

                //musicVolumeCheckBox
                scrollBar              = (ScrollBar)pageSound.Controls["MusicVolume"];
                scrollBar.Value        = enabled ? GameEngineApp.MusicVolume : 0;
                scrollBar.Enable       = enabled;
                scrollBar.ValueChange += delegate(ScrollBar sender)
                {
                    GameEngineApp.MusicVolume = sender.Value;
                };
            }

            //pageControls
            {
                Control pageControls = tabControl.Controls["Controls"];

                //MouseHSensitivity
                scrollBar              = (ScrollBar)pageControls.Controls["MouseHSensitivity"];
                scrollBar.Value        = GameControlsManager.Instance.MouseSensitivity.X;
                scrollBar.ValueChange += delegate(ScrollBar sender)
                {
                    Vec2 value = GameControlsManager.Instance.MouseSensitivity;
                    value.X = sender.Value;
                    GameControlsManager.Instance.MouseSensitivity = value;
                };

                //MouseVSensitivity
                scrollBar              = (ScrollBar)pageControls.Controls["MouseVSensitivity"];
                scrollBar.Value        = Math.Abs(GameControlsManager.Instance.MouseSensitivity.Y);
                scrollBar.ValueChange += delegate(ScrollBar sender)
                {
                    Vec2 value  = GameControlsManager.Instance.MouseSensitivity;
                    bool invert = ((CheckBox)pageControls.Controls["MouseVInvert"]).Checked;
                    value.Y = sender.Value * (invert ? -1.0f : 1.0f);
                    GameControlsManager.Instance.MouseSensitivity = value;
                };

                //MouseVInvert
                checkBox                = (CheckBox)pageControls.Controls["MouseVInvert"];
                checkBox.Checked        = GameControlsManager.Instance.MouseSensitivity.Y < 0;
                checkBox.CheckedChange += delegate(CheckBox sender)
                {
                    Vec2 value = GameControlsManager.Instance.MouseSensitivity;
                    value.Y =
                        ((ScrollBar)pageControls.Controls["MouseVSensitivity"]).Value *
                        (sender.Checked ? -1.0f : 1.0f);
                    GameControlsManager.Instance.MouseSensitivity = value;
                };

                //AlwaysRun
                checkBox                = (CheckBox)pageControls.Controls["AlwaysRun"];
                checkBox.Checked        = GameControlsManager.Instance.AlwaysRun;
                checkBox.CheckedChange += delegate(CheckBox sender)
                {
                    GameControlsManager.Instance.AlwaysRun = sender.Checked;
                };

                //Devices
                comboBox             = (ComboBox)pageControls.Controls["InputDevices"];
                comboBoxInputDevices = comboBox;
                comboBox.Items.Add("Keyboard/Mouse");
                if (InputDeviceManager.Instance != null)
                {
                    foreach (InputDevice device in InputDeviceManager.Instance.Devices)
                    {
                        comboBox.Items.Add(device);
                    }
                }
                comboBox.SelectedIndex = 0;

                comboBox.SelectedIndexChange += delegate(ComboBox sender)
                {
                    UpdateBindedInputControlsTextBox();
                };

                //Controls
                UpdateBindedInputControlsTextBox();
            }

            //pageLanguage
            {
                Control pageLanguage = tabControl.Controls["Language"];

                //Language
                {
                    comboBox = (ComboBox)pageLanguage.Controls["Language"];

                    List <string> languages = new List <string>();
                    {
                        languages.Add("Autodetect");
                        string[] directories = VirtualDirectory.GetDirectories(LanguageManager.LanguagesDirectory, "*.*",
                                                                               SearchOption.TopDirectoryOnly);
                        foreach (string directory in directories)
                        {
                            languages.Add(Path.GetFileNameWithoutExtension(directory));
                        }
                    }

                    string language = "Autodetect";
                    if (engineConfigBlock != null)
                    {
                        TextBlock localizationBlock = engineConfigBlock.FindChild("Localization");
                        if (localizationBlock != null && localizationBlock.IsAttributeExist("language"))
                        {
                            language = localizationBlock.GetAttribute("language");
                        }
                    }

                    foreach (string lang in languages)
                    {
                        string displayName = lang;
                        if (lang == "Autodetect")
                        {
                            displayName = Translate(lang);
                        }

                        comboBox.Items.Add(new ComboBoxItem(lang, displayName));
                        if (string.Compare(language, lang, true) == 0)
                        {
                            comboBox.SelectedIndex = comboBox.Items.Count - 1;
                        }
                    }
                    if (comboBox.SelectedIndex == -1)
                    {
                        comboBox.SelectedIndex = 0;
                    }

                    comboBox.SelectedIndexChange += comboBoxLanguage_SelectedIndexChange;
                }

                //LanguageRestart
                {
                    Button button = (Button)pageLanguage.Controls["LanguageRestart"];
                    button.Click += buttonLanguageRestart_Click;
                }
            }

            tabControl.SelectedIndex        = lastPageIndex;
            tabControl.SelectedIndexChange += tabControl_SelectedIndexChange;
            UpdatePageButtonsState();
        }
Ejemplo n.º 50
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(FrmPreferences));
     this.fontDialog1     = new System.Windows.Forms.FontDialog();
     this.label1          = new System.Windows.Forms.Label();
     this.txtFontDisplay  = new System.Windows.Forms.TextBox();
     this.btnFontPick     = new System.Windows.Forms.Button();
     this.btnCancel       = new System.Windows.Forms.Button();
     this.btnOK           = new System.Windows.Forms.Button();
     this.tabControl1     = new System.Windows.Forms.TabControl();
     this.tpGeneral       = new System.Windows.Forms.TabPage();
     this.label5          = new System.Windows.Forms.Label();
     this.btnInputFont    = new System.Windows.Forms.Button();
     this.txtInputFont    = new System.Windows.Forms.TextBox();
     this.btnPlay         = new System.Windows.Forms.Button();
     this.btnBellSound    = new System.Windows.Forms.Button();
     this.label4          = new System.Windows.Forms.Label();
     this.txtBellSound    = new System.Windows.Forms.TextBox();
     this.label3          = new System.Windows.Forms.Label();
     this.txtHistSize     = new System.Windows.Forms.TextBox();
     this.txtCommandSep   = new System.Windows.Forms.TextBox();
     this.label2          = new System.Windows.Forms.Label();
     this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
     this.errorProvider1  = new System.Windows.Forms.ErrorProvider();
     this.tabControl1.SuspendLayout();
     this.tpGeneral.SuspendLayout();
     this.SuspendLayout();
     //
     // label1
     //
     this.label1.Location  = new System.Drawing.Point(8, 16);
     this.label1.Name      = "label1";
     this.label1.Size      = new System.Drawing.Size(384, 23);
     this.label1.TabIndex  = 0;
     this.label1.Text      = "Window Font: (Make sure it\'s a monospaced font like Courier New)";
     this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // txtFontDisplay
     //
     this.txtFontDisplay.Location = new System.Drawing.Point(48, 40);
     this.txtFontDisplay.Name     = "txtFontDisplay";
     this.txtFontDisplay.ReadOnly = true;
     this.txtFontDisplay.Size     = new System.Drawing.Size(440, 20);
     this.txtFontDisplay.TabIndex = 0;
     this.txtFontDisplay.TabStop  = false;
     this.txtFontDisplay.Text     = "";
     //
     // btnFontPick
     //
     this.btnFontPick.Location = new System.Drawing.Point(496, 40);
     this.btnFontPick.Name     = "btnFontPick";
     this.btnFontPick.Size     = new System.Drawing.Size(32, 23);
     this.btnFontPick.TabIndex = 0;
     this.btnFontPick.Text     = "...";
     this.btnFontPick.Click   += new System.EventHandler(this.btnFontPick_Click);
     //
     // btnCancel
     //
     this.btnCancel.Location = new System.Drawing.Point(416, 288);
     this.btnCancel.Name     = "btnCancel";
     this.btnCancel.TabIndex = 8;
     this.btnCancel.Text     = "&Cancel";
     this.btnCancel.Click   += new System.EventHandler(this.btnCancel_Click);
     //
     // btnOK
     //
     this.btnOK.Location = new System.Drawing.Point(88, 288);
     this.btnOK.Name     = "btnOK";
     this.btnOK.TabIndex = 7;
     this.btnOK.Text     = "&OK";
     this.btnOK.Click   += new System.EventHandler(this.btnOK_Click);
     //
     // tabControl1
     //
     this.tabControl1.Controls.Add(this.tpGeneral);
     this.tabControl1.Location      = new System.Drawing.Point(8, 8);
     this.tabControl1.Name          = "tabControl1";
     this.tabControl1.SelectedIndex = 0;
     this.tabControl1.Size          = new System.Drawing.Size(544, 272);
     this.tabControl1.TabIndex      = 5;
     //
     // tpGeneral
     //
     this.tpGeneral.Controls.Add(this.label5);
     this.tpGeneral.Controls.Add(this.btnInputFont);
     this.tpGeneral.Controls.Add(this.txtInputFont);
     this.tpGeneral.Controls.Add(this.btnPlay);
     this.tpGeneral.Controls.Add(this.btnBellSound);
     this.tpGeneral.Controls.Add(this.label4);
     this.tpGeneral.Controls.Add(this.txtBellSound);
     this.tpGeneral.Controls.Add(this.label3);
     this.tpGeneral.Controls.Add(this.txtHistSize);
     this.tpGeneral.Controls.Add(this.txtCommandSep);
     this.tpGeneral.Controls.Add(this.label2);
     this.tpGeneral.Controls.Add(this.label1);
     this.tpGeneral.Controls.Add(this.txtFontDisplay);
     this.tpGeneral.Controls.Add(this.btnFontPick);
     this.tpGeneral.Location = new System.Drawing.Point(4, 22);
     this.tpGeneral.Name     = "tpGeneral";
     this.tpGeneral.Size     = new System.Drawing.Size(536, 246);
     this.tpGeneral.TabIndex = 0;
     this.tpGeneral.Text     = "General";
     //
     // label5
     //
     this.label5.Location = new System.Drawing.Point(8, 72);
     this.label5.Name     = "label5";
     this.label5.TabIndex = 12;
     this.label5.Text     = "Input Area Font:";
     //
     // btnInputFont
     //
     this.btnInputFont.Location = new System.Drawing.Point(496, 96);
     this.btnInputFont.Name     = "btnInputFont";
     this.btnInputFont.Size     = new System.Drawing.Size(32, 23);
     this.btnInputFont.TabIndex = 1;
     this.btnInputFont.Text     = "...";
     this.btnInputFont.Click   += new System.EventHandler(this.btnInputFont_Click);
     //
     // txtInputFont
     //
     this.txtInputFont.Location = new System.Drawing.Point(48, 96);
     this.txtInputFont.Name     = "txtInputFont";
     this.txtInputFont.ReadOnly = true;
     this.txtInputFont.Size     = new System.Drawing.Size(440, 20);
     this.txtInputFont.TabIndex = 0;
     this.txtInputFont.TabStop  = false;
     this.txtInputFont.Text     = "";
     //
     // btnPlay
     //
     this.btnPlay.Image    = ((System.Drawing.Image)(resources.GetObject("btnPlay.Image")));
     this.btnPlay.Location = new System.Drawing.Point(496, 208);
     this.btnPlay.Name     = "btnPlay";
     this.btnPlay.Size     = new System.Drawing.Size(32, 23);
     this.btnPlay.TabIndex = 6;
     this.btnPlay.Click   += new System.EventHandler(this.btnPlay_Click);
     //
     // btnBellSound
     //
     this.btnBellSound.Location = new System.Drawing.Point(464, 208);
     this.btnBellSound.Name     = "btnBellSound";
     this.btnBellSound.Size     = new System.Drawing.Size(32, 23);
     this.btnBellSound.TabIndex = 5;
     this.btnBellSound.Text     = "...";
     this.btnBellSound.Click   += new System.EventHandler(this.btnBellSound_Click);
     //
     // label4
     //
     this.label4.Location = new System.Drawing.Point(72, 208);
     this.label4.Name     = "label4";
     this.label4.TabIndex = 8;
     this.label4.Text     = "Bell Sound:";
     //
     // txtBellSound
     //
     this.txtBellSound.Location = new System.Drawing.Point(184, 208);
     this.txtBellSound.Name     = "txtBellSound";
     this.txtBellSound.Size     = new System.Drawing.Size(272, 20);
     this.txtBellSound.TabIndex = 4;
     this.txtBellSound.Text     = "";
     //
     // label3
     //
     this.label3.Location = new System.Drawing.Point(16, 176);
     this.label3.Name     = "label3";
     this.label3.Size     = new System.Drawing.Size(152, 23);
     this.label3.TabIndex = 6;
     this.label3.Text     = "Command History Size:";
     //
     // txtHistSize
     //
     this.txtHistSize.Location    = new System.Drawing.Point(184, 176);
     this.txtHistSize.Name        = "txtHistSize";
     this.txtHistSize.Size        = new System.Drawing.Size(48, 20);
     this.txtHistSize.TabIndex    = 3;
     this.txtHistSize.Text        = "";
     this.txtHistSize.Validating += new System.ComponentModel.CancelEventHandler(this.txtHistSize_Validating);
     //
     // txtCommandSep
     //
     this.txtCommandSep.Location  = new System.Drawing.Point(184, 128);
     this.txtCommandSep.MaxLength = 1;
     this.txtCommandSep.Name      = "txtCommandSep";
     this.txtCommandSep.Size      = new System.Drawing.Size(24, 20);
     this.txtCommandSep.TabIndex  = 2;
     this.txtCommandSep.Text      = "";
     //
     // label2
     //
     this.label2.Location = new System.Drawing.Point(8, 128);
     this.label2.Name     = "label2";
     this.label2.Size     = new System.Drawing.Size(168, 23);
     this.label2.TabIndex = 3;
     this.label2.Text     = "Command Seperator Character:";
     //
     // openFileDialog1
     //
     this.openFileDialog1.Filter = "Wav files (*.wav)|*.wav|All files (*.*) | *.*";
     //
     // errorProvider1
     //
     this.errorProvider1.ContainerControl = this;
     //
     // FrmPreferences
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(560, 317);
     this.Controls.Add(this.tabControl1);
     this.Controls.Add(this.btnOK);
     this.Controls.Add(this.btnCancel);
     this.Name  = "FrmPreferences";
     this.Text  = "Preferences";
     this.Load += new System.EventHandler(this.FrmPreferences_Load);
     this.tabControl1.ResumeLayout(false);
     this.tpGeneral.ResumeLayout(false);
     this.ResumeLayout(false);
 }
Ejemplo n.º 51
0
        public AddInScoutViewContent() : base()
        {
            this.TitleName = "AddIn Scout";

            Panel p = new Panel();

            p.Dock        = DockStyle.Fill;
            p.BorderStyle = BorderStyle.FixedSingle;

            Panel RightPanel = new Panel();

            RightPanel.Dock = DockStyle.Fill;
            p.Controls.Add(RightPanel);

            codonListPanel.Dock = DockStyle.Fill;
            codonListPanel.CurrentAddinChanged += new EventHandler(CodonListPanelCurrentAddinChanged);
            RightPanel.Controls.Add(codonListPanel);

            Splitter hs = new Splitter();

            hs.Dock = DockStyle.Top;
            RightPanel.Controls.Add(hs);

            addInDetailsPanel.Dock   = DockStyle.Top;
            addInDetailsPanel.Height = 175;
            RightPanel.Controls.Add(addInDetailsPanel);

            Splitter s1 = new Splitter();

            s1.Dock = DockStyle.Left;
            p.Controls.Add(s1);

            AddinTreeView addinTreeView = new AddinTreeView();

            addinTreeView.Dock = DockStyle.Fill;
            addinTreeView.treeView.AfterSelect += new TreeViewEventHandler(this.tvSelectHandler);

            TreeTreeView treeTreeView = new TreeTreeView();

            treeTreeView.Dock = DockStyle.Fill;
            treeTreeView.treeView.AfterSelect += new TreeViewEventHandler(this.tvSelectHandler);

            TabControl tab = new TabControl();

            tab.Width = 300;
            tab.Dock  = DockStyle.Left;

            TabPage tabPage2 = new TabPage("Tree");

            tabPage2.Dock = DockStyle.Left;
            tabPage2.Controls.Add(treeTreeView);
            tab.TabPages.Add(tabPage2);

            TabPage tabPage = new TabPage("AddIns");

            tabPage.Dock = DockStyle.Left;
            tabPage.Controls.Add(addinTreeView);
            tab.TabPages.Add(tabPage);

            p.Controls.Add(tab);

            this.control   = p;
            this.TitleName = "AddIn Scout";
        }
Ejemplo n.º 52
0
 void tabControl_SelectedIndexChange(TabControl sender)
 {
     lastPageIndex = sender.SelectedIndex;
     UpdatePageButtonsState();
 }
Ejemplo n.º 53
0
        public TaskDialog(Manager manager) : base(manager)
        {
            //Alpha = 200;
            Height        = 520;
            MinimumWidth  = 254;
            MinimumHeight = 160;
            Center();

            TopPanel.Height      = 80;
            TopPanel.BevelStyle  = BevelStyle.None;
            TopPanel.BevelBorder = BevelBorder.None;
            Caption.Visible      = false;
            Description.Visible  = false;
            Text = "Dialog Template";

            imgTop = new ImageBox(manager);
            imgTop.Init();
            // imgTop.Parent = TopPanel;
            imgTop.Top      = 0;
            imgTop.Left     = 0;
            imgTop.Width    = TopPanel.ClientWidth;
            imgTop.Height   = TopPanel.ClientHeight;
            imgTop.Anchor   = Anchors.Left | Anchors.Top | Anchors.Right | Anchors.Bottom;
            imgTop.SizeMode = SizeMode.Normal;
            imgTop.Image    = Manager.Content.Load <Texture2D>("Content\\Images\\Caption");

            tbcMain = new TabControl(manager);
            tbcMain.Init();
            tbcMain.Parent = this;
            tbcMain.Left   = 4;
            tbcMain.Top    = TopPanel.Height + 4;
            tbcMain.Width  = ClientArea.Width - 8;
            tbcMain.Height = ClientArea.Height - 8 - TopPanel.Height - BottomPanel.Height;
            tbcMain.Anchor = Anchors.All;
            tbcMain.AddPage();
            tbcMain.TabPages[0].Text = "First";
            tbcMain.AddPage();
            tbcMain.TabPages[1].Text = "Second";
            tbcMain.AddPage();
            tbcMain.TabPages[2].Text = "Third";

            btnFirst = new Button(manager);
            btnFirst.Init();
            btnFirst.Parent = tbcMain.TabPages[0];
            btnFirst.Anchor = Anchors.Left | Anchors.Top | Anchors.Right;
            btnFirst.Top    = 8;
            btnFirst.Left   = 8;
            btnFirst.Width  = btnFirst.Parent.ClientWidth - 16;
            btnFirst.Text   = ">>> First Page Button <<<";

            grpFirst = new GroupPanel(manager);
            grpFirst.Init();
            grpFirst.Parent = tbcMain.TabPages[0];
            grpFirst.Anchor = Anchors.All;
            //grpFirst.Type = GroupBoxType.Flat;
            grpFirst.Left   = 8;
            grpFirst.Top    = btnFirst.Top + btnFirst.Height + 4;
            grpFirst.Width  = btnFirst.Parent.ClientWidth - 16;
            grpFirst.Height = btnFirst.Parent.ClientHeight - grpFirst.Top - 8;

            btnSecond = new Button(manager);
            btnSecond.Init();
            btnSecond.Parent = tbcMain.TabPages[1];
            btnSecond.Anchor = Anchors.Left | Anchors.Top | Anchors.Right;
            btnSecond.Top    = 8;
            btnSecond.Left   = 8;
            btnSecond.Width  = btnSecond.Parent.ClientWidth - 16;
            btnSecond.Text   = ">>> Second Page Button <<<";

            btnThird = new Button(manager);
            btnThird.Init();
            btnThird.Parent = tbcMain.TabPages[2];
            btnThird.Anchor = Anchors.Left | Anchors.Top | Anchors.Right;
            btnThird.Top    = 8;
            btnThird.Left   = 8;
            btnThird.Width  = btnThird.Parent.ClientWidth - 16;
            btnThird.Text   = ">>> Third Page Button <<<";

            btnOk = new Button(manager);
            btnOk.Init();
            btnOk.Parent      = BottomPanel;
            btnOk.Anchor      = Anchors.Top | Anchors.Right;
            btnOk.Top         = btnOk.Parent.ClientHeight - btnOk.Height - 8;
            btnOk.Left        = btnOk.Parent.ClientWidth - 8 - btnOk.Width * 3 - 8;
            btnOk.Text        = "OK";
            btnOk.ModalResult = ModalResult.Ok;

            btnApply = new Button(manager);
            btnApply.Init();
            btnApply.Parent = BottomPanel;
            btnApply.Anchor = Anchors.Top | Anchors.Right;
            btnApply.Top    = btnOk.Parent.ClientHeight - btnOk.Height - 8;
            btnApply.Left   = btnOk.Parent.ClientWidth - 4 - btnOk.Width * 2 - 8;
            btnApply.Text   = "Apply";
            btnApply.Alpha  = 128;

            btnClose = new Button(manager);
            btnClose.Init();
            btnClose.Parent      = BottomPanel;
            btnClose.Anchor      = Anchors.Top | Anchors.Right;
            btnClose.Top         = btnOk.Parent.ClientHeight - btnClose.Height - 8;
            btnClose.Left        = btnOk.Parent.ClientWidth - btnClose.Width - 8;
            btnClose.Text        = "Close";
            btnClose.ModalResult = ModalResult.Cancel;

            btnFirst.Focused = true;

            var lblMsg = new Label(Manager)
            {
                Width     = 100,
                Text      = "Testing123 Alpha",
                Left      = 10,
                Top       = 24,
                Alignment = Alignment.TopLeft,
            };

            lblMsg.Init();
            lblMsg.Alpha = 255;
            Add(lblMsg);
        }
Ejemplo n.º 54
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(FormMain));
     this.mainMenu1               = new System.Windows.Forms.MainMenu(this.components);
     this.toolTip1                = new System.Windows.Forms.ToolTip(this.components);
     this.tabControl1             = new System.Windows.Forms.TabControl();
     this.tabPageDay              = new System.Windows.Forms.TabPage();
     this.tabPageArc              = new System.Windows.Forms.TabPage();
     this.tabPageMPoll            = new System.Windows.Forms.TabPage();
     this.tabPageRecords          = new System.Windows.Forms.TabPage();
     this.tabPageSnowGG           = new System.Windows.Forms.TabPage();
     this.tabPageSetup            = new System.Windows.Forms.TabPage();
     this.tabPageUpdater          = new System.Windows.Forms.TabPage();
     this.tabControl2             = new System.Windows.Forms.TabControl();
     this.tabPageDailyImport      = new System.Windows.Forms.TabPage();
     this.tabPageFdrImport        = new System.Windows.Forms.TabPage();
     this.tabPageRating           = new System.Windows.Forms.TabPage();
     this.ratingTable1            = new HydrometTools.RatingTableDisplay();
     this.tabPageAdvanced         = new System.Windows.Forms.TabPage();
     this.tabPageAgrimet          = new System.Windows.Forms.TabPage();
     this.agriMetTab1             = new HydrometTools.AgriMet.AgriMetTab();
     this.tabPageHydrographEditor = new System.Windows.Forms.TabPage();
     this.tabPageStats            = new System.Windows.Forms.TabPage();
     this.tabPageReports          = new System.Windows.Forms.TabPage();
     this.statusStrip1            = new System.Windows.Forms.StatusStrip();
     this.toolStripStatusLabel1   = new System.Windows.Forms.ToolStripStatusLabel();
     this.tabPageShifts           = new System.Windows.Forms.TabPage();
     this.tabControl1.SuspendLayout();
     this.tabPageUpdater.SuspendLayout();
     this.tabControl2.SuspendLayout();
     this.tabPageRating.SuspendLayout();
     this.tabPageAgrimet.SuspendLayout();
     this.statusStrip1.SuspendLayout();
     this.SuspendLayout();
     //
     // tabControl1
     //
     this.tabControl1.Controls.Add(this.tabPageDay);
     this.tabControl1.Controls.Add(this.tabPageArc);
     this.tabControl1.Controls.Add(this.tabPageMPoll);
     this.tabControl1.Controls.Add(this.tabPageRecords);
     this.tabControl1.Controls.Add(this.tabPageSnowGG);
     this.tabControl1.Controls.Add(this.tabPageSetup);
     this.tabControl1.Controls.Add(this.tabPageUpdater);
     this.tabControl1.Controls.Add(this.tabPageRating);
     this.tabControl1.Controls.Add(this.tabPageAdvanced);
     this.tabControl1.Controls.Add(this.tabPageAgrimet);
     this.tabControl1.Controls.Add(this.tabPageHydrographEditor);
     this.tabControl1.Controls.Add(this.tabPageStats);
     this.tabControl1.Controls.Add(this.tabPageReports);
     this.tabControl1.Controls.Add(this.tabPageShifts);
     this.tabControl1.Dock                  = System.Windows.Forms.DockStyle.Fill;
     this.tabControl1.Location              = new System.Drawing.Point(0, 0);
     this.tabControl1.Name                  = "tabControl1";
     this.tabControl1.SelectedIndex         = 0;
     this.tabControl1.Size                  = new System.Drawing.Size(942, 522);
     this.tabControl1.TabIndex              = 0;
     this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
     //
     // tabPageDay
     //
     this.tabPageDay.Location = new System.Drawing.Point(4, 22);
     this.tabPageDay.Name     = "tabPageDay";
     this.tabPageDay.Padding  = new System.Windows.Forms.Padding(3);
     this.tabPageDay.Size     = new System.Drawing.Size(934, 496);
     this.tabPageDay.TabIndex = 0;
     this.tabPageDay.Text     = "Instant";
     this.tabPageDay.UseVisualStyleBackColor = true;
     //
     // tabPageArc
     //
     this.tabPageArc.Location = new System.Drawing.Point(4, 22);
     this.tabPageArc.Name     = "tabPageArc";
     this.tabPageArc.Padding  = new System.Windows.Forms.Padding(3);
     this.tabPageArc.Size     = new System.Drawing.Size(934, 496);
     this.tabPageArc.TabIndex = 1;
     this.tabPageArc.Text     = "Daily";
     this.tabPageArc.UseVisualStyleBackColor = true;
     //
     // tabPageMPoll
     //
     this.tabPageMPoll.Location = new System.Drawing.Point(4, 22);
     this.tabPageMPoll.Name     = "tabPageMPoll";
     this.tabPageMPoll.Padding  = new System.Windows.Forms.Padding(3);
     this.tabPageMPoll.Size     = new System.Drawing.Size(934, 496);
     this.tabPageMPoll.TabIndex = 8;
     this.tabPageMPoll.Text     = "Monthly";
     this.tabPageMPoll.UseVisualStyleBackColor = true;
     //
     // tabPageRecords
     //
     this.tabPageRecords.Location = new System.Drawing.Point(4, 22);
     this.tabPageRecords.Name     = "tabPageRecords";
     this.tabPageRecords.Padding  = new System.Windows.Forms.Padding(3);
     this.tabPageRecords.Size     = new System.Drawing.Size(934, 496);
     this.tabPageRecords.TabIndex = 17;
     this.tabPageRecords.Text     = "Daily Records";
     this.tabPageRecords.UseVisualStyleBackColor = true;
     //
     // tabPageSnowGG
     //
     this.tabPageSnowGG.Location = new System.Drawing.Point(4, 22);
     this.tabPageSnowGG.Name     = "tabPageSnowGG";
     this.tabPageSnowGG.Padding  = new System.Windows.Forms.Padding(3);
     this.tabPageSnowGG.Size     = new System.Drawing.Size(934, 496);
     this.tabPageSnowGG.TabIndex = 2;
     this.tabPageSnowGG.Text     = "SnowGG";
     this.tabPageSnowGG.UseVisualStyleBackColor = true;
     //
     // tabPageSetup
     //
     this.tabPageSetup.Location = new System.Drawing.Point(4, 22);
     this.tabPageSetup.Name     = "tabPageSetup";
     this.tabPageSetup.Padding  = new System.Windows.Forms.Padding(3);
     this.tabPageSetup.Size     = new System.Drawing.Size(934, 496);
     this.tabPageSetup.TabIndex = 3;
     this.tabPageSetup.Text     = "settings";
     this.tabPageSetup.UseVisualStyleBackColor = true;
     //
     // tabPageUpdater
     //
     this.tabPageUpdater.Controls.Add(this.tabControl2);
     this.tabPageUpdater.Location = new System.Drawing.Point(4, 22);
     this.tabPageUpdater.Name     = "tabPageUpdater";
     this.tabPageUpdater.Padding  = new System.Windows.Forms.Padding(3);
     this.tabPageUpdater.Size     = new System.Drawing.Size(934, 496);
     this.tabPageUpdater.TabIndex = 6;
     this.tabPageUpdater.Text     = "Data Import";
     this.tabPageUpdater.UseVisualStyleBackColor = true;
     //
     // tabControl2
     //
     this.tabControl2.Controls.Add(this.tabPageDailyImport);
     this.tabControl2.Controls.Add(this.tabPageFdrImport);
     this.tabControl2.Dock          = System.Windows.Forms.DockStyle.Fill;
     this.tabControl2.Location      = new System.Drawing.Point(3, 3);
     this.tabControl2.Name          = "tabControl2";
     this.tabControl2.SelectedIndex = 0;
     this.tabControl2.Size          = new System.Drawing.Size(928, 490);
     this.tabControl2.TabIndex      = 0;
     //
     // tabPageDailyImport
     //
     this.tabPageDailyImport.Location = new System.Drawing.Point(4, 22);
     this.tabPageDailyImport.Name     = "tabPageDailyImport";
     this.tabPageDailyImport.Padding  = new System.Windows.Forms.Padding(3);
     this.tabPageDailyImport.Size     = new System.Drawing.Size(920, 464);
     this.tabPageDailyImport.TabIndex = 0;
     this.tabPageDailyImport.Text     = "Daily";
     this.tabPageDailyImport.UseVisualStyleBackColor = true;
     //
     // tabPageFdrImport
     //
     this.tabPageFdrImport.Location = new System.Drawing.Point(4, 22);
     this.tabPageFdrImport.Name     = "tabPageFdrImport";
     this.tabPageFdrImport.Padding  = new System.Windows.Forms.Padding(3);
     this.tabPageFdrImport.Size     = new System.Drawing.Size(920, 464);
     this.tabPageFdrImport.TabIndex = 1;
     this.tabPageFdrImport.Text     = "FDR - Water Quality";
     this.tabPageFdrImport.UseVisualStyleBackColor = true;
     //
     // tabPageRating
     //
     this.tabPageRating.Controls.Add(this.ratingTable1);
     this.tabPageRating.Location = new System.Drawing.Point(4, 22);
     this.tabPageRating.Name     = "tabPageRating";
     this.tabPageRating.Padding  = new System.Windows.Forms.Padding(3);
     this.tabPageRating.Size     = new System.Drawing.Size(934, 496);
     this.tabPageRating.TabIndex = 7;
     this.tabPageRating.Text     = "Rating Tables";
     this.tabPageRating.UseVisualStyleBackColor = true;
     //
     // ratingTable1
     //
     this.ratingTable1.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.ratingTable1.Location = new System.Drawing.Point(3, 3);
     this.ratingTable1.Margin   = new System.Windows.Forms.Padding(4);
     this.ratingTable1.Name     = "ratingTable1";
     this.ratingTable1.Size     = new System.Drawing.Size(928, 490);
     this.ratingTable1.TabIndex = 0;
     //
     // tabPageAdvanced
     //
     this.tabPageAdvanced.Location = new System.Drawing.Point(4, 22);
     this.tabPageAdvanced.Name     = "tabPageAdvanced";
     this.tabPageAdvanced.Size     = new System.Drawing.Size(934, 496);
     this.tabPageAdvanced.TabIndex = 9;
     this.tabPageAdvanced.Text     = "Advanced";
     this.tabPageAdvanced.UseVisualStyleBackColor = true;
     //
     // tabPageAgrimet
     //
     this.tabPageAgrimet.Controls.Add(this.agriMetTab1);
     this.tabPageAgrimet.Location = new System.Drawing.Point(4, 22);
     this.tabPageAgrimet.Name     = "tabPageAgrimet";
     this.tabPageAgrimet.Padding  = new System.Windows.Forms.Padding(3);
     this.tabPageAgrimet.Size     = new System.Drawing.Size(934, 496);
     this.tabPageAgrimet.TabIndex = 10;
     this.tabPageAgrimet.Text     = "AgriMet";
     this.tabPageAgrimet.UseVisualStyleBackColor = true;
     //
     // agriMetTab1
     //
     this.agriMetTab1.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.agriMetTab1.Location = new System.Drawing.Point(3, 3);
     this.agriMetTab1.Margin   = new System.Windows.Forms.Padding(4);
     this.agriMetTab1.Name     = "agriMetTab1";
     this.agriMetTab1.Size     = new System.Drawing.Size(928, 490);
     this.agriMetTab1.TabIndex = 0;
     //
     // tabPageHydrographEditor
     //
     this.tabPageHydrographEditor.Location = new System.Drawing.Point(4, 22);
     this.tabPageHydrographEditor.Name     = "tabPageHydrographEditor";
     this.tabPageHydrographEditor.Padding  = new System.Windows.Forms.Padding(3);
     this.tabPageHydrographEditor.Size     = new System.Drawing.Size(934, 496);
     this.tabPageHydrographEditor.TabIndex = 12;
     this.tabPageHydrographEditor.Text     = "Hydrograph Editor";
     this.tabPageHydrographEditor.UseVisualStyleBackColor = true;
     //
     // tabPageStats
     //
     this.tabPageStats.Location = new System.Drawing.Point(4, 22);
     this.tabPageStats.Name     = "tabPageStats";
     this.tabPageStats.Padding  = new System.Windows.Forms.Padding(3);
     this.tabPageStats.Size     = new System.Drawing.Size(934, 496);
     this.tabPageStats.TabIndex = 15;
     this.tabPageStats.Text     = "Check";
     this.tabPageStats.UseVisualStyleBackColor = true;
     //
     // tabPageReports
     //
     this.tabPageReports.Location = new System.Drawing.Point(4, 22);
     this.tabPageReports.Name     = "tabPageReports";
     this.tabPageReports.Padding  = new System.Windows.Forms.Padding(3);
     this.tabPageReports.Size     = new System.Drawing.Size(934, 496);
     this.tabPageReports.TabIndex = 16;
     this.tabPageReports.Text     = "Reports";
     this.tabPageReports.UseVisualStyleBackColor = true;
     //
     // statusStrip1
     //
     this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.toolStripStatusLabel1
     });
     this.statusStrip1.Location = new System.Drawing.Point(0, 522);
     this.statusStrip1.Name     = "statusStrip1";
     this.statusStrip1.Size     = new System.Drawing.Size(942, 22);
     this.statusStrip1.TabIndex = 1;
     //
     // toolStripStatusLabel1
     //
     this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
     this.toolStripStatusLabel1.Size = new System.Drawing.Size(118, 17);
     this.toolStripStatusLabel1.Text = "toolStripStatusLabel1";
     //
     // tabPageShifts
     //
     this.tabPageShifts.Location = new System.Drawing.Point(4, 22);
     this.tabPageShifts.Name     = "tabPageShifts";
     this.tabPageShifts.Padding  = new System.Windows.Forms.Padding(3);
     this.tabPageShifts.Size     = new System.Drawing.Size(934, 496);
     this.tabPageShifts.TabIndex = 18;
     this.tabPageShifts.Text     = "Shifts";
     this.tabPageShifts.UseVisualStyleBackColor = true;
     //
     // FormMain
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize          = new System.Drawing.Size(942, 544);
     this.Controls.Add(this.tabControl1);
     this.Controls.Add(this.statusStrip1);
     this.HelpButton  = true;
     this.Icon        = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.Menu        = this.mainMenu1;
     this.MinimumSize = new System.Drawing.Size(723, 419);
     this.Name        = "FormMain";
     this.Text        = "Hydromet/AgriMet Tools";
     this.tabControl1.ResumeLayout(false);
     this.tabPageUpdater.ResumeLayout(false);
     this.tabControl2.ResumeLayout(false);
     this.tabPageRating.ResumeLayout(false);
     this.tabPageAgrimet.ResumeLayout(false);
     this.statusStrip1.ResumeLayout(false);
     this.statusStrip1.PerformLayout();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Ejemplo n.º 55
0
        private void CreateEditors()
        {
            SuspendLayout();
            PropertyModelView propertyModelView = _registeredViews[0];
            int nonemptyGroups = 0;

            foreach (PropertyDescriptor property in propertyModelView.GetProperties())
            {
                if (property.GetChildProperties().Count > 0)
                {
                    ++nonemptyGroups;
                }
            }

            if (nonemptyGroups < 2 || propertyModelView.SectionCount < 2)
            {
                bool drawBox = false;
                PropertyDescriptorCollection properties    = propertyModelView.GetProperties();
                DialogSectionControl         clientControl =
                    new DialogSectionControl(this, properties, drawBox, this.Title);
                topLevelControlMap[View.Handler.ID] = clientControl;
                this.Controls.Add(clientControl);
                sectionControl = clientControl;
                minHeight      = clientControl.PreferredSize.Height;
                minWidth       = clientControl.PreferredSize.Width;
                topControl     = clientControl;
            }
            else
            {
                TabControl multipleCategoryTabControl = new TabControl()
                {
                    Multiline = multiLine
                };
                if (multiLine)
                {
                    multipleCategoryTabControl.SizeMode = TabSizeMode.FillToRight;
                }
                Controls.Add(multipleCategoryTabControl);
                sectionControl = multipleCategoryTabControl;
                PropertyDescriptorCollection properties = propertyModelView.GetProperties();
                foreach (PropertyDescriptor property in properties)
                {
                    if (property.GetChildProperties().Count == 0)
                    {
                        continue;
                    }
                    string  category = property.Category;
                    string  name     = category.TrimStart('\r');
                    TabPage page     = new TabPage(name);
                    page.Name = name;
                    DialogSectionControl clientControl =
                        new DialogSectionControl(this, property.GetChildProperties(), property, false);
                    page.Controls.Add(clientControl);
                    topLevelControlMap[
                        ((PropertyModelView.OptionItemPropertyDescriptor)
                             ((PropertyModelView.OptionItemPropertyDescriptor)property).Owner).ID] = clientControl;
                    page.Dock = DockStyle.Fill;
                    multipleCategoryTabControl.TabPages.Add(page);
                    minHeight = Math.Max(minHeight, clientControl.Height);
                    minWidth  = Math.Max(minWidth, clientControl.PreferredSize.Width);
                }

                minWidth += 3;
                int tabSize = 0;
                if (multiLine)
                {
                    for (int i = 0; i < multipleCategoryTabControl.TabCount; ++i)
                    {
                        var rect = multipleCategoryTabControl.GetTabRect(i);
                        tabSize = Math.Max(tabSize, rect.Location.Y);
                    }
                }
                else
                {
                    tabSize = multipleCategoryTabControl.ItemSize.Height;
                }
                minHeight += tabSize + multipleCategoryTabControl.Margin.Vertical;

                multipleCategoryTabControl.Width  = minWidth;
                multipleCategoryTabControl.Height = minHeight;
                topControl = multipleCategoryTabControl;
                multipleCategoryTabControl.Dock = DockStyle.Fill;
            }

            ResumeLayout(false);
        }
Ejemplo n.º 56
0
        public void Close()
        {
            TabControl tabControl = (TabControl)(this.tabPage.Parent);

            tabControl.TabPages.Remove(this.tabPage);
        }
Ejemplo n.º 57
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();
     this.panel                 = new System.Windows.Forms.Panel();
     this.fileTab               = new System.Windows.Forms.TabControl();
     this.tabPageFiles          = new System.Windows.Forms.TabPage();
     this.buttonExtractData     = new System.Windows.Forms.Button();
     this.buttonRemoveFiles     = new System.Windows.Forms.Button();
     this.buttonAddFiles        = new System.Windows.Forms.Button();
     this.listBoxFiles          = new System.Windows.Forms.ListBox();
     this.mainMenu              = new System.Windows.Forms.MainMenu(this.components);
     this.menuItemClose         = new System.Windows.Forms.MenuItem();
     this.openFileDialog        = new System.Windows.Forms.OpenFileDialog();
     this.propComboBox          = new System.Windows.Forms.ComboBox();
     this.substanceTypeComboBox = new System.Windows.Forms.ComboBox();
     this.panel.SuspendLayout();
     this.fileTab.SuspendLayout();
     this.tabPageFiles.SuspendLayout();
     this.SuspendLayout();
     //
     // panel
     //
     this.panel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
     this.panel.Controls.Add(this.fileTab);
     this.panel.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.panel.Location = new System.Drawing.Point(0, 0);
     this.panel.Name     = "panel";
     this.panel.Size     = new System.Drawing.Size(579, 398);
     this.panel.TabIndex = 1;
     //
     // fileTab
     //
     this.fileTab.Controls.Add(this.tabPageFiles);
     this.fileTab.Dock          = System.Windows.Forms.DockStyle.Fill;
     this.fileTab.Location      = new System.Drawing.Point(0, 0);
     this.fileTab.Name          = "fileTab";
     this.fileTab.SelectedIndex = 0;
     this.fileTab.Size          = new System.Drawing.Size(575, 394);
     this.fileTab.TabIndex      = 5;
     //
     // tabPageFiles
     //
     this.tabPageFiles.Controls.Add(this.substanceTypeComboBox);
     this.tabPageFiles.Controls.Add(this.propComboBox);
     this.tabPageFiles.Controls.Add(this.buttonExtractData);
     this.tabPageFiles.Controls.Add(this.buttonRemoveFiles);
     this.tabPageFiles.Controls.Add(this.buttonAddFiles);
     this.tabPageFiles.Controls.Add(this.listBoxFiles);
     this.tabPageFiles.Location = new System.Drawing.Point(4, 22);
     this.tabPageFiles.Name     = "tabPageFiles";
     this.tabPageFiles.Padding  = new System.Windows.Forms.Padding(3);
     this.tabPageFiles.Size     = new System.Drawing.Size(567, 368);
     this.tabPageFiles.TabIndex = 1;
     this.tabPageFiles.Text     = "File Panel";
     this.tabPageFiles.UseVisualStyleBackColor = true;
     this.tabPageFiles.MouseClick += new System.Windows.Forms.MouseEventHandler(this.tabPageFiles_MouseClick);
     //
     // buttonExtractData
     //
     this.buttonExtractData.AllowDrop = true;
     this.buttonExtractData.Location  = new System.Drawing.Point(466, 339);
     this.buttonExtractData.Name      = "buttonExtractData";
     this.buttonExtractData.Size      = new System.Drawing.Size(98, 23);
     this.buttonExtractData.TabIndex  = 3;
     this.buttonExtractData.Text      = "Extract Data";
     this.buttonExtractData.UseVisualStyleBackColor = true;
     this.buttonExtractData.Click += new System.EventHandler(this.buttonExtractData_Click);
     //
     // buttonRemoveFiles
     //
     this.buttonRemoveFiles.Location = new System.Drawing.Point(84, 339);
     this.buttonRemoveFiles.Name     = "buttonRemoveFiles";
     this.buttonRemoveFiles.Size     = new System.Drawing.Size(75, 23);
     this.buttonRemoveFiles.TabIndex = 2;
     this.buttonRemoveFiles.Text     = "Remove";
     this.buttonRemoveFiles.UseVisualStyleBackColor = true;
     this.buttonRemoveFiles.Click += new System.EventHandler(this.buttonRemoveFiles_Click);
     //
     // buttonAddFiles
     //
     this.buttonAddFiles.Location = new System.Drawing.Point(3, 339);
     this.buttonAddFiles.Name     = "buttonAddFiles";
     this.buttonAddFiles.Size     = new System.Drawing.Size(75, 23);
     this.buttonAddFiles.TabIndex = 1;
     this.buttonAddFiles.Text     = "Add";
     this.buttonAddFiles.UseVisualStyleBackColor = true;
     this.buttonAddFiles.Click += new System.EventHandler(this.buttonAddFiles_Click);
     //
     // listBoxFiles
     //
     this.listBoxFiles.FormattingEnabled   = true;
     this.listBoxFiles.HorizontalScrollbar = true;
     this.listBoxFiles.Location            = new System.Drawing.Point(6, 6);
     this.listBoxFiles.Name          = "listBoxFiles";
     this.listBoxFiles.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended;
     this.listBoxFiles.Size          = new System.Drawing.Size(555, 316);
     this.listBoxFiles.TabIndex      = 0;
     //
     // mainMenu
     //
     this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.menuItemClose
     });
     //
     // menuItemClose
     //
     this.menuItemClose.Index  = 0;
     this.menuItemClose.Text   = "Close";
     this.menuItemClose.Click += new System.EventHandler(this.menuItemClose_Click);
     //
     // openFileDialog
     //
     this.openFileDialog.Multiselect = true;
     //
     // propComboBox
     //
     this.propComboBox.FormattingEnabled = true;
     this.propComboBox.Items.AddRange(new object[] {
         "GasCp",
         "LiquidCp",
         "SolidCp",
         "EvapHeat",
         "VapPressure",
         "LiquidDensity",
         "GasVisc",
         "LiquidVisc",
         "GasK",
         "LiquidK",
         "SurfaceTension",
         "EnthalpyOfFormation",
         "CriticalProp"
     });
     this.propComboBox.Location              = new System.Drawing.Point(329, 341);
     this.propComboBox.Name                  = "propComboBox";
     this.propComboBox.Size                  = new System.Drawing.Size(121, 21);
     this.propComboBox.TabIndex              = 4;
     this.propComboBox.SelectedIndexChanged += new System.EventHandler(this.propComboBox_SelectedIndexChanged);
     //
     // substanceTypeComboBox
     //
     this.substanceTypeComboBox.FormattingEnabled = true;
     this.substanceTypeComboBox.Items.AddRange(new object[] {
         "Inorganic",
         "Organic"
     });
     this.substanceTypeComboBox.Location              = new System.Drawing.Point(187, 339);
     this.substanceTypeComboBox.Name                  = "substanceTypeComboBox";
     this.substanceTypeComboBox.Size                  = new System.Drawing.Size(121, 21);
     this.substanceTypeComboBox.TabIndex              = 5;
     this.substanceTypeComboBox.SelectedIndexChanged += new System.EventHandler(this.substanceTypeComboBox_SelectedIndexChanged);
     //
     // MainForm
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(579, 398);
     this.Controls.Add(this.panel);
     this.Menu          = this.mainMenu;
     this.Name          = "MainForm";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text          = "Data Extraction Manager";
     this.panel.ResumeLayout(false);
     this.fileTab.ResumeLayout(false);
     this.tabPageFiles.ResumeLayout(false);
     this.ResumeLayout(false);
 }
Ejemplo n.º 58
0
        private Control GetEditorControl(object value)
        {
            TabControl tab_control = new TabControl();

            tab_control.Dock = DockStyle.Fill;
            TabPage custom_tab = new TabPage("Custom");
            TabPage web_tab    = new TabPage("Web");
            TabPage system_tab = new TabPage("System");

            ColorListBox web_listbox    = new ColorListBox();
            ColorListBox system_listbox = new ColorListBox();

            web_listbox.Dock    = DockStyle.Fill;
            system_listbox.Dock = DockStyle.Fill;

            web_tab.Controls.Add(web_listbox);
            system_tab.Controls.Add(system_listbox);

            SystemColorCompare system_compare = new SystemColorCompare();

            System.Collections.ArrayList color_list = new System.Collections.ArrayList();
            foreach (System.Reflection.PropertyInfo property in typeof(SystemColors).GetProperties(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static))
            {
                Color clr = (Color)property.GetValue(null, null);
                color_list.Add(clr);
            }
            color_list.Sort(system_compare);
            system_listbox.Items.AddRange(color_list.ToArray());
            system_listbox.MouseUp += new MouseEventHandler(HandleMouseUp);
            system_listbox.SelectedValueChanged += new EventHandler(HandleChange);

            WebColorCompare web_compare = new WebColorCompare();

            color_list = new System.Collections.ArrayList();
            foreach (KnownColor known_color in Enum.GetValues(typeof(KnownColor)))
            {
                Color color = Color.FromKnownColor(known_color);
                if (color.IsSystemColor)
                {
                    continue;
                }
                color_list.Add(color);
            }
            color_list.Sort(web_compare);
            web_listbox.Items.AddRange(color_list.ToArray());
            web_listbox.MouseUp += new MouseEventHandler(HandleMouseUp);
            web_listbox.SelectedValueChanged += new EventHandler(HandleChange);

            CustomColorPicker custom_picker = new CustomColorPicker();

            custom_picker.Dock          = DockStyle.Fill;
            custom_picker.ColorChanged += new EventHandler(CustomColorPicked);
            custom_tab.Controls.Add(custom_picker);

            tab_control.TabPages.Add(custom_tab);
            tab_control.TabPages.Add(web_tab);
            tab_control.TabPages.Add(system_tab);

            if (value != null)
            {
                Color current_color = (Color)value;
                if (current_color.IsSystemColor)
                {
                    system_listbox.SelectedValue = current_color;
                    tab_control.SelectedTab      = system_tab;
                }
                else if (current_color.IsKnownColor)
                {
                    web_listbox.SelectedValue = current_color;
                    tab_control.SelectedTab   = web_tab;
                }
                selected_color = current_color;
                color_chosen   = true;
            }

            tab_control.Height = 216;             // the height of the custom colors tab
            return(tab_control);
        }
Ejemplo n.º 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.radioGPS        = new System.Windows.Forms.RadioButton();
     this.Caption         = new System.Windows.Forms.Label();
     this.tabControl1     = new System.Windows.Forms.TabControl();
     this.navTab          = new System.Windows.Forms.TabPage();
     this.label6          = new System.Windows.Forms.Label();
     this.cbScale         = new GravurGIS.GUI.Controls.ComboBoxEx();
     this.radioManual     = new System.Windows.Forms.RadioButton();
     this.label5          = new System.Windows.Forms.Label();
     this.label3          = new System.Windows.Forms.Label();
     this.tBRW            = new TextBoxEx();
     this.label2          = new System.Windows.Forms.Label();
     this.tbHW            = new TextBoxEx();
     this.label1          = new System.Windows.Forms.Label();
     this.relTab          = new System.Windows.Forms.TabPage();
     this.lblAnchorSTatus = new System.Windows.Forms.Label();
     this.anchorChooser1  = new GravurGIS.GUI.Controls.AnchorChooser();
     this.label4          = new System.Windows.Forms.Label();
     this.tabControl1.SuspendLayout();
     this.navTab.SuspendLayout();
     this.relTab.SuspendLayout();
     this.SuspendLayout();
     //
     // radioGPS
     //
     this.radioGPS.Font            = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular);
     this.radioGPS.Location        = new System.Drawing.Point(14, 71);
     this.radioGPS.Name            = "radioGPS";
     this.radioGPS.Size            = new System.Drawing.Size(161, 20);
     this.radioGPS.TabIndex        = 7;
     this.radioGPS.TabStop         = false;
     this.radioGPS.Text            = "Aktueller Standpunkt (GPS)";
     this.radioGPS.CheckedChanged += new System.EventHandler(this.radios_CheckedChanged);
     //
     // Caption
     //
     this.Caption.Font      = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular);
     this.Caption.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
     this.Caption.Location  = new System.Drawing.Point(6, 4);
     this.Caption.Name      = "Caption";
     this.Caption.Size      = new System.Drawing.Size(172, 18);
     this.Caption.Text      = "Navigator";
     //
     // tabControl1
     //
     this.tabControl1.Anchor = System.Windows.Forms.AnchorStyles.None;
     this.tabControl1.Controls.Add(this.navTab);
     this.tabControl1.Controls.Add(this.relTab);
     this.tabControl1.Dock          = System.Windows.Forms.DockStyle.None;
     this.tabControl1.Location      = new System.Drawing.Point(3, 22);
     this.tabControl1.Name          = "tabControl1";
     this.tabControl1.SelectedIndex = 0;
     this.tabControl1.Size          = new System.Drawing.Size(222, 187);
     this.tabControl1.TabIndex      = 2;
     //
     // navTab
     //
     this.navTab.Controls.Add(this.label6);
     this.navTab.Controls.Add(this.cbScale);
     this.navTab.Controls.Add(this.radioManual);
     this.navTab.Controls.Add(this.radioGPS);
     this.navTab.Controls.Add(this.label5);
     this.navTab.Controls.Add(this.label3);
     this.navTab.Controls.Add(this.tBRW);
     this.navTab.Controls.Add(this.label2);
     this.navTab.Controls.Add(this.tbHW);
     this.navTab.Controls.Add(this.label1);
     this.navTab.Location = new System.Drawing.Point(0, 0);
     this.navTab.Name     = "navTab";
     this.navTab.Size     = new System.Drawing.Size(222, 164);
     this.navTab.Text     = "Navigation";
     //
     // label6
     //
     this.label6.Location = new System.Drawing.Point(14, 26);
     this.label6.Name     = "label6";
     this.label6.Size     = new System.Drawing.Size(22, 20);
     this.label6.Text     = "1 :";
     //
     // cbScale
     //
     this.cbScale.Location = new System.Drawing.Point(39, 23);
     this.cbScale.Name     = "cbScale";
     this.cbScale.Size     = new System.Drawing.Size(135, 23);
     this.cbScale.TabIndex = 28;
     this.cbScale.Text     = "comboBoxEx1";
     //
     // radioManual
     //
     this.radioManual.Checked         = true;
     this.radioManual.Font            = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular);
     this.radioManual.Location        = new System.Drawing.Point(14, 90);
     this.radioManual.Name            = "radioManual";
     this.radioManual.Size            = new System.Drawing.Size(161, 20);
     this.radioManual.TabIndex        = 6;
     this.radioManual.Text            = "Koordinaten eingeben";
     this.radioManual.CheckedChanged += new System.EventHandler(this.radios_CheckedChanged);
     //
     // label5
     //
     this.label5.Font     = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
     this.label5.Location = new System.Drawing.Point(3, 54);
     this.label5.Name     = "label5";
     this.label5.Size     = new System.Drawing.Size(57, 20);
     this.label5.Text     = "Position";
     //
     // label3
     //
     this.label3.Font     = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
     this.label3.Location = new System.Drawing.Point(3, 4);
     this.label3.Name     = "label3";
     this.label3.Size     = new System.Drawing.Size(100, 20);
     this.label3.Text     = "Maßstab";
     //
     // tBRW
     //
     this.tBRW.Font     = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular);
     this.tBRW.Location = new System.Drawing.Point(97, 116);
     this.tBRW.Name     = "tBRW";
     this.tBRW.Size     = new System.Drawing.Size(77, 19);
     this.tBRW.TabIndex = 17;
     this.tBRW.Text     = "0";
     //
     // label2
     //
     this.label2.Font     = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular);
     this.label2.Location = new System.Drawing.Point(33, 118);
     this.label2.Name     = "label2";
     this.label2.Size     = new System.Drawing.Size(58, 15);
     this.label2.Text     = "Rechtswert:";
     //
     // tbHW
     //
     this.tbHW.Font     = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular);
     this.tbHW.Location = new System.Drawing.Point(97, 138);
     this.tbHW.Name     = "tbHW";
     this.tbHW.Size     = new System.Drawing.Size(77, 19);
     this.tbHW.TabIndex = 16;
     this.tbHW.Text     = "0";
     //
     // label1
     //
     this.label1.Font     = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular);
     this.label1.Location = new System.Drawing.Point(33, 140);
     this.label1.Name     = "label1";
     this.label1.Size     = new System.Drawing.Size(58, 15);
     this.label1.Text     = "Hochwert:";
     //
     // relTab
     //
     this.relTab.Controls.Add(this.lblAnchorSTatus);
     this.relTab.Controls.Add(this.anchorChooser1);
     this.relTab.Controls.Add(this.label4);
     this.relTab.Location = new System.Drawing.Point(0, 0);
     this.relTab.Name     = "relTab";
     this.relTab.Size     = new System.Drawing.Size(222, 164);
     this.relTab.Text     = "Bezugspunkt";
     //
     // lblAnchorSTatus
     //
     this.lblAnchorSTatus.Font      = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular);
     this.lblAnchorSTatus.Location  = new System.Drawing.Point(6, 124);
     this.lblAnchorSTatus.Name      = "lblAnchorSTatus";
     this.lblAnchorSTatus.Size      = new System.Drawing.Size(209, 31);
     this.lblAnchorSTatus.TextAlign = System.Drawing.ContentAlignment.TopCenter;
     //
     // anchorChooser1
     //
     this.anchorChooser1.Location = new System.Drawing.Point(64, 55);
     this.anchorChooser1.Name     = "anchorChooser1";
     this.anchorChooser1.Size     = new System.Drawing.Size(95, 54);
     this.anchorChooser1.TabIndex = 1;
     this.anchorChooser1.Text     = "anchorChooser1";
     this.anchorChooser1.Changed += new GravurGIS.GUI.Controls.AnchorChooser.ChangedDelegate(this.anchorChooser1_Changed);
     //
     // label4
     //
     this.label4.Font     = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular);
     this.label4.Location = new System.Drawing.Point(4, 8);
     this.label4.Name     = "label4";
     this.label4.Size     = new System.Drawing.Size(212, 48);
     this.label4.Text     = "Hier können Sie einstellen, auf welchen Teil des Bildschrims sich Ihre Eingabe be" +
                            "ziehen soll.";
     this.label4.TextAlign = System.Drawing.ContentAlignment.TopCenter;
     //
     // Navigator
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Dpi;
     this.BackColor           = System.Drawing.SystemColors.ActiveCaption;
     this.ClientSize          = new System.Drawing.Size(228, 211);
     this.Controls.Add(this.tabControl1);
     this.Controls.Add(this.Caption);
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
     this.MinimizeBox     = false;
     this.Name            = "Navigator";
     this.MouseDown      += new System.Windows.Forms.MouseEventHandler(this.Form2_MouseDown);
     this.MouseUp        += new System.Windows.Forms.MouseEventHandler(this.Form2_MouseUp);
     this.tabControl1.ResumeLayout(false);
     this.navTab.ResumeLayout(false);
     this.relTab.ResumeLayout(false);
     this.ResumeLayout(false);
 }
        public OptionsWindow(BaseControl owner)
            : base(owner)
        {
            Font        = CtlCommon.SmFont;
            Width       = 480;
            Height      = 390;
            WindowStyle = new WindowStyles(WindowStyles.wsScreenCenter, WindowStyles.wsModal, WindowStyles.wsKeyPreview);

            fPages        = new TabControl(this);
            fPages.Left   = 10;
            fPages.Top    = 10;
            fPages.Width  = Width - 20;
            fPages.Height = Height - 30 - 40;

            TabSheet ts = fPages.AddPage(BaseLocale.GetStr(RS.rs_CommonOptions));

            ts.OnLangChange = GlobalVars.nwrWin.LangChange;
            ts.LangResID    = 9;

            fSngVolume          = new ScrollBar(ts);
            fSngVolume.Min      = 0;
            fSngVolume.Max      = 255;
            fSngVolume.Pos      = 255;
            fSngVolume.OnChange = OnSongsVolumeChange;
            fSngVolume.Kind     = ScrollBar.SBK_HORIZONTAL;
            fSngVolume.Width    = ts.Width - 50;
            fSngVolume.Left     = 25;
            fSngVolume.Top      = 30;

            Label label = new Label(ts);

            label.Bounds       = ExtRect.Create(25, 30 - 20, 25 + fSngVolume.Width, 30);
            label.LangResID    = RS.rs_MusicVolume;
            label.OnLangChange = GlobalVars.nwrWin.LangChange;

            fSndVolume          = new ScrollBar(ts);
            fSndVolume.Min      = 0;
            fSndVolume.Max      = 255;
            fSndVolume.Pos      = 255;
            fSndVolume.OnChange = OnSoundsVolumeChange;
            fSndVolume.Kind     = ScrollBar.SBK_HORIZONTAL;
            fSndVolume.Width    = ts.Width - 50;
            fSndVolume.Left     = 25;
            fSndVolume.Top      = 70;

            label              = new Label(ts);
            label.Bounds       = ExtRect.Create(25, 70 - 20, 25 + fSndVolume.Width, 70);
            label.LangResID    = RS.rs_SoundsVolume;
            label.OnLangChange = GlobalVars.nwrWin.LangChange;

            fNewStyle = new CheckBox(ts);
            fNewStyle.OnLangChange = GlobalVars.nwrWin.LangChange;
            fNewStyle.LangResID    = 12;
            fNewStyle.Group        = 1;
            fNewStyle.Left         = 25;
            fNewStyle.Top          = 100;
            fNewStyle.Width        = Width - 50;
            fNewStyle.OnClick      = OnNewStyleClick;

            fModernStyle = new CheckBox(ts);
            fModernStyle.OnLangChange = GlobalVars.nwrWin.LangChange;
            fModernStyle.LangResID    = 13;
            fModernStyle.Group        = 1;
            fModernStyle.Left         = 225;
            fModernStyle.Top          = 100;
            fModernStyle.Width        = Width - 50;
            fModernStyle.OnClick      = OnModernStyleClick;

            fHideLocMap = new CheckBox(ts);
            fHideLocMap.OnLangChange = GlobalVars.nwrWin.LangChange;
            fHideLocMap.LangResID    = 14;
            fHideLocMap.Left         = 25;
            fHideLocMap.Top          = 130;
            fHideLocMap.Width        = Width - 50;
            fHideLocMap.OnClick      = OnHideLocMapClick;

            fHideCtlPanel = new CheckBox(ts);
            fHideCtlPanel.OnLangChange = GlobalVars.nwrWin.LangChange;
            fHideCtlPanel.LangResID    = 15;
            fHideCtlPanel.Left         = 25;
            fHideCtlPanel.Top          = 160;
            fHideCtlPanel.Width        = Width - 50;
            fHideCtlPanel.OnClick      = OnHideCtlPanelClick;

            fHideInfoPanel = new CheckBox(ts);
            fHideInfoPanel.OnLangChange = GlobalVars.nwrWin.LangChange;
            fHideInfoPanel.LangResID    = 16;
            fHideInfoPanel.Left         = 25;
            fHideInfoPanel.Top          = 190;
            fHideInfoPanel.Width        = Width - 50;
            fHideInfoPanel.OnClick      = OnHideInfoPanelClick;

            fInvOnlyIcons = new CheckBox(ts);
            fInvOnlyIcons.OnLangChange = GlobalVars.nwrWin.LangChange;
            fInvOnlyIcons.LangResID    = 549;
            fInvOnlyIcons.Left         = 25;
            fInvOnlyIcons.Top          = 220;
            fInvOnlyIcons.Width        = Width - 50;
            fInvOnlyIcons.OnClick      = OnInvOnlyIconsClick;

            ts = fPages.AddPage(BaseLocale.GetStr(RS.rs_KeyOptions));
            ts.OnLangChange = GlobalVars.nwrWin.LangChange;
            ts.LangResID    = 10;

            fKeyList        = new ListBox(ts);
            fKeyList.Mode   = ListBox.MODE_REPORT;
            fKeyList.Left   = 10;
            fKeyList.Top    = 10;
            fKeyList.Width  = ts.Width - 20;
            fKeyList.Height = ts.Height - 20;
            fKeyList.ColumnTitles.Add("name", 300);
            fKeyList.ColumnTitles.Add("key", 150);
            fKeyList.OnKeyDown = OnKeyListKeyDown;
            fKeyList.ShowHints = true;
            fKeyList.Hint      = "hint";

            ts = fPages.AddPage(BaseLocale.GetStr(RS.rs_GameplayOptions));
            ts.OnLangChange = GlobalVars.nwrWin.LangChange;
            ts.LangResID    = 11;

            fCircularFOV = new CheckBox(ts);
            fCircularFOV.OnLangChange = GlobalVars.nwrWin.LangChange;
            fCircularFOV.LangResID    = 17;
            fCircularFOV.Left         = 25;
            fCircularFOV.Top          = 25;
            fCircularFOV.Width        = Width - 50;
            fCircularFOV.OnClick      = OnCircularFOVClick;

            fAutoPickup = new CheckBox(ts);
            fAutoPickup.OnLangChange = GlobalVars.nwrWin.LangChange;
            fAutoPickup.LangResID    = 536;
            fAutoPickup.Left         = 25;
            fAutoPickup.Top          = 65;
            fAutoPickup.Width        = Width - 50;
            fAutoPickup.OnClick      = OnAutoPickupClick;

            fExtremeMode = new CheckBox(ts);
            fExtremeMode.OnLangChange = GlobalVars.nwrWin.LangChange;
            fExtremeMode.LangResID    = 82;
            fExtremeMode.Left         = 25;
            fExtremeMode.Top          = 105;
            fExtremeMode.Width        = Width - 50;
            fExtremeMode.OnClick      = OnExtremeModeClick;
            ts = fPages.AddPage(BaseLocale.GetStr(RS.rs_Language));
            ts.OnLangChange = GlobalVars.nwrWin.LangChange;
            ts.LangResID    = 815;

            fLangList         = new ListBox(ts);
            fLangList.Mode    = ListBox.MODE_LIST;
            fLangList.Options = new LBOptions(LBOptions.lboChecks, LBOptions.lboRadioChecks);
            fLangList.Left    = 10;
            fLangList.Top     = 10;
            fLangList.Width   = ts.Width - 20;
            fLangList.Height  = ts.Height - 20;

            Locale locale = GlobalVars.nwrWin.Locale;
            int    num    = locale.LangsCount;

            for (int i = 0; i < num; i++)
            {
                fLangList.Items.Add(locale.GetLang(i).Name, null);
            }
            fLangList.OnItemSelect = OnLangSelect;

            fPages.TabIndex = 0;

            NWButton tRButton = new NWButton(this);

            tRButton.Width        = 90;
            tRButton.Height       = 30;
            tRButton.Left         = Width - 90 - 20;
            tRButton.Top          = Height - 30 - 20;
            tRButton.ImageFile    = "itf/DlgBtn.tga";
            tRButton.OnClick      = OnBtnClose;
            tRButton.OnLangChange = GlobalVars.nwrWin.LangChange;
            tRButton.LangResID    = 8;
        }