本文整理汇总了C++中dom::element::index方法的典型用法代码示例。如果您正苦于以下问题:C++ element::index方法的具体用法?C++ element::index怎么用?C++ element::index使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dom::element
的用法示例。
在下文中一共展示了element::index方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: set_current_row
/** set current row **/
void set_current_row( dom::element& table, dom::element& row, UINT keyboardStates, bool dblClick = false )
{
if(is_multiple(table))
{
if (keyboardStates & SHIFT_KEY_PRESSED)
{
checkall(table, false);
check_range(table,row.index(),TRUE); // from current to new
}
else
{
if (keyboardStates & CONTROL_KEY_PRESSED)
set_checked_row (table,row, true); // toggle
else
checkall(table, false);
set_anchor(table,row.index ());
}
}
// get previously selected row:
dom::element prev = get_current_row( table );
if( prev.is_valid() )
{
if( prev != row )
prev.set_state(0,STATE_CURRENT, false); // drop state flags
}
row.set_state(STATE_CURRENT); // set state flags
row.scroll_to_view();
::UpdateWindow(row.get_element_hwnd(false));
table.post_event( dblClick? TABLE_ROW_DBL_CLICK:TABLE_ROW_CLICK, row.index(), row);
}
示例2: set_current_row
/** set current row **/
void set_current_row( dom::element& table, dom::element& row, UINT keyboardStates, bool dblClick = false, bool smooth = false )
{
// get previously selected row:
dom::element prev = get_current_row( table );
uint new_row_checked = STATE_CHECKED;
uint old_row_checked = STATE_CHECKED;
if(is_multiple(table))
{
if (keyboardStates & SHIFT_KEY_PRESSED)
{
checkall(table, false);
check_range(table,row.index(),TRUE); // from current to new
}
else
{
if (keyboardStates & CONTROL_KEY_PRESSED)
{
set_checked_row (table,row, true); // toggle
new_row_checked = 0;
}
else
checkall(table, false);
set_anchor(table,row.index ());
}
old_row_checked = 0;
}
if( prev.is_valid() )
{
if( prev != row )
prev.set_state(0,STATE_CURRENT | old_row_checked); // drop state flags
}
row.set_state(STATE_CURRENT | new_row_checked); // set state flags
row.scroll_to_view(false,smooth);
//::UpdateWindow(row.get_element_hwnd(false));
table.post_event( dblClick? TABLE_ROW_DBL_CLICK:TABLE_ROW_CLICK, row.index(), row);
table.post_event(WY_GRID_VERTICAL_SCROLL, 0);
}
示例3: set_current_row
/** set current row **/
void set_current_row( dom::element& table, dom::element& row, UINT keyboardStates, bool dblClick = false )
{
// get previously selected row:
dom::element prev = get_current_row( table );
if( prev.is_valid() )
{
if( prev != row )
prev.set_state(0,STATE_CURRENT, false); // drop state flags
}
row.set_state(STATE_CURRENT); // set state flags
row.scroll_to_view();
table.post_event( dblClick? TABLE_ROW_DBL_CLICK:TABLE_ROW_CLICK, row.index(), row);
}
示例4: on_column_click
virtual void on_column_click( dom::element& table, dom::element& header_cell )
{
super::on_column_click( table, header_cell );
dom::element current = table.find_first("th:checked");
if( current == header_cell )
return; // already here, nothing to do.
if( current.is_valid() )
current.set_state(0, STATE_CHECKED);
header_cell.set_state(STATE_CHECKED);
dom::element ctr = get_current_row( table );
sort_rows( table, header_cell.index() );
if( ctr.is_valid() )
ctr.scroll_to_view();
}
示例5: select_next_option
BOOL select_next_option( dom::element& option )
{
dom::element next = option.next_sibling();
if( !next.is_valid() )
goto ADD_NEW;
if( !aux::streq(next.get_element_type(),"option") )
goto ADD_NEW;
next.set_state(STATE_FOCUS);
return TRUE;
ADD_NEW:
std::wstring text = option.text();
if(text.empty() || text == L" ")
{
::MessageBeep(MB_ICONEXCLAMATION);
return FALSE;
}
dom::element select = option.parent();
next = dom::element::create("option", L" ");
select.insert(next,option.index()+1);
select.update();
next.set_state(STATE_FOCUS);
return TRUE;
}