text.class

来自「是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到」· CLASS 代码 · 共 90 行

CLASS
90
字号
/*				text
	
	a subview class to hold text
*/
*! version 1.0.0  30jul2002

version 8

class {
	text  = ""
	style = .textstyle.new

	/* x -- optionally declared dynamically by new or set */
	/* y -- optionally declared dynamically by new or set */

} , inherit(subview)


/* -------------------------------------------------------------------------*/
/*
	Usage:  see .set below
*/
program define new

	.set `0'
end


/* -------------------------------------------------------------------------*/
/*
	passes options style() and styleref up to subview.setstyle
*/
program define set

	syntax [ , Text(string) X(string) Y(string) * ]

	if `"`text'"' != `""' {
		.text = `"`text'"'
	}

	if "`x'" != "" {
		confirm number `x'
		if "`.x.isa'" == "" {
			.Declare x = `x'
		}
		else	.x = `x'
	}
	if "`y'" != "" {
		confirm number `y'
		if "`.y.isa'" == "" {
			.Declare y = `y'
		}
		else	.y = `y'
	}

	.setstyle,  `options'
end


/* -------------------------------------------------------------------------*/
program define xsize

	if mod(`.style.angle.val'+90, 180) == 0 {
		class exit = `.style.size.gmval'
	}
	else	class exit = 0
end


/* -------------------------------------------------------------------------*/
program define ysize

	if mod(`.style.angle.val', 180) == 0 {
		class exit = `.style.size.gmval'
	}
	else	class exit = 0
end


/* -------------------------------------------------------------------------*/
/*
	Usage:  .draw [ , style_setgdi_options ]
*/
program define draw

	.style.setgdifull `0'
	gdi text 0`.x' 0`.y' `.text'

end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?