comparison mac/dw.m @ 1449:632346743f46

Fixed dw_window_redraw() on Windows not recalculating notebook page contents if the notebook size didn't change. Remove notebook page subclass and do the redrawing in _resize_box() itself. Fixed expandable boxes with no contents not consuming any space on OS/2, Windows and Mac. Added invalidated window redraw on entering dw_main() on OS/2, Windows and Mac.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 14 Dec 2011 00:23:30 +0000
parents 0d4fdf646caf
children 4b516ef23b62
comparison
equal deleted inserted replaced
1448:508dde3dc398 1449:632346743f46
2467 { 2467 {
2468 /* On the first pass calculate the box contents */ 2468 /* On the first pass calculate the box contents */
2469 if(pass == 1) 2469 if(pass == 1)
2470 { 2470 {
2471 (*depth)++; 2471 (*depth)++;
2472 2472
2473 /* Save the newly calculated values on the box */ 2473 /* Save the newly calculated values on the box */
2474 _resize_box(tmp, depth, x, y, pass); 2474 _resize_box(tmp, depth, x, y, pass);
2475 2475
2476 /* Duplicate the values in the item list for use below */ 2476 /* Duplicate the values in the item list for use below */
2477 thisbox->items[z].width = tmp->minwidth; 2477 thisbox->items[z].width = tmp->minwidth;
2478 thisbox->items[z].height = tmp->minheight; 2478 thisbox->items[z].height = tmp->minheight;
2479 2479
2480 /* If the box has no contents but is expandable... default the size to 1 */
2481 if(!thisbox->items[z].width && thisbox->items[z].hsize)
2482 thisbox->items[z].width = 1;
2483 if(!thisbox->items[z].height && thisbox->items[z].vsize)
2484 thisbox->items[z].height = 1;
2485
2480 (*depth)--; 2486 (*depth)--;
2481 } 2487 }
2482 } 2488 }
2483 } 2489 }
2484 2490
2485 /* Precalculate these values, since they will 2491 /* Precalculate these values, since they will
2486 * be used used repeatedly in the next section. 2492 * be used used repeatedly in the next section.
2487 */ 2493 */
2488 itempad = thisbox->items[z].pad * 2; 2494 itempad = thisbox->items[z].pad * 2;
2489 itemwidth = thisbox->items[z].width + itempad; 2495 itemwidth = thisbox->items[z].width + itempad;
2773 */ 2779 */
2774 void API dw_main(void) 2780 void API dw_main(void)
2775 { 2781 {
2776 dw_mutex_lock(DWRunMutex); 2782 dw_mutex_lock(DWRunMutex);
2777 DWThread = dw_thread_id(); 2783 DWThread = dw_thread_id();
2784 /* Make sure any queued redraws are handled */
2785 _dw_redraw(0, FALSE);
2778 [DWApp run]; 2786 [DWApp run];
2779 DWThread = (DWTID)-1; 2787 DWThread = (DWTID)-1;
2780 dw_mutex_unlock(DWRunMutex); 2788 dw_mutex_unlock(DWRunMutex);
2781 } 2789 }
2782 2790
2797 if(orig == (DWTID)-1) 2805 if(orig == (DWTID)-1)
2798 { 2806 {
2799 dw_mutex_lock(DWRunMutex); 2807 dw_mutex_lock(DWRunMutex);
2800 DWThread = curr; 2808 DWThread = curr;
2801 } 2809 }
2802 /* Process any pending events */ 2810 /* Process any pending events */
2803 while(_dw_main_iteration(until)) 2811 while(_dw_main_iteration(until))
2804 { 2812 {
2805 /* Just loop */ 2813 /* Just loop */
2806 } 2814 }
2807 if(orig == (DWTID)-1) 2815 if(orig == (DWTID)-1)