Пример #1
0
void
BeNetWindow::MessageReceived(BMessage* msg)
{
	switch (msg->what)
	{
		case MSG_SOUNDCONTROLS_VOLUME:
			Preferences::Instance()->RecordVolume(m_pSoundControlsView->Volume());
			m_pRecorder->SetRecVolume(((float)Preferences::Instance()->RecordVolume()/(float)100));
			break;
		case MSG_SOUNDCONTROLS_MUTE:
			if(m_pSoundControlsView->IsMute())
				m_pRecorder->StopRecording();
			else
//				m_pRecorder->Record();
				m_pRecorder->StartRecording();
			break;
		case MSG_MENU_EXIT:				// QuitRequested(); OliverESP: This will make be called twice in Zeta hmmmmmmm
										be_app_messenger.SendMessage(B_QUIT_REQUESTED);
										break;
		case MSG_MENU_TOOLBAR:			ToggleToolBar(); break; 
		case MSG_MENU_STATUSBAR:		ToggleStatusBar(); break; 
		case MSG_MENU_ABOUT:			ShowWindow(m_pAboutWindow); break;
		case MSG_MENU_OUTPUTWINDOW:		ShowWindow(Output::Instance()); break; 
		case MSG_MENU_PREFERENCES:		ShowWindow(m_pPreferencesWindow); break; 
		//case MSG_MENU_BOOKMARKS:		ShowWindow(m_pBookmarksWindow); break; 
		case MSG_MENU_MAILIP:			ShowMailIPWindow(); break; 
		case MSG_MENU_HELP:				LaunchHelp(); break; 
		case MENU_BOOKMARKS:			m_pConnectView->MessageReceived(msg); break;
		case MSG_MENU_CONNECT:			Connect(); break;
		case MSG_MENU_ACCEPT:			Accept(); break;
		case MSG_MENU_DISCONNECT:		Disconnect(); break; 
		case MSG_MENU_TERMINATE:		Terminate(); break; 
		case MSG_MENU_ONLINE:			GoOnline(); break; 
		case MSG_MENU_OFFLINE:			GoOffline(); break;
		
		case MSG_NOT_CONNECTED:			ToggleConection(false); // we receive this from the connectionView and this from the network 
										EnableActions(true);
										break; //OliverESP
		
		default:						BWindow::MessageReceived(msg); break;	 
	}
}
Пример #2
0
void HelpPlugin::OnFindItem(wxCommandEvent &event)
{
  wxString text; // save here the word to lookup... if any
  cbEditor *ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();

  if (ed)
  {
    cbStyledTextCtrl *control = ed->GetControl();
    text = control->GetSelectedText();

    if (text.IsEmpty())
    {
      int origPos = control->GetCurrentPos();
      int start = control->WordStartPosition(origPos, true);
      int end = control->WordEndPosition(origPos, true);
      text = control->GetTextRange(start, end);
    }
  }

  int id = event.GetId();
  HelpCommon::HelpFileAttrib hfa = HelpFileFromId(id);
  // Patch by Yorgos Pagles: Use the new keyword calculation
  LaunchHelp(hfa.name, hfa.isExecutable, hfa.openEmbeddedViewer, hfa.keywordCase, hfa.defaultKeyword, text);
}