本文整理汇总了C++中Params::change_callback方法的典型用法代码示例。如果您正苦于以下问题:C++ Params::change_callback方法的具体用法?C++ Params::change_callback怎么用?C++ Params::change_callback使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Params
的用法示例。
在下文中一共展示了Params::change_callback方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: up_btn
LLScrollbar::LLScrollbar(const Params & p)
: LLUICtrl(p),
mChangeCallback( p.change_callback() ),
mOrientation( p.orientation ),
mDocSize( p.doc_size ),
mDocPos( p.doc_pos ),
mPageSize( p.page_size ),
mStepSize( p.step_size ),
mDocChanged(FALSE),
mDragStartX( 0 ),
mDragStartY( 0 ),
mHoverGlowStrength(0.15f),
mCurGlowStrength(0.f),
mTrackColor( p.track_color() ),
mThumbColor ( p.thumb_color() ),
mThumbImageV(p.thumb_image_vertical),
mThumbImageH(p.thumb_image_horizontal),
mTrackImageV(p.track_image_vertical),
mTrackImageH(p.track_image_horizontal),
mThickness(p.thickness.isProvided() ? p.thickness : LLUI::sSettingGroups["config"]->getS32("UIScrollbarSize")),
mBGVisible(p.bg_visible),
mBGColor(p.bg_color)
{
updateThumbRect();
// Page up and page down buttons
LLRect line_up_rect;
LLRect line_down_rect;
if( VERTICAL == mOrientation )
{
line_up_rect.setLeftTopAndSize( 0, getRect().getHeight(), mThickness, mThickness );
line_down_rect.setOriginAndSize( 0, 0, mThickness, mThickness );
}
else // HORIZONTAL
{
line_up_rect.setOriginAndSize( 0, 0, mThickness, mThickness );
line_down_rect.setOriginAndSize( getRect().getWidth() - mThickness, 0, mThickness, mThickness );
}
LLButton::Params up_btn(mOrientation == VERTICAL ? p.up_button : p.left_button);
up_btn.name(std::string("Line Up"));
up_btn.rect(line_up_rect);
up_btn.click_callback.function(boost::bind(&LLScrollbar::onLineUpBtnPressed, this, _2));
up_btn.mouse_held_callback.function(boost::bind(&LLScrollbar::onLineUpBtnPressed, this, _2));
up_btn.tab_stop(false);
up_btn.follows.flags = (mOrientation == VERTICAL ? (FOLLOWS_RIGHT | FOLLOWS_TOP) : (FOLLOWS_LEFT | FOLLOWS_BOTTOM));
addChild(LLUICtrlFactory::create<LLButton>(up_btn));
LLButton::Params down_btn(mOrientation == VERTICAL ? p.down_button : p.right_button);
down_btn.name(std::string("Line Down"));
down_btn.rect(line_down_rect);
down_btn.follows.flags(FOLLOWS_RIGHT|FOLLOWS_BOTTOM);
down_btn.click_callback.function(boost::bind(&LLScrollbar::onLineDownBtnPressed, this, _2));
down_btn.mouse_held_callback.function(boost::bind(&LLScrollbar::onLineDownBtnPressed, this, _2));
down_btn.tab_stop(false);
addChild(LLUICtrlFactory::create<LLButton>(down_btn));
}