From: Thomas W. <wi...@ac...> - 2005-12-30 00:12:29
Attachments:
ui_core_implementation.patch
|
Hi, The attached patch fixes 2 issues with the widget implementation on win32 that show up in begin. a) The text in an edit_text widget is truncated to 1023 char on extraction. As a result loading any example in begin that is longer than that (some are) and making a small modification will see the update fail with a syntax error. b) The edit_text widget does not grow vertically. This makes editing/viewing larger examples in Begin a pain. It works for begin but this fix might need more review. Thomas -- Thomas Witt wi...@ac... |
From: Ralph T. <ra...@gm...> - 2005-12-30 08:12:26
|
Hi Thomas, The first change (to get_window_title) looks good. I assume that your issue with (2) is that the Begin window grows but the edit text widgets remain the same size. It seems like it should grow... I'll test your change and verify that the baseline is correct. Sean, what is the correct behavior for the edit text widget here? Thanks, Ralph On 12/29/05, Thomas Witt <wi...@ac...> wrote: > > Hi, > > The attached patch fixes 2 issues with the widget implementation on > win32 that show up in begin. > > a) The text in an edit_text widget is truncated to 1023 char on > extraction. As a result loading any example in begin that is longer than > that (some are) and making a small modification will see the update fail > with a syntax error. > > b) The edit_text widget does not grow vertically. This makes > editing/viewing larger examples in Begin a pain. It works for begin but > this fix might need more review. > > Thomas > > -- > Thomas Witt > wi...@ac... > > > Index: ui_core_implementation.cpp > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /cvsroot/adobe-source/adobe-source/adobe/future/widgets/sources= /win/ui_core_implementation.cpp,v > retrieving revision 1.5 > diff -u -3 -p -u -r1.5 ui_core_implementation.cpp > --- ui_core_implementation.cpp 2 Dec 2005 02:52:56 -0000 1.5 > +++ ui_core_implementation.cpp 30 Dec 2005 00:02:05 -0000 > @@ -245,11 +245,13 @@ std::string get_window_title(HWND window > { > assert(window); > > - std::vector<WCHAR> titlename; > + int const buffer_size =3D ::GetWindowTextLengthW(window) + 1; > > - titlename.resize(1024); > + std::vector<WCHAR> titlename(buffer_size, 0); > > - *(&titlename[::GetWindowTextW(window, &titlename[0], 1024)]) =3D = 0; > + int const text_length =3D ::GetWindowTextW(window, &titlename[0], buff= er_size); > + > + assert(text_length < buffer_size); > > return std::string(hackery::convert_utf(&titlename[0])); > } > @@ -3143,7 +3145,10 @@ void edit_text_t::implementation_t::set_ > // alignment. > // > position.y_m +=3D baseline - edit_baseline_m; > - geometry.height() =3D edit_height_m; > + > + // Do we need to adapt the height for baseline alignment? (thw) > + // Disabled as it disables vertical align_fill (thw) > + // geometry.height() =3D edit_height_m; > _super::set_bounds(position, geometry); > } > > > > |
From: Thomas W. <wi...@ac...> - 2005-12-30 18:25:05
|
Ralph. Ralph Thomas wrote: > Hi Thomas, > > The first change (to get_window_title) looks good. I assume that > your issue with (2) is that the Begin window grows but the edit text > widgets remain the same size. It seems like it should grow... That's what it does on Mac. > I'll > test your change and verify that the baseline is correct. Thanks! Thomas -- Thomas Witt wi...@ac... |
From: Foster T. B. <fbr...@ad...> - 2006-01-03 19:25:50
|
This patch has been applied. Thanks for the fixes, Thomas. Keep 'em coming! Blessings, Foster On Dec 29, 2005, at 04:12p, Thomas Witt wrote: > > Hi, > > The attached patch fixes 2 issues with the widget implementation on > win32 that show up in begin. > > a) The text in an edit_text widget is truncated to 1023 char on > extraction. As a result loading any example in begin that is longer > than that (some are) and making a small modification will see the > update fail with a syntax error. > > b) The edit_text widget does not grow vertically. This makes > editing/viewing larger examples in Begin a pain. It works for begin > but this fix might need more review. > > Thomas > > -- > Thomas Witt > wi...@ac... > Index: ui_core_implementation.cpp > =================================================================== > RCS file: /cvsroot/adobe-source/adobe-source/adobe/future/widgets/ > sources/win/ui_core_implementation.cpp,v > retrieving revision 1.5 > diff -u -3 -p -u -r1.5 ui_core_implementation.cpp > --- ui_core_implementation.cpp 2 Dec 2005 02:52:56 -0000 1.5 > +++ ui_core_implementation.cpp 30 Dec 2005 00:02:05 -0000 > @@ -245,11 +245,13 @@ std::string get_window_title(HWND window > { > assert(window); > > - std::vector<WCHAR> titlename; > + int const buffer_size = ::GetWindowTextLengthW(window) + 1; > > - titlename.resize(1024); > + std::vector<WCHAR> titlename(buffer_size, 0); > > - *(&titlename[::GetWindowTextW(window, &titlename[0], 1024)]) = 0; > + int const text_length = ::GetWindowTextW(window, &titlename[0], > buffer_size); > + > + assert(text_length < buffer_size); > > return std::string(hackery::convert_utf(&titlename[0])); > } > @@ -3143,7 +3145,10 @@ void edit_text_t::implementation_t::set_ > // alignment. > // > position.y_m += baseline - edit_baseline_m; > - geometry.height() = edit_height_m; > + > + // Do we need to adapt the height for baseline alignment? (thw) > + // Disabled as it disables vertical align_fill (thw) > + // geometry.height() = edit_height_m; > _super::set_bounds(position, geometry); > } > -- Foster T. Brereton <}}}>< Romans 3:21-26 A d o b e S o f t w a r e T e c h n o l o g y L a b "The fact is that the author of STL does not know how to write min, the author of C++ is not quite sure, and the standards committee is at a loss." -- Alexander Stepanov |