private void InitializeComponent()
        {
            // XXX read these from a settings file
            this.Width  = 640;
            this.Height = 480;

            this.Text = "Manticore"; // XXX localize

            mMenuBuilder = new MenuBuilder("browser\\browser-menu.xml", this);
            mMenuBuilder.Build();
            mMenuBuilder.OnCommand += new EventHandler(OnMenuCommand);

            // Show the resize handle
            this.SizeGripStyle = SizeGripStyle.Auto;

            // Set up the Status Bar
            mStatusBar = new StatusBar();

            StatusBarPanel docStatePanel = new StatusBarPanel();

            mStatusPanel   = new StatusBarPanel();
            mProgressMeter = new StatusBarPanel();
            StatusBarPanel zonePanel = new StatusBarPanel();

            docStatePanel.Text    = "X";
            zonePanel.Text        = "Internet Region";
            mStatusPanel.Text     = "Document Done";
            mStatusPanel.AutoSize = StatusBarPanelAutoSize.Spring;


            mStatusBar.Panels.AddRange(new StatusBarPanel[] { docStatePanel, mStatusPanel, mProgressMeter, zonePanel });
            mStatusBar.ShowPanels = true;

            this.Controls.Add(mStatusBar);

            mToolbarBuilder = new BrowserToolbarBuilder("browser\\browser-toolbar.xml", this);

            mLocationBar                      = new LocationBar();
            mLocationBar.Top                  = mToolbarBuilder.Bounds.Top + mToolbarBuilder.Bounds.Height;
            mLocationBar.Left                 = 0;
            mLocationBar.Width                = ClientRectangle.Width;
            mLocationBar.Anchor               = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
            mLocationBar.LocationBarCommit   += new LocationBar.LocationBarEventHandler(OnLocationCommit);
            mLocationBar.LocationBarModified += new LocationBar.LocationBarEventHandler(OnLocationModified);
            this.Controls.Add(mLocationBar);

            mWebBrowser        = new WebBrowser(this);
            mWebBrowser.Dock   = DockStyle.Bottom;
            mWebBrowser.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
            mWebBrowser.Top    = mLocationBar.Top + mLocationBar.Height;
            mWebBrowser.Width  = ClientRectangle.Width;
            mWebBrowser.Height = ClientRectangle.Height - mWebBrowser.Top - mStatusBar.Height;
            this.Controls.Add(mWebBrowser);

            // Start Page handler
            this.VisibleChanged += new EventHandler(LoadStartPage);
        }
Exemplo n.º 2
0
        private void InitializeComponent()
        {
            // XXX read these from a settings file
              this.Width = 640;
              this.Height = 480;

              this.Text = "Manticore"; // XXX localize

              mMenuBuilder = new MenuBuilder("browser\\browser-menu.xml", this);
              mMenuBuilder.Build();
              mMenuBuilder.OnCommand += new EventHandler(OnMenuCommand);

              // Show the resize handle
              this.SizeGripStyle = SizeGripStyle.Auto;

              // Set up the Status Bar
              mStatusBar = new StatusBar();

              StatusBarPanel docStatePanel = new StatusBarPanel();
              mStatusPanel = new StatusBarPanel();
              mProgressMeter = new StatusBarPanel();
              StatusBarPanel zonePanel = new StatusBarPanel();

              docStatePanel.Text = "X";
              zonePanel.Text = "Internet Region";
              mStatusPanel.Text = "Document Done";
              mStatusPanel.AutoSize = StatusBarPanelAutoSize.Spring;

              mStatusBar.Panels.AddRange(new StatusBarPanel[] {docStatePanel, mStatusPanel, mProgressMeter, zonePanel});
              mStatusBar.ShowPanels = true;

              this.Controls.Add(mStatusBar);

              mToolbarBuilder = new BrowserToolbarBuilder("browser\\browser-toolbar.xml", this);

              mLocationBar = new LocationBar();
              mLocationBar.Top = mToolbarBuilder.Bounds.Top + mToolbarBuilder.Bounds.Height;
              mLocationBar.Left = 0;
              mLocationBar.Width = ClientRectangle.Width;
              mLocationBar.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
              mLocationBar.LocationBarCommit += new LocationBar.LocationBarEventHandler(OnLocationCommit);
              mLocationBar.LocationBarModified += new LocationBar.LocationBarEventHandler(OnLocationModified);
              this.Controls.Add(mLocationBar);

              mWebBrowser = new WebBrowser(this);
              mWebBrowser.Dock = DockStyle.Bottom;
              mWebBrowser.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
              mWebBrowser.Top = mLocationBar.Top + mLocationBar.Height;
              mWebBrowser.Width = ClientRectangle.Width;
              mWebBrowser.Height = ClientRectangle.Height - mWebBrowser.Top - mStatusBar.Height;
              this.Controls.Add(mWebBrowser);

              // Start Page handler
              this.VisibleChanged += new EventHandler(LoadStartPage);
        }