From 09e92b0eb35e45b1cc18f295b2467ca5703fcca0 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Thu, 10 Apr 2014 16:18:53 -0400 Subject: [PATCH] Documented scrollbars on Listbox and Area to the best of my ability, shuffling the appropriate TODOs around. --- area.go | 2 +- listbox.go | 2 ++ todo.md | 4 +--- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/area.go b/area.go index 3fd7cfb..2dc9328 100644 --- a/area.go +++ b/area.go @@ -8,7 +8,7 @@ import ( ) // Area represents a blank canvas upon which programs may draw anything and receive arbitrary events from the user. -// An Area has an explicit size, represented in pixels, that may be different from the size shown in its Window; scrollbars are placed automatically should they be needed. +// An Area has an explicit size, represented in pixels, that may be different from the size shown in its Window; Areas have horizontal and vertical scrollbars that are hidden when not needed. // The coordinate system of an Area always has an origin of (0,0) which maps to the top-left corner; all image.Points and image.Rectangles sent across Area's channels conform to this. // // To handle events to the Area, an Area must be paired with an AreaHandler. diff --git a/listbox.go b/listbox.go index 111d790..92067c0 100644 --- a/listbox.go +++ b/listbox.go @@ -9,6 +9,8 @@ import ( // A Listbox is a vertical list of items, of which either at most one or any number of items can be selected at any given time. // On creation, no item is selected. +// Listboxes have vertical scrollbars that are hidden when not needed. +// [TODO decide horizontal scrollbar behavior; only the Windows HIG explicitly says to do anything about them (in their case, avoid them unless the control has lots of info and is wide enough, such as a multi-column list) (the Mac OS X one says to just make lists wide enough and ellipsize if needed)] type Listbox struct { // TODO Select event diff --git a/todo.md b/todo.md index d1c927c..360fbb0 100644 --- a/todo.md +++ b/todo.md @@ -17,9 +17,7 @@ important things: - Cocoa has similar margining issues (like Comboboxes having margins) - 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) - - pin down this behavior; also note non-editability - - I think the behavior is, for the most part, a platform detail; perhaps a better option is to simply dictate the autohiding of scrollbars and the appearance of horizontal scrollbars for both Listbox and Area (this will also let us consolidate scroll view code in GTK+ and Mac OS X) +- consolidate scroll view code in GTK+ and Mac OS X - make sure mouse events don't trigger if the control size is larger than the Area size and the mouse event happens outside the Area range on all platforms - area test time label weirdness - does not show anything past the date on windows