comparison template/dw.c @ 2386:47b214db2465

Add _dw to the internal functions in the template source.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 23 Mar 2021 20:25:56 +0000
parents fad0821cb953
children 0286ac44d347
comparison
equal deleted inserted replaced
2385:a126b04b9996 2386:47b214db2465
24 } 24 }
25 25
26 /* This function calculates how much space the widgets and boxes require 26 /* This function calculates how much space the widgets and boxes require
27 * and does expansion as necessary. 27 * and does expansion as necessary.
28 */ 28 */
29 static void _resize_box(Box *thisbox, int *depth, int x, int y, int pass) 29 static void _dw_resize_box(Box *thisbox, int *depth, int x, int y, int pass)
30 { 30 {
31 /* Current item position */ 31 /* Current item position */
32 int z, currentx = thisbox->pad, currenty = thisbox->pad; 32 int z, currentx = thisbox->pad, currenty = thisbox->pad;
33 /* Used x, y and padding maximum values... 33 /* Used x, y and padding maximum values...
34 * These will be used to find the widest or 34 * These will be used to find the widest or
85 if(pass == 1) 85 if(pass == 1)
86 { 86 {
87 (*depth)++; 87 (*depth)++;
88 88
89 /* Save the newly calculated values on the box */ 89 /* Save the newly calculated values on the box */
90 _resize_box(tmp, depth, x, y, pass); 90 _dw_resize_box(tmp, depth, x, y, pass);
91 91
92 /* Duplicate the values in the item list for use below */ 92 /* Duplicate the values in the item list for use below */
93 thisbox->items[z].width = tmp->minwidth; 93 thisbox->items[z].width = tmp->minwidth;
94 thisbox->items[z].height = tmp->minheight; 94 thisbox->items[z].height = tmp->minheight;
95 95
208 /* Here you put your platform specific placement widget placement code */ 208 /* Here you put your platform specific placement widget placement code */
209 PlaceWidget(handle, currentx + pad, currenty + pad, width, height); 209 PlaceWidget(handle, currentx + pad, currenty + pad, width, height);
210 210
211 /* If any special handling needs to be done... like diving into 211 /* If any special handling needs to be done... like diving into
212 * controls that have sub-layouts... like notebooks or splitbars... 212 * controls that have sub-layouts... like notebooks or splitbars...
213 * do that here. Figure out the sub-layout size and call _do_resize(). 213 * do that here. Figure out the sub-layout size and call _dw_do_resize().
214 */ 214 */
215 #endif 215 #endif
216 216
217 /* Advance the current position in the box */ 217 /* Advance the current position in the box */
218 if(thisbox->type == DW_HORZ) 218 if(thisbox->type == DW_HORZ)
225 } 225 }
226 226
227 /* This is a convenience function used in the window's resize event 227 /* This is a convenience function used in the window's resize event
228 * to relayout the controls in the window. 228 * to relayout the controls in the window.
229 */ 229 */
230 void _do_resize(Box *thisbox, int x, int y) 230 void _dw_do_resize(Box *thisbox, int x, int y)
231 { 231 {
232 if(x != 0 && y != 0) 232 if(x != 0 && y != 0)
233 { 233 {
234 if(thisbox) 234 if(thisbox)
235 { 235 {
236 int depth = 0; 236 int depth = 0;
237 237
238 /* Calculate space requirements */ 238 /* Calculate space requirements */
239 _resize_box(thisbox, &depth, x, y, 1); 239 _dw_resize_box(thisbox, &depth, x, y, 1);
240 240
241 /* Finally place all the boxes and controls */ 241 /* Finally place all the boxes and controls */
242 _resize_box(thisbox, &depth, x, y, 2); 242 _dw_resize_box(thisbox, &depth, x, y, 2);
243 } 243 }
244 } 244 }
245 } 245 }
246 246
247 /* 247 /*