From: Ralph T. <ra...@us...> - 2006-01-24 05:01:37
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/sources/win In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9556/adobe-source/adobe/future/widgets/sources/win Modified Files: ui_core_implementation.cpp Log Message: Resolved the bug where the combo box drop down would take up the entire screen if there were enough elements. It turned out that this behavior was being explicitly set (!); now we will show enough room for all of the elements up to a maximum of 10 (at which point you will get a scrollbar). This still doesn't verify that the specified size can fit on the screen (e.g.: Windows PocketPC might have trouble), and uses a fixed value. Index: ui_core_implementation.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/sources/win/ui_core_implementation.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ui_core_implementation.cpp 24 Jan 2006 02:47:19 -0000 1.9 --- ui_core_implementation.cpp 24 Jan 2006 05:01:27 -0000 1.10 *************** *** 39,42 **** --- 39,44 ---- //End yuck + #include <algorithm> + /****************************************************************************************************/ *************** *** 3375,3379 **** control_m = ::CreateWindowEx( WS_EX_COMPOSITED, WC_COMBOBOX, NULL, ! WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | WS_TABSTOP, 0, 0, width, height, invisible_parent_m, --- 3377,3381 ---- control_m = ::CreateWindowEx( WS_EX_COMPOSITED, WC_COMBOBOX, NULL, ! WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | WS_TABSTOP | WS_VSCROLL, 0, 0, width, height, invisible_parent_m, *************** *** 3565,3570 **** geometry_m.width() -= width; } long old_height = geometry_m.height(); ! geometry_m.height() += static_cast<long>((menu_items_m.size() + 1) * geometry_m.height()); _super::set_bounds(position, geometry_m); geometry_m.height() = old_height; --- 3567,3582 ---- geometry_m.width() -= width; } + // + // On Win32, you give a combo box the height it should have + // when it's fully extended (which seems a bit like a hackish + // implementation detail poking through). Here we ensure that + // the combo box is maximally the size of 10 elements (so that + // we don't go over the edges of the screen if we have a huge + // number of elements). + // + // REVISIT (ralpht) : fixed value. + // long old_height = geometry_m.height(); ! geometry_m.height() += std::min<long>(static_cast<long>((menu_items_m.size() + 1)), 10) * geometry_m.height(); _super::set_bounds(position, geometry_m); geometry_m.height() = old_height; |