Subversion Repositories Kolibri OS

Rev

Rev 9302 | Rev 9318 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9302 Rev 9309
Line 327... Line 327...
327
 
327
 
328
 
328
 
329
struct TABLE {
329
struct TABLE {
-
 
330
	int count;
330
	int count;
331
	int depth;
-
 
332
	int margin;
331
	int depth;
333
	collection_int cols;
Line 332... Line 334...
332
	collection_int cols;
334
	collection_int width;
333
} table;
335
} table;
Line 358... Line 360...
358
		if(tag.opened) {
360
		if(tag.opened) {
359
			table.depth++;
361
			table.depth++;
360
			if (table.depth==1) {
362
			if (table.depth==1) {
361
				table.count++;
363
				table.count++;
362
				colcount = 0;
364
				colcount = 0;
-
 
365
				if (tag.get_number_of("width")) {
-
 
366
					if (strchr(tag.value, '%')) tag.number = list.w * tag.number / 100;
-
 
367
					table.width.set(table.count, math.min(tag.number,list.w));
-
 
368
				} else {
-
 
369
					table.width.set(table.count, list.w);
-
 
370
				}
363
			}
371
			}
364
		} else {
372
		} else {
365
			if (table.depth>0) {
373
			if (table.depth>0) {
366
				table.depth--;
374
				table.depth--;
367
			}
375
			}
Line 426... Line 434...
426
			tallest_cell_in_row = math.max(draw_y+style.cur_line_h-list.item_h, tallest_cell_in_row);
434
			tallest_cell_in_row = math.max(draw_y+style.cur_line_h-list.item_h, tallest_cell_in_row);
427
			style.cur_line_h = list.item_h;
435
			style.cur_line_h = list.item_h;
428
			if (tag.opened) {
436
			if (tag.opened) {
Line 429... Line 437...
429
				
437
				
-
 
438
				if (!td_pos) {
430
				if (!td_pos) {
439
					table.margin = list.w - table.width.get(table.count) / 2 + BODY_MARGIN;
-
 
440
					draw_x = left_gap = table.margin;
431
					draw_x = left_gap = BODY_MARGIN;
441
					draw_w = table.width.get(table.count) - BODY_MARGIN;
432
				} else {
442
				} else {
-
 
443
					draw_x = left_gap = left_gap + draw_w;
433
					draw_x = left_gap = left_gap + draw_w;
444
					draw_w = table.width.get(table.count) - left_gap;
Line 434... Line -...
434
				}
-
 
435
 
445
				}
436
				draw_w = list.w - BODY_MARGIN - 23 - left_gap;
446
 
437
				if (EAX = table.cols.get(tr_pos-1)-td_pos) draw_w /= EAX; else {
447
				if (EAX = table.cols.get(tr_pos-1)-td_pos) draw_w /= EAX; else {
438
					draw_y = row_start_y;
448
					draw_y = row_start_y;
439
					draw_x = left_gap = BODY_MARGIN;
449
					draw_x = left_gap = table.margin;
440
				}
450
				}
441
				if (table.cols.get(tr_pos-1)-td_pos>1) && (tag.get_number_of("width")) {
451
				if (table.cols.get(tr_pos-1)-td_pos>1) && (tag.get_number_of("width")) {
442
					if (strchr(tag.value, '%')) {
452
					if (strchr(tag.value, '%')) {
443
						tag.number = list.w - BODY_MARGIN - 23 - left_gap * tag.number / 100;
453
						tag.number = table.width.get(table.count) - table.margin - 23 - left_gap * tag.number / 100;
444
					}
454
					}
445
					if (tag.number < draw_w) draw_w = tag.number;
455
					if (tag.number < draw_w) draw_w = tag.number;
446
				}
456
				}
447
				draw_y = row_start_y;
457
				draw_y = row_start_y;
448
				//canvas.WriteText(draw_x, draw_y, 10001001b, 0x0000FE, itoa(draw_x), NULL);
458
				//canvas.WriteText(draw_x, draw_y, 10001001b, 0x0000FE, itoa(draw_x), NULL);
449
				td_pos++;				
459
				td_pos++;				
450
			}
460
			}
451
		}
461
		}
452
	}
462
	}
453
	if (draw_x > list.w) {
463
	if (draw_x > table.width.get(table.count)) {
454
		draw_x = left_gap = BODY_MARGIN;
464
		draw_x = left_gap = table.margin;
455
		draw_w = list.w - BODY_MARGIN - 23 - left_gap;
465
		draw_w = table.width.get(table.count) - table.margin - 23 - left_gap;
456
		table.depth = 0;
466
		table.depth = 0;
457
		NewLine();
467
		NewLine();
458
		if (debug_mode) {
468
		if (debug_mode) {