コード例 #1
0
ファイル: PlannerCalendar.C プロジェクト: AlexanderKotliar/wt
PlannerCalendar::PlannerCalendar(dbo::ptr<UserAccount> user)
  : WCalendar(),
    user_(user)
{
  setStyleClass(styleClass() + " calendar");
  
  setSelectionMode(SelectionMode::None);
}
コード例 #2
0
ファイル: Widget.C プロジェクト: ReWeb3D/wt
void Widget::createConfig(std::ostream& config)
{ 
  Container *c = dynamic_cast<Container *>(parent());

  config << ",id:'" << extId() << "'";

  if (applySelfCss()) {
    if (!styleClass().empty())
      config << ",cls:'" << styleClass().toUTF8() << "'";

    std::string cssStyle = inlineCssStyle();

    if (!cssStyle.empty())
      config << ",style:'" << cssStyle << "'";
  }

  if (c)
    c->addLayoutConfig(this, config);
}
コード例 #3
0
ファイル: WAnchor.C プロジェクト: bvanhauwaert/wt
void WAnchor::updateDom(DomElement& element, bool all)
{
  if (element.type() != DomElement_A) {
    WContainerWidget::updateDom(element, all);
    return;
  }

  if (flags_.test(BIT_CHANGE_TAG)) {
    if (!all)
      element.callJavaScript(WT_CLASS ".changeTag(" + jsRef() + ",'a');");

    flags_.reset(BIT_CHANGE_TAG);
  }

  bool needsUrlResolution = false;

  if (flags_.test(BIT_LINK_CHANGED) || all) {
    WApplication *app = WApplication::instance();

    std::string url = link_.resolveUrl(app);

    /*
     * From 但浩亮: setRefInternalPath() and setTarget(TargetNewWindow)
     * does not work without the check below:
     */
    if (target_ == TargetSelf)
      changeInternalPathJS_
	= link_.manageInternalPathChange(app, this, changeInternalPathJS_);
    else {
      delete changeInternalPathJS_;
      changeInternalPathJS_ = 0;
    }

    url = app->encodeUntrustedUrl(url);

    std::string href = resolveRelativeUrl(url);
    element.setAttribute("href", href);

    needsUrlResolution = !app->environment().hashInternalPaths()
      && href.find("://") == std::string::npos && href[0] != '/';

    flags_.reset(BIT_LINK_CHANGED);
  }

  if (flags_.test(BIT_TARGET_CHANGED) || all) {
    switch (target_) {
    case TargetSelf:
      if (!all)
	element.setProperty(PropertyTarget, "_self");
      break;
    case TargetThisWindow:
      element.setProperty(PropertyTarget, "_top");
      break;
    case TargetNewWindow:
      element.setProperty(PropertyTarget, "_blank");
    }
    flags_.reset(BIT_TARGET_CHANGED);
  }

  WContainerWidget::updateDom(element, all);

  if (needsUrlResolution) {
    if (all)
      element.setProperty(PropertyClass,
			  Utils::addWord(styleClass().toUTF8(), "Wt-rr"));
    else
      element.callJavaScript("$('#" + id() + "').addClass('Wt-rr');");
  }
}
コード例 #4
0
ファイル: WNavigationBar.C プロジェクト: DTidd/wt
 bool isBootstrap2Responsive() const {
   return styleClass().toUTF8().find("nav-collapse") != std::string::npos;
 }