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


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

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


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

示例3: 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

示例4: 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

示例5: settings

void
NetPulseView::MessageReceived(BMessage* message)
{
	if (message->what == kMsgUpdate) {
		Update();
		Draw(Bounds());
	} else if (message->what == kMsgQuit) {
		SettingsFile settings("Settings", "NetPulse");
		settings.AddInt32("Interface", fCookie);
		settings.AddInt32("InputColor", *((int32 *) &fInputColor));
		settings.AddInt32("OutputColor", *((int32 *) &fOutputColor));
		settings.AddFloat("DecayRate", fDecayRate);
		settings.AddInt64("UpdateInterval", fUpdateInterval);
		settings.Save();

		BDeskbar deskbar;
		deskbar.RemoveItem(Name());
	} else if (message->what == kMsgConnect) {
		if (fCookie != 0) {
			BNetworkInterface interface(fCookie);
			interface.SetFlags(interface.Flags() & IFF_UP);
		}
	} else if (message->what == kMsgDisconnect) {
		if (fCookie != 0) {
			BNetworkInterface interface(fCookie);
			interface.SetFlags(interface.Flags() & ~IFF_UP);
		}
	} else if (message->what >= kMsgChangeInterface + 1
		&& message->what <= kMsgChangeInterface + 1000) {
		fCookie = message->what - kMsgChangeInterface;
		fInputRate = fOutputRate = 0;
		fMaxInputRate = fMaxOutputRate = 0;

		BNetworkInterface interface(fCookie);
		ifreq_stats stats;
		if (interface.GetStats(stats) == B_OK) {
			fInputBytes = stats.receive.bytes;
			fOutputBytes = stats.send.bytes;
		}

		Update();

		if (fMessenger != NULL) {
			BMessage message(kMsgChangeInterface);
			message.AddInt32("interface_index", fCookie);
			if (fMessenger->SendMessage(&message) != B_OK)
				fMessenger = NULL;
		}
		SettingsFile settings("Settings", "NetPulse");
		settings.AddInt32("Interface", fCookie);
		settings.AddInt32("InputColor", *((int32 *) &fInputColor));
		settings.AddInt32("OutputColor", *((int32 *) &fOutputColor));
		settings.AddFloat("DecayRate", fDecayRate);
		settings.AddInt64("UpdateInterval", fUpdateInterval);
		settings.Save();
		
	} else if (message->what == kMsgStatistics) {
		if (fMessenger == NULL || !fMessenger->IsValid()) {
			BRect frame(BScreen().Frame());
			BWindow* window = new BWindow(
				BRect(frame.right - kViewWidth - 20, frame.top + 60,
					frame.right - 20 - 1, frame.top + 60 + kViewHeight - 1),
				"Statistics", B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
					B_NOT_ZOOMABLE | B_NOT_RESIZABLE
						| B_AUTO_UPDATE_SIZE_LIMITS);
			BView* view = new NetPulseStatsView("Statistics", fCookie);
			view->Pulse();
			BLayoutBuilder::Group<>(window, B_VERTICAL)
				.Add(view)
				.End();
			window->SetPulseRate(1000000LL);
			window->Show();
			fMessenger = new BMessenger(view);
		}
	} else
		BView::MessageReceived(message);
}
开发者ID:HaikuArchives,项目名称:NetPulse,代码行数:77,代码来源:NetPulseView.cpp


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