Summary description for TabPage.
Inheritance: System.Windows.Forms.TabPage
Exemplo n.º 1
0
        private void oneCharacterSheetToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //new tab
            CharTabPage tabPage;

            tabs++;
            tabPage          = new MyControlLibrary.CharTabPage(this.components, 3);
            tabPage.Location = new System.Drawing.Point(4, 28);
            tabPage.Menu     = this.contextMenuStrip1;
            tabPage.Name     = "New Group " + tabs;
            tabPage.Size     = new System.Drawing.Size(816, 288);
            tabPage.TabIndex = tabs;
            tabPage.Text     = "New Group " + tabs;
            this.userControl11.Controls.Add(tabPage);
        }
Exemplo n.º 2
0
 private void toolStripMenuItem3_Click(object sender, EventArgs e)
 {
     //new tab
     CharTabPage tabPage;
     tabs++;
     tabPage = new MyControlLibrary.CharTabPage(this.components, 2);
     tabPage.Location = new System.Drawing.Point(4, 28);
     tabPage.Menu = this.contextMenuStrip1;
     tabPage.Name = "New Group " + tabs;
     tabPage.Size = new System.Drawing.Size(816, 288);
     tabPage.TabIndex = tabs;
     tabPage.Text = "New Group " + tabs;
     this.userControl11.Controls.Add(tabPage);
 }
Exemplo n.º 3
0
        private void loadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Displays an OpenFileDialog so the user can select a Cursor.
            OpenFileDialog openFileDialog1 = new OpenFileDialog();
            openFileDialog1.Filter = "All DnD sheets (*.DM; *.dnd; *.DG)|*.DM; *.dnd; *.DG|DM Sheet (*.DM)|*.DM| Dnd character sheet (*.dnd)|*.dnd | DM Group (*.DG)|*.DG";
            openFileDialog1.Title = "Select a DM Sheet to load";
            openFileDialog1.ShowDialog();
            PATH = openFileDialog1.FileName;

            if (openFileDialog1.FileName != "")
            {
                if (PATH.Contains(".DG"))
                    loadGM(PATH);
                else
                {
                    String[] GroupName = PATH.Split('\\');
                    CharTabPage t = (CharTabPage)this.userControl11.TabPages[this.userControl11.SelectedIndex];
                    bool isNew = t.isNew();
                    int lineCount = File.ReadAllLines(PATH).Length;

                    tabs++;

                    CharTabPage tabPage = null;
                    switch (lineCount)
                    {
                        case 1: tabPage = new MyControlLibrary.CharTabPage(this.components, 3);
                            tabPage.Location = new System.Drawing.Point(4, 28);
                            tabPage.Menu = this.contextMenuStrip1;
                            tabPage.Name = "New Group " + tabs;
                            tabPage.Size = new System.Drawing.Size(816, 288);
                            tabPage.TabIndex = tabs;
                            tabPage.Text = "New Group " + tabs;
                            if (isNew)
                            {
                                //replace with correct size page
                                this.userControl11.Controls.RemoveAt(this.userControl11.SelectedIndex);
                                this.userControl11.Controls.Add(tabPage);
                            }
                            else this.userControl11.Controls.Add(tabPage);
                            t = tabPage;
                            break;
                        case 2: tabPage = new MyControlLibrary.CharTabPage(this.components, 2);
                            tabPage.Location = new System.Drawing.Point(4, 28);
                            tabPage.Menu = this.contextMenuStrip1;
                            tabPage.Name = "New Group " + tabs;
                            tabPage.Size = new System.Drawing.Size(816, 288);
                            tabPage.TabIndex = tabs;
                            tabPage.Text = "New Group " + tabs;
                            if (isNew)
                            {
                                //replace with correct size page
                                this.userControl11.Controls.RemoveAt(this.userControl11.SelectedIndex);
                                this.userControl11.Controls.Add(tabPage);
                            }
                            else this.userControl11.Controls.Add(tabPage);
                            t = tabPage;
                            break;
                        case 3: tabPage = new MyControlLibrary.CharTabPage(this.components, 1);
                            tabPage.Location = new System.Drawing.Point(4, 28);
                            tabPage.Menu = this.contextMenuStrip1;
                            tabPage.Name = "New Group " + tabs;
                            tabPage.Size = new System.Drawing.Size(816, 288);
                            tabPage.TabIndex = tabs;
                            tabPage.Text = "New Group " + tabs;
                            if (isNew)
                            {
                                //replace with correct size page
                                this.userControl11.Controls.RemoveAt(this.userControl11.SelectedIndex);
                                this.userControl11.Controls.Add(tabPage);
                            }
                            else this.userControl11.Controls.Add(tabPage);
                            t = tabPage;
                            break;
                        case 4: tabPage = new MyControlLibrary.CharTabPage(this.components, 0);
                            tabPage.Location = new System.Drawing.Point(4, 28);
                            tabPage.Menu = this.contextMenuStrip1;
                            tabPage.Name = "New Group " + tabs;
                            tabPage.Size = new System.Drawing.Size(816, 288);
                            tabPage.TabIndex = tabs;
                            tabPage.Text = "New Group " + tabs;
                            if (!isNew)
                            {
                                this.userControl11.Controls.Add(tabPage);
                                t = tabPage;
                            }
                            break;
                        default: tabPage = (CharTabPage)this.userControl11.TabPages[0]; break;
                    }//end of switch

                    tabs--;

                    t.Loadsheet(openFileDialog1.FileName);//call load routine and pass in a File name

                    GroupName = GroupName[GroupName.Length - 1].Split('.');

                }//end if
            }//end else
        }
Exemplo n.º 4
0
        private void loadGM(String path)
        {
            //mygroups is an arraylist of arraylists of the input from a DG file
            ArrayList myGruops = this.tabPage1.LoadGroup(path);
            object[] test = (object[])myGruops[0];
            ArrayList tmp = ArrayList.Adapter(test);
            this.tabPage1.LoadGroup(path, tmp);
            CharTabPage tabPage = null;

            for (int i = 1; i < myGruops.Count; i++)
            {
                test = (object[])myGruops[i];
                tmp = ArrayList.Adapter(test);
                int lineCount = tmp.Count;

                tabs++;

                tabPage = null;
                switch (lineCount)
                {
                    case 1: tabPage = new MyControlLibrary.CharTabPage(this.components, 3);
                        tabPage.Location = new System.Drawing.Point(4, 28);
                        tabPage.Menu = this.contextMenuStrip1;
                        tabPage.Name = "New Group " + tabs;
                        tabPage.Size = new System.Drawing.Size(816, 288);
                        tabPage.TabIndex = tabs;
                        tabPage.Text = "New Group " + tabs;
                        this.userControl11.Controls.Add(tabPage);
                        break;
                    case 2: tabPage = new MyControlLibrary.CharTabPage(this.components, 2);
                        tabPage.Location = new System.Drawing.Point(4, 28);
                        tabPage.Menu = this.contextMenuStrip1;
                        tabPage.Name = "New Group " + tabs;
                        tabPage.Size = new System.Drawing.Size(816, 288);
                        tabPage.TabIndex = tabs;
                        tabPage.Text = "New Group " + tabs;
                        this.userControl11.Controls.Add(tabPage);
                        break;
                    case 3: tabPage = new MyControlLibrary.CharTabPage(this.components, 1);
                        tabPage.Location = new System.Drawing.Point(4, 28);
                        tabPage.Menu = this.contextMenuStrip1;
                        tabPage.Name = "New Group " + tabs;
                        tabPage.Size = new System.Drawing.Size(816, 288);
                        tabPage.TabIndex = tabs;
                        tabPage.Text = "New Group " + tabs;
                        this.userControl11.Controls.Add(tabPage);
                        break;
                    case 4: tabPage = new MyControlLibrary.CharTabPage(this.components, 0);
                        tabPage.Location = new System.Drawing.Point(4, 28);
                        tabPage.Menu = this.contextMenuStrip1;
                        tabPage.Name = "New Group " + tabs;
                        tabPage.Size = new System.Drawing.Size(816, 288);
                        tabPage.TabIndex = tabs;
                        tabPage.Text = "New Group " + tabs;
                        this.userControl11.Controls.Add(tabPage);
                        break;
                    default: tabPage = (CharTabPage)this.userControl11.TabPages[0]; break;
                }//end of switch

                tabPage.LoadGroup(path, tmp);
            }//end of for
        }
Exemplo n.º 5
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
     this.contextMenuStrip1 = new System.Windows.Forms.ContextMenu();
     this.NewTab = new System.Windows.Forms.MenuItem();
     this.New4charTab = new System.Windows.Forms.MenuItem();
     this.New3charTab = new System.Windows.Forms.MenuItem();
     this.New2charTab = new System.Windows.Forms.MenuItem();
     this.New1charTab = new System.Windows.Forms.MenuItem();
     this.closeAllButThisToolStripMenuItem = new System.Windows.Forms.MenuItem();
     this.closeTabToolStripMenuItem = new System.Windows.Forms.MenuItem();
     this.panel1 = new System.Windows.Forms.Panel();
     this.userControl11 = new MyControlLibrary.TabCtlEx();
     this.tabPage1 = new MyControlLibrary.CharTabPage(this.components);
     this.menuStrip1 = new System.Windows.Forms.MenuStrip();
     this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.fourCharacterSheetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.ThreeCharcterSheet = new System.Windows.Forms.ToolStripMenuItem();
     this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
     this.oneCharacterSheetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.loadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
     this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.saveAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.saveAsGroupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.saveToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
     this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
     this.printToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.printDocument1 = new System.Drawing.Printing.PrintDocument();
     this.LastTabPage = new MyControlLibrary.CharTabPage(this.components);
     this.panel1.SuspendLayout();
     this.userControl11.SuspendLayout();
     this.menuStrip1.SuspendLayout();
     this.SuspendLayout();
     //
     // contextMenuStrip1
     //
     this.contextMenuStrip1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
     this.NewTab,
     this.closeAllButThisToolStripMenuItem,
     this.closeTabToolStripMenuItem});
     //
     // NewTab
     //
     this.NewTab.Index = 0;
     this.NewTab.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
     this.New4charTab,
     this.New3charTab,
     this.New2charTab,
     this.New1charTab});
     this.NewTab.Text = "New Tab";
     //
     // New4charTab
     //
     this.New4charTab.Index = 0;
     this.New4charTab.Text = "4 character sheet";
     this.New4charTab.Click += new System.EventHandler(this.New4charTab_Click);
     //
     // New3charTab
     //
     this.New3charTab.Index = 1;
     this.New3charTab.Text = "3 character sheet";
     this.New3charTab.Click += new System.EventHandler(this.New3charTab_Click);
     //
     // New2charTab
     //
     this.New2charTab.Index = 2;
     this.New2charTab.Text = "2 character sheet";
     this.New2charTab.Click += new System.EventHandler(this.New2charTab_Click);
     //
     // New1charTab
     //
     this.New1charTab.Index = 3;
     this.New1charTab.Text = "1 character sheet";
     this.New1charTab.Click += new System.EventHandler(this.New1charTab_Click);
     //
     // closeAllButThisToolStripMenuItem
     //
     this.closeAllButThisToolStripMenuItem.Index = 1;
     this.closeAllButThisToolStripMenuItem.Text = "Close all other tabs";
     this.closeAllButThisToolStripMenuItem.Click += new System.EventHandler(this.closeAllButThisToolStripMenuItem_Click);
     //
     // closeTabToolStripMenuItem
     //
     this.closeTabToolStripMenuItem.Index = 2;
     this.closeTabToolStripMenuItem.Text = "Close tab";
     this.closeTabToolStripMenuItem.Click += new System.EventHandler(this.closeTabToolStripMenuItem_Click);
     //
     // panel1
     //
     this.panel1.AutoScroll = true;
     this.panel1.AutoSize = true;
     this.panel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     this.panel1.Controls.Add(this.userControl11);
     this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.panel1.Location = new System.Drawing.Point(0, 24);
     this.panel1.Name = "panel1";
     this.panel1.Size = new System.Drawing.Size(1078, 527);
     this.panel1.TabIndex = 1;
     //
     // userControl11
     //
     this.userControl11.ConfirmOnClose = true;
     this.userControl11.Controls.Add(this.tabPage1);
     this.userControl11.Dock = System.Windows.Forms.DockStyle.Top;
     this.userControl11.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed;
     this.userControl11.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.userControl11.ItemSize = new System.Drawing.Size(330, 24);
     this.userControl11.Location = new System.Drawing.Point(0, 0);
     this.userControl11.Name = "userControl11";
     this.userControl11.SelectedIndex = 0;
     this.userControl11.Size = new System.Drawing.Size(1061, 770);
     this.userControl11.TabIndex = 0;
     this.userControl11.TabStop = false;
     this.userControl11.OnClose += new MyControlLibrary.TabCtlEx.OnHeaderCloseDelegate(this.userControl11_OnClose);
     //
     // tabPage1
     //
     this.tabPage1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("tabPage1.BackgroundImage")));
     this.tabPage1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
     this.tabPage1.Location = new System.Drawing.Point(4, 28);
     this.tabPage1.Menu = this.contextMenuStrip1;
     this.tabPage1.Name = "tabPage1";
     this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
     this.tabPage1.Size = new System.Drawing.Size(1053, 738);
     this.tabPage1.TabIndex = 0;
     this.tabPage1.Text = "New Group                                                 ";
     this.tabPage1.UseVisualStyleBackColor = true;
     //
     // menuStrip1
     //
     this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
     this.fileToolStripMenuItem,
     this.helpToolStripMenuItem});
     this.menuStrip1.Location = new System.Drawing.Point(0, 0);
     this.menuStrip1.Name = "menuStrip1";
     this.menuStrip1.Size = new System.Drawing.Size(1078, 24);
     this.menuStrip1.TabIndex = 2;
     this.menuStrip1.Text = "menuStrip1";
     //
     // fileToolStripMenuItem
     //
     this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
     this.newToolStripMenuItem,
     this.loadToolStripMenuItem,
     this.toolStripSeparator1,
     this.saveToolStripMenuItem,
     this.saveAllToolStripMenuItem,
     this.saveAsGroupToolStripMenuItem,
     this.saveToolStripMenuItem1,
     this.toolStripSeparator2,
     this.printToolStripMenuItem,
     this.exitToolStripMenuItem});
     this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
     this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
     this.fileToolStripMenuItem.Text = "File";
     //
     // newToolStripMenuItem
     //
     this.newToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
     this.fourCharacterSheetToolStripMenuItem,
     this.ThreeCharcterSheet,
     this.toolStripMenuItem3,
     this.oneCharacterSheetToolStripMenuItem});
     this.newToolStripMenuItem.Name = "newToolStripMenuItem";
     this.newToolStripMenuItem.Size = new System.Drawing.Size(190, 22);
     this.newToolStripMenuItem.Text = "New..";
     //
     // fourCharacterSheetToolStripMenuItem
     //
     this.fourCharacterSheetToolStripMenuItem.Name = "fourCharacterSheetToolStripMenuItem";
     this.fourCharacterSheetToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.D1)));
     this.fourCharacterSheetToolStripMenuItem.Size = new System.Drawing.Size(226, 22);
     this.fourCharacterSheetToolStripMenuItem.Text = "Four Character Sheet";
     this.fourCharacterSheetToolStripMenuItem.Click += new System.EventHandler(this.fourCharacterSheetToolStripMenuItem_Click);
     //
     // ThreeCharcterSheet
     //
     this.ThreeCharcterSheet.Name = "ThreeCharcterSheet";
     this.ThreeCharcterSheet.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.D2)));
     this.ThreeCharcterSheet.Size = new System.Drawing.Size(226, 22);
     this.ThreeCharcterSheet.Text = "Three Character Sheet";
     this.ThreeCharcterSheet.Click += new System.EventHandler(this.toolStripMenuItem2_Click);
     //
     // toolStripMenuItem3
     //
     this.toolStripMenuItem3.Name = "toolStripMenuItem3";
     this.toolStripMenuItem3.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.D3)));
     this.toolStripMenuItem3.Size = new System.Drawing.Size(226, 22);
     this.toolStripMenuItem3.Text = "Two Character Sheet";
     this.toolStripMenuItem3.Click += new System.EventHandler(this.toolStripMenuItem3_Click);
     //
     // oneCharacterSheetToolStripMenuItem
     //
     this.oneCharacterSheetToolStripMenuItem.Name = "oneCharacterSheetToolStripMenuItem";
     this.oneCharacterSheetToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.D4)));
     this.oneCharacterSheetToolStripMenuItem.Size = new System.Drawing.Size(226, 22);
     this.oneCharacterSheetToolStripMenuItem.Text = "One Character Sheet";
     this.oneCharacterSheetToolStripMenuItem.Click += new System.EventHandler(this.oneCharacterSheetToolStripMenuItem_Click);
     //
     // loadToolStripMenuItem
     //
     this.loadToolStripMenuItem.Name = "loadToolStripMenuItem";
     this.loadToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.L)));
     this.loadToolStripMenuItem.Size = new System.Drawing.Size(190, 22);
     this.loadToolStripMenuItem.Text = "Load...";
     this.loadToolStripMenuItem.Click += new System.EventHandler(this.loadToolStripMenuItem_Click);
     //
     // toolStripSeparator1
     //
     this.toolStripSeparator1.Name = "toolStripSeparator1";
     this.toolStripSeparator1.Size = new System.Drawing.Size(187, 6);
     //
     // saveToolStripMenuItem
     //
     this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
     this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
     this.saveToolStripMenuItem.Size = new System.Drawing.Size(190, 22);
     this.saveToolStripMenuItem.Text = "Save";
     this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click);
     //
     // saveAllToolStripMenuItem
     //
     this.saveAllToolStripMenuItem.Name = "saveAllToolStripMenuItem";
     this.saveAllToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
     | System.Windows.Forms.Keys.S)));
     this.saveAllToolStripMenuItem.Size = new System.Drawing.Size(190, 22);
     this.saveAllToolStripMenuItem.Text = "Save All";
     this.saveAllToolStripMenuItem.Click += new System.EventHandler(this.saveAllToolStripMenuItem_Click);
     //
     // saveAsGroupToolStripMenuItem
     //
     this.saveAsGroupToolStripMenuItem.Name = "saveAsGroupToolStripMenuItem";
     this.saveAsGroupToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.G)));
     this.saveAsGroupToolStripMenuItem.Size = new System.Drawing.Size(190, 22);
     this.saveAsGroupToolStripMenuItem.Text = "Save as Group";
     this.saveAsGroupToolStripMenuItem.Click += new System.EventHandler(this.saveAsGroupToolStripMenuItem_Click);
     //
     // saveToolStripMenuItem1
     //
     this.saveToolStripMenuItem1.Name = "saveToolStripMenuItem1";
     this.saveToolStripMenuItem1.Size = new System.Drawing.Size(190, 22);
     this.saveToolStripMenuItem1.Text = "Save as...";
     this.saveToolStripMenuItem1.Click += new System.EventHandler(this.saveToolStripMenuItem1_Click);
     //
     // toolStripSeparator2
     //
     this.toolStripSeparator2.Name = "toolStripSeparator2";
     this.toolStripSeparator2.Size = new System.Drawing.Size(187, 6);
     //
     // printToolStripMenuItem
     //
     this.printToolStripMenuItem.Name = "printToolStripMenuItem";
     this.printToolStripMenuItem.Size = new System.Drawing.Size(190, 22);
     this.printToolStripMenuItem.Text = "Print";
     this.printToolStripMenuItem.Click += new System.EventHandler(this.printToolStripMenuItem_Click);
     //
     // exitToolStripMenuItem
     //
     this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
     this.exitToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E)));
     this.exitToolStripMenuItem.Size = new System.Drawing.Size(190, 22);
     this.exitToolStripMenuItem.Text = "Exit";
     this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
     //
     // helpToolStripMenuItem
     //
     this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
     this.aboutToolStripMenuItem});
     this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
     this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
     this.helpToolStripMenuItem.Text = "Help";
     //
     // aboutToolStripMenuItem
     //
     this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
     this.aboutToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F1;
     this.aboutToolStripMenuItem.Size = new System.Drawing.Size(126, 22);
     this.aboutToolStripMenuItem.Text = "About";
     this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
     //
     // printDocument1
     //
     this.printDocument1.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printDocument1_PrintPage);
     //
     // LastTabPage
     //
     this.LastTabPage.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("LastTabPage.BackgroundImage")));
     this.LastTabPage.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
     this.LastTabPage.Location = new System.Drawing.Point(4, 22);
     this.LastTabPage.Menu = null;
     this.LastTabPage.Name = "LastTabPage";
     this.LastTabPage.Padding = new System.Windows.Forms.Padding(3);
     this.LastTabPage.Size = new System.Drawing.Size(816, 288);
     this.LastTabPage.TabIndex = 0;
     this.LastTabPage.Text = "New Group                                                 ";
     this.LastTabPage.UseVisualStyleBackColor = true;
     //
     // Form1
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize = new System.Drawing.Size(1078, 551);
     this.Controls.Add(this.panel1);
     this.Controls.Add(this.menuStrip1);
     this.MainMenuStrip = this.menuStrip1;
     this.Name = "Form1";
     this.Text = "DM Sheet 1.2.3";
     this.panel1.ResumeLayout(false);
     this.userControl11.ResumeLayout(false);
     this.menuStrip1.ResumeLayout(false);
     this.menuStrip1.PerformLayout();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Exemplo n.º 6
0
        }         //end of loadToolStripMenuItem_Click

        private void loadGM(String path)
        {
            //mygroups is an arraylist of arraylists of the input from a DG file
            ArrayList myGruops = this.tabPage1.LoadGroup(path);

            object[]  test = (object[])myGruops[0];
            ArrayList tmp  = ArrayList.Adapter(test);

            this.tabPage1.LoadGroup(path, tmp);
            CharTabPage tabPage = null;

            for (int i = 1; i < myGruops.Count; i++)
            {
                test = (object[])myGruops[i];
                tmp  = ArrayList.Adapter(test);
                int lineCount = tmp.Count;

                tabs++;

                tabPage = null;
                switch (lineCount)
                {
                case 1: tabPage      = new MyControlLibrary.CharTabPage(this.components, 3);
                    tabPage.Location = new System.Drawing.Point(4, 28);
                    tabPage.Menu     = this.contextMenuStrip1;
                    tabPage.Name     = "New Group " + tabs;
                    tabPage.Size     = new System.Drawing.Size(816, 288);
                    tabPage.TabIndex = tabs;
                    tabPage.Text     = "New Group " + tabs;
                    this.userControl11.Controls.Add(tabPage);
                    break;

                case 2: tabPage      = new MyControlLibrary.CharTabPage(this.components, 2);
                    tabPage.Location = new System.Drawing.Point(4, 28);
                    tabPage.Menu     = this.contextMenuStrip1;
                    tabPage.Name     = "New Group " + tabs;
                    tabPage.Size     = new System.Drawing.Size(816, 288);
                    tabPage.TabIndex = tabs;
                    tabPage.Text     = "New Group " + tabs;
                    this.userControl11.Controls.Add(tabPage);
                    break;

                case 3: tabPage      = new MyControlLibrary.CharTabPage(this.components, 1);
                    tabPage.Location = new System.Drawing.Point(4, 28);
                    tabPage.Menu     = this.contextMenuStrip1;
                    tabPage.Name     = "New Group " + tabs;
                    tabPage.Size     = new System.Drawing.Size(816, 288);
                    tabPage.TabIndex = tabs;
                    tabPage.Text     = "New Group " + tabs;
                    this.userControl11.Controls.Add(tabPage);
                    break;

                case 4: tabPage      = new MyControlLibrary.CharTabPage(this.components, 0);
                    tabPage.Location = new System.Drawing.Point(4, 28);
                    tabPage.Menu     = this.contextMenuStrip1;
                    tabPage.Name     = "New Group " + tabs;
                    tabPage.Size     = new System.Drawing.Size(816, 288);
                    tabPage.TabIndex = tabs;
                    tabPage.Text     = "New Group " + tabs;
                    this.userControl11.Controls.Add(tabPage);
                    break;

                default: tabPage = (CharTabPage)this.userControl11.TabPages[0]; break;
                }//end of switch

                tabPage.LoadGroup(path, tmp);
            }//end of for
        }
Exemplo n.º 7
0
        private void loadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Displays an OpenFileDialog so the user can select a Cursor.
            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            openFileDialog1.Filter = "All DnD sheets (*.DM; *.dnd; *.DG)|*.DM; *.dnd; *.DG|DM Sheet (*.DM)|*.DM| Dnd character sheet (*.dnd)|*.dnd | DM Group (*.DG)|*.DG";
            openFileDialog1.Title  = "Select a DM Sheet to load";
            openFileDialog1.ShowDialog();
            PATH = openFileDialog1.FileName;

            if (openFileDialog1.FileName != "")
            {
                if (PATH.Contains(".DG"))
                {
                    loadGM(PATH);
                }
                else
                {
                    String[]    GroupName = PATH.Split('\\');
                    CharTabPage t         = (CharTabPage)this.userControl11.TabPages[this.userControl11.SelectedIndex];
                    bool        isNew     = t.isNew();
                    int         lineCount = File.ReadAllLines(PATH).Length;

                    tabs++;

                    CharTabPage tabPage = null;
                    switch (lineCount)
                    {
                    case 1: tabPage      = new MyControlLibrary.CharTabPage(this.components, 3);
                        tabPage.Location = new System.Drawing.Point(4, 28);
                        tabPage.Menu     = this.contextMenuStrip1;
                        tabPage.Name     = "New Group " + tabs;
                        tabPage.Size     = new System.Drawing.Size(816, 288);
                        tabPage.TabIndex = tabs;
                        tabPage.Text     = "New Group " + tabs;
                        if (isNew)
                        {
                            //replace with correct size page
                            this.userControl11.Controls.RemoveAt(this.userControl11.SelectedIndex);
                            this.userControl11.Controls.Add(tabPage);
                        }
                        else
                        {
                            this.userControl11.Controls.Add(tabPage);
                        }
                        t = tabPage;
                        break;

                    case 2: tabPage      = new MyControlLibrary.CharTabPage(this.components, 2);
                        tabPage.Location = new System.Drawing.Point(4, 28);
                        tabPage.Menu     = this.contextMenuStrip1;
                        tabPage.Name     = "New Group " + tabs;
                        tabPage.Size     = new System.Drawing.Size(816, 288);
                        tabPage.TabIndex = tabs;
                        tabPage.Text     = "New Group " + tabs;
                        if (isNew)
                        {
                            //replace with correct size page
                            this.userControl11.Controls.RemoveAt(this.userControl11.SelectedIndex);
                            this.userControl11.Controls.Add(tabPage);
                        }
                        else
                        {
                            this.userControl11.Controls.Add(tabPage);
                        }
                        t = tabPage;
                        break;

                    case 3: tabPage      = new MyControlLibrary.CharTabPage(this.components, 1);
                        tabPage.Location = new System.Drawing.Point(4, 28);
                        tabPage.Menu     = this.contextMenuStrip1;
                        tabPage.Name     = "New Group " + tabs;
                        tabPage.Size     = new System.Drawing.Size(816, 288);
                        tabPage.TabIndex = tabs;
                        tabPage.Text     = "New Group " + tabs;
                        if (isNew)
                        {
                            //replace with correct size page
                            this.userControl11.Controls.RemoveAt(this.userControl11.SelectedIndex);
                            this.userControl11.Controls.Add(tabPage);
                        }
                        else
                        {
                            this.userControl11.Controls.Add(tabPage);
                        }
                        t = tabPage;
                        break;

                    case 4: tabPage      = new MyControlLibrary.CharTabPage(this.components, 0);
                        tabPage.Location = new System.Drawing.Point(4, 28);
                        tabPage.Menu     = this.contextMenuStrip1;
                        tabPage.Name     = "New Group " + tabs;
                        tabPage.Size     = new System.Drawing.Size(816, 288);
                        tabPage.TabIndex = tabs;
                        tabPage.Text     = "New Group " + tabs;
                        if (!isNew)
                        {
                            this.userControl11.Controls.Add(tabPage);
                            t = tabPage;
                        }
                        break;

                    default: tabPage = (CharTabPage)this.userControl11.TabPages[0]; break;
                    }//end of switch


                    tabs--;

                    t.Loadsheet(openFileDialog1.FileName);//call load routine and pass in a File name

                    GroupName = GroupName[GroupName.Length - 1].Split('.');
                } //end if
            }     //end else
        }         //end of loadToolStripMenuItem_Click