GUI bug - Address Bar's ComboBox

Found a bug or something that needs fixing?
Post Reply
Edgar5
Posts: 63
Joined: Sun Apr 02, 2017 7:22 am

GUI bug - Address Bar's ComboBox

Post by Edgar5 »

Which version of Windows you are using.
Windows 7 Pro SP1
Which version of Explorer++ you are using, and the build type (32-bit or 64-bit).
1.3.5 32-bit
Whether the bug arose in previous versions of Explorer++.
unknown - I'm new to using & compiling Explorer++
What you were doing at the time of the crash/what caused the bug
This is a GUI bug visible anytime the Address Bar is visible in the font
is large (e.g. 16 point Times New Roman)
Steps to reproduce:
1) Run Explorer++ 1.3.5 32-bit with no modifications to the source.
2) Ensure that the Address Bar is made visible - make sure to check menu item:
View>Toolbars>Address Bar
if it is not already done so.
3) Open the Display Window Colors dialog by using the menu item:
View>Change Display Window Colors…
4) Click the <Choose font…> button.
5) In the resulting Font dialog make the font "Times New Roman", style "Regular"
and size at least 16.
6) Click the <OK> button.
7) Click the <OK> button on the Display Window Colors dialog.
8) Exit Explorer++ then restart it (this ensures that the new font is picked up everywhere).
9) Note that quite a bit of the text is cut off at the bottom of the Address Bar's combo box.

The problem occurs after line 119 in file
explorer++_1.3.5_src\Explorer++\Explorer++\WindowHandler.cpp
in the function CreateMainControls(void):
<119> CreateAddressBar();
SendMessage(m_hAddressBar, TB_GETMAXSIZE, 0, (LPARAM)&sz);//efm5 debug font sensitivity
LoadString(g_hLanguageModule,IDS_ADDRESSBAR,szBandText,SIZEOF_ARRAY(szBandText));
ToolbarSize = (DWORD)SendMessage(m_hAddressToolbar,TB_GETBUTTONSIZE,0,0);

m_ToolbarInformation[i].cyMinChild = sz.cy;//efm5 debug font sensitivity
//HIWORD(ToolbarSize) is always 22
//m_ToolbarInformation[i].cyMinChild = HIWORD(ToolbarSize);
//Using ToolbarSize as calculated above only yields enough height for a
//combo box with a default (eight point?) font. It is not aware that the font of the
//combo box might be larger than default and that the text letters might include descenders.

As you can see you need to add one line at 120 and change the line at 125. I didn't bother to
dig into the code far enough to see if ToolbarSize is ever used after being calculated here;
the line:
ToolbarSize = (DWORD)SendMessage(m_hAddressToolbar,TB_GETBUTTONSIZE,0,0);
might be superfluous.
Pre-code change:
[attachment=1]bad.png[/attachment]
Post-code change:
[attachment=0]good.png[/attachment]
Attachments
good.png
good.png (17.41 KiB) Viewed 8229 times
bad.png
bad.png (16.79 KiB) Viewed 8229 times
Edgar5
Posts: 63
Joined: Sun Apr 02, 2017 7:22 am

Re: GUI bug - Address Bar's ComboBox

Post by Edgar5 »

After playing around a bit with this I realize that my steps to reproduce are wrong. The Address Bar is picking up its font from one of the default Window's fonts* not the Display Window font. The problem and solution remain the same.

* Menu font, Icon font Text font etc.; a high resolution monitor it's almost impossible to read text on screen at the default (8 or 10 point) size.
David Erceg
Site Admin
Posts: 933
Joined: Sat Apr 18, 2009 1:46 am

Re: GUI bug - Address Bar's ComboBox

Post by David Erceg »

Hi Edgar,

Thanks for the detailed bug description. It would be good to have this fixed. Could you check if the bug is still present on master and if it is, file a pull request on GitHub?
Edgar5
Posts: 63
Joined: Sun Apr 02, 2017 7:22 am

Re: GUI bug - Address Bar's ComboBox

Post by Edgar5 »

My current version of Explorer++'s code contains many thousands of lines of new code for bug fixes and enhancements. To repair this specific bug only requires a few of those lines of code but there are a couple of enhancements that go along with it. I don't know how to do anything with Git beyond downloading a zip file (although I do have an account).
Post Reply