本文整理汇总了C++中ToolBar::Updated方法的典型用法代码示例。如果您正苦于以下问题:C++ ToolBar::Updated方法的具体用法?C++ ToolBar::Updated怎么用?C++ ToolBar::Updated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ToolBar
的用法示例。
在下文中一共展示了ToolBar::Updated方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMotion
void ToolBarResizer::OnMotion( wxMouseEvent & event )
{
// Go ahead and set the event to propagate
event.Skip();
// Retrieve the mouse position
wxPoint raw_pos = event.GetPosition();
wxPoint pos = ClientToScreen( raw_pos );
if( event.Dragging() )
{
wxRect r = mBar->GetRect();
wxSize msz = mBar->GetMinSize();
wxSize psz = mBar->GetParent()->GetClientSize();
// Adjust the size by the difference between the
// last mouse and current mouse positions.
r.width += ( pos.x - mResizeStart.x );
// Constrain
if( r.width < msz.x )
{
// Don't allow resizing to go too small
r.width = msz.x;
}
else if( r.GetRight() > psz.x - 3 )
{
// Don't allow resizing to go too large
//
// The 3 magic pixels are because I'm too chicken to change the
// calculations in ToolDock::LayoutToolBars() even though I'm
// the one that set them up. :-)
r.SetRight( psz.x - 3 );
}
else
{
// Remember for next go round
mResizeStart = pos;
}
// Resize the bar
mBar->SetSize( r.GetSize() );
// Tell everyone we've changed sizes
mBar->Updated();
// Refresh our world
mBar->GetParent()->Refresh();
mBar->GetParent()->Update();
}
}