OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: Carsten on May 24, 2013, 01:51:20 AM

Title: Combobox of style 0, getting text values input by user
Post by: Carsten on May 24, 2013, 01:51:20 AM
Hello Forum,

I am using a combobox style 0, because I want the user to have both the option of selecting from defined set of values (the list) or alternatively to type any "free input" in the editfield.

For some reason the user input values shows in the editpart, but I can't retrieve it through the "gettext" ?

Can anybody help me with this (maybe I am missing the obvious)?

PS! I can use "settext" during the oninitialize to place a value in the editfield, which is not included in the "list property" but also that can not be changed.

BR Carsten
Title: Re: Combobox of style 0, getting text values input by user
Post by: Carsten on May 24, 2013, 04:41:25 AM
Hello Carsten,

Just use a string variable to hold the value, it can be set both by the "OnEditChanged" & "OnSelectionChanged" events.

BR
Carsten

PS! and don't post a question until you have fully explored the problem yourself!
Sorry,  :)
Title: Re: Combobox of style 0, getting text values input by user
Post by: owenwengerd on May 24, 2013, 07:11:58 AM
Just to clarify, do I understand correctly that you called (dcl_Control_GetText), but it returned an unexpected result? If so, from what context did you call that function, and how did you determine that the returned value was incorrect? In any case, the (dcl_ComboBox_GetEBText) (http://www.opendcl.com/HelpFiles/index.php?page=Reference/Method/ComboBox/GetEBText.htm) function may be more reliable.
Title: Re: Combobox of style 0, getting text values input by user
Post by: Carsten on May 24, 2013, 08:23:59 AM
Owen, thanks for responding.

Yes, I could not get the "dcl_Control_GetText" to return the value changed by typing.
Here is some additional info:
- The combobox list property is defined in OpenCDL studio, Fex.:
      ItemA
      ItemB
      ItemC

- The text property is initially set by the dialogs "oninitialize" it could be a value included in the list (but it works ok also to set it at values not included in the list)

- The edit part accepts and displays all typed input ok

- In the "OK button" control / "onclicked" event before closing dialog, when I try to catch the revised (typed in) text value with the gettext, what I got was the initial value not the one displayed.


I will also try the GetEBText

Have a good weekend
Title: Re: Combobox of style 0, getting text values input by user
Post by: Carsten on May 24, 2013, 12:10:59 PM
Owen,

The GetEBText Works fine, so I can trim the editchange and currentselection out of my code, and just pick up the text value in that way.

Thanks
Carsten