本文整理汇总了C++中AttributeList::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ AttributeList::clear方法的具体用法?C++ AttributeList::clear怎么用?C++ AttributeList::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AttributeList
的用法示例。
在下文中一共展示了AttributeList::clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
StandardIMInstance::imm_update_candidates_list (const IME_InputContext *ic,
const IME_CandidatesList *candidates)
{
if (ic && ic->id >= 0 && candidates) {
StandardIMInstance *inst = __global->find_instance (ic->id);
if (inst) {
inst->m_lookup_table.clear ();
if (candidates->nr_candidates > 0 && candidates->candidates) {
std::vector <WideString> labels;
AttributeList attrs;
WideString wstr;
if ((candidates->page_state & IME_FIRST_PAGE) == 0)
inst->m_lookup_table.append_candidate ((ucs4_t) 0x20);
for (int i = 0; i < candidates->nr_candidates; ++i) {
labels.push_back (inst->m_factory->convert_string (String (candidates->candidates [i].label)));
attrs.clear ();
for (int j = 0; j < candidates->candidates [i].content.nr_attributes; ++j)
attrs.push_back (convert_attribute (candidates->candidates [i].content.attributes [j]));
wstr = inst->m_factory->convert_string (String (candidates->candidates [i].content.string));
inst->m_lookup_table.append_candidate (wstr, attrs);
}
if ((candidates->page_state & IME_LAST_PAGE) == 0)
inst->m_lookup_table.append_candidate ((ucs4_t) 0x20);
if ((candidates->page_state & IME_FIRST_PAGE) == 0) {
inst->m_lookup_table.set_page_size (1);
inst->m_lookup_table.page_down ();
}
inst->m_lookup_table.set_page_size (candidates->nr_candidates);
inst->m_lookup_table.set_candidate_labels (labels);
if (candidates->focused_candidate >= 0 && candidates->focused_candidate < candidates->nr_candidates)
inst->m_lookup_table.set_cursor_pos_in_current_page (candidates->focused_candidate);
}
inst->update_lookup_table (inst->m_lookup_table);
}
}
}