Exemplo n.º 1
0
        void Init()
        {
	        _tbxShellData = new TextArea {Size = new Size(-1, 200)};
            _tbxMsg = new TextBox();
	        _btnShowMsgInStatus = new Button {Text = "Show Msg In Status", Width = 150};
            _btnShowMsgInStatus.Click+=btn_showMsgInStatus_Click;
			_btnShowMessageBox = new Button { Text = "Show Msg In Message", Width = 150 };
            _btnShowMessageBox.Click+=btn_showMessageBox_Click;
			_btnCreateNewTabPage = new Button { Text = "Create New TabPage", Width = 150 };
            _btnCreateNewTabPage.Click+=btn_createNewTabPage_Click;

			// Test
	        var btnTest = new Button {Text = "Test", Width = 150};
			btnTest.Click += btnTest_Click;

	        var layout = new DynamicLayout {Padding = new Padding(10, 10), Size = new Size(10, 10)};
            layout.AddRow(new Label() { Text = "ShellData"});
			layout.AddRow(_tbxShellData);
			layout.AddSeparateRow(new Label() { Text = "Msg", VerticalAlign = VerticalAlign.Middle }, _tbxMsg, null);
	        layout.AddAutoSized(_btnShowMsgInStatus);
	        layout.AddAutoSized(_btnShowMessageBox);
	        layout.AddAutoSized(_btnCreateNewTabPage);
			layout.AddAutoSized(btnTest);
			layout.Add(null);

            this.Content = layout;
        }
Exemplo n.º 2
0
		public LinkButtonSection()
		{
			var layout = new DynamicLayout();

			layout.AddAutoSized(NormalButton(), centered: true);
			layout.AddAutoSized(LongerButton(), centered: true);
			layout.AddAutoSized(ColourButton(), centered: true);
			layout.AddAutoSized(DisabledButton(), centered: true);
			layout.AddAutoSized(DisabledButtonWithColor(), centered: true);
			layout.Add(StretchedButton());
			layout.Add(null);

			Content = layout;
		}
Exemplo n.º 3
0
		public LinkButtonSection()
		{
			var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) };

			layout.AddAutoSized(NormalButton(), centered: true);
			layout.AddAutoSized(LongerButton(), centered: true);
			layout.AddAutoSized(ColourButton(), centered: true);
			layout.AddAutoSized(DisabledButton(), centered: true);
			layout.AddAutoSized(DisabledButtonWithColor(), centered: true);
			layout.Add(StretchedButton());
			layout.Add(null);

			Content = layout;
		}
Exemplo n.º 4
0
		Control TestProperties()
		{
			var layout = new DynamicLayout();
			DateTimePicker min, max, current, setValue;
			Button setButton;

			layout.AddRow(new Label { Text = "Min Value" }, min = new DateTimePicker());
			layout.AddRow(new Label { Text = "Max Value" }, max = new DateTimePicker());
			layout.BeginHorizontal();
			layout.Add(new Label { Text = "Set to value" });
			layout.BeginVertical();
			layout.BeginHorizontal();
			layout.AddAutoSized(setValue = new DateTimePicker());
			layout.Add(setButton = new Button { Text = "Set" });
			layout.EndHorizontal();
			layout.EndVertical();
			layout.EndHorizontal();
			layout.AddRow(new Label { Text = "Value" }, current = new DateTimePicker());

			min.ValueChanged += (sender, e) => current.MinDate = min.Value ?? DateTime.MinValue;
			max.ValueChanged += (sender, e) => current.MaxDate = max.Value ?? DateTime.MaxValue;
			setButton.Click += (sender, e) => current.Value = setValue.Value;
			LogEvents(current);

			return layout;
		}
Exemplo n.º 5
0
		Control TestProperties()
		{
			var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5) };
			DateTimePicker min, max, current, setValue;
			Button setButton;

			layout.AddRow("Min Value", min = new DateTimePicker());
			layout.AddRow("Max Value", max = new DateTimePicker());
			layout.BeginHorizontal();
			layout.Add("Set to value");
			layout.BeginVertical(Padding.Empty);
			layout.BeginHorizontal();
			layout.AddAutoSized(setValue = new DateTimePicker());
			layout.Add(setButton = new Button { Text = "Set" });
			layout.EndHorizontal();
			layout.EndVertical();
			layout.EndHorizontal();
			layout.AddRow("Value", current = new DateTimePicker());

			min.ValueChanged += (sender, e) => current.MinDate = min.Value ?? DateTime.MinValue;
			max.ValueChanged += (sender, e) => current.MaxDate = max.Value ?? DateTime.MaxValue;
			setButton.Click += (sender, e) => current.Value = setValue.Value;
			LogEvents(current);

			return layout;
		}
Exemplo n.º 6
0
		public ButtonSection()
		{
			var layout = new DynamicLayout();

			layout.AddAutoSized(NormalButton(), centered: true);
			layout.AddAutoSized(LongerButton(), centered: true);
			layout.AddAutoSized(DefaultSizeButton(), centered: true);
			layout.AddAutoSized(ColourButton(), centered: true);
			layout.AddAutoSized(DisabledButton(), centered: true);
			layout.Add(StretchedButton());
			layout.AddSeparateRow(null, new Label { Text = "Image Position:", VerticalAlign = VerticalAlign.Middle }, ImagePositionControl(), null);
			layout.AddSeparateRow(null, TableLayout.AutoSized(ImageButton(smallImage)), TableLayout.AutoSized(ImageTextButton(smallImage)), null);
			layout.AddSeparateRow(null, TableLayout.AutoSized(ImageButton(largeImage)), TableLayout.AutoSized(ImageTextButton(largeImage)), null);

			layout.Add(null);

			Content = layout;
		}
Exemplo n.º 7
0
		public ButtonSection()
		{
			var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) };

			layout.AddAutoSized(NormalButton(), centered: true);
			layout.AddAutoSized(LongerButton(), centered: true);
			layout.AddAutoSized(DefaultSizeButton(), centered: true);
			layout.AddAutoSized(ColourButton(), centered: true);
			layout.AddAutoSized(DisabledButton(), centered: true);
			layout.Add(StretchedButton());
			layout.AddSeparateRow(null, new Label { Text = "Image Position:", VerticalAlignment = VerticalAlignment.Center }, ImagePositionControl(), ClearMinimumSizeControl(), null);
			layout.AddSeparateRow(null, TableLayout.AutoSized(ImageButton(smallImage)), TableLayout.AutoSized(ImageTextButton(smallImage)), null);
			layout.AddSeparateRow(null, TableLayout.AutoSized(ImageButton(largeImage)), TableLayout.AutoSized(ImageTextButton(largeImage)), null);

			layout.Add(null);

			Content = layout;
		}
Exemplo n.º 8
0
		Control CreateViews(Image image)
		{
			var layout = new DynamicLayout();
			layout.BeginHorizontal();
			layout.Add("ImageView");
			layout.AddAutoSized(new ImageView { Image = image });
			layout.AddAutoSized(new ImageView { Image = image, Size = new Size(64, 64) });
			layout.AddAutoSized(new ImageView { Image = image, Size = new Size(32, 32) });
			layout.EndBeginHorizontal();
			layout.Add("Drawable");
			layout.AddAutoSized(new DrawableImageView { Image = image });
			layout.AddAutoSized(new DrawableImageView { Image = image, MinimumSize = new Size(64, 64), ScaleImage = true });
			layout.AddAutoSized(new DrawableImageView { Image = image, MinimumSize = new Size(32, 32), ScaleImage = true });
			layout.EndBeginHorizontal();
			layout.Add("Button");
			layout.AddAutoSized(new Button { Image = image, Text = "Auto Size" });
			layout.AddAutoSized(new Button { Image = image, Text = "64px Height", Height = 64 });
			layout.AddAutoSized(new Button { Image = image, Text = "32px Height", Height = 32 });
			layout.EndBeginHorizontal();
			layout.EndHorizontal();
			return layout;
		}
Exemplo n.º 9
0
		void InitUi()
		{
			// input
            _textBoxName = new TextBox { PlaceholderText = "*Name", Width = 200};
		    _comboBoxLevel = new ComboBox {Width = 100};
		    _dropDownScritpType = new DropDown {Width = 120};
		    _textBoxShellPath = new TextBox {PlaceholderText = "*Shell Url", Width = 300};
			_textBoxShellPass = new TextBox { PlaceholderText = "*Pass" };
			_textBoxRemark = new TextBox { PlaceholderText = "Remark" };

			// _buttonAdd
			_buttonAdd = new Button { Text = StrRes.GetString("StrAdd", "Add") };
			_buttonAdd.Click += buttonAdd_Click;

			// _buttonAlter
			_buttonAlter = new Button { Text = StrRes.GetString("StrAlter", "Alter") };
			_buttonAlter.Click += _buttonAlter_Click;

			// _buttonAdvanced
			_buttonAdvanced = new Button { Text = StrRes.GetString("StrAdvanced","Advanced") };
			_buttonAdvanced.Click += _buttonAdvanced_Click;

			var codeList = new List<IListItem>
			{
				new ListItem {Text = "UTF-8"},
				new ListItem {Text = "GB2312"}
			};
			_dropDownServerCoding = new DropDown();
			_dropDownServerCoding.Items.AddRange(codeList);
			_dropDownServerCoding.SelectedIndex = 0;
			_dropDownWebCoding = new DropDown();
			_dropDownWebCoding.Items.AddRange(codeList);
			_dropDownWebCoding.SelectedIndex = 0;

			// _buttonDefault
			_buttonDefault = new Button { Text = "Default" };
			_buttonDefault.Click += _buttonDefault_Click;

			// _richTextBoxSetting
			_richTextBoxSetting = new TextArea {Wrap = false};

			// _panelAdvanced
			_panelAdvanced = new DynamicLayout { Padding = new Padding(5, 5), Spacing = new Size(5, 5) };
			_panelAdvanced.BeginVertical();
			_panelAdvanced.BeginHorizontal();
			_panelAdvanced.AddAutoSized(new Label
			{
				Text = StrRes.GetString("StrServerCoding", "ServerCoding"),
				VerticalAlign = VerticalAlign.Middle
			}, centered: true);
			_panelAdvanced.AddAutoSized(_dropDownServerCoding, centered: true);
			_panelAdvanced.AddAutoSized(new Label
			{
				Text = StrRes.GetString("StrWebCoding", "WebCoding"),
				VerticalAlign = VerticalAlign.Middle
			}, centered: true);
			_panelAdvanced.AddAutoSized(_dropDownWebCoding, centered: true);
			_panelAdvanced.Add(null);
			_panelAdvanced.AddAutoSized(_buttonDefault, centered: true);
			_panelAdvanced.EndHorizontal();
			_panelAdvanced.EndVertical();
			//_panelAdvanced.AddSeparateRow(new Label { Text = StrRes.GetString("StrServerCoding", "ServerCoding"), VerticalAlign = VerticalAlign.Middle }, _dropDownServerCoding);
			//_panelAdvanced.AddSeparateRow(new Label { Text = StrRes.GetString("StrWebCoding", "WebCoding"), VerticalAlign = VerticalAlign.Middle }, _dropDownWebCoding);
			_panelAdvanced.AddSeparateRow(_richTextBoxSetting);

			var panel1 = new DynamicLayout { Padding = new Padding(5, 5), Spacing = new Size(5, 5) };
			//line 1
			panel1.BeginVertical();
			panel1.BeginHorizontal();
			panel1.Add(_textBoxName, xscale: true);
			panel1.Add(_comboBoxLevel);
			panel1.Add(_dropDownScritpType);
			panel1.EndHorizontal();
			panel1.EndVertical();
			//line 2
			panel1.BeginVertical();
			panel1.BeginHorizontal();
			panel1.Add(_textBoxShellPath, true);
			panel1.Add(_textBoxShellPass);
			panel1.EndHorizontal();
			panel1.EndVertical();
			//line 3
			panel1.AddRow(_textBoxRemark);
			//line 4
			panel1.BeginVertical();
			panel1.BeginHorizontal();
			panel1.Add(_buttonAdvanced);
			panel1.Add(null, true);
			panel1.Add(_buttonAdd);
			panel1.Add(_buttonAlter);
			panel1.EndHorizontal();
			panel1.EndVertical();
			//line 5
			panel1.Add(_panelAdvanced, false, true);
			_panelAdvanced.Visible = false;

			//_p12 = new Splitter
			//{
			//	Panel1 = panel1,
			//	Panel2 = _panelAdvanced,
			//	Orientation = SplitterOrientation.Vertical,
			//	Position = 130,
			//};
			//_p12.FixedPanel = SplitterFixedPanel.Panel1;
			//_p12.Panel2.Visible = false;

			Content = panel1;
			ClientSize = new Size(500, 130);
			Title = "Edit Shell";
			Icon = Application.Instance.MainForm.Icon;
		}