Inheritance: AbstractDialog
示例#1
0
        // The constructor for the main view
        public MainView(string name)
            : base(name)
        {
            this._locationlist = new List<Label>();
            this._buildinglist = new List<Label>();
            this._floorlist = new List<Label>();

            this._doch = DocumentHandler.GetInstance();
            this.SelectCorrectLocations();

            this._addLocationDialog = new AddLocationDialog("Locatie toevoegen", delegate () {
                this.RemoveAllLocationsFromPanel();
                this.SelectCorrectLocations();
                this._locationLabelLocationY = 0;
                this.PlaceLocationsOnPanel();
                this.DecisionShowScrollbar();
            });

            this._addBuildingDialog = new AddBuildingDialog("Gebouw toevoegen", delegate () {        // If the floor has been added, all floors and their labels will be deleted from the panel and their arrays
                this.RemoveAllBuildingsFromPanel();
                this.SelectCorrectBuildings(this._currentLocationID); // The floors of the current building are being selected.
                this._locationLabelBuildingY = 0; // The field for the Y-coordinate of the labels of the floors is set to zero.
                this.PlaceBuildingsOnPanel(); // The labels of the floors are being placed on the panel with each their own spcific Y-coordinate.
                this.DecisionShowScrollbar(); // Decide if the scrollbar has to be shown });
            });

            this._addFloorDialog = new AddFloorDialog("Verdieping toevoegen", delegate () {
                this.RemoveAllFloorsFromPanel(); // If the floor has been added, all floors and their labels will be deleted from the panel and their arrays
                this.SelectCorrectFloors(this._currentBuildingID); // The floors of the current building are being selected.
                this._locationLabelFloorY = 0; // The field for the Y-coordinate of the labels of the floors is set to zero.
                this.PlaceFloorsOnPanel(); // The labels of the floors are being placed on the panel with each their own spcific Y-coordinate.
                this.DecisionShowScrollbar(); // Decide if the scrollbar has to be shown
            });

            this._deleteLocationDialog = new DeleteLocationDialog("Locatie verwijderen", delegate () {
                this.RemoveAllLocationsFromPanel();
                this.RemoveAllBuildingsFromPanel();
                this.RemoveAllFloorsFromPanel();
                this.SelectCorrectLocations();
                this._locationLabelLocationY = 0;
                this.PlaceLocationsOnPanel();
                this.DecisionShowScrollbar();
            });

            this._deleteBuildingDialog = new DeleteBuildingDialog("Gebouw verwijderen", delegate () {        // If the floor has been added, all floors and their labels will be deleted from the panel and their arrays
                this.RemoveAllFloorsFromPanel();
                this.RemoveAllBuildingsFromPanel();
                this.SelectCorrectBuildings(this._currentLocationID); // The floors of the current building are being selected.
                this._locationLabelBuildingY = 0; // The field for the Y-coordinate of the labels of the floors is set to zero.
                this.PlaceBuildingsOnPanel(); // The labels of the floors are being placed on the panel with each their own spcific Y-coordinate.
                this.DecisionShowScrollbar(); // Decide if the scrollbar has to be shown });
            });

            this._deleteFloorDialog = new DeleteFloorDialog("Verdieping verwijderen", delegate () {
                this.RemoveAllFloorsFromPanel(); // If the floor has been added, all floors and their labels will be deleted from the panel and their arrays
                this.SelectCorrectFloors(this._currentBuildingID); // The floors of the current building are being selected.
                this._locationLabelFloorY = 0; // The field for the Y-coordinate of the labels of the floors is set to zero.
                this.PlaceFloorsOnPanel(); // The labels of the floors are being placed on the panel with each their own spcific Y-coordinate.
                this.DecisionShowScrollbar(); // Decide if the scrollbar has to be shown
            });

            this._editLocationDialog = new EditLocationDialog("Locatie wijzigen", delegate () {
                this.RemoveAllLocationsFromPanel();
                this.SelectCorrectLocations();
                this._locationLabelLocationY = 0;
                this.PlaceLocationsOnPanel();
                this.DecisionShowScrollbar();
            });

            this._editBuildingDialog = new EditBuildingDialog("Gebouw wijzigen", delegate () {
                this.RemoveAllBuildingsFromPanel();
                this.SelectCorrectBuildings(this._currentLocationID);
                this._locationLabelBuildingY = 0;
                this.PlaceBuildingsOnPanel();
                this.DecisionShowScrollbar();
            });

            this._editFloorDialog = new EditFloorDialog("Verdieping wijzigen", delegate () {
                this.RemoveAllFloorsFromPanel();
                this.SelectCorrectFloors(this._currentBuildingID);
                this._locationLabelFloorY = 0;
                this.PlaceFloorsOnPanel();
                this.DecisionShowScrollbar();
            });

            this._addItemTypeDialog = new AddItemTypeDialog("Meubel type toevoegen", null);
            this._addItemDialog = new AddItemDialog("Meubel toevoegen",null);
        }
示例#2
0
        protected override void InitializeComponent()
        {
            this.itemTypeComboBox = new System.Windows.Forms.ComboBox();
            this.viewHeaderLabel = new System.Windows.Forms.Label();
            this.itemPreviewLabel = new System.Windows.Forms.Label();
            this.roomOverviewLabel = new System.Windows.Forms.Label();
            this.backButton = new System.Windows.Forms.Button();
            this.displayPictureBox = new System.Windows.Forms.PictureBox();
            this._addObjectBtn = new System.Windows.Forms.Button();
            this._details = new ShowDetailDialog("Details", this.UpdateDropdown);
            this._addItemButton = new Button();
            ((System.ComponentModel.ISupportInitialize)(this.displayPictureBox)).BeginInit();
            this.SuspendLayout();
            //
            // itemTypeComboBox
            //
            this.itemTypeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.itemTypeComboBox.FormattingEnabled = true;
            this.itemTypeComboBox.Location = new System.Drawing.Point(267, 98);
            this.itemTypeComboBox.Name = "itemTypeComboBox";
            this.itemTypeComboBox.Size = new System.Drawing.Size(138, 21);
            this.itemTypeComboBox.TabIndex = 0;
            this.itemTypeComboBox.SelectedIndexChanged += new System.EventHandler(this.ComboBoxChanged);
            this.UpdateDropdown();
            //
            // viewHeaderLabel
            //
            this.viewHeaderLabel.AutoSize = true;
            this.viewHeaderLabel.Location = new System.Drawing.Point(150, 11);
            this.viewHeaderLabel.Name = "label1";
            this.viewHeaderLabel.TabIndex = 1;
            this.viewHeaderLabel.Text = "Objecten Menu";
            this.viewHeaderLabel.Font = new Font("Arial", 10, FontStyle.Bold);
            this.viewHeaderLabel.BackColor = Color.FromArgb(255, 40, 40, 40);
            this.viewHeaderLabel.ForeColor = Color.WhiteSmoke;
            //
            // backButton
            //
            this.backButton.BackColor = System.Drawing.Color.DimGray;
            this.backButton.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Gray;
            this.backButton.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
            this.backButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold);
            this.backButton.ForeColor = System.Drawing.Color.White;
            this.backButton.Location = new System.Drawing.Point(5, 8);
            this.backButton.Margin = new System.Windows.Forms.Padding(5);
            this.backButton.Name = "backButton";
            this.backButton.Size = new System.Drawing.Size(72, 24);
            this.backButton.TabIndex = 4;
            this.backButton.Text = "Terug";
            this.backButton.UseVisualStyleBackColor = false;
            this.backButton.Click += BackButtonClick;
            //
            // displayPictureBox
            //
            this.displayPictureBox.Location = new System.Drawing.Point(39, 125);
            this.displayPictureBox.Name = "pictureBox1";
            this.displayPictureBox.Size = new System.Drawing.Size(366, 327);
            this.displayPictureBox.TabIndex = 5;
            this.displayPictureBox.BorderStyle = BorderStyle.FixedSingle;
            this.displayPictureBox.TabStop = false;
            this.displayPictureBox.DoubleClick += itemTypeClick;
            //
            // _addObjectBtn
            //
            this._addObjectBtn.BackColor = System.Drawing.Color.DimGray;
            this._addObjectBtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Gray;
            this._addObjectBtn.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
            this._addObjectBtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold);
            this._addObjectBtn.ForeColor = System.Drawing.Color.White;
            this._addObjectBtn.Location = new System.Drawing.Point(39, 471);
            this._addObjectBtn.Margin = new System.Windows.Forms.Padding(5);
            this._addObjectBtn.Name = "_addObjectBtn";
            this._addObjectBtn.Size = new System.Drawing.Size(103, 40);
            this._addObjectBtn.TabIndex = 6;
            this._addObjectBtn.Text = "Object Type toevoegen";
            this._addObjectBtn.UseVisualStyleBackColor = false;
            this._addObjectBtn.Click += new EventHandler(this.AddObjectBtn_click);
            //
            // _addItemButton
            //
            this._addItemButton.BackColor = System.Drawing.Color.DimGray;
            this._addItemButton.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Gray;
            this._addItemButton.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
            this._addItemButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold);
            this._addItemButton.ForeColor = System.Drawing.Color.White;
            this._addItemButton.Location = new System.Drawing.Point(490, 400);
            this._addItemButton.Margin = new System.Windows.Forms.Padding(5);
            this._addItemButton.Name = "_editObjectTypeButton";
            this._addItemButton.Size = new System.Drawing.Size(103, 40);
            this._addItemButton.TabIndex = 6;
            this._addItemButton.Text = "Meubel toevoegen";
            this._addItemButton.UseVisualStyleBackColor = false;
            this._addItemButton.Click += new EventHandler(this._addItemButton_Click);
            //
            // itemPreviewLabel
            //
            this.itemPreviewLabel.AutoSize = true;
            this.itemPreviewLabel.Location = new System.Drawing.Point(36, 99);
            this.itemPreviewLabel.Name = "label2";
            this.itemPreviewLabel.Size = new System.Drawing.Size(94, 13);
            this.itemPreviewLabel.TabIndex = 7;
            this.itemPreviewLabel.Text = "Visuele Weergave";
            this.itemPreviewLabel.Font = new Font("Arial", 10, FontStyle.Bold);
            this.itemPreviewLabel.BackColor = Color.FromArgb(255, 40, 40, 40);
            this.itemPreviewLabel.ForeColor = Color.WhiteSmoke;

            //          label 3

            this.roomOverviewLabel.AutoSize = true;
            this.roomOverviewLabel.Location = new System.Drawing.Point(615, 98);
            this.roomOverviewLabel.Name = "label3";
            this.roomOverviewLabel.Size = new System.Drawing.Size(94, 13);
            this.roomOverviewLabel.TabIndex = 8;
            this.roomOverviewLabel.Text = "Overzicht "+DocumentHandler.GetInstance().CurrentRoom.Name;
            this.roomOverviewLabel.Font = new Font("Arial", 12, FontStyle.Bold);
            this.roomOverviewLabel.BackColor = Color.FromArgb(255, 40, 40, 40);
            this.roomOverviewLabel.ForeColor = Color.WhiteSmoke;

            backgroundPanel = GetHeader(Color.FromArgb(255, 239, 235, 235), new Point(480, 122), new Size(383, displayPictureBox.Height));
            backgroundPanel.BorderStyle = BorderStyle.FixedSingle;

            UpdateContent();
            //
            // ObjectView
            //
            this._addItemTypeDialog = new AddItemTypeDialog("Object Type / Meubel toevoegen", this.UpdateDropdown);
            this._addItemDialog = new AddItemDialog("Meubel toevoegen",UpdateContent);

            this.Controls.Add(this._addItemDialog);
            this.Controls.Add(this._addItemTypeDialog);
            this.Controls.Add(this._details);
            this.Load += new EventHandler(objectViewLoad);
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.Color.White;
            this.Controls.Add(this.displayPictureBox);
            this.Controls.Add(this.itemPreviewLabel);
            this.Controls.Add(this.roomOverviewLabel);
            this.Controls.Add(this._addObjectBtn);
            this.Controls.Add(this._addItemButton);
            this.Controls.Add(this.backButton);
            this.Controls.Add(this.itemTypeComboBox);
            this.Margin = new System.Windows.Forms.Padding(2);
            this.Name = "ObjectView";
            this.Size = new System.Drawing.Size(900, 555);
            this.Controls.Add(this.viewHeaderLabel);
            this._oldSize = base.Form.Size;
            this._oldStyle = base.Form.FormBorderStyle;
            base.Form.Size = this.Size;
            this.BackColor = Color.White;
            this.Form.MaximizeBox = false;
            this.Form.FormBorderStyle = FormBorderStyle.FixedSingle;

            this.Controls.Add(GetHeader(Color.FromArgb(255, 40, 40, 40), new Point(0,0), new Size(this.Width, 40)));
            this.Controls.Add(GetHeader(Color.FromArgb(255, 40, 40, 40), new Point(34, 94), new Size(383, 28)));
            this.Controls.Add(GetHeader(Color.FromArgb(255, 40, 40, 40), new Point(480, 94), new Size(383, 28)));
            this.Controls.Add(backgroundPanel);
            ((System.ComponentModel.ISupportInitialize)(this.displayPictureBox)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();
        }