Exemplo n.º 1
0
        private void panelQuickButtons_RowDoubleClick(object sender, ODButtonPanelEventArgs e)
        {
            FormProcButtonQuickEdit FormPBQ = new FormProcButtonQuickEdit();

            //Search through tags of the ODPanelItem for the PBQ.
            for (int i = 0; e.Item != null && i < e.Item.Tags.Count; i++)
            {
                if (e.Item.Tags[i].GetType() == typeof(ProcButtonQuick))
                {
                    FormPBQ.pbqCur = (ProcButtonQuick)e.Item.Tags[i];
                    break;
                }
            }
            if (FormPBQ.pbqCur == null)           //clicked on either a blank row or to the right of existing buttons on a row.
            {
                FormPBQ.IsNew       = true;
                FormPBQ.pbqCur      = new ProcButtonQuick();
                FormPBQ.pbqCur.YPos = e.Row;                         //Set Row
                for (int i = 0; i < listProcButtonQuicks.Count; i++) //Set ItemOrder
                {
                    if (listProcButtonQuicks[i].YPos != FormPBQ.pbqCur.YPos ||               //Wrong row
                        FormPBQ.pbqCur.ItemOrder > listProcButtonQuicks[i].ItemOrder)                            //Already have a larger item order
                    {
                        continue;
                    }
                    FormPBQ.pbqCur.ItemOrder = listProcButtonQuicks[i].ItemOrder + 1;                //new PBQ should have the highest item order in the row.
                }
            }
            FormPBQ.ShowDialog();
            if (FormPBQ.DialogResult != DialogResult.OK)
            {
                return;
            }
            fillPanelQuickButtons();
        }
Exemplo n.º 2
0
		private void panelQuickButtons_RowDoubleClick(object sender,ODButtonPanelEventArgs e) {
			FormProcButtonQuickEdit FormPBQ=new FormProcButtonQuickEdit();
			//Search through tags of the ODPanelItem for the PBQ.
			for(int i=0;e.Item!=null && i<e.Item.Tags.Count;i++) {
				if(e.Item.Tags[i].GetType()==typeof(ProcButtonQuick)){
					FormPBQ.pbqCur=(ProcButtonQuick)e.Item.Tags[i];
					break;
				}
			}
			if(FormPBQ.pbqCur==null) {//clicked on either a blank row or to the right of existing buttons on a row.
				FormPBQ.IsNew=true;
				FormPBQ.pbqCur=new ProcButtonQuick();
				FormPBQ.pbqCur.YPos=e.Row;//Set Row
				for(int i=0;i<listProcButtonQuicks.Count;i++){ //Set ItemOrder
					if(listProcButtonQuicks[i].YPos!=FormPBQ.pbqCur.YPos //Wrong row
						|| FormPBQ.pbqCur.ItemOrder>listProcButtonQuicks[i].ItemOrder) { //Already have a larger item order
							continue;
					}
					FormPBQ.pbqCur.ItemOrder=listProcButtonQuicks[i].ItemOrder+1;//new PBQ should have the highest item order in the row.
				}
			}
			FormPBQ.ShowDialog();
			if(FormPBQ.DialogResult!=DialogResult.OK) {
				return;
			}
			fillPanelQuickButtons();
		}