Пример #1
0
        public ModEntry(string modName, string modCreator, string modURL, TreeNode[] nodes)
        {
            InitializeComponent();

            ModName    = modName;
            ModCreator = modCreator;
            ModURL     = modURL;

            this.entryNameLabel.Text     = modName;
            this.entryCreatorLabel.Text += " " + modCreator;
            this.entryWebsiteLabel.Text += " " + modURL;

            this.entryFileListTreeView.Nodes.Clear();
            for (int i = 0; i < nodes.Length; i++)
            {
                this.entryFileListTreeView.Nodes.Add(nodes[i]);
            }

            this.Resize += new EventHandler(ModEntry_Resize);
            TreeViewStylizer.Stylize(this.entryFileListTreeView);

            wGUI.InitializeButton(
                entryEnableCheckboxPB,
                Properties.Resources.ModDisabled,
                Properties.Resources.ModDisabledHover,
                Properties.Resources.ModDisabledDown,
                true
                );

            wGUI.InitializeButton(
                optionsButtonPB,
                Properties.Resources.OptionsButton_Normal,
                Properties.Resources.OptionsButton_Highlight,
                Properties.Resources.OptionsButton_Down,
                false
                );
            wGUI.InitializeButton(
                deleteButtonPB,
                Properties.Resources.DeleteButton_Normal,
                Properties.Resources.DeleteButton_Highlight,
                Properties.Resources.DeleteButton_Down,
                false
                );

            entryEnableCheckboxPB.MouseUp += new MouseEventHandler(entryEnableCheckboxPB_MouseUp);

            ManageLayout(true);
        }
        public void InitializeLayoutManagement()
        {
            bottomPanel     = splitContainer1.Panel2;
            modEntriesPanel = splitContainer2.Panel2;

            //Initialize buttons & their states
            wGUI.InitializeButton(consoleButtonPB,
                                  Properties.Resources.ConsoleButton_Normal,
                                  Properties.Resources.ConsoleButton_Highlight,
                                  Properties.Resources.ConsoleButton_Down,
                                  false
                                  );
            wGUI.InitializeButton(optionsButtonPB,
                                  Properties.Resources.OptionsButton_Normal,
                                  Properties.Resources.OptionsButton_Highlight,
                                  Properties.Resources.OptionsButton_Down,
                                  false
                                  );

            //Binds tabs to their panels
            BindTab(consoleButtonPB, bottomPanelConsoleTab);
            BindTab(optionsButtonPB, bottomPanelOptionsTab);

            //Handle resizing
            int bottomPanelHeight = 0;
            int leftPanelWidth    = 0;

            this.ResizeBegin += delegate(object sender, EventArgs e)
            {
                bottomPanelHeight = splitContainer1.Panel2.Height;
                leftPanelWidth    = splitContainer2.Panel1.Width;
            };
            this.Resize += delegate(object sender, EventArgs e)
            {
                try
                {
                    HandleUI();
                    splitContainer1.SplitterDistance = splitContainer1.Height - bottomPanelHeight;
                    splitContainer2.SplitterDistance = leftPanelWidth;
                }
                catch { }
            };

            this.splitContainer1.SplitterMoved += delegate(object sender, SplitterEventArgs e)
            {
                //For if we're minimized and such
                try
                {
                    HandleUI();
                }
                catch { }
            };

            this.modEntriesScrollbar.Scroll += new ScrollEventHandler(modEntriesScrollbar_Scroll);
            TreeViewStylizer.Stylize(rafContentView);

            //ToolStripManager.Renderer
            toolStrip1.Renderer = new BlackCustomRenderer(new BlackCustomProfessionalColors());

            dropFileToBeginPB.Image    = Properties.Resources.DropFileToBegin;
            dropFileToBeginPB.Visible  = false;
            dropFileToBeginPB.Size     = dropFileToBeginPB.Image.Size;
            dropFileToBeginPB.SizeMode = PictureBoxSizeMode.StretchImage;
            modEntriesPanel.Controls.Add(dropFileToBeginPB);

            HandleUI();
            HandleTabClick(consoleButtonPB);
        }