Wanting to "hybridize" the standard ComboBox as a control; any ideas?
Wanting to "hybridize" the standard ComboBox as a control; any ideas?
(OP)
This is for Compaq Visual Fortran (v6x):
As most of you know, for the standard ComboBox has 3 Types (modes):
1. Simple
2. Dropdown
3. Drop List
1&2 are both editable and only differ in the way the choices are displayed (simple exposes all choices; Dropdown hides them until the dropdown list is clicked).
In this latter sense (display of choices), 2&3 are identical but the choices for 3 are fixed (i.e., not editable).
In my case, I have an input variable that takes on one of two modes in terms of choices:
A) a fixed value (hardwired; user cannot alter).
B) some editable (adjustable) value - presented in an edit box that the user can change.
For A, #3 (Drop List) would be ideal; for B, #2 (Dropdown) would be ideal.
This is actually very common in dialogs you see used in a variety of apps. in which a list may provide a series of "fixed" choices, and then a last one [e.g., Other (please specify)] - the "please specify" is editable. I believe Delphi allows one to configure this way fairly easily.
For CVF, I wonder if there is any way to configure either the ComboBox in the Resource Editor itself, or some trick coding using (for example) DlgSet, etc. to accomplish this.
Any help is appreciated.
p.s.
The so-called "Extended" ComboBox in the Resource Editor is of no help in overcoming this obstacle.
As most of you know, for the standard ComboBox has 3 Types (modes):
1. Simple
2. Dropdown
3. Drop List
1&2 are both editable and only differ in the way the choices are displayed (simple exposes all choices; Dropdown hides them until the dropdown list is clicked).
In this latter sense (display of choices), 2&3 are identical but the choices for 3 are fixed (i.e., not editable).
In my case, I have an input variable that takes on one of two modes in terms of choices:
A) a fixed value (hardwired; user cannot alter).
B) some editable (adjustable) value - presented in an edit box that the user can change.
For A, #3 (Drop List) would be ideal; for B, #2 (Dropdown) would be ideal.
This is actually very common in dialogs you see used in a variety of apps. in which a list may provide a series of "fixed" choices, and then a last one [e.g., Other (please specify)] - the "please specify" is editable. I believe Delphi allows one to configure this way fairly easily.
For CVF, I wonder if there is any way to configure either the ComboBox in the Resource Editor itself, or some trick coding using (for example) DlgSet, etc. to accomplish this.
Any help is appreciated.
p.s.
The so-called "Extended" ComboBox in the Resource Editor is of no help in overcoming this obstacle.





RE: Wanting to "hybridize" the standard ComboBox as a control; any ideas?
The overlaid box is quite painful to program and debug. You also need to close it immediately you lose focus otherwise it gets left behind when the dialog moves.
Easiest to use 2 machines to debug this - once you lose focus and go into the debugger, strange things happen.
RE: Wanting to "hybridize" the standard ComboBox as a control; any ideas?
I would say that you want to set up an unsorted list in your ComboBox, with the editable entry's location permanently set so that when you select a list item whose index does not match the editable entry's index, you can disable the edit box selection so that it cannot be edited. You can get the handle to the edit control portion of a ComboBoxEx control by sending it the CBEM_GetEditControl message with parameters wParam = 0, lParam = 0 using the Windows API function SendMessage, using the handle to the ComboBox.
e.g.
use dfWinTY ! contains definitions of window messages such as CBEM_GetEditControl
Integer(handle) hEditControl, hComboWnd
hEditControl= SendMessage(hComboWnd, & handle of combo box
CBEM_GetEditControl, & message to send
0, & first message parameter
0 & second message parameter)
This is consistent with the description for CBEM_GetEditControl Message posted here:
http
RE: Wanting to "hybridize" the standard ComboBox as a control; any ideas?
Basically, you need to be as warped as your users and handle all the weird stuff they will do like typing half way and then changing their mind and going back to the drop down list.