Пример #1
0
        /// <summary>
        /// Sets the text portion of the TextValueWithTypeControl to the specified text by sending keystrokes
        /// </summary>
        /// <param name="text">The text to set the text portion of the TextValueWithTypeControl to</param>
        public void SetText(string text)
        {
            GUI.m_APE.AddFirstMessageFindByHandle(DataStores.Store0, Identity.ParentHandle, Identity.Handle);
            GUI.m_APE.AddQueryMessageReflect(DataStores.Store0, DataStores.Store1, "TextBox", MemberTypes.Property);
            GUI.m_APE.AddQueryMessageReflect(DataStores.Store1, DataStores.Store2, "Handle", MemberTypes.Property);
            GUI.m_APE.AddRetrieveMessageGetValue(DataStores.Store2);
            GUI.m_APE.SendMessages(EventSet.APE);
            GUI.m_APE.WaitForMessages(EventSet.APE);
            //Get the value(s) returned MUST be done straight after the WaitForMessages call;
            IntPtr textboxHandle = GUI.m_APE.GetValueFromMessage();

            GUITextBox textBox = new GUITextBox(ParentForm, Identity.Description + " textbox", new Identifier(Identifiers.Handle, textboxHandle));

            // Select the item
            textBox.SetText(text);
        }
Пример #2
0
        /// <summary>
        /// Sets the text portion of the combobox to the specified text by sending keystrokes
        /// </summary>
        /// <param name="text">The text to set the text portion of the combobox to</param>
        public void SetText(string text)
        {
            GUITextBox comboboxTextBox = GetTextBox();

            Input.Block();
            try
            {
                comboboxTextBox.SetText(text);
            }
            catch when(Input.ResetInputFilter())
            {
                // Will never be reached as ResetInputFilter always returns false
            }
            finally
            {
                Input.Unblock();
            }
        }
Пример #3
0
        /// <summary>
        /// Sets the text portion of the combobox to the specified text by sending keystrokes
        /// </summary>
        /// <param name="text">The text to set the text portion of the combobox to</param>
        public void SetText(string text)
        {
            //Get the style
            GUI.m_APE.AddFirstMessageFindByHandle(DataStores.Store0, Identity.ParentHandle, Identity.Handle);
            GUI.m_APE.AddQueryMessageReflect(DataStores.Store0, DataStores.Store1, "DropDownStyle", MemberTypes.Property);
            GUI.m_APE.AddQueryMessageReflect(DataStores.Store1, DataStores.Store2, "ToString", MemberTypes.Method);
            GUI.m_APE.AddRetrieveMessageGetValue(DataStores.Store2);
            GUI.m_APE.SendMessages(EventSet.APE);
            GUI.m_APE.WaitForMessages(EventSet.APE);
            //Get the value(s) returned MUST be done straight after the WaitForMessages call
            string Style = GUI.m_APE.GetValueFromMessage();

            if (Style == "DropDownList")
            {
                throw new Exception("ComboBox Edit control is not editable");
            }

            //get the editbox child window
            GUI.m_APE.AddFirstMessageFindByHandle(DataStores.Store0, Identity.ParentHandle, Identity.Handle);
            GUI.m_APE.AddQueryMessageReflect(DataStores.Store0, DataStores.Store1, "childEdit", MemberTypes.Field);
            GUI.m_APE.AddQueryMessageReflect(DataStores.Store1, DataStores.Store2, "Handle", MemberTypes.Property);
            GUI.m_APE.AddRetrieveMessageGetValue(DataStores.Store2);
            GUI.m_APE.SendMessages(EventSet.APE);
            GUI.m_APE.WaitForMessages(EventSet.APE);
            //Get the value(s) returned MUST be done straight after the WaitForMessages call
            IntPtr EditBox = (IntPtr)GUI.m_APE.GetValueFromMessage();

            Input.Block(Identity.ParentHandle, Identity.Handle);
            try
            {
                GUITextBox comboboxTextBox = new GUITextBox(ParentForm, Identity.Description + " textbox", new Identifier(Identifiers.Handle, EditBox), new Identifier(Identifiers.TechnologyType, "Windows Native"));
                comboboxTextBox.SetText(text);
            }
            finally
            {
                Input.Unblock();
            }
        }
Пример #4
0
        /// <summary>
        /// Sets the text portion of the up down control to the specified text
        /// </summary>
        /// <param name="text">The text to set the control to</param>
        public void SetText(string text)
        {
            //Get the selectedText property
            GUI.m_APE.AddFirstMessageFindByHandle(DataStores.Store0, Identity.ParentHandle, Identity.Handle);
            GUI.m_APE.AddQueryMessageReflect(DataStores.Store0, DataStores.Store1, "upDownEdit", MemberTypes.Field);
            GUI.m_APE.AddQueryMessageReflect(DataStores.Store1, DataStores.Store2, "Handle", MemberTypes.Property);
            GUI.m_APE.AddRetrieveMessageGetValue(DataStores.Store2);
            GUI.m_APE.SendMessages(EventSet.APE);
            GUI.m_APE.WaitForMessages(EventSet.APE);
            //Get the value(s) returned MUST be done straight after the WaitForMessages call
            dynamic UpDownEditControl = GUI.m_APE.GetValueFromMessage();

            if (UpDownEditControl == null)
            {
                throw new Exception("Failed to find the updown edit control");
            }

            IntPtr UpDownEditHandle = UpDownEditControl;

            GUITextBox UpDownEdit = new GUITextBox(ParentForm, Identity.Description + " textbox", new Identifier(Identifiers.Handle, UpDownEditHandle));

            UpDownEdit.SetText(text);
        }