本文整理汇总了C++中dom::element::scroll_to_view方法的典型用法代码示例。如果您正苦于以下问题:C++ element::scroll_to_view方法的具体用法?C++ element::scroll_to_view怎么用?C++ element::scroll_to_view使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dom::element
的用法示例。
在下文中一共展示了element::scroll_to_view方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 )
{
// 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);
}
示例3: set_current_item
// set current item
virtual void set_current_item( const dom::element& ctl, dom::element& item )
{
// get previously expanded item:
dom::element prev = ctl.find_first(":expanded");
dom::element prev_current = ctl.find_first(":current");
if(prev_current != item && prev_current.is_valid())
prev_current.set_state(0, STATE_CURRENT);
if( prev == item )
{
prev.set_state(STATE_CURRENT | STATE_COLLAPSED);
}
else
{
if( prev.is_valid() )
prev.set_state(STATE_COLLAPSED); // collapse old one
item.set_state(STATE_CURRENT | STATE_EXPANDED); // set new expanded.
}
item.scroll_to_view();
}
示例4: 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);
}