Esempio n. 1
0
        public BrowserWindow()
        {
            this.Title = "Hushpuppy";
            this.Size = new Size(1280, 800);

            this.Menu = new MenuBar();
            ButtonMenuItem fileMenu = Menu.Items.GetSubmenu("&File");
            fileMenu.Items.AddRange(new Command[] { new NewTabCommand(this, _homePage), new CloseTabCommand(this), new NewWindowCommand(), });

            BrowserToolbar = new BrowserToolbar();

            DynamicLayout layout = new DynamicLayout();
            layout.AddColumn(BrowserToolbar, _tabControl);

            this.Content = layout;

            new NavigateCommand(this, _homePage).Execute();
        }
Esempio n. 2
0
        public About()
        {
            /* dialog attributes */

            this.Text = "About Notedown";
            this.ClientSize = new Size(300, 280);
            this.Resizable = false;

            /* dialog controls */

            var imageView = new ImageView();
            imageView.Image = Icon.FromResource("Icon.ico");
            imageView.Size = new Size(128, 128);

            var labelTitle = new Label();
            labelTitle.Text = "Notedown";
            labelTitle.Size = new Size(240, 24);
            labelTitle.Font = new Font(FontFamily.Sans, 16);
            labelTitle.HorizontalAlign = HorizontalAlign.Center;

            var version = Assembly.GetExecutingAssembly().GetName().Version;
            var labelVersion = new Label();
            labelVersion.Text = string.Format("Version {0}", version);
            labelVersion.HorizontalAlign = HorizontalAlign.Center;

            var labelCopyright = new Label();
            labelCopyright.Text = "Copyright by Andre Straubmeier";
            labelCopyright.HorizontalAlign = HorizontalAlign.Center;

            var button = new Button();
            button.Text = "Close";
            button.Size = new Size(90, 26);
            button.Click += delegate
            {
                Close();
            };

            /* dialog layout */

            var layout = new DynamicLayout(this);
            layout.AddColumn(imageView, labelTitle, labelVersion, labelCopyright);
            layout.AddCentered(button);
        }
Esempio n. 3
0
        void Init()
        {
            textBox_url = new TextBox();
            textBox_url.TextChanged+=textBox_url_TextChanged;
            textBox_url.Text = "http://";
            
            textBox_save = new TextBox();
            textBox_save.Text = _saveDir;

            button_wget = new Button
            {
                Text = "Wget"
            };
            button_wget.Click+=button_wget_Click;

            var layout = new DynamicLayout {Padding = new Padding(20, 10), Spacing = new Size(5, 5)};

	        var layout_left = new DynamicLayout();
	        layout_left.AddColumn(textBox_url, textBox_save);
			layout.AddRow(layout_left,button_wget);

	        Content = layout;
        }
Esempio n. 4
0
		static Form Test2(bool setSize)
		{
			var leftPane = new DynamicLayout { Padding = Padding.Empty, DefaultPadding = Padding.Empty };
			leftPane.AddColumn(new TreeGridView());

			var rightTop = new DynamicLayout();
			rightTop.AddColumn(ComboWithItems(), new Panel());

			var rightBottom = new DynamicLayout();
			rightBottom.AddRow(new ComboBox(), ComboWithItems(), new Button(), new CheckBox(), null);

			var rightPane = new Splitter
			{
				Orientation = SplitterOrientation.Vertical,
				FixedPanel = SplitterFixedPanel.Panel2,
				Panel1 = rightTop,
				Panel2 = rightBottom,
				Position = 200,
			};

			var form = new Form
			{ 
				Padding = new Padding(5),
				Content = new Splitter
				{
					Orientation = SplitterOrientation.Horizontal,
					FixedPanel = SplitterFixedPanel.Panel1,
					BackgroundColor = Colors.Gray,
					Position = 200,
					Panel1 = leftPane,
					Panel2 = rightPane
				}
			};
			if (setSize)
				form.Size = new Size(600, 400);
			return form;
		}
Esempio n. 5
0
        public BrowserToolbar()
        {
            _urlBox.KeyDown +=
                (Object sender, KeyEventArgs e) =>
                {
                    if (e.Key == Keys.Enter)
                    {
                        TextBox urlBox = (TextBox)sender;
                        BrowserWindow browser = urlBox.FindParent<BrowserWindow>();

                        UriBuilder builder = new UriBuilder(urlBox.Text);
                        new NavigateCommand(browser, builder.Uri).Execute();
                    }
                };

            DynamicLayout layout = new DynamicLayout();
            layout.AddColumn(_urlBox);

            this.Content = layout;
        }