Exemplo n.º 1
0
  public Thing cget(Interp ip, Object target, String optname) throws HeclException {
    HeclCanvas c = (HeclCanvas) target;

    if (optname.equals(WidgetInfo.NWIDTH)) return IntThing.create(c.getWidth());
    if (optname.equals("-drawwidth")) return IntThing.create(c.getDrawWidth());
    if (optname.equals(WidgetInfo.NHEIGHT)) return IntThing.create(c.getHeight());
    if (optname.equals("-drawheight")) return IntThing.create(c.getDrawHeight());
    if (optname.equals("-fullwidth")) return IntThing.create(c.getFullWidth());
    if (optname.equals("-fullheight")) return IntThing.create(c.getFullHeight());
    if (optname.equals("-fullscreen")) return IntThing.create(c.getFullScreenMode());
    if (optname.equals("-doublebuffered")) return IntThing.create(c.isDoubleBuffered());
    if (optname.equals("-pointerevents")) return IntThing.create(c.hasPointerEvents());
    if (optname.equals("-pointermotionevents")) return IntThing.create(c.hasPointerMotionEvents());
    if (optname.equals("-repeatevents")) return IntThing.create(c.hasRepeatEvents());
    if (optname.equals("-autoflush")) return IntThing.create(c.getAutoFlushMode());
    if (optname.equals("-cmdbg")) return WidgetInfo.fromColor(c.getCmdBgColor());
    if (optname.equals("-cmdfg")) return WidgetInfo.fromColor(c.getCmdFgColor());
    // #ifdef notdef
    GraphicsCmd gcmd = c.getGraphicsCmd();
    if (gcmd != null) {
      return gcmd.cget(ip, target, optname);
    }
    // #endif
    return super.cget(ip, target, optname);
  }