Beispiel #1
0
        private void InitializeComponent()
        {
            CustomPropertyGrid currGrid = new CustomPropertyGrid();
            ContextMenu currGridContextMenu = new ContextMenu();

            currGrid.Dock = DockStyle.Fill;
            currGrid.Font = new Font("Tahoma", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((System.Byte)(0)));
            currGrid.Location = new Point(140, 0);
            currGrid.Name = "_currGrid";
            currGrid.Size = new Size(269, 266);
            currGrid.TabIndex = 1;
            currGrid.PropertySort = PropertySort.Alphabetical;
            currGrid.ToolbarVisible = false;
            currGrid.HelpVisible = false;
            currGrid.ContextMenu = currGridContextMenu;
            currGridContextMenu.Popup += new EventHandler(OnPropertyGridPopupContextMenu);

            Controls.Add(currGrid);

            CurrentGrid = currGrid;
            CurrentGridContextMenu = currGridContextMenu;
        }
Beispiel #2
0
        private void InitializeComponent()
        {
            PropertyGrid propertyGrid;
            ContextMenu propertyGridContextMenu;

            viewMenu = new IconMenuItem();
            Opacity100 = new IconMenuItem();
            Opacity75 = new IconMenuItem();
            Opacity50 = new IconMenuItem();
            Opacity25 = new IconMenuItem();
            Separator = new IconMenuItem("-");
            AlwaysOnTop = new IconMenuItem();
            SnapToGrid = new IconMenuItem();
            DialogScale = new IconMenuItem();
            dialogTreeView = new TreeView();
            propertyGrid = new CustomPropertyGrid();
            propertyGridContextMenu = new ContextMenu();
            wxsDialogs = new ListView();
            wxsDialogsContextMenu = new ContextMenu();
            splitter1 = new Splitter();
            splitter2 = new Splitter();
            panel1 = new Panel();
            panel1.SuspendLayout();
            SuspendLayout();

            viewMenu.MenuItems.AddRange(new MenuItem[] {
                                                              Opacity100,
                                                              Opacity75,
                                                              Opacity50,
                                                              Opacity25,
                                                              Separator,
                                                              AlwaysOnTop,
                                                              SnapToGrid,
                                                              DialogScale});
            viewMenu.Text = "&Dialogs";
            //
            // Opacity100
            //
            Opacity100.Index = 0;
            Opacity100.Text = "Set Opacity 100%";
            Opacity100.Click += new EventHandler(Opacity_Click);
            //
            // Opacity75
            //
            Opacity75.Index = 1;
            Opacity75.Text = "Set Opacity 75%";
            Opacity75.Click += new EventHandler(Opacity_Click);
            //
            // Opacity50
            //
            Opacity50.Index = 2;
            Opacity50.Text = "Set Opacity 50%";
            Opacity50.Click += new EventHandler(Opacity_Click);
            //
            // Opacity25
            //
            Opacity25.Index = 3;
            Opacity25.Text = "Set Opacity 25%";
            Opacity25.Click += new EventHandler(Opacity_Click);
            //
            // Separator
            //
            Separator.Index = 4;
            //
            // AlwaysOnTop
            //
            AlwaysOnTop.Index = 5;
            AlwaysOnTop.Text = "Always on top";
            AlwaysOnTop.Click += new EventHandler(AlwaysOnTop_Click);
            AlwaysOnTop.Checked = WixEditSettings.Instance.AlwaysOnTop;
            //
            // SnapToGrid
            //
            SnapToGrid.Index = 6;
            SnapToGrid.Text = "Snap to grid";
            SnapToGrid.Click += new EventHandler(SnapToGrid_Click);
            //
            // Scale
            //
            DialogScale.Index = 6;
            DialogScale.Text = "Scale Dialog";
            DialogScale.Click += new EventHandler(DialogScale_Click);
            //
            // dialogTreeView
            //
            dialogTreeView.HideSelection = false;
            dialogTreeView.Dock = DockStyle.Left;
            dialogTreeView.ImageIndex = -1;
            dialogTreeView.Location = new Point(0, 0);
            dialogTreeView.Name = "dialogTreeView";
            dialogTreeView.SelectedImageIndex = -1;
            dialogTreeView.Size = new Size(170, 266);
            dialogTreeView.TabIndex = 6;
            dialogTreeView.AfterSelect += new TreeViewEventHandler(OnAfterSelect);
            dialogTreeViewContextMenu = new ContextMenu();
            dialogTreeViewContextMenu.Popup += new EventHandler(PopupDialogTreeViewContextMenu);
            dialogTreeView.MouseDown += new MouseEventHandler(TreeViewMouseDown);
            dialogTreeView.KeyDown += new KeyEventHandler(TreeViewKeyDown);

            dialogTreeView.ImageList = ImageListFactory.GetImageList();

            newControlElementMenu = new IconMenuItem("New Control", new Bitmap(WixFiles.GetResourceStream("elements.control.bmp")));

            foreach (string controlType in controlTypes)
            {
                MenuItem menuItem = new MenuItem(controlType);
                menuItem.Click += new EventHandler(NewControlElement_Click);
                newControlElementMenu.MenuItems.Add(menuItem);
            }

            MenuItem dashMenuItem = new MenuItem("-");
            newControlElementMenu.MenuItems.Add(dashMenuItem);

            otherMenuItem = new MenuItem("Other...");
            otherMenuItem.Click += new EventHandler(NewControlElement_Click);
            newControlElementMenu.MenuItems.Add(otherMenuItem);

            newControlSubElementsMenu = new IconMenuItem("New", new Bitmap(WixFiles.GetResourceStream("bmp.new.bmp")));

            deleteCurrentElementMenu = new IconMenuItem("&Delete", new Bitmap(WixFiles.GetResourceStream("bmp.delete.bmp")));
            deleteCurrentElementMenu.Click += new EventHandler(DeleteElement_Click);

            infoAboutCurrentElementMenu = new IconMenuItem("&Info", new Bitmap(WixFiles.GetResourceStream("bmp.info.bmp")));
            infoAboutCurrentElementMenu.Click += new EventHandler(InfoAboutCurrentElement_Click);

            //
            // propertyGridContextMenu
            //
            propertyGridContextMenu.Popup += new EventHandler(OnPropertyGridPopupContextMenu);
            //
            // propertyGrid
            //
            propertyGrid.Dock = DockStyle.Fill;
            propertyGrid.Font = new Font("Tahoma", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((Byte)(0)));
            propertyGrid.Location = new Point(140, 0);
            propertyGrid.Name = "propertyGrid";
            propertyGrid.Size = new Size(250, 266);
            propertyGrid.TabIndex = 1;
            propertyGrid.PropertySort = PropertySort.Alphabetical;
            propertyGrid.ToolbarVisible = false;
            propertyGrid.PropertyValueChanged += new PropertyValueChangedEventHandler(OnPropertyValueChanged);
            propertyGrid.ContextMenu = propertyGridContextMenu;

            //
            // wxsDialogs
            //
            wxsDialogs.Dock = DockStyle.Left;
            wxsDialogs.Font = new Font("Tahoma", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((Byte)(0)));
            wxsDialogs.Location = new Point(0, 0);
            wxsDialogs.Name = "wxsDialogs";
            wxsDialogs.Size = new Size(140, 264);
            wxsDialogs.TabIndex = 0;
            wxsDialogs.View = View.Details;
            wxsDialogs.MultiSelect = false;
            wxsDialogs.HideSelection = false;
            wxsDialogs.FullRowSelect = true;
            wxsDialogs.GridLines = false;
            wxsDialogs.SelectedIndexChanged += new EventHandler(OnSelectedDialogChanged);
            wxsDialogs.KeyDown += new KeyEventHandler(OnDialogKeyDown);
            wxsDialogs.ContextMenu = wxsDialogsContextMenu;

            wxsDialogsContextMenu.Popup += new EventHandler(OnWxsDialogsPopupContextMenu);
            //
            // splitter1
            //
            splitter1.Location = new Point(140, 0);
            splitter1.Name = "splitter1";
            splitter1.Size = new Size(2, 266);
            splitter1.TabIndex = 7;
            splitter1.TabStop = false;
            //
            // panel1
            //
            panel1.Controls.Add(splitter2);
            panel1.Controls.Add(propertyGrid);
            panel1.Controls.Add(dialogTreeView);
            panel1.Dock = DockStyle.Fill;
            panel1.Location = new Point(142, 0);
            panel1.Name = "panel1";
            panel1.Size = new Size(409, 266);
            panel1.TabIndex = 9;
            //
            // splitter2
            //
            splitter2.Location = new Point(140, 0);
            splitter2.Name = "splitter2";
            splitter2.Size = new Size(2, 266);
            splitter2.TabIndex = 7;
            splitter2.TabStop = false;
            //
            // EditorForm
            //
            //AutoScaleBaseSize = new Size(5, 14);
            ClientSize = new Size(553, 266);
            Controls.Add(panel1);
            Controls.Add(splitter1);
            Controls.Add(wxsDialogs);
            Font = new Font("Tahoma", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((Byte)(0)));

            Name = "EditorForm";
            Text = "Wix Dialog Editor";
            panel1.ResumeLayout(false);
            ResumeLayout(false);

            double opacity = WixEditSettings.Instance.Opacity;
            if (opacity == 1.00)
            {
                Opacity100.Checked = true;
            }
            else if (opacity == 0.75)
            {
                Opacity75.Checked = true;
            }
            else if (opacity == 0.50)
            {
                Opacity50.Checked = true;
            }
            else if (opacity == 0.25)
            {
                Opacity25.Checked = true;
            }
            else
            {
                Opacity100.Checked = true;
            }

            wxsDialogs.Columns.Add("Item Column", -2, HorizontalAlignment.Left);
            wxsDialogs.HeaderStyle = ColumnHeaderStyle.None;
            wxsDialogs.Resize += new EventHandler(OnResizeWxsDialogs);

            CurrentGrid = propertyGrid;
            CurrentGridContextMenu = propertyGridContextMenu;

            LoadData();

            CurrentGrid.PropertyValueChanged += new PropertyValueChangedEventHandler(OnPropertyGridValueChanged);
        }
Beispiel #3
0
        private void InitializeComponent()
        {
            currTreeView = new TreeView();
            splitter1 = new Splitter();
            panel1 = new Panel();

            CustomPropertyGrid currGrid = new CustomPropertyGrid();
            ContextMenu currGridContextMenu = new ContextMenu();

            panelContextMenu = new ContextMenu();
            panelContextMenu.Popup += new EventHandler(PopupPanelContextMenu);

            currTreeView.HideSelection = false;
            currTreeView.Dock = DockStyle.Left;
            currTreeView.ImageIndex = -1;
            currTreeView.Location = new Point(0, 0);
            currTreeView.Name = "currTreeView";
            currTreeView.SelectedImageIndex = -1;
            currTreeView.Size = new Size(256, 266);
            currTreeView.TabIndex = 6;
            currTreeView.ImageList = ImageListFactory.GetImageList();
            currTreeView.AfterSelect += new TreeViewEventHandler(OnAfterSelect);
            currTreeViewContextMenu = new ContextMenu();
            currTreeViewContextMenu.Popup += new EventHandler(PopupTreeViewContextMenu);
            currTreeView.MouseDown += new MouseEventHandler(TreeViewMouseDown);
            currTreeView.KeyDown += new KeyEventHandler(TreeViewKeyDown);

            splitter1.Dock = DockStyle.Left;
            splitter1.Location = new Point(140, 0);
            splitter1.Name = "splitter1";
            splitter1.Size = new Size(2, 266);
            splitter1.TabIndex = 7;
            splitter1.TabStop = false;

            currGridContextMenu.Popup += new EventHandler(OnPropertyGridPopupContextMenu);

            currGrid.Dock = DockStyle.Fill;
            currGrid.Font = new Font("Tahoma", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((System.Byte)(0)));
            currGrid.Location = new Point(140, 0);
            currGrid.Name = "_currGrid";
            currGrid.Size = new Size(250, 266);
            currGrid.TabIndex = 1;
            currGrid.PropertySort = PropertySort.Alphabetical;
            currGrid.ToolbarVisible = false;
            currGrid.PropertyValueChanged += new PropertyValueChangedEventHandler(OnPropertyValueChanged);
            currGrid.ContextMenu = currGridContextMenu;

            panel1.Controls.Add(currGrid);
            panel1.Dock = DockStyle.Fill;
            panel1.Location = new Point(142, 0);
            panel1.Name = "panel1";
            panel1.Size = new Size(409, 266);
            panel1.TabIndex = 9;

            Controls.Add(panel1);
            Controls.Add(splitter1);
            Controls.Add(currTreeView);

            CurrentGrid = currGrid;
            CurrentGridContextMenu = currGridContextMenu;
        }