查看单个帖子
旧 2009-05-06, 07:55 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】oddbmtext navigation

oddbmtext navigation
oddbmtext navigation
hello,
i'm trying to implement navigation through oddbmtext entity. say, user clicks somewhere inside mtext and i'd like to display caret there.
it's generally needed to calculate offset so to place caret before clicked character and not in the middle of it. i have trouble with such caret positioning, because i can't find methods those allow obtaining character's width or position in mtext. it seems, i only may obtain start and end points of mtext entity.
could someone, please, advise any algorithm for getting location of a definite character within oddbmtext entity?
hello gennadyv,
the mtext is complex object. the text size and font may be changed within mtext. try to see explodefragments() method. you may get the simple text fragments (possible it will be helpful). in any case there is no direct method for getting location of a definite haracter within oddbmtext entity.
best regards,
sergey z.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)