1. ComboBox behaviour in win32Lib

1) When win32Lib builds a combobox, it does so with a style flag that limits the text one can type in the control to the width of the control...is there a way to change that behavior so that it functions like a text box (allowing input longer than the size of the box)?

2) Other than inserting an OnChange event which compare s what has been typed into the ComboBox to the item values and rejects any keys which result in a non-match, is there a simpler way to do what us old Access programmers call "Limit to List"?

Thanks

Mike

new topic     » topic index » view message » categorize

2. Re: ComboBox behaviour in win32Lib

Mike777 said...

2) Other than inserting an OnChange event which compare s what has been typed into the ComboBox to the item values and rejects any keys which result in a non-match, is there a simpler way to do what us old Access programmers call "Limit to List"?

Does the DropDownList control suit?

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

3. Re: ComboBox behaviour in win32Lib

DerekParnell said...
Mike777 said...

2) Other than inserting an OnChange event which compare s what has been typed into the ComboBox to the item values and rejects any keys which result in a non-match, is there a simpler way to do what us old Access programmers call "Limit to List"?

Does the DropDownList control suit?

Forgot to mention that I'm using newUIObj so I don't think I can specify that. Can I change an already created control to include that?

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

4. Re: ComboBox behaviour in win32Lib

Mike777 said...

Forgot to mention that I'm using newUIObj so I don't think I can specify that. Can I change an already created control to include that?

I don't see why not. newUIObect supports all control types.

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

5. Re: ComboBox behaviour in win32Lib

Mike777 said...
DerekParnell said...
Mike777 said...

2) Other than inserting an OnChange event which compare s what has been typed into the ComboBox to the item values and rejects any keys which result in a non-match, is there a simpler way to do what us old Access programmers call "Limit to List"?

Does the DropDownList control suit?

Forgot to mention that I'm using newUIObj so I don't think I can specify that. Can I change an already created control to include that?

I have a feeling I can find the Flag that needs to be set to create that attribute. Thanks.

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

6. Re: ComboBox behaviour in win32Lib

DerekParnell said...
Mike777 said...

2) Other than inserting an OnChange event which compare s what has been typed into the ComboBox to the item values and rejects any keys which result in a non-match, is there a simpler way to do what us old Access programmers call "Limit to List"?

Does the DropDownList control suit?

The newUIObj docs specify that the control is built with the CBS_DROPDOWN attribute. Further, they say: In addition to being able to select a value from the combo's list, the user can enter their own value as well.

I'm trying to eliminate the ability of the user to enter their own value.

Mike

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

7. Re: ComboBox behaviour in win32Lib

Mike777 said...
DerekParnell said...
Mike777 said...

2) Other than inserting an OnChange event which compare s what has been typed into the ComboBox to the item values and rejects any keys which result in a non-match, is there a simpler way to do what us old Access programmers call "Limit to List"?

Does the DropDownList control suit?

The newUIObj docs specify that the control is built with the CBS_DROPDOWN attribute. Further, they say: In addition to being able to select a value from the combo's list, the user can enter their own value as well.

I'm trying to eliminate the ability of the user to enter their own value.

OK, never mind. There is a separate control type, in addition to Combo, called DropDownList. Got it.

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

8. Re: ComboBox behaviour in win32Lib

Mike777 said...
Mike777 said...
DerekParnell said...
Mike777 said...

2) Other than inserting an OnChange event which compare s what has been typed into the ComboBox to the item values and rejects any keys which result in a non-match, is there a simpler way to do what us old Access programmers call "Limit to List"?

Does the DropDownList control suit?

The newUIObj docs specify that the control is built with the CBS_DROPDOWN attribute. Further, they say: In addition to being able to select a value from the combo's list, the user can enter their own value as well.

I'm trying to eliminate the ability of the user to enter their own value.

OK, never mind. There is a separate control type, in addition to Combo, called DropDownList. Got it.

Now, I'm back where I started. My routines are built upon the combo boxes being, well, "combo" controls and not DropDownList controls.

So I renew my original question: is there a way to modify the flags of the combo such that the computer will treat it like a DropDownList control in that it will not allow an entry other than what is in the list?

Thanks

Mike

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

9. Re: ComboBox behaviour in win32Lib

Mike777 said...

1) When win32Lib builds a combobox, it does so with a style flag that limits the text one can type in the control to the width of the control...is there a way to change that behavior so that it functions like a text box (allowing input longer than the size of the box)?

2) Other than inserting an OnChange event which compare s what has been typed into the ComboBox to the item values and rejects any keys which result in a non-match, is there a simpler way to do what us old Access programmers call "Limit to List"?

Thanks

Mike

I'll check the flag, but I'm not sure what you are asking for is the expected thing. I'll look.

What could be simpler than checking the contents when change is validated? The only way would be to wrap the COM object that does this, and I don't think it's worth the pain.

CChris

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

10. Re: ComboBox behaviour in win32Lib

Thanks. As fas as the second item, using newUIObj means that I only have the ability to either assign one validate function to all combo's or I need a separate validate function for each combo. Anything in between would require some sort of naming convention which I'm trying to avoid. I guess I could assign a specific name of LTL to any combo that I wanted to Limit To List and then activate the validate (OnChange) event only for those whose names matched.

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

11. or thRe: ComboBox behaviour in win32Lib

I still don't get why you use a combo where a dropdownlist is what you need. If you want to limit input to list, what is the point of having an edit field with free content you validate afterwards? Just have your user choose from the list by dropping it down.

I must be missing something obvious.

If you need a particular style for the list, there is quite a variety of them. If you use the IDE, then it provides an FList component developed by A. Drummond which is even more flexible than a plain list.

If what you need is a dropdown list with images, then I would go owner drawn. You can implement owner drawn controls using win32lib as it is, but need to deal with raw Windows messages. There are long term plans for that.

Otherwise, I need your explaining what you want to achieve.

CChris

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

12. Re: or th ComboBox behaviour in win32Lib

CChris said...

I still don't get why you use a combo where a dropdownlist is what you need. If you want to limit input to list, what is the point of having an edit field with free content you validate afterwards? Just have your user choose from the list by dropping it down.

... Otherwise, I need your explaining what you want to achieve.

They are two entirely separate requests.

In one case I don't want a limit-to-list at all. In fact, I want to be able to type more in the combo box than what will fit based on the font. Obviously, I could try to expand the combo box to hold the largest possible entry, but that doesn't look good in all cases.

In the other, I want to limit-to-list and I can use the DropDownList concept, but I have a lot of code surrounding the generation of Combo controls and would have to do a bit of surgery to change to DropDownList controls. While doable, if I could find a way to just change a flag and coerce the behavior of a Combo into a DropDownList it would be simpler for me at this point in time for this particular project.

Sorry I didn't make it clear they were not related inquiries.

Mike

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

13. Re: or th ComboBox behaviour in win32Lib

Mike777 said...
CChris said...

I still don't get why you use a combo where a dropdownlist is what you need. If you want to limit input to list, what is the point of having an edit field with free content you validate afterwards? Just have your user choose from the list by dropping it down.

... Otherwise, I need your explaining what you want to achieve.

They are two entirely separate requests.

In one case I don't want a limit-to-list at all. In fact, I want to be able to type more in the combo box than what will fit based on the font. Obviously, I could try to expand the combo box to hold the largest possible entry, but that doesn't look good in all cases.

Did you try

w32VOID=sendMessage(getEdit(my_combo), EM_LIMITTET, 0, some_reasonable_max_value)? 

Oops, perhaps the last two need being swapped. Try both ways.

Mike777 said...

In the other, I want to limit-to-list and I can use the DropDownList concept, but I have a lot of code surrounding the generation of Combo controls and would have to do a bit of surgery to change to DropDownList controls. While doable, if I could find a way to just change a flag and coerce the behavior of a Combo into a DropDownList it would be simpler for me at this point in time for this particular project.

Sorry I didn't make it clear they were not related inquiries.

Mike

Now it is clear. If you pore over the internals of Windows notifications, you'll see that combos are completely different from lists internally. So I wouldn't even expect there being a flag, everything else is different under the hood. Lists existed in Windows 3.0, combos are from one or two generations later.

Unless your code actually uses specific features of combo boxes - and it doesn't look so from your descrition -, then I'd try refactoring and use the right control in the right place. If there is a technical issue stemmo,ng from what's in your code, then I can help with the refactoring perhaps.

You may have noticed that dev/doc work on Eu4.0 has gotten priority. My being off the net for 15+ days didn't help. I haven't started doing anything on win32lib 0.70.5.

CChris

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

14. Re: or th ComboBox behaviour in win32Lib

CChris said...

Now it is clear. If you pore over the internals of Windows notifications, you'll see that combos are completely different from lists internally. So I wouldn't even expect there being a flag, everything else is different under the hood. Lists existed in Windows 3.0, combos are from one or two generations later.

Unless your code actually uses specific features of combo boxes - and it doesn't look so from your descrition -, then I'd try refactoring and use the right control in the right place. If there is a technical issue stemmo,ng from what's in your code, then I can help with the refactoring perhaps.

You may have noticed that dev/doc work on Eu4.0 has gotten priority. My being off the net for 15+ days didn't help. I haven't started doing anything on win32lib 0.70.5.

I'll refactor. There is nothing technical standing in the way. I'll let you know on the text length, also.

Thanks

Mike

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

Search



Quick Links

User menu

Not signed in.

Misc Menu