comparison win/dw.c @ 416:a4197ddfc50d

Changes to calculate groupbox border widths and take this into account when calculating window positions.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 15 May 2003 03:38:44 +0000
parents 2a55f61714fd
children 4ae67c291a8a
comparison
equal deleted inserted replaced
415:9ffdbfd83652 416:a4197ddfc50d
844 int nux = *usedx, nuy = *usedy; 844 int nux = *usedx, nuy = *usedy;
845 int nupx = *usedpadx, nupy = *usedpady; 845 int nupx = *usedpadx, nupy = *usedpady;
846 846
847 (*usedx) += (thisbox->pad * 2); 847 (*usedx) += (thisbox->pad * 2);
848 (*usedy) += (thisbox->pad * 2); 848 (*usedy) += (thisbox->pad * 2);
849
850 if(thisbox->grouphwnd)
851 {
852 char *text = dw_window_get_text(thisbox->grouphwnd);
853
854 if(text)
855 {
856 dw_font_text_extents(thisbox->grouphwnd, 0, text, NULL, &textheight);
857 dw_free(text);
858 }
859
860 (*usedx) += 6;
861 (*usedy) += textheight ? (3 + textheight) : 6;
862 }
849 863
850 for(z=0;z<thisbox->count;z++) 864 for(z=0;z<thisbox->count;z++)
851 { 865 {
852 if(thisbox->items[z].type == TYPEBOX) 866 if(thisbox->items[z].type == TYPEBOX)
853 { 867 {
1047 (*usedpadx) += upxmax; 1061 (*usedpadx) += upxmax;
1048 (*usedpady) += upymax; 1062 (*usedpady) += upymax;
1049 1063
1050 currentx += thisbox->pad; 1064 currentx += thisbox->pad;
1051 currenty += thisbox->pad; 1065 currenty += thisbox->pad;
1066
1067 if(thisbox->grouphwnd)
1068 {
1069 currentx += 3;
1070 currenty += textheight ? textheight : 3;
1071 }
1052 1072
1053 /* The second pass is for expansion and actual placement. */ 1073 /* The second pass is for expansion and actual placement. */
1054 if(pass > 1) 1074 if(pass > 1)
1055 { 1075 {
1056 /* Any SIZEEXPAND items should be set to uxmax/uymax */ 1076 /* Any SIZEEXPAND items should be set to uxmax/uymax */