1. Disable Combo
- Posted by dcole Jun 01, 2010
- 1321 views
Hello,
My understanding of a Combo is that it is really 2 Controls. 1.) An EditText and 2.) a List
What I would like to do is freeze the EditText part while allowing the List to work.
In other words I would like to select anything on the List and put it in the EditText but not be allowed to edit or change or click anything in the EditText.
I use the folling code to find the handler of the EditText,
global function find_editbox(integer combo) object WGWords_Editbox-- Combo boxes are 'subclassed' by win32lib and its child is the editbox. WGWords_Editbox=findChildren(combo) for i=1 to length(WGWords_Editbox) do if WGWords_Editbox[i][2] = EditText then return WGWords_Editbox[i][1] end if end for return 1 end function
And this code to mousetrap the Combo,
VOID = createMouseTrap(Window1,Combo3) procedure MouseTrap(integer self, integer event, sequence params) setFocus(Combo3)--I'm not sure what to put here end procedure setHandler(Window1, w32HMouseTrap, routine_id("MouseTrap"))
This seems to work pretty well but if I MouseClick in the EditText the text in the EditText becomes unhighlighted and the cursor blinks at the end of the text. Then if I hit the space bar the text in the EditText Changes. (Causing an error in my program).
I don't know if any of this helps or not.
Don Cole
2. Re: Disable Combo
- Posted by ArthurCrump Jun 01, 2010
- 1306 views
I don't know whether it is worth trying to give the edit box the style ES_READONLY.
This may disable the combo box altogether or it may be ignored.
I am not currently doing anything on Euphoria except keeping a track of the forum.
3. Re: Disable Combo
- Posted by DerekParnell (admin) Jun 01, 2010
- 1352 views
What I would like to do is freeze the EditText part while allowing the List to work.
Does using the control type 'DropDownList' rather than 'Combo' work as you'd like?
4. Re: Disable Combo
- Posted by dcole Jun 02, 2010
- 1285 views
Thank you Arthur Crump and Derek Parnell,
Authur,
I coundn't get ES_READONLY to do anything.
Derek,
Your idea, DropDownList, works perfect except I don't know how to put anything in the EditText part except to select something on the list. I want to put the top name on the list in there on start up.
Don Cole
5. Re: Disable Combo
- Posted by ArthurCrump Jun 02, 2010
- 1302 views
Sorry, I was in too much of a hurry last night to remember DropDownList.
To set the box on startup, use setIndex(boxname,1)
6. Re: Disable Combo
- Posted by DerekParnell (admin) Jun 02, 2010
- 1306 views
I want to put the top name on the list in there on start up.
Try ...
setIndex(theList, 1)
Run after the list data has been added to the control.
7. Re: Disable Combo
- Posted by dcole Jun 02, 2010
- 1292 views
I want to put the top name on the list in there on start up.
Try ...
setIndex(theList, 1)
Run after the list data has been added to the control.
Thank you Derek,
Now it's doing exactly what I want.
Don Cole