本文整理汇总了C++中BLooper::UnlockLooper方法的典型用法代码示例。如果您正苦于以下问题:C++ BLooper::UnlockLooper方法的具体用法?C++ BLooper::UnlockLooper怎么用?C++ BLooper::UnlockLooper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLooper
的用法示例。
在下文中一共展示了BLooper::UnlockLooper方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/*! \brief Adds the handler to window's looper
*/
void CalendarModulePreferencesView::AttachedToWindow()
{
BLooper* looper = this->Looper();
if ( looper && looper->LockLooper() )
{
looper->AddHandler( ( BHandler* )this );
looper->UnlockLooper();
}
UpdateTargetting(); // Updates targets of all contents
BView::AttachedToWindow();
// Fill the rest of the interface
this->Looper()->PostMessage( calendarModules->FindMarked()->Message(), this );
} // <-- end of CalendarModulePreferencesView::AttachedToWindow()
示例2:
/*! \brief Setting the view as preferred handler
*/
void CategoryPreferencesView::AttachedToWindow( void )
{
BLooper* looper = this->Looper();
if ( looper && looper->LockLooper() )
{
looper->AddHandler( ( BHandler* )this );
looper->UnlockLooper();
}
addButton->SetTarget( this );
editButton->SetTarget( this );
listView->SetTarget( this );
for ( int i = 0; i < listMenu->CountItems(); ++i )
{
( listMenu->ItemAt( i ) )->SetTarget( this );
}
BView::AttachedToWindow();
} // <-- end of function CategoryPreferencesView::AttachedToWindow
示例3: AttachedToWindow
/*!
\brief Sets up the view color and calls this view's children.
*/
void CalendarControl::AttachedToWindow() {
// Get the view color of the father
if ( Parent() ) {
SetViewColor( Parent()->ViewColor() );
}
// Attach to window both current view and all of its children
BControl::AttachedToWindow();
// This view should respond to the messages - thus the Looper must know it
BLooper* looper = ( BLooper* )Looper();
if ( looper && looper->LockLooper() ) {
looper->AddHandler( ( BHandler* )this );
looper->UnlockLooper();
}
UpdateTargets( fDateSelector );
this->InvalidateLayout();
this->Relayout();
this->Invalidate();
}
示例4: r
/*! \brief Constructor of CategoryPreferencesView
* \details It's a descendant of BView.
* \param[in] frame The frame rectangle of the view.
*/
CategoryPreferencesView::CategoryPreferencesView( BRect frame )
:
BView( frame,
"Category Preferences",
B_FOLLOW_ALL_SIDES,
B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE )
{
BLayoutItem* layoutItem = NULL;
BMessage* toSend = NULL;
menuField = NULL;
this->SetViewColor( ui_color( B_PANEL_BACKGROUND_COLOR ) );
/*! \note Layout of the view
* The view has a grid layout. It's arranged in the following way:
* 1) Left column - list of Categories (CategoryList) that
* contains all categories currently available.
* 2) Right column - three buttons, from top to bottom:
* 2a) Edit currently selected category - guess what it's doing
* 2b) Add a new category
* 2c) Merge a current directory into another one + menu with
* all categories. The category selected in the list is disabled.
* \note Restrictions:
* a) The list of categories is scrolled.
* b) If no category is selected, then
* i) "Edit" button is disabled
* ii) "Merge to" field is disabled
*
*/
BGridLayout* gridLayout = new BGridLayout();
if ( !gridLayout )
{
/* Panic! */
exit( 1 );
}
// Margins from the sides of the view and spacing between the elements
gridLayout->SetInsets( 5, 5, 5, 5 );
gridLayout->SetHorizontalSpacing( 10 );
gridLayout->SetVerticalSpacing( 10 );
this->SetLayout( gridLayout );
gridLayout->SetExplicitAlignment( BAlignment( B_ALIGN_USE_FULL_WIDTH, B_ALIGN_USE_FULL_HEIGHT ) );
gridLayout->SetExplicitMinSize( BSize( (this->Bounds()).Width(), (this->Bounds()).Height() ) );
BRect rect = gridLayout->Frame();
printf ( "The frame is %d pixels wide and %d pixels high.\n",
(int )rect.Width(),
(int )rect.Height() );
/* Creating the CategoryListView with its scroller */
BRect r( this->Bounds() );
r.InsetBySelf( 5, 10 ); // Margins near the border of the view
r.right = (int)(r.right / 2) - B_V_SCROLL_BAR_WIDTH;
r.bottom -= 0;
listView = new CategoryListView( r, "List View" );
if ( ! listView ) {
/* Panic! */
exit( 1 );
}
BLooper* looper = this->Looper();
if ( looper && looper->LockLooper() )
{
looper->AddHandler( ( BHandler* )this );
looper->UnlockLooper();
}
scroller = new BScrollView( "Scroller",
listView,
B_FOLLOW_LEFT | B_FOLLOW_TOP,
0, // Flags
true,
true );
if ( !scroller )
{
/* Panic! */
exit( 1 );
}
layoutItem = gridLayout->AddView( scroller, 0, 0, 1, 3 );
if ( !layoutItem ) {
/* Panic! */
exit( 1 );
}
layoutItem->SetExplicitAlignment( BAlignment( B_ALIGN_LEFT,
B_ALIGN_USE_FULL_HEIGHT ) );
toSend = new BMessage( kCategoryInvoked );
if ( !toSend )
{
/* Panic! */
exit( 1 );
}
listView->SetInvocationMessage( toSend );
toSend = new BMessage( kCategorySelected );
if ( !toSend )
{
//.........这里部分代码省略.........