Пример #1
0
KstGfxLineMouseHandler::KstGfxLineMouseHandler()
: KstGfxMouseHandler() {
  // initial default settings before any sticky settings
  KstViewLinePtr defaultLine = new KstViewLine;
  defaultLine->setWidth(2);
  defaultLine->setPenStyle(Qt::SolidLine);
  defaultLine->setForegroundColor(Qt::black);
  _defaultObject = KstViewObjectPtr(defaultLine);
}  
Пример #2
0
void KstBindLine::setWidth(KJS::ExecState *exec, const KJS::Value& value) {
  unsigned w = 0;
  if (value.type() != KJS::NumberType || !value.toUInt32(w)) {
    return createPropertyTypeError(exec);
  }
  KstViewLinePtr d = makeLine(_d);
  if (d) {
    KstWriteLocker wl(d);
    d->setWidth(w);
    KstApp::inst()->paintAll(KstPainter::P_PAINT);
  }
}
Пример #3
0
void KstBindLine::setWidth(KJS::ExecState *exec, const KJS::Value& value) {
  unsigned w = 0;
  if (value.type() != KJS::NumberType || !value.toUInt32(w)) {
    KJS::Object eobj = KJS::Error::create(exec, KJS::TypeError);
    exec->setException(eobj);
    return;
  }
  KstViewLinePtr d = makeLine(_d);
  if (d) {
    KstWriteLocker wl(d);
    d->setWidth(w);
    KstApp::inst()->paintAll(KstPainter::P_PAINT);
  }
}