comparison ios/dw.m @ 2793:24977a1ec6fc

iOS: Rewrite dw_window_redraw() so it actually works. The existing code essentially did nothing, it just set the redraw and shown state without actually doing anything. This new code works and Interface Builder now displays correctly without needing to rotate the tablet.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 14 Jul 2022 06:22:19 +0000
parents 9c6fdafd10be
children 7ce51a7e8009
comparison
equal deleted inserted replaced
2792:9c6fdafd10be 2793:24977a1ec6fc
799 @end 799 @end
800 800
801 @interface DWWindow : UIWindow 801 @interface DWWindow : UIWindow
802 { 802 {
803 DWMenu *windowmenu, *popupmenu; 803 DWMenu *windowmenu, *popupmenu;
804 int redraw;
805 int shown; 804 int shown;
806 void *userdata; 805 void *userdata;
807 } 806 }
808 -(void)sendEvent:(UIEvent *)theEvent; 807 -(void)sendEvent:(UIEvent *)theEvent;
809 -(void)keyDown:(UIKey *)key API_AVAILABLE(ios(13.4)); 808 -(void)keyDown:(UIKey *)key API_AVAILABLE(ios(13.4));
810 -(int)redraw;
811 -(void)setRedraw:(int)val;
812 -(int)shown; 809 -(int)shown;
813 -(void)setShown:(int)val; 810 -(void)setShown:(int)val;
814 -(void)layoutSubviews; 811 -(void)layoutSubviews;
815 -(void)setMenu:(DWMenu *)input; 812 -(void)setMenu:(DWMenu *)input;
816 -(void)setPopupMenu:(DWMenu *)input; 813 -(void)setPopupMenu:(DWMenu *)input;
830 } 827 }
831 if ( rcode != TRUE ) 828 if ( rcode != TRUE )
832 [super sendEvent:theEvent]; 829 [super sendEvent:theEvent];
833 } 830 }
834 -(void)keyDown:(UIKey *)key { } 831 -(void)keyDown:(UIKey *)key { }
835 -(int)redraw { return redraw; }
836 -(void)setRedraw:(int)val { redraw = val; }
837 -(int)shown { return shown; } 832 -(int)shown { return shown; }
838 -(void)setShown:(int)val { shown = val; } 833 -(void)setShown:(int)val { shown = val; }
839 -(void)layoutSubviews { } 834 -(void)layoutSubviews { }
840 -(void)setMenu:(DWMenu *)input { [windowmenu release]; windowmenu = input; [windowmenu retain]; } 835 -(void)setMenu:(DWMenu *)input { [windowmenu release]; windowmenu = input; [windowmenu retain]; }
841 -(void)setPopupMenu:(DWMenu *)input { [popupmenu release]; popupmenu = input; [popupmenu retain]; } 836 -(void)setPopupMenu:(DWMenu *)input { [popupmenu release]; popupmenu = input; [popupmenu retain]; }
9849 * handle: Toplevel window handle to be redrawn. 9844 * handle: Toplevel window handle to be redrawn.
9850 */ 9845 */
9851 void API dw_window_redraw(HWND handle) 9846 void API dw_window_redraw(HWND handle)
9852 { 9847 {
9853 DWWindow *window = handle; 9848 DWWindow *window = handle;
9854 [window setRedraw:YES]; 9849 NSArray *array = [[[window rootViewController] view] subviews];
9850
9851 for(id obj in array)
9852 {
9853 if([obj isMemberOfClass:[DWView class]])
9854 {
9855 DWView *view = obj;
9856 [view showWindow];
9857 }
9858 }
9859
9855 [window setShown:YES]; 9860 [window setShown:YES];
9856 [window setRedraw:NO];
9857 } 9861 }
9858 9862
9859 /* 9863 /*
9860 * Makes the window topmost. 9864 * Makes the window topmost.
9861 * Parameters: 9865 * Parameters: