本文整理汇总了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
}
示例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;
}
示例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();
}
示例4: validate
void VisibleSelection::setBase(const VisiblePosition& visiblePosition)
{
Position oldBase = m_base;
m_base = visiblePosition.deepEquivalent();
validate();
if (m_base != oldBase)
didChange();
}
示例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");
}
示例6: willChange
void VTTCue::setRegionId(const String& regionId)
{
if (m_regionId == regionId)
return;
willChange();
m_regionId = regionId;
didChange();
}
示例7: willChange
void TextTrackCue::setId(const String& id)
{
if (m_id == id)
return;
willChange();
m_id = id;
didChange();
}
示例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;
}
示例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();
}
示例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();
}
示例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);
}
}