void EscDraw::DrawSmartText(EscEscape& e) { if(e.GetCount() < 3 || e.GetCount() > 7) e.ThrowError("wrong number of arguments in call to 'DrawSmartText'"); int x = e.Int(0); int y = e.Int(1); int ii = 2; String text; if(ii < e.GetCount() && e[ii].IsArray()) text = ToUtf8((WString)e[ii++]); int accesskey = ExtractAccessKey(text, text); Font font = StdFont().Height(11); if(ii < e.GetCount()) font = FontEsc(e[ii++]); if(font.GetHeight() == 0) #ifdef GUI_X11 font.Height(12); #else font.Height(11); #endif Color color = SColorText; if(ii < e.GetCount()) color = ColorEsc(e[ii++]); int cx = INT_MAX; if(ii < e.GetCount()) cx = e.Int(ii++); ::DrawSmartText(w, x, y, cx, text, font, color, accesskey); }
void EscDraw::DrawText(EscEscape& e) { if(e.GetCount() < 3 || e.GetCount() > 6) e.ThrowError("wrong number of arguments in call to 'DrawText'"); int x = e.Int(0); int y = e.Int(1); Font font = StdFont(); Color color = SColorText; if(e[2].IsInt()) { int z = e.Int(2); e.CheckArray(3); WString text = e[3]; if(e.GetCount() > 4) font = FontEsc(e[4]); if(e.GetCount() > 5) color = ColorEsc(e[5]); w.DrawText(x, y, z, text, Nvl(font, StdFont()), color); } else { e.CheckArray(2); WString text = e[2]; if(e.GetCount() > 3) font = FontEsc(e[3]); if(e.GetCount() > 4) color = ColorEsc(e[4]); w.DrawText(x, y, text, Nvl(font, StdFont()), color); } }
void SIC_GetQtfHeight(EscEscape& e) { int zoom = e.Int(0); e.CheckArray(0); String text = e[1]; int cx = e.Int(2); RichText doc; doc = ParseQTF(text);//!!!!! e = doc.GetHeight(Zoom(zoom, 1024), cx); }
void EscDraw::DrawRect(EscEscape& e) { if(e.GetCount() == 2) w.DrawRect(RectEsc(e[0]), ColorEsc(e[1])); else if(e.GetCount() == 5) w.DrawRect(e.Int(0), e.Int(1), e.Int(2), e.Int(3), ColorEsc(e[4])); else e.ThrowError("wrong number of arguments in call to 'DrawRect'"); }
void EscDraw::DrawQtf(EscEscape& e) { if(e.GetCount() < 5 || e.GetCount() > 6) e.ThrowError("wrong number of arguments in call to 'DrawQtf'"); // int zoom = e.Int(0); int x = e.Int(1); int y = e.Int(2); e.CheckArray(3); WString text = e[3]; int cx = e.Int(4); String txt = '\1' + ToUtf8(text); ::DrawSmartText(w, x, y, cx, txt, StdFont(), SColorText, 0); }
void SIC_StdFont(EscEscape& e) { if(e.GetCount() == 1) e = EscFont(StdFont()(Zy(e.Int(0)))); else e = EscFont(StdFont()); }
void EscDraw::DrawLine(EscEscape& e) { if(e.GetCount() == 4) w.DrawLine(PointEsc(e[0]), PointEsc(e[1]), e.Int(2), ColorEsc(e[3])); else if(e.GetCount() == 6) w.DrawLine(e.Int(0), e.Int(1), e.Int(2), e.Int(3), e.Int(4), ColorEsc(e[5])); else e.ThrowError("wrong number of arguments in call to 'DrawLine'"); }
void EscDraw::DrawImageColor(EscEscape& e) { int cnt = e.GetCount(); if(cnt != 4 && cnt != 5 && cnt != 7) e.ThrowError("wrong number of arguments in call to 'DrawImageColor'"); Image img = Colorize(GetUscImage((String)e[cnt - 3]), ColorEsc(e[cnt - 2]), e.Int(cnt - 1)); if(cnt == 4) w.DrawImage(RectEsc(e[0]), img); else if(cnt == 5) w.DrawImage(e.Int(0), e.Int(1), img); else if(cnt == 7) w.DrawImage(e.Int(0), e.Int(1), e.Int(2), e.Int(3), img); }
void EscDraw::DrawImage(EscEscape& e) { int cnt = e.GetCount(); if(cnt == 2) w.DrawImage(RectEsc(e[0]), GetUscImage((String)e[1])); else if(cnt == 3) w.DrawImage(e.Int(0), e.Int(1), GetUscImage((String)e[2])); else if(cnt == 5) w.DrawImage(e.Int(0), e.Int(1), e.Int(2), e.Int(3), GetUscImage((String)e[4])); else e.ThrowError("wrong number of arguments in call to 'DrawImage'"); }
void SIC_Courier(EscEscape& e) { e = EscFont(Courier(Zy(e.Int(0)))); }
void SIC_Roman(EscEscape& e) { e = EscFont(Roman(Zy(e.Int(0)))); }
void SIC_Arial(EscEscape& e) { e = EscFont(Arial(Zy(e.Int(0)))); }
void Height(EscEscape& e) { e = EscFont(FontEsc(e.self).Height(e.Int(0))); }