当前位置: 首页>>代码示例>>C++>>正文


C++ BView::UnlockLooper方法代码示例

本文整理汇总了C++中BView::UnlockLooper方法的典型用法代码示例。如果您正苦于以下问题:C++ BView::UnlockLooper方法的具体用法?C++ BView::UnlockLooper怎么用?C++ BView::UnlockLooper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BView的用法示例。


在下文中一共展示了BView::UnlockLooper方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: MessageReceived

void SetKeyWindow::MessageReceived(BMessage* msg){
	switch(msg->what){
	case SET:
		key = control1->GetKey();
		mod = control1->GetMod();
		key2 = control2->GetKey();
		mod2 = control2->GetMod();
		KeyBind.Install(menu, KeyBind.GetID(index), key, mod, key2, mod2, message);
		parent->LockLooper();
		parent->Pulse();
		parent->UnlockLooper();
		Quit();
		break;
	
	case CLEAR1:
		mod = key = 0;
		control1->SetBinding(key,mod);
		break;
		
	case CLEAR2:
		mod2 = key2 = 0;
		control2->SetBinding(key2,mod2);
		break;
		
	default:
		BWindow::MessageReceived(msg);
	}
}
开发者ID:HaikuArchives,项目名称:BeAE,代码行数:28,代码来源:PrefKeys.cpp

示例2: scaledBounds

status_t
MakeScreenshot(BBitmap **here)
{
	status_t err;
	BScreen bs;
	BWindow *win;
	BBitmap *shot;
	BBitmap *scaledBmp = NULL;
	be_app->Lock();
	win = be_app->WindowAt(0);
	if (win) {
		win->Lock();
		win->Hide();
		win->Unlock();
	}
	snooze(500000);
	err = bs.GetBitmap(&shot);
	if (!err) {
		BRect scaledBounds(0,0,640-1,480-1);
		scaledBmp = new BBitmap(scaledBounds, B_BITMAP_ACCEPTS_VIEWS, B_RGB32/*shot->ColorSpace()*/);
		err = scaledBmp->InitCheck();
		if (!err) {
			err = ENOSYS;
#ifdef B_ZETA_VERSION
			err = ScaleBitmap(*shot, *scaledBmp);
#endif
			if (err) {
				// filtered scaling didn't work, do it manually
				BView *v = new BView(scaledBounds, "scaleview", B_FOLLOW_NONE, 0);
				scaledBmp->AddChild(v);
				v->LockLooper();
				v->DrawBitmap(shot);
				v->Sync();
				v->UnlockLooper();
				scaledBmp->RemoveChild(v);
				delete v;
				err = B_OK;
			}
		}
		delete shot;
	}

	if (win) {
		win->Lock();
		win->Show();
		win->Unlock();
	}
	be_app->Unlock();
	
	if (err)
		return err;
	
	*here = scaledBmp;

	return B_OK;
}
开发者ID:HaikuArchives,项目名称:HaikuThemeManager,代码行数:56,代码来源:MakeScreenshot.cpp

示例3: focusDocumentView

void EventHandler::focusDocumentView()
{
    BView* view = m_frame->view()->platformWidget();
    if (view && view->LockLooperWithTimeout(5000) == B_OK) {
        view->MakeFocus(true);
        view->UnlockLooper();
    }

    Page* page = m_frame->page();
    if (page)
        page->focusController()->setFocusedFrame(m_frame);
}
开发者ID:UIKit0,项目名称:WebkitAIR,代码行数:12,代码来源:EventHandlerHaiku.cpp

示例4: BPoint

void
KeyboardLayoutView::Draw(BRect updateRect)
{
	if (fOldSize != BSize(Bounds().Width(), Bounds().Height())) {
		_InitOffscreen();
		_LayoutKeyboard();
	}

	BView* view;
	if (fOffscreenBitmap != NULL) {
		view = fOffscreenView;
		view->LockLooper();
	} else
		view = this;

	// Draw background

	if (Parent())
		view->SetLowColor(Parent()->ViewColor());
	else
		view->SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR));

	view->FillRect(updateRect, B_SOLID_LOW);

	// Draw keys

	for (int32 i = 0; i < fLayout->CountKeys(); i++) {
		Key* key = fLayout->KeyAt(i);

		_DrawKey(view, updateRect, key, _FrameFor(key),
			_IsKeyPressed(key->code));
	}

	// Draw LED indicators

	for (int32 i = 0; i < fLayout->CountIndicators(); i++) {
		Indicator* indicator = fLayout->IndicatorAt(i);

		_DrawIndicator(view, updateRect, indicator, _FrameFor(indicator->frame),
			(fModifiers & indicator->modifier) != 0);
	}

	if (fOffscreenBitmap != NULL) {
		view->Sync();
		view->UnlockLooper();

		DrawBitmapAsync(fOffscreenBitmap, BPoint(0, 0));
	}
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:49,代码来源:KeyboardLayoutView.cpp

示例5: InitNative

//-------------------------------------------------------------------------
void nsFilePicker::InitNative(nsIWidget *aParent,
                              const nsAString& aTitle,
                              PRInt16 aMode)
{
	mParentWindow = 0;

  BView *view = (BView *) aParent->GetNativeData(NS_NATIVE_WIDGET);
  if (view && view->LockLooper()) {
    mParentWindow = view->Window();
    view->UnlockLooper();
  }

	mTitle.Assign(aTitle);
	mMode = aMode;
}
开发者ID:fortunto2,项目名称:celtx,代码行数:16,代码来源:nsFilePicker.cpp

示例6: MessageReceived

void PrefWindow::MessageReceived(BMessage *message){
	BView *tmpV;
	int32 k;

	switch (message->what){
	case QUIT:
		Hide();
		break;
	
	case CHANGE_LANGUAGE:
		tmpV = ChildAt(0);
		if (tmpV != NULL){
			tmpV->RemoveSelf();
			delete tmpV;
		}
		BLayoutBuilder::Group<>(this)
		.AddGroup(B_VERTICAL, B_USE_DEFAULT_SPACING)
			.Add(new PrefView());
		break;
	
	case SET_FACTORY:
		k = (new BAlert(NULL,Language.get("FACTORY_SURE"),Language.get("APPLY"),Language.get("CANCEL")))->Go();
		if (k==0){
			Prefs.FactorySettings();
			KeyBind.InstallDefaults();
			tmpV = FindView("Prefs color");
			if (tmpV != NULL){
				PostMessage(COLOR_SELECT, tmpV);
			}
			tmpV = FindView("Prefs keys");
			if (tmpV != NULL){
				tmpV->LockLooper();
				tmpV->Pulse();
				tmpV->UnlockLooper();
			}else{
				be_app->PostMessage(CHANGE_LANGUAGE);
			}
			Pool.sample_view_dirty = true;	// update the sample-view
			Pool.update_draw_cache = true;	// update the draw cache
			Pool.update_index = true;		// update the index cache
			Pool.RedrawWindow();
		}
		break;

	default:
		BWindow::MessageReceived(message);
	}
}
开发者ID:HaikuArchives,项目名称:BeAE,代码行数:48,代码来源:PrefWindow.cpp

示例7: iuphaikuGetListView

BListView* iuphaikuGetListView(BView* view)
{
  // TODO maybe it is easier to get ScrollBar->Target ?
  BListView* listview = dynamic_cast<BListView*>(view);
  if(!listview)
  {
	BView* previous = view;
	previous->LockLooper();
	view = view->ChildAt(0);
	previous->UnlockLooper();
	while(view && !listview)
	{
      listview = dynamic_cast<BListView*>(view);
	  view = view->NextSibling();
	}
  }

  return listview;
}
开发者ID:DavidPhillipOster,项目名称:IupCocoa,代码行数:19,代码来源:iuphaiku_list.cpp

示例8: KeyBind

void
SetKeyWindow::MessageReceived(BMessage* msg)
{
	switch(msg->what) {
		case SET:
		{
			KeyBind* key = new KeyBind();
	
			key->key = control1->GetKey();
			key->mod = control1->GetMod();
			key->altKey = control2->GetKey();
			key->altMod = control2->GetMod();
			key->label = gKeyBind->GetLabel(index);
			key->message = MessageBuilder(message);
			key->isMenuItem = menu;
	
			gKeyBind->AddKeyBind(key);
	
			if (parent->LockLooper()) {
				parent->Pulse();
				parent->UnlockLooper();
			}
			Quit();
			break;
		}

		case CLEAR1:
			mod = key = 0;
			control1->SetBinding(key,mod);
			break;
			
		case CLEAR2:
			mod2 = key2 = 0;
			control2->SetBinding(key2,mod2);
			break;
			
		default:
			BWindow::MessageReceived(msg);
	}
}
开发者ID:ysei,项目名称:Faber,代码行数:40,代码来源:Keymap.cpp

示例9: DrawStatusBar

void wxStatusBarBeOS::DrawStatusBar()
{

	int i=0;
	int leftPos=0;
	wxArrayInt widthsAbs;
	wxString text;

	m_view->Clear();
	BRect bounds(m_view->bounds());
	BView * drawview = m_view->GetBack();
	if(drawview->LockLooper())
	{	
		rgb_color clr;
		drawview->PushState();
		clr = drawview->ViewColor();
		clr.red-=50; clr.green-=50; clr.blue-=50;
		drawview->SetHighColor(clr);
		drawview->StrokeLine(BPoint(bounds.left, bounds.top), BPoint(bounds.right, bounds.top));
		clr.red+=100; clr.green+=100; clr.blue+=100;
		drawview->SetHighColor(clr);
		drawview->StrokeLine(BPoint(bounds.left, bounds.top+1), BPoint(bounds.right, bounds.top+1));
		drawview->PopState();
		
		if(m_nFields>0)
			widthsAbs = CalculateAbsWidths(bounds.IntegerWidth() - 2*(m_nFields - 1));
		
		drawview->SetDrawingMode(B_OP_OVER);
		for(i=0;i<m_nFields;i++)
		{
			text = GetStatusBufferText(i);
			drawview->DrawString(text, BPoint(leftPos, bounds.bottom-2));
			leftPos+=widthsAbs[i]+2;
		}
		
		drawview->UnlockLooper();
	}
	m_view->flush();
}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:39,代码来源:statbrbeos.cpp

示例10: KeyBind

void
SetKeyWindow::MessageReceived(BMessage* msg)
{
	switch(msg->what) {
		case SET:
		{
			KeyBind* key = new KeyBind();
	
			key->key = control1->GetKey();
			key->mod = control1->GetMod();
			key->label = FaberShortcut::KeyBindAt(index)->label;
			key->message = FaberShortcut::KeyBindAt(index)->message;
			key->itemType = FaberShortcut::KeyBindAt(index)->itemType;
			
	
			FaberShortcut::AddKeyBind(key);
	
			if (parent->LockLooper()) {
				parent->Pulse();
				parent->UnlockLooper();
			}
			Quit();
			break;
		}

		case CLEAR1:
			mod = key = 0;
			control1->SetBinding(key,mod);
			break;
			
		case CLEAR2:
			mod2 = key2 = 0;
			control2->SetBinding(key2,mod2);
			break;
			
		default:
			BWindow::MessageReceived(msg);
	}
}
开发者ID:Barrett17,项目名称:Faber,代码行数:39,代码来源:Keymap.cpp


注:本文中的BView::UnlockLooper方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。