View previous topic :: View next topic |
Author |
Message |
Portis
Joined: 26 Sep 2005 Posts: 6
|
Posted: Wed Jan 31, 2007 7:06 pm Post subject: Strange behaviour with combo boxes on dialog forms |
|
|
Hi,
I've using DMD 1.00 and DFL (dfl-20070120.zip snapshot) for a number of internal projects and I've noticed a weird behaviour with combo boxes on forms used as dialog windows.
Specifically, you select a choice from the dropdown list and type something over it (which is accepted by the ComboBoxStyle.DROP_DOWN style) and it doesn't clear the contents of the combo box immediately .. you actually get the typed text being drawn over top of the choice selected from the drop down list, which looks rather odd.
The display of the combo box will correct itself if you click within in the 'text' part of the combo box or switch to another application then switch back.
I've probably haven't explained myself very well, so here's the shortest reproducible case I can come up with .. which is still long-ish.
Code: |
private import dfl.all;
class ComboTestForm: Form
{
Label pick_one_label;
ComboBox pick_one_combo;
this()
{
text = "ComboBox Test Form";
size = Size(250, 100);
with (pick_one_label = new Label)
{
text = "Pick one";
left = 10;
top = 10;
width = 80;
parent = this;
}
with (pick_one_combo = new ComboBox)
{
left = 100;
top = 10;
width = 100;
dropDownStyle = ComboBoxStyle.DROP_DOWN;
items.add("Red");
items.add("Blue");
items.add("Yellow");
parent = this;
}
}
}
class PopupMakerForm: Form
{
Button the_button;
this()
{
text = "Popup";
size = Size(200, 200);
with (the_button = new Button)
{
text = "Popup";
left = 50;
top = 50;
click ~= &the_button_click;
parent = this;
}
}
void the_button_click(Object sender, EventArgs e)
{
ComboTestForm popup_form = new ComboTestForm;
popup_form.showDialog(this);
}
}
int main(char[][] args)
{
//ComboTestForm the_form = new ComboTestForm;
PopupMakerForm the_form = new PopupMakerForm;
Application.enableVisualStyles();
Application.run(the_form);
return 0;
}
|
If you click the 'Popup' button, select a colour from the list, then type over it you *should* see what I mean.
Then either click inside the white area of the combo box or switch applications and the text you've typed is now displayed properly.
As an aside, if you comment out the 'PopupMakerForm' line and un-comment the 'ComboTestForm' one, you'll see the form works as expected if it is not displayed via the 'showDialog' call.
I don't know whether this is a DFL thing, or if I'm doing something wrong in regard to the 'showDialog' call.
Cheers. _________________ - Brendon - |
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Thu Feb 01, 2007 12:32 pm Post subject: Re: Strange behaviour with combo boxes on dialog forms |
|
|
I can't reproduce it.. perhaps it's caused by Windows XP. However, I have an idea for a fix; check out this snapshot. |
|
Back to top |
|
|
Portis
Joined: 26 Sep 2005 Posts: 6
|
Posted: Thu Feb 01, 2007 1:46 pm Post subject: Re: Strange behaviour with combo boxes on dialog forms |
|
|
Hi Chris,
The new snapshot, dfl-20070201, works like a charm.
Oh, and yes I do develop on and deploy to WinXP. The only non-XP Windows I have access to for testing is my *extremely old* Win95 laptop, so I wasn't able to check the issue on Win2K/98.
Thanks for all your hard work.
Cheers. _________________ - Brendon - |
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Sun Feb 04, 2007 4:32 am Post subject: Re: Strange behaviour with combo boxes on dialog forms |
|
|
Changes from a while back that attempted to support GDC had several side affects, and this was one of them. I just completely removed those changes and GDC is no longer supported at this time.
The issues when using DFL with GDC are really strange. It all seems to work fine except the colors are screwed up. I spent quite a lot of time trying to track it down but was unsuccessful. |
|
Back to top |
|
|
|