[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(mgp-users 00565) side-by-side positioning



Dear List,

I patched the cvs version of mgp to add a new command 'xoffset' which 
makes it possible to make lists (or anything else) look like

	* item 1	* item 4
	* item 2	* item 5
	* item 3	* item 6


with

------------------snip -----------------
%mark
	item 1
	item 2
	item 3
%cont, xoffset 50
	item 4
	item 5
	item 6
------------------snip -----------------

The parameter for 'xoffset' is the percentage of the x-width of the
presentation which is added to each subsequent objects horizontal position.

The offset is reset to 0 at the beginning of a new page.

The code is not heavily tested but it works for my presentations. Maybe this
patch is of some interest to others, it's attached to this email.

Regards,
Chris


-- 
Dipl.-Inf. Christopher Drexler, Lehrst.f. Mustererkennung _    __  __ ___ 
Institut f. Informatik, Universitaet Erlangen-Nuernberg  | |  |  \/  | __|
WWW : http://www5.informatik.uni-erlangen.de/~drexler  	 | |__| |\/| | _| 
GPG : http://www.keyserver.net                           |____|_|  |_|___|
Index: draw.c
===================================================================
RCS file: /cvsmgp/kit/draw.c,v
retrieving revision 1.185
diff -r1.185 draw.c
261a262
> 	state->xoffset = 0;
470a472,475
> 	case CTL_XOFFSET:
> 		state->xoffset = state->width * cp->ctf_value / 100;
> 		break;
> 
1837a1843
> 	xpos += state->xoffset; 
Index: globals.c
===================================================================
RCS file: /cvsmgp/kit/globals.c,v
retrieving revision 1.44
diff -r1.44 globals.c
149a150
> /*CTL*/	{ CTL_XOFFSET,		T_DOUBLE, "xoffset", 7 },
Index: grammar.y
===================================================================
RCS file: /cvsmgp/kit/grammar.y,v
retrieving revision 1.37
diff -r1.37 grammar.y
700c700,701
< %token KW_CHARSET KW_TMFONT KW_PCACHE KW_TMFONT0 KW_ANIM KW_VALIGN
---
> %token KW_CHARSET KW_TMFONT KW_PCACHE KW_TMFONT0 KW_ANIM KW_VALIGN 
> %token KW_XOFFSET
765a767,768
> 	| KW_XOFFSET NUM	{ $$ = gen_double_int(CTL_XOFFSET, $2); }
> 	| KW_XOFFSET DOUBLE	{ $$ = gen_double(CTL_XOFFSET, $2); }
Index: mgp.h
===================================================================
RCS file: /cvsmgp/kit/mgp.h,v
retrieving revision 1.126
diff -r1.126 mgp.h
382a383
> 	u_int xoffset;
Index: scanner.l
===================================================================
RCS file: /cvsmgp/kit/scanner.l,v
retrieving revision 1.21
diff -r1.21 scanner.l
166a167
> (XOFFSET|xoffset)	return KW_XOFFSET;