ACT Advanced Combat Tracker - MMORPG Log Parser Paypal
underwater

Add a UserControl plugin to the Options tab

  1. TreeNode optionsNode = null;
  2. public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText)
  3. {
  4.     pluginScreenSpace.Controls.Add(this);   // Add this UserControl to the plugins tab
  5.     this.Dock = DockStyle.Fill;
  6.  
  7.     int dcIndex = -1;   // Find the Data Correction node in the Options tab
  8.     for (int i = 0; i < ActGlobals.oFormActMain.OptionsTreeView.Nodes.Count; i++)
  9.     {
  10.         if (ActGlobals.oFormActMain.OptionsTreeView.Nodes[i].Text == "Data Correction")
  11.             dcIndex = i;
  12.     }
  13.     if (dcIndex != -1)
  14.     {
  15.         // Add our own node to the Data Correction node
  16.         optionsNode = ActGlobals.oFormActMain.OptionsTreeView.Nodes[dcIndex].Nodes.Add("EQ2 English Settings");
  17.         // Register our user control(this) to our newly create node path.  All controls added to the list will be laid out left to right, top to bottom
  18.         ActGlobals.oFormActMain.OptionsControlSets.Add(@"Data Correction\EQ2 English Settings", new List<Control> { this });
  19.         Label lblConfig = new Label();
  20.         lblConfig.AutoSize = true;
  21.         lblConfig.Text = "Find the applicable options in the Options tab, Data Correction section.";
  22.         pluginScreenSpace.Controls.Add(lblConfig);  // This is a placeholder label for when the UserControl is removed from the plugins tab and shown in the Options tab
  23.     }
  24. }
  25.  
  26. public void DeInitPlugin()
  27. {
  28.     if (optionsNode != null)    // If we added our user control to the Options tab, remove it
  29.     {
  30.         optionsNode.Remove();
  31.         ActGlobals.oFormActMain.OptionsControlSets.Remove(@"Data Correction\EQ2 English Settings");
  32.     }
  33. }
  34.  

Summary:

Assuming your plugin is based on a UserControl or some other control container, it can be added to ACT's options tab.  This allows your plugin's options to be found along with the rest of ACT's options and be searchable.


HTML5 Powered with CSS3 / Styling, Graphics, 3D & Effects, and Semantics
Softpedia Clean Award
Random Background