# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1637061979 0 # Node ID 246f23670e3bbe45f8002d17f73ac9c961f783c1 # Parent 0d5e99279c8b3efc57eca3e5653d767715d1c509 iOS: Fix dw_mle_set_word_wrap() and dw_checkbox_get(). The checkbox code is a recent breakage, from a method conflict. The MLE word wrap code isn't pretty, not sure this is the best way... but it works, so using it for the time being. diff -r 0d5e99279c8b -r 246f23670e3b ios/dw.m --- a/ios/dw.m Mon Nov 15 21:12:32 2021 +0000 +++ b/ios/dw.m Tue Nov 16 11:26:19 2021 +0000 @@ -3193,6 +3193,13 @@ DWSplitBar *split = (DWSplitBar *)handle; [split resize]; } + else if([handle isMemberOfClass:[DWMLE class]]) + { + DWMLE *mle = (DWMLE *)handle; + + if([[mle textContainer] lineBreakMode] == NSLineBreakByClipping) + [[mle textContainer] setSize:CGRectInfinite.size]; + } /* Advance the current position in the box */ if(thisbox->type == DW_HORZ) @@ -4662,7 +4669,7 @@ DWButton *button = handle; int retval = FALSE; - if([button state]) + if([button checkState]) retval = TRUE; DW_FUNCTION_RETURN_THIS(retval); } @@ -5343,10 +5350,16 @@ DW_FUNCTION_RESTORE_PARAM2(handle, HWND, state, int) { DWMLE *mle = handle; - NSUInteger mask = state ? 0 :UIViewAutoresizingFlexibleWidth; - - [mle setAutoresizingMask:UIViewAutoresizingFlexibleHeight|mask]; + [[mle textContainer] setLineBreakMode:(state ? NSLineBreakByWordWrapping : NSLineBreakByClipping)]; + [[mle textContainer] setWidthTracksTextView:(state ? YES : NO)]; + if(!state) + [[mle textContainer] setSize:CGRectInfinite.size]; + else + { + CGSize size = [mle frame].size; + [[mle textContainer] setSize:CGSizeMake(size.width, CGRectInfinite.size.height)]; + } DW_FUNCTION_RETURN_NOTHING; }