1. Disable Combo

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

new topic     » topic index » view message » categorize

2. Re: Disable Combo

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.

new topic     » goto parent     » topic index » view message » categorize

3. Re: Disable Combo

dcole said...

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?

new topic     » goto parent     » topic index » view message » categorize

4. Re: Disable Combo

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

new topic     » goto parent     » topic index » view message » categorize

5. Re: Disable Combo

Sorry, I was in too much of a hurry last night to remember DropDownList.
To set the box on startup, use setIndex(boxname,1)

new topic     » goto parent     » topic index » view message » categorize

6. Re: Disable Combo

dcole said...

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.

new topic     » goto parent     » topic index » view message » categorize

7. Re: Disable Combo

DerekParnell said...
dcole said...

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

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu