当前位置: 首页>>代码示例>>C++>>正文


C++ didChange函数代码示例

本文整理汇总了C++中didChange函数的典型用法代码示例。如果您正苦于以下问题:C++ didChange函数的具体用法?C++ didChange怎么用?C++ didChange使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了didChange函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: TEST

TEST(Account, shouldTriggerMemberObserverEvents) {
  // given
  Account acc;
  MockModelObserver obs(acc);

  {
    InSequence dummy;

    EXPECT_CALL(obs, willChange("name"));
    EXPECT_CALL(obs, didChange("name"));

    EXPECT_CALL(obs, willChange("descr"));
    EXPECT_CALL(obs, didChange("descr"));

    EXPECT_CALL(obs, willChange("type"));
    EXPECT_CALL(obs, didChange("type"));
  }

  // when
  acc.setName("A name");
  acc.setDescr("A descr");
  acc.setType(Account::AccountType::Asset);

  // then
  // mock expectations implicitly verified
}
开发者ID:opencash,项目名称:libopencash,代码行数:26,代码来源:AccountTest.cpp

示例2: GetName

wxString dlgRule::GetSql()
{
    wxString sql, name = GetName();


    if (!rule || didChange())
    {
        sql += wxT("CREATE OR REPLACE RULE ") + qtIdent(name)
               + wxT(" AS\n   ON ") + rbxEvent->GetStringSelection()
               + wxT(" TO ") + table->GetQuotedFullIdentifier();
        AppendIfFilled(sql, wxT("\n   WHERE ") , txtCondition->GetValue());

        sql += wxT("\n   DO ");

        if (chkDoInstead->GetValue())
            sql += wxT("INSTEAD ");

        if (txtSqlBox->GetTextLength())
        {
            sql += wxT("\n") + txtSqlBox->GetText().Strip(wxString::both);
            if (sql.Right(1) != wxT(";"))
                sql += wxT(";");
        }
        else
            sql += wxT("NOTHING;");

        sql += wxT("\n");
    }
    AppendComment(sql, wxT("RULE ") + qtIdent(name)
                  + wxT(" ON ") + table->GetQuotedFullIdentifier(), rule);
    return sql;
}
开发者ID:douglasresende,项目名称:pgadmin3,代码行数:32,代码来源:dlgRule.cpp

示例3: if

void VTTCue::setVertical(const String& value, ExceptionCode& ec)
{
    // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-vertical
    // On setting, the text track cue writing direction must be set to the value given 
    // in the first cell of the row in the table above whose second cell is a 
    // case-sensitive match for the new value, if any. If none of the values match, then
    // the user agent must instead throw a SyntaxError exception.
    
    WritingDirection direction = m_writingDirection;
    if (value == horizontalKeyword())
        direction = Horizontal;
    else if (value == verticalGrowingLeftKeyword())
        direction = VerticalGrowingLeft;
    else if (value == verticalGrowingRightKeyword())
        direction = VerticalGrowingRight;
    else
        ec = SYNTAX_ERR;
    
    if (direction == m_writingDirection)
        return;

    willChange();
    m_writingDirection = direction;
    didChange();
}
开发者ID:aosm,项目名称:WebCore,代码行数:25,代码来源:VTTCue.cpp

示例4: validate

void VisibleSelection::setBase(const VisiblePosition& visiblePosition)
{
    Position oldBase = m_base;
    m_base = visiblePosition.deepEquivalent();
    validate();
    if (m_base != oldBase)
        didChange();
}
开发者ID:darktears,项目名称:blink-crosswalk,代码行数:8,代码来源:VisibleSelection.cpp

示例5: willChange

  void Split::setTransaction(TransactionWeakPtr transaction) {
    if(_transaction.lock() == transaction.lock()) return;

    willChange("transaction");
    if(_transaction.lock()) _transaction.lock()->removeSplit(shared_from_this());
    _transaction = transaction;
    if(_transaction.lock()) _transaction.lock()->addSplit(shared_from_this());
    didChange("transaction");
  }
开发者ID:opencash,项目名称:libopencash,代码行数:9,代码来源:Split.cpp

示例6: willChange

void VTTCue::setRegionId(const String& regionId)
{
    if (m_regionId == regionId)
        return;

    willChange();
    m_regionId = regionId;
    didChange();
}
开发者ID:aosm,项目名称:WebCore,代码行数:9,代码来源:VTTCue.cpp

示例7: willChange

void TextTrackCue::setId(const String& id)
{
    if (m_id == id)
        return;

    willChange();
    m_id = id;
    didChange();
}
开发者ID:sailei1,项目名称:webkit,代码行数:9,代码来源:TextTrackCue.cpp

示例8: didChange

VisibleSelection& VisibleSelection::operator=(const VisibleSelection& other)
{
    didChange();

    m_base = other.m_base;
    m_extent = other.m_extent;
    m_start = other.m_start;
    m_end = other.m_end;
    m_affinity = other.m_affinity;
    m_changeObserver = nullptr;
    m_selectionType = other.m_selectionType;
    m_baseIsFirst = other.m_baseIsFirst;
    m_isDirectional = other.m_isDirectional;
    return *this;
}
开发者ID:darktears,项目名称:blink-crosswalk,代码行数:15,代码来源:VisibleSelection.cpp

示例9: ASSERT

// FIXME: This function breaks the invariant of this class.
// But because we use VisibleSelection to store values in editing commands for use when
// undoing the command, we need to be able to create a selection that while currently
// invalid, will be valid once the changes are undone. This is a design problem.
// To fix it we either need to change the invariants of VisibleSelection or create a new
// class for editing to use that can manipulate selections that are not currently valid.
void VisibleSelection::setWithoutValidation(const Position& base, const Position& extent)
{
    ASSERT(!base.isNull());
    ASSERT(!extent.isNull());
    ASSERT(m_affinity == DOWNSTREAM);
    m_base = base;
    m_extent = extent;
    m_baseIsFirst = comparePositions(base, extent) <= 0;
    if (m_baseIsFirst) {
        m_start = base;
        m_end = extent;
    } else {
        m_start = extent;
        m_end = base;
    }
    m_selectionType = base == extent ? CaretSelection : RangeSelection;
    didChange();
}
开发者ID:darktears,项目名称:blink-crosswalk,代码行数:24,代码来源:VisibleSelection.cpp

示例10: makeSearchRange

void VisibleSelection::appendTrailingWhitespace()
{
    RefPtrWillBeRawPtr<Range> searchRange = makeSearchRange(m_end);
    if (!searchRange)
        return;

    CharacterIterator charIt(searchRange.get(), TextIteratorEmitsCharactersBetweenAllVisiblePositions);
    bool changed = false;

    for (; charIt.length(); charIt.advance(1)) {
        UChar c = charIt.characterAt(0);
        if ((!isSpaceOrNewline(c) && c != noBreakSpace) || c == '\n')
            break;
        m_end = charIt.range()->endPosition();
        changed = true;
    }
    if (changed)
        didChange();
}
开发者ID:darktears,项目名称:blink-crosswalk,代码行数:19,代码来源:VisibleSelection.cpp

示例11: EnableOK

void dlgRule::CheckChange()
{
    if (rule)
    {
        EnableOK(didChange() || txtSqlBox->GetText() != oldDefinition || txtComment->GetValue() != rule->GetComment());
    }
    else
    {
        wxString name = GetName();

        bool enable = true;

        CheckValid(enable, !name.IsEmpty(), _("Please specify name."));
        CheckValid(enable, rbxEvent->GetSelection() >= 0,
                   _("Please select at an event."));
        CheckValid(enable, !txtSqlBox->GetTextLength() || txtSqlBox->GetTextLength() > 6 , _("Please enter function definition."));

        EnableOK(enable);
    }
}
开发者ID:douglasresende,项目名称:pgadmin3,代码行数:20,代码来源:dlgRule.cpp


注:本文中的didChange函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。