Esempio n. 1
0
        public static void test_()
        {
            PaletteSet ps = new PaletteSet("Ribbon Custom")
            {
                //ps.Add("Ribbon", ribbon_Custom);
                // set some style parameters

                Style = PaletteSetStyles.NameEditable |

                        PaletteSetStyles.ShowPropertiesMenu |

                        PaletteSetStyles.ShowAutoHideButton |

                        PaletteSetStyles.ShowCloseButton |

                        PaletteSetStyles.Snappable,

                Visible = true,
                Dock    = DockSides.None
            };

            System.Drawing.Point startPos = new System.Drawing.Point(50, 50);
            ps.SetLocation(startPos);
            ps.SetSize(new System.Drawing.Size(700, 145));
            ps.TitleBarLocation = PaletteSetTitleBarLocation.Left;

            Ribbon_ViewModel viewModel = new Ribbon_ViewModel();

            ps.AddVisual("Ribbon", viewModel.InitRibbonView());
        }
Esempio n. 2
0
        public void Initialize()
        {
            PaletteSet paletteSet = new PaletteSet("Test")
            {
                Style = PaletteSetStyles.NameEditable |
                PaletteSetStyles.ShowPropertiesMenu |
                PaletteSetStyles.ShowAutoHideButton |
                PaletteSetStyles.ShowCloseButton |
                PaletteSetStyles.Snappable,

                Visible = true,
                Dock = DockSides.None
            };
            System.Drawing.Point startPos = new System.Drawing.Point(0, 50);
            paletteSet.SetLocation(startPos);
            paletteSet.SetSize(new System.Drawing.Size(900, 900));
            paletteSet.TitleBarLocation = PaletteSetTitleBarLocation.Left;
            UIViews uIViews = new UIViews();
            paletteSet.AddVisual("Ribbon", uIViews);
        }
Esempio n. 3
0
        public void Initialize()
        {
            PaletteSet paletteSet = new PaletteSet("Ribbon Custom")
            {
                Style = PaletteSetStyles.NameEditable |
                        PaletteSetStyles.ShowPropertiesMenu |
                        PaletteSetStyles.ShowAutoHideButton |
                        PaletteSetStyles.ShowCloseButton |
                        PaletteSetStyles.Snappable,
                Visible = true,
                Dock    = DockSides.None
            };

            System.Drawing.Point StartPos = new System.Drawing.Point(0, 100);
            paletteSet.SetLocation(StartPos);
            paletteSet.SetSize(new System.Drawing.Size((int)SystemParameters.PrimaryScreenWidth - 100, 400));
            paletteSet.TitleBarLocation = PaletteSetTitleBarLocation.Left;


            Class1 class1 = new Class1((int)SystemParameters.PrimaryScreenWidth - 100, 400);

            paletteSet.AddVisual("Ribbon", class1);
            PaletteSet test = new PaletteSet("Test Palette");
        }
Esempio n. 4
0
        public void CreateRibbon()
        {
            AcadWindows.RibbonControl ribbon = AcadWindows.ComponentManager.Ribbon;
            AcadWindows.RibbonTab     tab    = new AcadWindows.RibbonTab();
            tab.Name  = "MyTab";
            tab.Title = "My Tab";
            tab.Id    = "MyTabId";
            ribbon.Tabs.Add(tab);

            AcadWindows.RibbonPanelSource panelSrc = new AcadWindows.RibbonPanelSource();
            panelSrc.Name  = "MyPanel";
            panelSrc.Title = "My Panel";
            panelSrc.Id    = "MyPanelId";

            AcadWindows.RibbonCheckBox cb = new Autodesk.Windows.RibbonCheckBox();
            cb.Text      = "Testing";
            cb.IsChecked = true;
            cb.Size      = AcadWindows.RibbonItemSize.Large;

            AcadWindows.RibbonButton button1 = new AcadWindows.RibbonButton();
            button1.Name = "MyButton";
            button1.Text = "My Button";
            button1.Id   = "MyButtonId";

            AcadWindows.RibbonButton button2 = new AcadWindows.RibbonButton();
            button2.Name           = "MyOtherButton";
            button2.Text           = "My Other Button";
            button2.Id             = "MyOtherButtonId";
            button2.Size           = AcadWindows.RibbonItemSize.Large;
            button2.ShowText       = true;
            button2.LargeImage     = GetBitmap(new Bitmap(@"C:\Users\nguye\OneDrive\Desktop\Untitled.png"), 64, 64);
            button2.CommandHandler = new MyButtonCmd();

            AcadWindows.RibbonButton button3 = new AcadWindows.RibbonButton();
            button3.Name           = "MyOtherButton";
            button3.Text           = "My Other Button";
            button3.Id             = "MyOtherButtonId";
            button3.Size           = AcadWindows.RibbonItemSize.Large;
            button3.ShowText       = true;
            button3.Orientation    = System.Windows.Controls.Orientation.Vertical;
            button3.LargeImage     = GetBitmap(new Bitmap(@"C:\Users\nguye\OneDrive\Desktop\Untitled.png"), 64, 64);
            button3.CommandHandler = new MyButtonCmd();

            panelSrc.Items.Add(button1);
            panelSrc.Items.Add(button2);
            panelSrc.Items.Add(button3);
            panelSrc.Items.Add(cb);

            AcadWindows.RibbonPanel panel = new AcadWindows.RibbonPanel();
            panel.Source      = panelSrc;
            panel.ResizeStyle = AcadWindows.RibbonResizeStyles.NeverChangeImageSize;
            tab.Panels.Add(panel);

            if (ps == null)
            {
                ps = new PaletteSet("My Palette 1",
                                    new Guid("229E43DB-E76F-48F9-849A-CC8D726DF257"));
                ps.SetLocation(new System.Drawing.Point(312, 763));
                ps.SetSize(new System.Drawing.Size(909, 40));
                /*For the first time we 'll enable on Bottom*/
                ps.DockEnabled = DockSides.Right;

                UserControl user_control = new UserControl();

                Button btn = new Button();
                btn.Width  = 100;
                btn.Height = 100;
                btn.Text   = "abc";
                user_control.Controls.Add(btn);
                ps.Add("1", user_control);
            }

            ps.Visible = true;

            /*Add Handler*/

            ps.PaletteSetMoved += ps_PaletteSetMoved;
        }