예제 #1
0
        public UIPromptContext(FGLApplicationPanel f, PROMPT p)
        {
            //Label l;
            //TextBox tb;
            bool charMode;

            KeyList      = new List <ONKEY_EVENT>();
            onActionList = new List <ON_ACTION_EVENT>();
            mainWin      = f;



            promptStyle = p.ATTRIB_STYLE;
            if (promptStyle == "")
            {
                promptStyle = "NORMAL";
            }

            if (p.CHARMODE == "0")
            {
                charMode = false;
            }
            else
            {
                charMode = true;
            }

            promptForm = new PromptWindow(p.TEXT, Convert.ToInt32(p.FIELDATTRIBUTE), Convert.ToInt32(p.PROMPTATTRIBUTE), promptStyle, charMode, p.ATTRIB_TEXT, this);

            foreach (object evt in p.EVENTS)
            {
                if (evt is ONKEY_EVENT)
                {
                    ONKEY_EVENT e;
                    e = (ONKEY_EVENT)evt;
                    KeyList.Add(e);
                    promptForm.AddKeyWatch(Convert.ToInt32(e.ID), e.KEY);
                    //f.AddToolBarKey(e.KEY, e.ID);
                    continue;
                }
                if (evt is ON_ACTION_EVENT)
                {
                    ON_ACTION_EVENT e;
                    e = (ON_ACTION_EVENT)evt;
                    onActionList.Add(e);
                }

                Program.Show("Unhandled Event for PROMPT");
            }

            if (promptStyle == "NORMAL")
            {
                Control promptPanel;
                promptPanel = promptForm.GetPromptControls();
                f.setPrompt(promptPanel);
            }
        }
예제 #2
0
        public void ActivateContext(UIEventHandler UIPromptContext_EventTriggered, VALUE[] values, ROW[] rows)
        {
            promptForm.EventTriggered += new UIEventHandler(UIPromptContext_EventTriggered);
            promptForm.SetPromptFocus();
            mainWin.setActiveToolBarKeys(KeyList, onActionList);    //, false);

            if (!_contextIsActive)
            {
                _contextIsActive = true;
            }

            if (promptStyle == "WINDOW")
            {
                promptForm.ShowDialog();
            }
            else
            {
                Control promptPanel;
                promptPanel         = promptForm.GetPromptControls();
                promptPanel.Enabled = true;
                mainWin.ActivatePrompt(UIPromptContext_EventTriggered);
            }
        }