comparison os2/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 fecd529ba9d4
children 4be57ee7e006
comparison
equal deleted inserted replaced
415:9ffdbfd83652 416:a4197ddfc50d
878 int uymax = 0, uxmax = 0; 878 int uymax = 0, uxmax = 0;
879 int upymax = 0, upxmax = 0; 879 int upymax = 0, upxmax = 0;
880 /* Used for the SIZEEXPAND */ 880 /* Used for the SIZEEXPAND */
881 int nux = *usedx, nuy = *usedy; 881 int nux = *usedx, nuy = *usedy;
882 int nupx = *usedpadx, nupy = *usedpady; 882 int nupx = *usedpadx, nupy = *usedpady;
883 int textheight = 0;
883 884
884 (*usedx) += (thisbox->pad * 2); 885 (*usedx) += (thisbox->pad * 2);
885 (*usedy) += (thisbox->pad * 2); 886 (*usedy) += (thisbox->pad * 2);
887
888 if(thisbox->grouphwnd)
889 {
890 char *text = dw_window_get_text(thisbox->grouphwnd);
891
892 if(text)
893 {
894 dw_font_text_extents(thisbox->grouphwnd, 0, text, NULL, &textheight);
895 dw_free(text);
896 }
897
898 (*usedx) += 6;
899 (*usedy) += textheight ? (3 + textheight) : 6;
900 }
886 901
887 for(z=0;z<thisbox->count;z++) 902 for(z=0;z<thisbox->count;z++)
888 { 903 {
889 if(thisbox->items[z].type == TYPEBOX) 904 if(thisbox->items[z].type == TYPEBOX)
890 { 905 {
1084 (*usedpadx) += upxmax; 1099 (*usedpadx) += upxmax;
1085 (*usedpady) += upymax; 1100 (*usedpady) += upymax;
1086 1101
1087 currentx += thisbox->pad; 1102 currentx += thisbox->pad;
1088 currenty += thisbox->pad; 1103 currenty += thisbox->pad;
1104
1105 if(thisbox->grouphwnd)
1106 {
1107 currentx += 3;
1108 currenty += 3;
1109 }
1089 1110
1090 /* The second pass is for expansion and actual placement. */ 1111 /* The second pass is for expansion and actual placement. */
1091 if(pass > 1) 1112 if(pass > 1)
1092 { 1113 {
1093 /* Any SIZEEXPAND items should be set to uxmax/uymax */ 1114 /* Any SIZEEXPAND items should be set to uxmax/uymax */