Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Member Functions | Package Functions | Package Attributes | Private Member Functions | Private Attributes
Silverstone.Manticore.Browser.BrowserDisplayPanel Class Reference

Summary description for BrowserDisplayPanel. More...

Inheritance diagram for Silverstone.Manticore.Browser.BrowserDisplayPanel:
Inheritance graph
[legend]
Collaboration diagram for Silverstone.Manticore.Browser.BrowserDisplayPanel:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BrowserDisplayPanel (Form aParent, Form aOpener, Preferences aPrefs)
 Construct a BrowserDisplayPanel.
void OnRestoreSessionSettings (object sender, EventArgs e)
void OnStartupModeRadio (object sender, EventArgs e)
override void Load ()
 Implemented by derived class. Reads preferences for each UI element the first time this panel is shown, and populates the UI appropriately.
override void Save ()
 Implemented by derived class. Takes data from UI elements (which may be user-manipulated) and saves preferences.
void VisibilityChanged (Object sender, EventArgs e)
 Called when the visibility of the panel changes.

Protected Member Functions

override void Dispose (bool disposing)
 Clean up any resources being used.

Package Functions

void OnUseCurrent (object sender, EventArgs e)
void OnBrowseForHomepage (object sender, EventArgs e)

Package Attributes

Preferences mPrefs
 Preferences handle.
Form mParent
 Parent window (Preferences dialog)

Private Member Functions

void InitializeComponent ()
 Required method for Designer support - do not modify the contents of this method with the code editor.

Private Attributes

GroupBox groupBox1
Button button2
Label label2
Button button1
TextBox textBox1
Label label1
GroupBox groupBox2
Button restoreSessionSettingsButton
RadioButton radioButton3
RadioButton radioButton2
RadioButton radioButton1
System.ComponentModel.Container components = null
 Required designer variable.
Form mOpener = null
 LAME - the window that invoked the preferences dialog.
int mWindowOpenMode = 1
bool mSaveSessionHistory = false

Detailed Description

Summary description for BrowserDisplayPanel.

Definition at line 54 of file BrowserDisplayPanel.cs.


Constructor & Destructor Documentation

Silverstone.Manticore.Browser.BrowserDisplayPanel.BrowserDisplayPanel ( Form  aParent,
Form  aOpener,
Preferences  aPrefs 
) [inline]

Construct a BrowserDisplayPanel.

Parameters:
aParent
aOpenerThe window that opened the preferencs dialog. We'd really rather get rid of this and replace it with calls to a window-mediator service.
aPrefsThe preferences handle from the application object. We want to get rid of this and use some kind of global preferences service.

Definition at line 92 of file BrowserDisplayPanel.cs.

                                                                                         : base(aParent, aPrefs)
              {
                     // This call is required by the Windows.Forms Form Designer.
                     InitializeComponent();

      mOpener = aOpener;

      restoreSessionSettingsButton.Enabled = false;

      radioButton3.Click += new EventHandler(OnStartupModeRadio);
      radioButton2.Click += new EventHandler(OnStartupModeRadio);
      radioButton1.Click += new EventHandler(OnStartupModeRadio);

      restoreSessionSettingsButton.Click += new EventHandler(OnRestoreSessionSettings);

      button2.Click += new EventHandler(OnUseCurrent);
      button1.Click += new EventHandler(OnBrowseForHomepage);
    }

Here is the call graph for this function:


Member Function Documentation

override void Silverstone.Manticore.Browser.BrowserDisplayPanel.Dispose ( bool  disposing) [inline, protected]

Clean up any resources being used.

Reimplemented from Silverstone.Manticore.Browser.PrefPanel.

Definition at line 195 of file BrowserDisplayPanel.cs.

              {
      if (disposing && components != null)
        components.Dispose();
      base.Dispose(disposing);
              }

Required method for Designer support - do not modify the contents of this method with the code editor.

Reimplemented from Silverstone.Manticore.Browser.PrefPanel.

Definition at line 207 of file BrowserDisplayPanel.cs.

              {
      this.groupBox1 = new GroupBox();
      this.button2 = new Button();
      this.label2 = new Label();
      this.button1 = new Button();
      this.textBox1 = new TextBox();
      this.label1 = new Label();
      this.groupBox2 = new GroupBox();
      this.restoreSessionSettingsButton = new Button();
      this.radioButton3 = new RadioButton();
      this.radioButton2 = new RadioButton();
      this.radioButton1 = new RadioButton();
      this.groupBox1.SuspendLayout();
      this.groupBox2.SuspendLayout();
      this.SuspendLayout();
      // 
      // groupBox1
      // 
      this.groupBox1.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                            this.button2,
                                                                            this.label2,
                                                                            this.button1,
                                                                            this.textBox1,
                                                                            this.label1});
      this.groupBox1.Location = new System.Drawing.Point(8, 112);
      this.groupBox1.Name = "groupBox1";
      this.groupBox1.Size = new System.Drawing.Size(312, 104);
      this.groupBox1.TabIndex = 0;
      this.groupBox1.TabStop = false;
      this.groupBox1.Text = "Home Page";
      // 
      // button2
      // 
      this.button2.Location = new System.Drawing.Point(136, 72);
      this.button2.Name = "button2";
      this.button2.TabIndex = 4;
      this.button2.Text = "Use Current";
      this.button2.FlatStyle = FlatStyle.System;
      // 
      // label2
      // 
      this.label2.Location = new System.Drawing.Point(8, 48);
      this.label2.Name = "label2";
      this.label2.Size = new System.Drawing.Size(56, 16);
      this.label2.TabIndex = 3;
      this.label2.Text = "Location:";
      // 
      // button1
      // 
      this.button1.Location = new System.Drawing.Point(221, 72);
      this.button1.Name = "button1";
      this.button1.Size = new System.Drawing.Size(75, 24);
      this.button1.TabIndex = 2;
      this.button1.Text = "Browse...";
      this.button2.FlatStyle = FlatStyle.System;
      // 
      // textBox1
      // 
      this.textBox1.Location = new System.Drawing.Point(64, 48);
      this.textBox1.Name = "textBox1";
      this.textBox1.Size = new System.Drawing.Size(232, 20);
      this.textBox1.TabIndex = 1;
      this.textBox1.Text = "http://www.silverstone.net.nz/";
      // 
      // label1
      // 
      this.label1.Location = new System.Drawing.Point(8, 24);
      this.label1.Name = "label1";
      this.label1.Size = new System.Drawing.Size(280, 16);
      this.label1.TabIndex = 0;
      this.label1.Text = "Clicking the Home button takes you to this page:";
      // 
      // groupBox2
      // 
      this.groupBox2.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                            this.restoreSessionSettingsButton,
                                                                            this.radioButton3,
                                                                            this.radioButton2,
                                                                            this.radioButton1});
      this.groupBox2.Location = new System.Drawing.Point(8, 0);
      this.groupBox2.Name = "startupModeGroup";
      this.groupBox2.Size = new System.Drawing.Size(312, 104);
      this.groupBox2.TabIndex = 1;
      this.groupBox2.TabStop = false;
      this.groupBox2.Text = "When Manticore starts, ";
      // 
      // restoreSessionSettingsButton
      // 
      this.restoreSessionSettingsButton.Location = new Point(224, 72);
      this.restoreSessionSettingsButton.Name = "restoreSessionSettingsButton";
      this.restoreSessionSettingsButton.TabIndex = 3;
      this.restoreSessionSettingsButton.Text = "Settings...";
      this.restoreSessionSettingsButton.FlatStyle = FlatStyle.System;
      // 
      // radioButton3
      // 
      this.radioButton3.Location = new System.Drawing.Point(16, 72);
      this.radioButton3.Name = "restoreSessionRadio";
      this.radioButton3.Size = new System.Drawing.Size(152, 16);
      this.radioButton3.TabIndex = 2;
      this.radioButton3.Text = "Restore previous session";
      this.radioButton3.FlatStyle = FlatStyle.System;
      // 
      // radioButton2
      // 
      this.radioButton2.Location = new System.Drawing.Point(16, 48);
      this.radioButton2.Name = "blankPageRadio";
      this.radioButton2.Size = new System.Drawing.Size(112, 16);
      this.radioButton2.TabIndex = 1;
      this.radioButton2.Text = "Show blank page";
      this.radioButton2.FlatStyle = FlatStyle.System;
      // 
      // radioButton1
      // 
      this.radioButton1.Location = new System.Drawing.Point(16, 24);
      this.radioButton1.Name = "homePageRadio";
      this.radioButton1.Size = new System.Drawing.Size(120, 16);
      this.radioButton1.TabIndex = 0;
      this.radioButton1.Text = "Show home page";
      this.radioButton1.FlatStyle = FlatStyle.System;
      // 
      // BrowserDisplayPanel
      // 
      this.Controls.AddRange(new System.Windows.Forms.Control[] { this.groupBox1,
                                                                  this.groupBox2});
      this.Name = "BrowserDisplayPanel";
      this.Size = new System.Drawing.Size(320, 280);
      this.groupBox1.ResumeLayout(false);
      this.groupBox2.ResumeLayout(false);
      this.ResumeLayout(false);

    }

Implemented by derived class. Reads preferences for each UI element the first time this panel is shown, and populates the UI appropriately.

Reimplemented from Silverstone.Manticore.Browser.PrefPanel.

Definition at line 153 of file BrowserDisplayPanel.cs.

    {
      mWindowOpenMode = mPrefs.GetIntPref("browser.session.windowmode");
      mSaveSessionHistory = mPrefs.GetBoolPref("browser.session.savesessionhistory");

      String homepageURL = mPrefs.GetStringPref("browser.homepage");
      textBox1.Text = homepageURL;

      int startMode = mPrefs.GetIntPref("browser.homepage.mode");
      switch (startMode) {
        case 2:
          radioButton3.Checked = true;
          restoreSessionSettingsButton.Enabled = true;
          break;
        case 0:
          radioButton2.Checked = true;
          break;
        case 1:
        default:
          radioButton1.Checked = true;
          break;
      }
    }

Here is the call graph for this function:

Definition at line 121 of file BrowserDisplayPanel.cs.

    {
      OpenFileDialog ofd = new OpenFileDialog();
      // Initially set directory to "My Documents";
      ofd.InitialDirectory = FileLocator.GetFolderPath(FileLocator.SpecialFolders.ssfPERSONAL);
      ofd.Filter = "HTML documents (*.html;*.htm)|*.html;*.htm|All files (*.*)|*.*";
      ofd.FilterIndex = 1;
      ofd.RestoreDirectory = true;
      ofd.Title = "Browse for Home Page";

      if(ofd.ShowDialog() == DialogResult.OK)
        textBox1.Text = ofd.FileName;
    }

Here is the call graph for this function:

Definition at line 135 of file BrowserDisplayPanel.cs.

    {
      RestoreSessionSettings dlg = new RestoreSessionSettings(mParent);
      dlg.WindowOpenMode = mWindowOpenMode;
      dlg.SaveSessionHistory = mSaveSessionHistory;
      if (dlg.ShowDialog() == DialogResult.OK) {
        mWindowOpenMode = dlg.WindowOpenMode;
        mSaveSessionHistory = dlg.SaveSessionHistory;
      }
    }

Definition at line 146 of file BrowserDisplayPanel.cs.

    {
      // Enable the Restore Session Settings button when the Restore Settings
      // startup mode is enabled. 
      restoreSessionSettingsButton.Enabled = radioButton3.Checked;
    }
void Silverstone.Manticore.Browser.BrowserDisplayPanel.OnUseCurrent ( object  sender,
EventArgs  e 
) [inline, package]

Definition at line 111 of file BrowserDisplayPanel.cs.

    {
      // XXX what we really want to do here is use a window-mediator like
      //     entity to find the most recent browser window. This will surely
      //     fail miserably if the opening window isn't a browser. 
      BrowserWindow window = mOpener as BrowserWindow;
      if (window != null)
        textBox1.Text = window.URL;
    }

Implemented by derived class. Takes data from UI elements (which may be user-manipulated) and saves preferences.

Reimplemented from Silverstone.Manticore.Browser.PrefPanel.

Definition at line 177 of file BrowserDisplayPanel.cs.

    {
      mPrefs.SetStringPref("browser.homepage", textBox1.Text != "" ? textBox1.Text : "about:blank");

      int mode = 1;
      if (radioButton3.Checked) 
        mode = 2;
      else if (radioButton2.Checked)
        mode = 0;
      mPrefs.SetIntPref("browser.homepage.mode", mode);

      mPrefs.SetIntPref("browser.session.windowmode", mWindowOpenMode);
      mPrefs.SetBoolPref("browser.session.savesessionhistory", mSaveSessionHistory);
    }
void Silverstone.Manticore.Browser.PrefPanel.VisibilityChanged ( Object  sender,
EventArgs  e 
) [inline, inherited]

Called when the visibility of the panel changes.

Parameters:
sender
e

Definition at line 104 of file PrefPanel.cs.

    {
      if (!mGenerated) {
        // The first time we display the panel, read the values 
        // for UI elements from preferences and fill the controls.
        Load();
        mGenerated = true;
      }
    }

Here is the call graph for this function:


Member Data Documentation

Definition at line 59 of file BrowserDisplayPanel.cs.

Definition at line 57 of file BrowserDisplayPanel.cs.

System.ComponentModel.Container Silverstone.Manticore.Browser.BrowserDisplayPanel.components = null [private]

Required designer variable.

Reimplemented from Silverstone.Manticore.Browser.PrefPanel.

Definition at line 70 of file BrowserDisplayPanel.cs.

Definition at line 56 of file BrowserDisplayPanel.cs.

Definition at line 62 of file BrowserDisplayPanel.cs.

Definition at line 61 of file BrowserDisplayPanel.cs.

Definition at line 58 of file BrowserDisplayPanel.cs.

LAME - the window that invoked the preferences dialog.

Definition at line 75 of file BrowserDisplayPanel.cs.

Parent window (Preferences dialog)

Definition at line 77 of file PrefPanel.cs.

Preferences handle.

Definition at line 72 of file PrefPanel.cs.

Definition at line 78 of file BrowserDisplayPanel.cs.

Definition at line 77 of file BrowserDisplayPanel.cs.

Definition at line 66 of file BrowserDisplayPanel.cs.

Definition at line 65 of file BrowserDisplayPanel.cs.

Definition at line 64 of file BrowserDisplayPanel.cs.

Definition at line 63 of file BrowserDisplayPanel.cs.

Definition at line 60 of file BrowserDisplayPanel.cs.


The documentation for this class was generated from the following file: