本文整理汇总了C++中TBWidget::GetPrev方法的典型用法代码示例。如果您正苦于以下问题:C++ TBWidget::GetPrev方法的具体用法?C++ TBWidget::GetPrev怎么用?C++ TBWidget::GetPrev使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBWidget
的用法示例。
在下文中一共展示了TBWidget::GetPrev方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetParent
TBWindow *TBWindow::GetTopMostOtherWindow(bool only_activable_windows)
{
TBWindow *other_window = nullptr;
TBWidget *sibling = GetParent()->GetLastChild();
while (sibling && !other_window)
{
if (sibling != this)
other_window = TBSafeCast<TBWindow>(sibling);
if (only_activable_windows && other_window && !(other_window->m_settings & WINDOW_SETTINGS_CAN_ACTIVATE))
other_window = nullptr;
sibling = sibling->GetPrev();
}
return other_window;
}
示例2: ChangeValue
bool TBSelectList::ChangeValue(SPECIAL_KEY key)
{
if (!m_source || !m_layout.GetContentRoot()->GetFirstChild())
return false;
bool forward;
if (key == TB_KEY_HOME || key == TB_KEY_DOWN)
forward = true;
else if (key == TB_KEY_END || key == TB_KEY_UP)
forward = false;
else
return false;
TBWidget *item_root = m_layout.GetContentRoot();
TBWidget *current = GetItemWidget(m_value);
TBWidget *origin = nullptr;
if (key == TB_KEY_HOME || (!current && key == TB_KEY_DOWN))
current = item_root->GetFirstChild();
else if (key == TB_KEY_END || (!current && key == TB_KEY_UP))
current = item_root->GetLastChild();
else
origin = current;
while (current)
{
if (current != origin && !current->GetDisabled())
break;
current = forward ? current->GetNext() : current->GetPrev();
}
// Select and focus what we found
if (current)
{
SetValue(current->data.GetInt());
return true;
}
return false;
}