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); } }
public void FreeContext() { promptForm.clrEventTrigger(); //mainWin.setActiveToolBarKeys(null,false); if (promptStyle == "WINDOW") { promptForm.Dispose(); } else { mainWin.RemovePrompt(promptForm.GetPromptControls()); //promptForm.Dispose(); promptForm = null; } _contextIsActive = false; }