Might as well get editable comboboxes overwith.

This commit is contained in:
Pietro Gagliardi 2015-05-21 21:45:31 -04:00
parent 5e4e01ef52
commit 27260d6b0b
3 changed files with 22 additions and 4 deletions

View File

@ -28,8 +28,9 @@ SETTOO(Spinbox, High, 80)
SETTOO(Slider, Low, -80)
SETTOO(Slider, High, 80)
uiCombobox *cbox;
uiRadioButtons *rb;
static uiCombobox *cbox;
static uiCombobox *editable;
static uiRadioButtons *rb;
uiBox *makePage4(void)
{
@ -84,6 +85,12 @@ uiBox *makePage4(void)
uiComboboxAppend(cbox, "Item 3");
uiBoxAppend(page4, uiControl(cbox), 0);
editable = uiNewEditableCombobox();
uiComboboxAppend(editable, "Editable Item 1");
uiComboboxAppend(editable, "Editable Item 2");
uiComboboxAppend(editable, "Editable Item 3");
uiBoxAppend(page4, uiControl(editable), 0);
rb = uiNewRadioButtons();
uiRadioButtonsAppend(rb, "Item 1");
uiRadioButtonsAppend(rb, "Item 2");

View File

@ -174,6 +174,7 @@ interface Combobox from Control {
func Append(text *const char);
};
func NewCombobox(void) *Combobox;
func NewEditableCombobox(void) *Combobox;
interface RadioButtons from Control {
func Append(text *const char);

View File

@ -38,7 +38,7 @@ static void comboboxAppend(uiCombobox *cc, const char *text)
uiFree(wtext);
}
uiCombobox *uiNewCombobox(void)
static uiCombobox *finishNewCombobox(DWORD style)
{
struct combobox *c;
uiWindowsMakeControlParams p;
@ -49,7 +49,7 @@ uiCombobox *uiNewCombobox(void)
p.dwExStyle = WS_EX_CLIENTEDGE;
p.lpClassName = L"combobox";
p.lpWindowName = L"";
p.dwStyle = CBS_DROPDOWNLIST | WS_TABSTOP;
p.dwStyle = style | WS_TABSTOP;
p.hInstance = hInstance;
p.lpParam = NULL;
p.useStandardControlFont = TRUE;
@ -65,3 +65,13 @@ uiCombobox *uiNewCombobox(void)
return uiCombobox(c);
}
uiCombobox *uiNewCombobox(void)
{
return finishNewCombobox(CBS_DROPDOWNLIST);
}
uiCombobox *uiNewEditableCombobox(void)
{
return finishNewCombobox(CBS_DROPDOWN);
}