Example #1
0
        /// <summary>
        /// Adds a combo box style item.
        /// </summary>
        /// <param name="item">The item.</param>
        /// <returns>The added ComboBox.</returns>
        public override object Add(DropDownActionItem item)
        {
            var strip = GetOrCreateStrip(item.GroupCaption);
            var combo = new ToolStripComboBox(item.Key);

            ParseAllowEditingProperty(item, combo);

            combo.ToolTipText = item.Caption;
            if (item.Width != 0)
            {
                combo.Width = item.Width;
            }

            combo.Items.AddRange(item.Items.ToArray());
            combo.SelectedIndexChanged += (sender, args) =>
            {
                item.PropertyChanged -= DropDownActionItemPropertyChanged;
                item.SelectedItem     = combo.SelectedItem;
                item.PropertyChanged += DropDownActionItemPropertyChanged;
            };

            strip?.Items.Add(combo);

            item.PropertyChanged += DropDownActionItemPropertyChanged;
            return(combo);
        }
        /// <summary>
        /// Adds a combo box style item
        /// </summary>
        /// <param name="item">The item.</param>
        public override void Add(DropDownActionItem item)
        {
            ToolStrip strip = this.GetOrCreateStrip(item.GroupCaption);
            var       combo = new ToolStripComboBox(item.Key);

            ParseAllowEditingProperty(item, combo);

            combo.ToolTipText = item.Caption;
            if (item.Width != 0)
            {
                combo.Width = item.Width;
            }

            combo.Items.AddRange(item.Items.ToArray());
            combo.SelectedIndexChanged += delegate
            {
                item.PropertyChanged -= DropDownActionItem_PropertyChanged;
                item.SelectedItem     = combo.SelectedItem;
                item.PropertyChanged += DropDownActionItem_PropertyChanged;
            };

            if (strip != null)
            {
                strip.Items.Add(combo);
            }

            item.PropertyChanged += DropDownActionItem_PropertyChanged;
        }
 private static void ParseAllowEditingProperty(DropDownActionItem item, ToolStripComboBox combo)
 {
     if (item.AllowEditingText)
     {
         combo.DropDownStyle = ComboBoxStyle.DropDown;
     }
     else
     {
         combo.DropDownStyle = ComboBoxStyle.DropDownList;
     }
 }
        public override void Activate()
        {
            IHeaderControl header = App.HeaderControl;
            header.Add(new SimpleActionItem(rootKey, "自动", (sender, e) => { }) { SmallImage = Resources.cmd_test_16x16, LargeImage = Resources.cmd_test_32x32 });
            header.Add(new SimpleActionItem(rootKey, "手动", (sender, e) => { }) { SmallImage = Resources.cmd_test_16x16, LargeImage = Resources.cmd_test_32x32 });
            header.Add(new SimpleActionItem(rootKey, "申请", (sender, e) => { }) { SmallImage = Resources.cmd_test_16x16, LargeImage = Resources.cmd_test_32x32 });
            header.Add(new SimpleActionItem(rootKey, "取消", (sender, e) => { }) { SmallImage = Resources.cmd_test_16x16, LargeImage = Resources.cmd_test_32x32 });
            header.Add(new SimpleActionItem(rootKey, "完成", (sender, e) => { }) { SmallImage = Resources.cmd_test_16x16, LargeImage = Resources.cmd_test_32x32 });
            header.Add(new SimpleActionItem(rootKey, "批量", (sender, e) => { }) { SmallImage = Resources.cmd_test_16x16, LargeImage = Resources.cmd_test_32x32 });

            dropItem = new DropDownActionItem() { RootKey = rootKey, GroupCaption = "选择作业类型", Width = 170 , MultiSelect = true};


            this.Add(dropItem);
            dropItem.SelectedValueChanged += new EventHandler<SelectedValueChangedEventArgs>(dropItem_SelectedValueChanged);
            dropItem.DisplayText = "请选择作业类型";
        }
 public override void Activate()
 {
     IHeaderControl header = App.HeaderControl;
     header.Add(new SimpleActionItem(rootKey, "补货烟道", StockChannelQuery_Click) { ToolTipText = "仓库补货烟道查询", GroupCaption = "作业查询", LargeImage = Resources.SconQuery_32 });
     header.Add(new SimpleActionItem(rootKey, "分拣烟道", SortChannelQuery_Click) { ToolTipText = "分拣烟道查询", GroupCaption = "作业查询", LargeImage = Resources.SconQuery_32 });
     header.Add(new SimpleActionItem(rootKey, "扫码状态", ScanQuery_Click) { ToolTipText = "扫码状态查询", GroupCaption = "状态查询", LargeImage = Resources.SconQuery_32 });
     header.Add(new SimpleActionItem(rootKey, "订单状态", OrderQuery_Click) { ToolTipText = "订单状态查询", GroupCaption = "状态查询", LargeImage = Resources.SconQuery_32 });
     actionItem[0]= new SimpleActionItem(rootKey, "刷新", StockChannelRefresh_Click) { ToolTipText = "刷新补货烟道",GroupCaption="补货烟道操作", LargeImage = Resources.refresh_32x32 };
     actionItem[1] = new SimpleActionItem(rootKey, "刷新", SortChannelRefresh_Click) { ToolTipText = "刷新分拣烟道", GroupCaption = "分拣烟道操作", LargeImage = Resources.refresh_32x32 };
     actionItem[2] = new SimpleActionItem(rootKey, "交换烟道", SortChannelSwap_Click) { GroupCaption = "交换分拣烟道", LargeImage = Resources.SortChannelSwap_32 };
     actionItem[3] = new DropDownActionItem() { RootKey = rootKey, Caption = "选择扫码器:", Width = 200, NullValuePrompt = "请选择", GroupCaption = "订单操作" };
     actionItem[4] = new SimpleActionItem(rootKey, "刷新", OrderStateRefresh_Click) { ToolTipText = "刷新订单状态", GroupCaption = "订单操作", LargeImage = Resources.refresh_32x32 };
     actionItem[5] = new DropDownActionItem() { RootKey = rootKey, Caption = "选择扫码器:", Width = 170, NullValuePrompt = "请选择", GroupCaption = "扫码操作" };
     actionItem[6] = new SimpleActionItem(rootKey, "刷新", ScanRefresh_Click) { ToolTipText = "刷新扫码状态", LargeImage = Resources.refresh_32x32, GroupCaption = "扫码操作" };
     
     App.DockManager.PanelClosed += new EventHandler<DockablePanelEventArgs>(DockManager_PanelClosed);
     App.DockManager.ActivePanelChanged += new EventHandler<DockablePanelEventArgs>(DockManager_ActivePanelChanged);
 }
        public override void Activate()
        {
            btnAuto = this.Add(new SimpleActionItem(rootKey, "全自动", btnAuto_Click) { SmallImage = Resources.auto_full_16x16, LargeImage = Resources.auto_full_32x32 });
            btnHand = this.Add(new SimpleActionItem(rootKey, "半自动", btnHand_Click) { SmallImage = Resources.auto_semi_16x16, LargeImage = Resources.auto_semi_32x32 });
            this.Add(new SimpleActionItem(rootKey, "故障复位", btReset_Click) { SmallImage = Resources.error_reset_16x16, LargeImage = Resources.error_reset_32x32 });
            this.Add(new SimpleActionItem(rootKey, "重发任务", btResent_Click) { SmallImage = Resources.reset_16x16, LargeImage = Resources.reset_32x32 });
            this.Add(new SimpleActionItem(rootKey, "取消任务", btCancel_Click) { SmallImage = Resources.cancel_16x16, LargeImage = Resources.cancel_32x32 });

            dropItem = new DropDownActionItem() { RootKey = rootKey, GroupCaption = "选择堆垛机", Width = 170 };
            foreach (var srm in SRMManager.SRMs)
            {
                dropItem.Items.Add(srm.Name);
            }

            this.Add(dropItem);
            dropItem.SelectedValueChanged += new EventHandler<SelectedValueChangedEventArgs>(dropItem_SelectedValueChanged);
            dropItem.DisplayText = "请选择堆垛机";
            SRMManager.ActiveSRM = SRMManager.SRMs.FirstOrDefault();
            if (SRMManager.ActiveSRM != null)
            {
                dropItem.SelectedItem = SRMManager.ActiveSRM.Name;
            }            
        }
        public override void Activate()
        {
            IHeaderControl header = App.HeaderControl;
            header.Add(new SimpleActionItem(rootKey, "刷新", btnRefresh_Click) { SortOrder = 100, GroupCaption = "件烟扫码", SmallImage = Resources.refresh_16x16, LargeImage = Resources.refresh_32x32 });
            header.Add(new SimpleActionItem(rootKey, "停止刷新", btnStopRefresh_Click) { SortOrder = 100, GroupCaption = "件烟扫码", SmallImage = Resources.refresh_stop_16x16, LargeImage = Resources.refresh_stop_32x32 }); 
            header.Add(new SimpleActionItem(rootKey, "读取", btnRead_Click) { SortOrder = 100, GroupCaption = "件烟扫码", SmallImage = Resources.read_16x16, LargeImage = Resources.read_32x32 });
            header.Add(new SimpleActionItem(rootKey, "新增", btnNew_Click) { SortOrder = 100, GroupCaption = "件烟扫码", SmallImage = Resources.add_16x16, LargeImage = Resources.add_32x32 });
            header.Add(new SimpleActionItem(rootKey, "扫码", btnScan_Click) { SortOrder = 100, GroupCaption = "件烟扫码", SmallImage = Resources.scan_16x16, LargeImage = Resources.scan_32x32 });
            header.Add(new SimpleActionItem(rootKey, "停止", btnPause_Click) { SortOrder = 100, GroupCaption = "件烟扫码", SmallImage = Resources.pause_black_16x16, LargeImage = Resources.pause_black_32x32 });
            header.Add(new SimpleActionItem(rootKey, "完成", btnComplete_Click) { SortOrder = 100, GroupCaption = "件烟扫码", SmallImage = Resources.finish_16x16, LargeImage = Resources.finish_32x32 });
            header.Add(new SimpleActionItem(rootKey, "全部停止", btnStop_Click) { SortOrder = 100, GroupCaption = "件烟扫码", SmallImage = Resources.scan_stop_16x16, LargeImage = Resources.scan_stop_32x32 });
            header.Add(new SimpleActionItem(rootKey, "故障复位", btnReset_Click) { SortOrder = 100,GroupCaption = "件烟扫码", SmallImage = Resources.error_reset_16x16, LargeImage = Resources.error_reset_32x32 });
            
            header.Add(new SimpleActionItem(rootKey, "更新尺寸", btnUploadSize_Click) { SortOrder = 100, GroupCaption = "操作", SmallImage = Resources.update_size_16x16, LargeImage = Resources.update_size_32x32 });
            header.Add(new SimpleActionItem(rootKey, "更新条码", btnUploadBarcode_Click) { SortOrder = 100, GroupCaption = "操作", SmallImage = Resources.scan_update_16x16, LargeImage = Resources.scan_update_32x32 });
            header.Add(new SimpleActionItem(rootKey, "手工扫码", btnHandScan_Click) { SortOrder = 100, GroupCaption = "操作", SmallImage = Resources.scan_hand_16x16, LargeImage = Resources.scan_hand_32x32 });

            dropItem = new DropDownActionItem { RootKey = rootKey, GroupCaption = "手持扫码模式", Width = 170, Items = { "件烟扫码故障复位", "RFID整托盘入库", "手持扫码整托盘入库", "手持扫码盘点返库", "手持扫码出库余烟返库" } };
            dropItem.SelectedValueChanged += new EventHandler<SelectedValueChangedEventArgs>(dropItem_SelectedValueChanged);
            header.Add(dropItem);
            dropItem.DisplayText = "请选择手持扫码模式";
            dropItem.SelectedItem = "件烟扫码故障复位";
        }
Example #8
0
 /// <summary>
 /// Adds a combo box style item
 /// </summary>
 /// <param name="item">The item.</param>
 public abstract void Add(DropDownActionItem item);
 private void ParseAllowEditingProperty(DropDownActionItem item, ComboBox guiItem)
 {
     guiItem.DropDownStyle = item.AllowEditingText ? ComboBoxStyle.DropDown : ComboBoxStyle.DropDownList;
 }
 private static void ParseAllowEditingProperty(DropDownActionItem item, ToolStripComboBox combo)
 {
     combo.DropDownStyle = item.AllowEditingText ? ComboBoxStyle.DropDown : ComboBoxStyle.DropDownList;
 }
Example #11
0
 /// <summary>
 /// Adds a combo box style item
 /// </summary>
 /// <param name="item">The item.</param>
 public abstract void Add(DropDownActionItem item);
Example #12
0
        private void AddServiceDropDown(IHeaderControl header)
        {
            _serviceDropDown = new DropDownActionItem
            {
                Key = STR_KeyServiceDropDown,
                RootKey = HeaderControl.HomeRootItemKey,
                Width = 145,
                AllowEditingText = false,
                ToolTipText = Properties.Resources.Service_Box_ToolTip,
                GroupCaption = Properties.Resources.Panel_Name
            };

            // "None" provider
            _emptyProvider = new ServiceProvider(Properties.Resources.None);
            _serviceDropDown.Items.Add(_emptyProvider);

            // Default providers
            _serviceDropDown.Items.AddRange(ServiceProviderFactory.GetDefaultServiceProviders());

            // "Other" provider
            _serviceDropDown.Items.Add(ServiceProviderFactory.Create(Other));

            //Add it to the Header
            header.Add(_serviceDropDown);
        }
        /// <summary>
        /// Adds a combo box style item
        /// </summary>
        /// <param name="item">The item.</param>
        public override void Add(DropDownActionItem item)
        {
            var strip = GetOrCreateStrip(item.GroupCaption);
            var combo = new ToolStripComboBox(item.Key);

            ParseAllowEditingProperty(item, combo);

            combo.ToolTipText = item.Caption;
            if (item.Width != 0)
            {
                combo.Width = item.Width;
            }

            combo.Items.AddRange(item.Items.ToArray());
            combo.SelectedIndexChanged += delegate
                                              {
                                                  item.PropertyChanged -= DropDownActionItem_PropertyChanged;
                                                  item.SelectedItem = combo.SelectedItem;
                                                  item.PropertyChanged += DropDownActionItem_PropertyChanged;
                                              };

            if (strip != null)
            {
                strip.Items.Add(combo);
            }

            item.PropertyChanged += DropDownActionItem_PropertyChanged;
        }
Example #14
0
        private void AddServiceDropDown(IHeaderControl header)
        {
            _serviceDropDown = new DropDownActionItem();
            _serviceDropDown.Key = STR_KeyServiceDropDown;

            //Create "None" Option
            _emptyProvider = new ServiceProvider(Properties.Resources.None, null);
            _serviceDropDown.Items.Add(_emptyProvider);

            // no option presently for group image.
            // Image = resources.AddOnlineBasemap.GetThumbnailImage(32, 32, null, IntPtr.Zero),

            _serviceDropDown.Width = 145;
            _serviceDropDown.AllowEditingText = false;
            _serviceDropDown.ToolTipText = Properties.Resources.Service_Box_ToolTip;
            _serviceDropDown.SelectedValueChanged += ServiceSelected;
            _serviceDropDown.GroupCaption = Properties.Resources.Panel_Name;
            _serviceDropDown.Items.AddRange(ServiceProvider.GetDefaultServiceProviders());
            _serviceDropDown.RootKey = HeaderControl.HomeRootItemKey;

            //Create "Other" Option
            var otherProvider = new ServiceProvider(Other, null);
            _serviceDropDown.Items.Add(otherProvider);

            //Add it to the Header
            header.Add(_serviceDropDown);

            _serviceDropDown.SelectedItem = _emptyProvider;
        }
Example #15
0
        private void AddOpaticyDropDown(IHeaderControl header)
        {
            string defaultOpacity = null;
            _opacityDropDown = new DropDownActionItem
                                   {
                                       AllowEditingText = true,
                                       Caption = Properties.Resources.Opacity_Box_Text,
                                       ToolTipText = Properties.Resources.Opacity_Box_ToolTip,
                                       Width = 45,
                                       Key = STR_KeyOpacityDropDown
                                   };

            //Make some opacity settings
            for (var i = 100; i > 0; i -= 10)
            {
                string opacity = i.ToString();
                if (i == 100)
                {
                    defaultOpacity = opacity;
                }
                _opacityDropDown.Items.Add(opacity);
            }

            _opacityDropDown.GroupCaption = Properties.Resources.Panel_Name;
            _opacityDropDown.SelectedValueChanged += OpacitySelected;
            _opacityDropDown.RootKey = HeaderControl.HomeRootItemKey;

            //Add it to the Header
            header.Add(_opacityDropDown);
            if (defaultOpacity != null)
                _opacityDropDown.SelectedItem = defaultOpacity;
        }
Example #16
0
 private void ParseAllowEditingProperty(DropDownActionItem item, ComboBox guiItem)
 {
     if (item.AllowEditingText)
     {
         guiItem.DropDownStyle = ComboBoxStyle.DropDown;
     }
     else
     {
         guiItem.DropDownStyle = ComboBoxStyle.DropDownList;
     }
 }
        public override void Add(DropDownActionItem item)
        {
            var combo = new ComboBox {Name = item.Key};

            ParseAllowEditingProperty(item, combo);

            if (item.Width != 0)
            {
                combo.Width = item.Width;
            }

            combo.Items.AddRange(item.Items.ToArray());
            combo.SelectedIndexChanged += delegate
            {
                item.PropertyChanged -= DropDownActionItem_PropertyChanged;
                item.SelectedItem = combo.SelectedItem;
                item.PropertyChanged += DropDownActionItem_PropertyChanged;
            };
            item.PropertyChanged += DropDownActionItem_PropertyChanged;
            container.Controls.Add(combo);
        }
Example #18
0
 /// <summary>
 /// Adds a combo box style item.
 /// </summary>
 /// <param name="item">The item.</param>
 /// <returns>The added item.</returns>
 public abstract object Add(DropDownActionItem item);