public void ActivateContext(UIEventHandler UIDisplayArrayContext_EventTriggered, V[] values, ROW[] rows)
        {
            mainWin.setActiveToolBarKeys(KeyList, onActionList); //, true,true,false);

            foreach (ON_ACTION_EVENT e in onActionList)
            {
                foreach (FGLFoundField ffield in mainWin.FindAction(e.ACTION))
                {
                    ffield.fglField.onActionID  = e.ID;
                    ffield.fglField.onUIEvent   = onActionTriggered;
                    ffield.fglField.Enabled     = true;
                    ffield.fglField.ContextType = FGLContextType.ContextInput;
                }
            }
            constructGrid.ReadOnly = false;
            constructGrid.Enabled  = true;

            constructGrid.Focus();



            setActiveFields();

            this.EventTriggered = UIDisplayArrayContext_EventTriggered;

            if (!_contextIsActive)
            {
                _contextIsActive = true;
            }

            constructGrid.allowInsertRow = false;
            constructGrid.setActiveFocus();

            constructGrid.context = FGLContextType.ContextConstructArray;
        }
예제 #2
0
        public void ActivateContext(UIEventHandler UIDisplayArrayContext_EventTriggered, VALUE[] values, ROW[] rows)
        {
            foreach (ON_ACTION_EVENT e in onActionList)
            {
                foreach (FGLFoundField ffield in mainWin.FindAction(e.ACTION))
                {
                    ffield.fglField.onActionID  = e.ID;
                    ffield.fglField.onUIEvent   = onActionTriggered;
                    ffield.fglField.Enabled     = true;
                    ffield.fglField.ContextType = FGLContextType.ContextInput;
                }
            }
            displayArrayGrid.Enabled = true;

            displayArrayGrid.onDblClick = new EventHandler(displayArrayGrid_DoubleClick);


            if (afterRow != null)
            {
                displayArrayGrid.AfterRow = new UIArrayTableRowHandler(displayArrayGrid_RowLeave);
            }
            if (beforeRow != null)
            {
                displayArrayGrid.BeforeRow = new UIArrayTableRowHandler(displayArrayGrid_RowEnter);
            }

            mainWin.setActiveToolBarKeys(KeyList, onActionList); //, true,true,false);


            this.EventTriggered = UIDisplayArrayContext_EventTriggered;

            if (!_contextIsActive)
            {
                _contextIsActive = true;
            }

            if (initialRow)
            {
                initialRow = false;
                if (beforeRow != null)
                {
                    this.EventTriggered(null, beforeRow.ID, "<TRIGGERED ID=\"" + beforeRow.ID + "\" ARRLINE=\"" + this.arrLine + "\" SCRLINE=\"" + this.scrLine + "\"></TRIGGERED>", this);
                }
            }
            displayArrayGrid.context = FGLContextType.ContextDisplayArray;
        }
        public void ActivateContext(UIEventHandler UIDisplayArrayContext_EventTriggered, VALUE[] values, ROW[] rows)
        {
            //mainWin.SetContext(FGLContextType.ContextNone);
            mainWin.SetContext(FGLContextType.ContextDisplayArray, activeFields, this, KeyList, onActionList, UIDisplayArrayContext_EventTriggered);

            foreach (ON_ACTION_EVENT e in onActionList)
            {
                foreach (FGLFoundField ffield in mainWin.FindAction(e.ACTION))
                {
                    ffield.fglField.onActionID  = e.ID;
                    ffield.fglField.onUIEvent   = onActionTriggered;
                    ffield.fglField.Enabled     = true;
                    ffield.fglField.ContextType = FGLContextType.ContextDisplayArray;
                }
            }

            mainWin.setActiveToolBarKeys(KeyList, onActionList); //, true,true,false);
            if (nextMove == MoveType.MoveTypeNoPendingMovement)
            {
                setFocusToCurrentRow();
            }

            if (nextMove != MoveType.MoveTypeNoPendingMovement)
            {
                // Theres a pending movement...
                switch (nextMove)
                {
                case MoveType.MoveTypeUp:
                    moveUp();
                    if (beforeRow != null)
                    {
                        this.EventTriggered(null, beforeRow.ID, "<TRIGGERED ID=\"" + beforeRow.ID + "\" ARRLINE=\"" + this.arrLine + "\" SCRLINE=\"" + this.scrLine + "\"></TRIGGERED>", this);
                    }
                    nextMove = MoveType.MoveTypeNoPendingMovement;
                    break;

                case MoveType.MoveTypePageUp:
                    movePgUp();
                    if (beforeRow != null)
                    {
                        this.EventTriggered(null, beforeRow.ID, "<TRIGGERED ID=\"" + beforeRow.ID + "\" ARRLINE=\"" + this.arrLine + "\" SCRLINE=\"" + this.scrLine + "\"></TRIGGERED>", this);
                    }
                    nextMove = MoveType.MoveTypeNoPendingMovement;
                    break;

                case MoveType.MoveTypePageDown:
                    movePgDown();
                    if (beforeRow != null)
                    {
                        this.EventTriggered(null, beforeRow.ID, "<TRIGGERED ID=\"" + beforeRow.ID + "\" ARRLINE=\"" + this.arrLine + "\" SCRLINE=\"" + this.scrLine + "\"></TRIGGERED>", this);
                    }
                    nextMove = MoveType.MoveTypeNoPendingMovement;
                    break;

                case MoveType.MoveTypeDown:
                    moveDown();
                    if (beforeRow != null)
                    {
                        this.EventTriggered(null, beforeRow.ID, "<TRIGGERED ID=\"" + beforeRow.ID + "\" ARRLINE=\"" + this.arrLine + "\" SCRLINE=\"" + this.scrLine + "\"></TRIGGERED>", this);
                    }
                    nextMove = MoveType.MoveTypeNoPendingMovement;
                    break;
                }
            }
            redisplay_arr(true);

            this.EventTriggered = UIDisplayArrayContext_EventTriggered;

            if (finishing)
            {
                finishing = false;
                // ACCEPT was pressed and there was an AFTER DISPLAY processed..
                this.EventTriggered(null, "ACCEPT", "<TRIGGERED ID=\"ACCEPT\" ARRLINE=\"" + this.arrLine + "\" SCRLINE=\"" + this.scrLine + "\"></TRIGGERED>", this);
                return;
            }
            if (!_contextIsActive)
            {
                _contextIsActive = true;
            }
        }
예제 #4
0
        public void ActivateContext(UIEventHandler UIInputContext_EventTriggered, V[] values, ROW[] rows)
        {
            int cnt   = 0;
            int tstop = 0;

            careAboutFocus = false;

            Console.WriteLine("Activating context..");

            if (!_contextIsActive)
            {
                _contextIsActive = true;
            }
            // We should always get a set of values
            // if we dont - then it must be an INPUT without the WITHOUT DEFAULTS
            // and this must be the first time around - so we should set up the defaults...

            foreach (FGLFoundField f in activeFields)
            {
                Console.WriteLine(f.fullName);
                if (values == null)
                {
                    f.fglField.Text = f.fglField.defaultValue;
                }
                else
                {
                    if (f.fglField.Text == "" || true)
                    {
                        f.fglField.Text = values[cnt++].Text;
                    }
                    else
                    {
                        cnt++;
                    }
                }
                f.fglField.tabIndex      = tstop++;
                f.fglField.afterFieldID  = "";
                f.fglField.beforeFieldID = "";
                f.fglField.onActionID    = "";
            }

            this.EventTriggered = UIInputContext_EventTriggered;
            if (PendingEvents.Count > 0)
            {
                string s = PendingEvents[0];
                PendingEvents.RemoveAt(0);
                sendTrigger(s);
                return;
            }


            mainWin.SetContext(FGLContextType.ContextInput, activeFields, this, KeyList, onActionList, UIInputContext_EventTriggered);
            mainWin.setActiveToolBarKeys(KeyList, onActionList);



            foreach (FGLFoundField f in activeFields)
            {
                f.fglField.fieldValidationFailed = inputFieldValidationHandler;
                f.fglField.onGotFocus            = inputGotFocus;
                f.fglField.onUIEvent             = onActionTriggered;
            }


            if (setCurrentField != null) // Next field has been registered..
            {
                CurrentField   = setCurrentField;
                careAboutFocus = true;
                CurrentField.fglField.setFocus();
                careAboutFocus  = false;
                setCurrentField = null;
            }


            if (CurrentField == null)
            {
                CurrentField = activeFields[0];
                CurrentField.fglField.setFocus();
            }

            CurrentField.fglField.setFocus();


            //mainWin.CommentText = CurrentField.fglField.comment;


            #region setup after field event IDs
            // We might want to cache these results....
            // Set up the after fields by setting the afterFieldID property of the widget..
            //
            foreach (AFTER_FIELD_EVENT e in afterFieldList)
            {
                List <FGLFoundField> ff = mainWin.FindField(e.FIELD);

                if (ff == null)
                {
                    throw new ApplicationException("field not found :" + e.FIELD);
                }
                if (ff.Count == 0)
                {
                    throw new ApplicationException("field not found : " + e.FIELD);
                }

                foreach (FGLFoundField ffield in ff)
                {
                    ffield.fglField.afterFieldID = e.ID;
                }
            }
            #endregion

            #region set up before field event IDs
            // Set up the after fields by setting the afterFieldID property of the widget..
            //
            foreach (BEFORE_FIELD_EVENT e in beforeFieldList)
            {
                List <FGLFoundField> ff = mainWin.FindField(e.FIELD);

                if (ff == null)
                {
                    throw new ApplicationException("field not found :" + e.FIELD);
                }
                if (ff.Count == 0)
                {
                    throw new ApplicationException("field not found : " + e.FIELD);
                }

                foreach (FGLFoundField ffield in ff)
                {
                    ffield.fglField.beforeFieldID = e.ID;
                }
            }
            #endregion


            #region set up "on action" event IDs
            // Set up the actions by setting the onActionID property of the widget..
            //
            foreach (ON_ACTION_EVENT e in onActionList)
            {
                foreach (FGLFoundField ffield in mainWin.FindAction(e.ACTION))
                {
                    ffield.fglField.onActionID = e.ID;

                    ffield.fglField.Enabled     = true;
                    ffield.fglField.ContextType = FGLContextType.ContextInput;
                }
            }
            #endregion



            if (isInput == CurrentField.fglField.beforeFieldID)
            {
                isBeforeInput = false;
            }

            if (isBeforeInput)
            {
                if (CurrentField.fglField.beforeFieldID != "")
                {
                    sendTrigger(CurrentField.fglField.beforeFieldID);
                    isInput = CurrentField.fglField.beforeFieldID;
                }

                //  isBeforeInput = false;
            }

            careAboutFocus      = true;
            mainWin.CommentText = CurrentField.fglField.comment;


            //Application.DoEvents();
        }
예제 #5
0
        public void ActivateContext(UIEventHandler UIInputArrayContext_EventTriggered, V[] values, ROW[] rows)
        {
            this.EventTriggered = UIInputArrayContext_EventTriggered;

            if (PendingEvents.Count > 0)
            {
                s_pending p;
                p       = PendingEvents[0];
                arrLine = p.scrLine;

                string s = getTriggeredTag(p.ID, p.arrLine, p.scrLine); // p.triggeredText;
                PendingEvents.RemoveAt(0);
                sendPendingTrigger(s);

                return;
            }

            if (nextMove == MoveType.MoveTypeInsert)
            {
                doInsertRow();
                nextMove = MoveType.MoveTypeNoPendingMovement;
            }

            if (nextMove == MoveType.MoveTypeDelete)
            {
                doDeleteRow();
                if (afterDelete != null)
                {
                    sendTrigger(afterDelete.ID, -1);
                    return;
                }
            }


            //inputArrayGrid.ignEvents = true;
            foreach (ON_ACTION_EVENT e in onActionList)
            {
                foreach (FGLFoundField ffield in mainWin.FindAction(e.ACTION))
                {
                    ffield.fglField.onActionID  = e.ID;
                    ffield.fglField.onUIEvent   = onActionTriggered;
                    ffield.fglField.Enabled     = true;
                    ffield.fglField.ContextType = FGLContextType.ContextInput;
                }
            }



            if (rows != null)
            {
                setUpData(rows);
            }



            if (inputArrayGrid.DataSource != Data)
            {
                inputArrayGrid.DataSource  = Data;
                inputArrayGrid.CurrentCell = null;
                inputArrayGrid.init();
            }

            startHandlers();



            mainWin.setActiveToolBarKeys(KeyList, onActionList); //, true ,true,true);

            if (!_contextIsActive)
            {
                _contextIsActive = true;
            }



            inputArrayGrid.context = FGLContextType.ContextInputArray;



            inputArrayGrid.allowInsertRow = allowInsert;

            /*
             * if ((crow == -1 && crow == -1) || firstTime)
             * {
             *  setField(1, null);
             *  firstTime = false;
             * }
             */



            inputArrayGrid.Enabled = true;


            if (allowDelete)
            {
                inputArrayGrid.AllowUserToDeleteRows = true;
            }
            else
            {
                inputArrayGrid.AllowUserToDeleteRows = false;
            }

            if (inputArrayGrid.RowCount == 0)
            {
                InsertkeyPressed();
            }

            inputArrayGrid.setActiveFocus();

            Console.WriteLine("CR=" + currentRow + " CC=" + currentCol);
        }