Exemplo n.º 1
0
    public MainView()
    {
        this.SuspendLayout();

        this.DoubleBuffered = true;

        this.Height = 600;
        this.Width  = 600;

        this.Text = "PartsDB";

        tabControl           = new TabControl();
        tabControl.Dock      = DockStyle.Fill;
        tabControl.Selected += new TabControlEventHandler(delegate(object sender, TabControlEventArgs e) {
            if (e.TabPage == rsvTab)
            {
                activeTab = Tabs.RawSql;
            }
            else if (e.TabPage == rsvTab)
            {
                activeTab = Tabs.Prefs;
            }
            else if (e.TabPage == rsvTab)
            {
                activeTab = Tabs.Parts;
            }
            else if (e.TabPage == rsvTab)
            {
                activeTab = Tabs.Edit;
            }
        });
        Controls.Add(tabControl);

        partsTab   = new TabPage("Parts");
        parts      = new PartsView();
        parts.Dock = DockStyle.Fill;
        partsTab.Controls.Add(parts);
        tabControl.TabPages.Add(partsTab);

        partEditTab   = new TabPage("Edit Part");
        partEdit      = new PartEditView();
        partEdit.Dock = DockStyle.Fill;
        partEditTab.Controls.Add(partEdit);
        tabControl.TabPages.Add(partEditTab);

        pvTab   = new TabPage("Preferences");
        pv      = new PreferencesView();
        pv.Dock = DockStyle.Fill;
        pvTab.Controls.Add(pv);
        tabControl.TabPages.Add(pvTab);

        rsvTab   = new TabPage("Raw SQL");
        rsv      = new RawSqlView();
        rsv.Dock = DockStyle.Fill;
        rsvTab.Controls.Add(rsv);
        tabControl.TabPages.Add(rsvTab);


        this.ResumeLayout();
    }
Exemplo n.º 2
0
    public MainView()
    {
        this.SuspendLayout();

        this.DoubleBuffered = true;

        this.Height = 600;
        this.Width = 600;

        this.Text = "PartsDB";

        tabControl = new TabControl();
        tabControl.Dock = DockStyle.Fill;
        tabControl.Selected += new TabControlEventHandler(delegate (object sender, TabControlEventArgs e) {
            if (e.TabPage == rsvTab) {
                activeTab = Tabs.RawSql;
            } else if (e.TabPage == rsvTab) {
                activeTab = Tabs.Prefs;
            } else if (e.TabPage == rsvTab) {
                activeTab = Tabs.Parts;
            } else if (e.TabPage == rsvTab) {
                activeTab = Tabs.Edit;
            }
        });
        Controls.Add(tabControl);

        partsTab = new TabPage("Parts");
        parts = new PartsView();
        parts.Dock = DockStyle.Fill;
        partsTab.Controls.Add(parts);
        tabControl.TabPages.Add(partsTab);

        partEditTab = new TabPage("Edit Part");
        partEdit = new PartEditView();
        partEdit.Dock = DockStyle.Fill;
        partEditTab.Controls.Add(partEdit);
        tabControl.TabPages.Add(partEditTab);

        pvTab = new TabPage("Preferences");
        pv = new PreferencesView();
        pv.Dock = DockStyle.Fill;
        pvTab.Controls.Add(pv);
        tabControl.TabPages.Add(pvTab);

        rsvTab = new TabPage("Raw SQL");
        rsv = new RawSqlView();
        rsv.Dock = DockStyle.Fill;
        rsvTab.Controls.Add(rsv);
        tabControl.TabPages.Add(rsvTab);

        this.ResumeLayout();
    }