protected void OnOpenOrder(object sender, EventArgs arg)
    {
        CalendarItem item     = (CalendarItem)sender;
        OrderDlg     OrderWin = new OrderDlg(item.id);

        OrderWin.Show();
        if ((ResponseType)OrderWin.Run() == ResponseType.Ok)
        {
            item.Calendar.RefreshOrders();
        }
        OrderWin.Destroy();
    }
    protected void OnNewOrder(object sender, NewOrderEventArgs arg)
    {
        OrderDlg OrderWin = new OrderDlg(arg.PointNumber, arg.CalendarNumber, arg.OrderType, arg.Date, arg.Hour);

        OrderWin.Show();
        int result = OrderWin.Run();

        if (result == (int)ResponseType.Ok)
        {
            ((OrdersCalendar)sender).RefreshOrders();
        }
        OrderWin.Destroy();
    }
Example #3
0
        public void ConfigureMenu()
        {
            menuItems = new Dictionary <PopupMenuAction, MenuItem>();
            menu      = new Menu();

            Clipboard clipboard = Clipboard.Get(Gdk.Atom.Intern("CLIPBOARD", false));

            var copy = new MenuItem(PopupMenuAction.CopyCell.GetEnumTitle());

            menuItems.Add(PopupMenuAction.CopyCell, copy);
            copy.Activated += (s, args) => {
                if (!String.IsNullOrWhiteSpace(textToCopy))
                {
                    clipboard.Text = textToCopy;
                }
            };
            copy.Visible = false;

            var openReturns = new MenuItem(PopupMenuAction.OpenUndeliveries.GetEnumTitle());

            openReturns.Activated += (s, args) => OnClosingItemActivated(this, null);
            menuItems.Add(PopupMenuAction.OpenUndeliveries, openReturns);

            var openOrder = new MenuItem(PopupMenuAction.OpenOrder.GetEnumTitle());

            openOrder.Activated += (s, args) => {
                var dlg = new OrderDlg(GetSelectedRouteListItem().Order);
                dlg.Show();
                MyTab.TabParent.AddTab(dlg, MyTab);
            };
            menuItems.Add(PopupMenuAction.OpenOrder, openOrder);

            foreach (var item in menuItems)
            {
                menu.Append(item.Value);
                item.Value.Show();
            }
        }