Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Attributes | Properties
Silverstone.Manticore.Browser.BrowserToolbarBuilder Class Reference
Inheritance diagram for Silverstone.Manticore.Browser.BrowserToolbarBuilder:
Inheritance graph
[legend]
Collaboration diagram for Silverstone.Manticore.Browser.BrowserToolbarBuilder:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BrowserToolbarBuilder (String aFile, Form aForm)
override void OnCommand (Object sender, ToolBarButtonClickEventArgs e)
void Build (Object sender, EventArgs e)

Public Attributes

Hashtable mItems

Protected Attributes

String mToolbarFile
AxCoolBar mCoolBar
Form mForm
ToolBar mToolBar

Properties

Rectangle Bounds [get]

Detailed Description

Definition at line 473 of file browserwindow.cs.


Constructor & Destructor Documentation

Definition at line 475 of file browserwindow.cs.

                                                           : base(aFile, aForm)
    {
    }

Member Function Documentation

void Silverstone.Manticore.Toolkit.ToolbarBuilder.Build ( Object  sender,
EventArgs  e 
) [inline, inherited]

Definition at line 99 of file toolkit.toolbars.cs.

    {
      XmlTextReader reader;
      reader = new XmlTextReader(mToolbarFile);
      reader.WhitespaceHandling = WhitespaceHandling.None;
      reader.MoveToContent();

      bool shouldBuildNewRow = true;

      while (reader.Read()) 
      {
        if (reader.NodeType == XmlNodeType.Element) 
        {
          switch (reader.LocalName) 
          {
            case "toolstrip":
              // The next <toolbar/> we encounter should be created on a new row. 
              shouldBuildNewRow = true;
              break;
            case "toolbar":
              String[] tbvalues = new String[4] {"", "", "",  ""};
              String[] tbnames = new String[4] {"id", "label", "description", "visible"};
              for (int i = 0; i < tbnames.Length; ++i) 
              {
                if (reader.MoveToAttribute(tbnames[i]) &&
                  reader.ReadAttributeValue())
                  tbvalues[i] = reader.Value; // XXX need to handle entities
                reader.MoveToElement();
              }

              String key = tbvalues[0];
              String label = tbvalues[1];
              bool visible = tbvalues[3] == "true";
      
              // Create and add a new toolbar.
              mToolBar.Appearance = ToolBarAppearance.Flat;
              mToolBar.ButtonClick += new ToolBarButtonClickEventHandler(this.OnCommand);
              mForm.Controls.Add(mToolBar);

              //mCoolBar.Bands.Add(-1, key, label, new Object(), true, mToolBar, true);

              shouldBuildNewRow = false;
              break;
            case "toolbarseparator": 
            {
              if (mToolBar != null) 
              {
                ToolBarButton button = new ToolBarButton();
                button.Style = ToolBarButtonStyle.Separator;
                mToolBar.Buttons.Add(button);
              }
              break;
            }
            case "toolbarbutton":
            {
              if (mToolBar != null) 
              {
                String[] tbbvalues = new String[3] {"", "", ""};
                String[] tbbnames = new String[3] {"label", "icon", "command"};
                for (int i = 0; i < tbbnames.Length; ++i) 
                {
                  if (reader.MoveToAttribute(tbbnames[i]) &&
                    reader.ReadAttributeValue())
                    tbbvalues[i] = reader.Value; // XXX need to handle entities
                  reader.MoveToElement();
                }
         
                ToolBarButton button = new CommandButtonItem(tbbvalues[1]);
                button.Text = tbbvalues[0];
                mToolBar.Buttons.Add(button);
              }
              break;
            }
          }
        }
      }
    }

Here is the call graph for this function:

override void Silverstone.Manticore.Browser.BrowserToolbarBuilder.OnCommand ( Object  sender,
ToolBarButtonClickEventArgs  e 
) [inline, virtual]

Implements Silverstone.Manticore.Toolkit.ToolbarBuilder.

Definition at line 479 of file browserwindow.cs.

    {
      CommandButtonItem item = e.Button as CommandButtonItem;
      (mForm as BrowserWindow).DoCommand(item.Command);
    }

Member Data Documentation

Definition at line 59 of file toolkit.toolbars.cs.

Definition at line 60 of file toolkit.toolbars.cs.

Definition at line 62 of file toolkit.toolbars.cs.

Definition at line 65 of file toolkit.toolbars.cs.

Definition at line 58 of file toolkit.toolbars.cs.


Property Documentation

Definition at line 67 of file toolkit.toolbars.cs.


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