Ejemplo n.º 1
0
        protected override void OnClick(MouseEventArgs mouseEvent)
        {
            if (mouseEvent.Button == MouseButtons.Right)
            {
                var theme      = ApplicationController.Instance.MenuTheme;
                var printTasks = PrintHistoryData.Instance.GetHistoryItems(1000);

                var popupMenu          = new PopupMenu(theme);
                var printHistoryEditor = new PrintHistoryEditor(theme, printTask, printTasks);
                printHistoryEditor.AddQualityMenu(popupMenu, () =>
                {
                    printInfoWidget.Text = GetPrintInfo();
                    SetIndicatorColor();
                });

                printHistoryEditor.AddNotesMenu(popupMenu, printTasks, () =>
                {
                    printInfoWidget.Text = GetPrintInfo();
                });

                popupMenu.CreateSeparator();

                AddExportMenu(popupMenu, printTasks);

                popupMenu.CreateSeparator();

                AddClearHistorMenu(popupMenu, printTasks);

                popupMenu.ShowMenu(this, mouseEvent);
            }

            base.OnClick(mouseEvent);
        }
Ejemplo n.º 2
0
        protected override void OnClick(MouseEventArgs mouseEvent)
        {
            if (mouseEvent.Button == MouseButtons.Right)
            {
                var theme      = ApplicationController.Instance.MenuTheme;
                var printTasks = PrintHistoryData.Instance.GetHistoryItems(1000);

                var popupMenu          = new PopupMenu(theme);
                var printHistoryEditor = new PrintHistoryEditor(null, theme, printTask, printTasks);
                var qualityWidget      = PrintHistoryEditor.GetQualityWidget(theme,
                                                                             printTask,
                                                                             () =>
                {
                    popupMenu.Unfocus();
                    printInfoWidget.Text = GetPrintInfo();
                    SetIndicatorColor();
                },
                                                                             theme.DefaultFontSize);

                var menuItem = new PopupMenu.MenuItem(qualityWidget, theme)
                {
                    HAnchor    = HAnchor.Fit | HAnchor.Stretch,
                    VAnchor    = VAnchor.Fit,
                    HoverColor = Color.Transparent,
                };
                popupMenu.AddChild(menuItem);

                printHistoryEditor.AddNotesMenu(popupMenu, printTasks, () =>
                {
                    printInfoWidget.Text = GetPrintInfo();
                });

                popupMenu.CreateSeparator();

                AddExportMenu(popupMenu, printTasks);

                popupMenu.CreateSeparator();

                AddClearHistorMenu(popupMenu, printTasks);

                popupMenu.ShowMenu(this, mouseEvent);
            }

            base.OnClick(mouseEvent);
        }