From 865a0ec662d280884d61b1c40818551f66ad58c1 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Thu, 10 Apr 2014 12:53:23 -0400 Subject: [PATCH] "Fixed" the zero-size Combobox drop-down on Windows by having Windows fix it for us (and since we did everything we need to do to get it to fix it for us, it was already fixed!). --- prefsize_windows.go | 4 ++++ todo.md | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/prefsize_windows.go b/prefsize_windows.go index 5e761ec..cb44f2c 100644 --- a/prefsize_windows.go +++ b/prefsize_windows.go @@ -42,6 +42,10 @@ var stdDlgSizes = [nctypes]dlgunits{ height: 10, }, c_combobox: dlgunits{ + // technically the height of a combobox has to include the drop-down list (this is a historical accident: originally comboboxes weren't drop-down) + // but since we're forcing Common Controls version 6, we can take advantage of one of its mechanisms to automatically fix this mistake (bad practice but whatever) + // see also: http://blogs.msdn.com/b/oldnewthing/archive/2006/03/10/548537.aspx + // note that the Microsoft guidelines pages don't take the list size into account longest: true, height: 12, // from the Visual Studio 2012 offline docs's Win32 layout page; the online page above says 14 }, diff --git a/todo.md b/todo.md index ae9f48a..b59dbc9 100644 --- a/todo.md +++ b/todo.md @@ -14,8 +14,6 @@ important things: - LineEdit heights on Windows seem too big; either that or LineEdit, Button, and Label text is not vertically centered properly - are Checkboxes and Comboboxes too small? - Cocoa has similar margining issues (like Comboboxes having margins) -- sometimes the size of the drop-down part of a Combobox becomes 0 or 1 or some other impossibly small value on Windows - - http://blogs.msdn.com/b/oldnewthing/archive/2006/03/10/548537.aspx - make gcc (Unix)/clang (Mac OS X) pedantic about warnings/errors; also -Werror - problem: cgo-generated files trip -Werror up; I can't seem to turn off unused argument warnings with the -Wall/-Wextra/-pedantic options - make sure scrollbars in Listbox work identically on all platforms (specifically the existence and autohiding of both horizontal and vertical scrollbars)