示例#1
0
void MenuBar::AddHelpMenu()
{
    QMenu* help_menu = addMenu(tr("Help"));
    QAction* documentation = help_menu->addAction(tr("Online Documentation"));
    connect(documentation, &QAction::triggered, this, [=]() {
        QDesktopServices::openUrl(QUrl(QStringLiteral("https://dolphin-emu.org/docs/guides")));
    });
    help_menu->addAction(tr("About"), this, SIGNAL(ShowAboutDialog()));
}
示例#2
0
文件: winmain.c 项目: rmallof/reactos
VOID
MainWndOnCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
    WORD wCommand = LOWORD(wParam);

    if (lParam == (LPARAM)hSearchBar)
    {
        WCHAR szBuf[MAX_STR_LEN];

        switch (HIWORD(wParam))
        {
            case EN_SETFOCUS:
            {
                WCHAR szWndText[MAX_STR_LEN];

                LoadStringW(hInst, IDS_SEARCH_TEXT, szBuf, sizeof(szBuf) / sizeof(WCHAR));
                GetWindowTextW(hSearchBar, szWndText, MAX_STR_LEN);
                if (wcscmp(szBuf, szWndText) == 0) SetWindowTextW(hSearchBar, L"");
            }
            break;

            case EN_KILLFOCUS:
            {
                GetWindowTextW(hSearchBar, szBuf, MAX_STR_LEN);
                if (wcslen(szBuf) < 1)
                {
                    LoadStringW(hInst, IDS_SEARCH_TEXT, szBuf, sizeof(szBuf) / sizeof(WCHAR));
                    SetWindowTextW(hSearchBar, szBuf);
                }
            }
            break;

            case EN_CHANGE:
                /* TODO: Implement search */
                break;
        }

        return;
    }

    switch (wCommand)
    {
        case ID_OPEN_LINK:
            ShellExecuteW(hwnd, L"open", pLink, NULL, NULL, SW_SHOWNOACTIVATE);
            HeapFree(GetProcessHeap(), 0, pLink);
            break;

        case ID_COPY_LINK:
            CopyTextToClipboard(pLink);
            HeapFree(GetProcessHeap(), 0, pLink);
            break;

        case ID_SETTINGS:
            CreateSettingsDlg(hwnd);
            break;

        case ID_EXIT:
            PostMessageW(hwnd, WM_CLOSE, 0, 0);
            break;

        case ID_INSTALL:
            if (DownloadApplication(-1))
            /* TODO: Implement install dialog
             *   if (InstallApplication(-1))
             */
                UpdateApplicationsList(-1);
            break;

        case ID_UNINSTALL:
            if (UninstallApplication(-1, FALSE))
                UpdateApplicationsList(-1);
            break;

        case ID_MODIFY:
            if (UninstallApplication(-1, TRUE))
                UpdateApplicationsList(-1);
            break;

        case ID_REGREMOVE:
            RemoveAppFromRegistry(-1);
            break;

        case ID_REFRESH:
            UpdateApplicationsList(-1);
            break;

        case ID_RESETDB:
            UpdateAppsDB();
            UpdateApplicationsList(-1);
            break;

        case ID_HELP:
            MessageBoxW(hwnd, L"Help not implemented yet", NULL, MB_OK);
            break;

        case ID_ABOUT:
            ShowAboutDialog();
            break;
    }
}
示例#3
0
//
// OnCommand()
// Override this function to handle WM_COMMAND messages sent to the main window.
//
BOOL CDemoApp::OnCommand(int nCmdID, int nEvent)
{
  switch (nCmdID)
  {
    case IDM_EXIT:
      SendMessage(m_hWnd, WM_CLOSE, 0, 0);
      break;

    case IDM_ABOUT:
      ShowAboutDialog();
      break;

	case ID_CAM_ROT:
		m_hand_action = HA_ROTATE;
		break;
	case ID_CAM_MOV:
		m_hand_action = HA_MOVE;
		break;
	case ID_CAM_ZOOM:
		m_hand_action = HA_ZOOM;
		break;
	case ID_CAM_FIT:
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;

	case ID_SAVE:
		{
			OnBnClickedSave();
		}
		break;
	case ID_LOAD:
		{
			OnBnClickedLoad();
			FitToScene();
			SendMessage(m_hWnd, WM_PAINT, 0, 0);
		}
		break;
	case ID_IMPORT_DXF:
		{
			OnBnClickedImportDXF();
			FitToScene();
			SendMessage(m_hWnd, WM_PAINT, 0, 0);
		}
		break;
	case ID_EXPORT_DXF:
		{
			OnBnClickedExportDXF();
		}
		break;
	case ID_IMPORT_STL:
		{
			OnBnClickedImportSTL();
			FitToScene();
			SendMessage(m_hWnd, WM_PAINT, 0, 0);
		}
		break;
	case ID_EXPORT_STL:
		{
			OnBnClickedExportSTL();
		}
		break;
	case ID_TRIANGLES_OBJ:
		{
			OnBnClickedFromTriangles();
			FitToScene();
			SendMessage(m_hWnd, WM_PAINT, 0, 0);
		}
		break;

	case ID_PRIM_POINTS:
		OnBnClickedPrPoints();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;

	case ID_PRIM_LINES:
		OnBnClickedPrLines();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;

	case ID_PRIM_CIRCLES:
		OnBnClickedPrCircles();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;

	case ID_PRIM_ARCS:
		OnBnClickedPrArcs();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;

	case ID_PRIM_SPLINES:
		OnBnClickedPrSplines();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;

	case ID_PRIM_CONTOURS:
		OnBnClickedPrContours();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;

	case ID_PRIM_EQIUDI:
		OnBnClickedPrEquidi();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;

	case ID_PRIM_BOXES:
		OnBnClickedPrBoxes();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;

	case ID_PRIM_SPHERES:
		OnBnClickedPrSpheres();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;

	case ID_PRIM_CYL:
		OnBnClickedPrCyls();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;

	case ID_PRIM_CONES:
		OnBnClickedPrCones();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;

	case ID_PRIM_ELL:
		OnBnClickedPrEllipsoids();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;

	case ID_PRIM_TORS:
		OnBnClickedPrTors();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;

	case ID_PRIM_SPH_B:
		OnBnClickedPrSphericBands();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;

	case ID_BOOL_INTER	:
		OnBnClickedBInters();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;
	case ID_BOOL_UNION:
		OnBnClickedBUnion();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;
	case ID_BOOL_SUB:
		OnBnClickedBSub();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;
	case ID_BOOL_INT_SEC:
		OnBnClickedBIntCont();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;
	case ID_BOOL_PL_SECTIONS:
		OnBnClickedBSection();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;

	case ID_KIN_ROT_SUR:
		OnBnClickedKinRotSurf();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;
	case ID_KIN_ROT_BODY:
		OnBnClickedKinRotBod();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;
	case ID_KIN_EXTR_SUR:
		OnBnClickedKinExtrSurf();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;
	case ID_KIN_EXTR_BODY:
		OnBnClickedKinExtrBod();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;
	case ID_KIN_SPIR_SUR:
		OnBnClickedKinSpirSurf();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;
	case ID_KIN_SPIR_BODY:
		OnBnClickedKinSpirBod();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;
	case ID_KIN_PIPE_SUR:
		OnBnClickedKinPipeSurf();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;
	case ID_KIN_PIPE_BODY:
		OnBnClickedKinPipeBod();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;

	case ID_SUR_MESH:
		OnBnClickedSurfMesh();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;
	case ID_SUR_FACE:
		OnBnClickedSurfFace();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;
	case ID_SUR_COONS_3:
		OnBnClickedSurfCoons3();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;
	case ID_SUR_COONS_4:
		OnBnClickedSurfCoons4();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;
	case ID_SUR_LINEAR:
		OnBnClickedSurfLinear();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;
	case ID_SUR_CLIPS:
		OnBnClickedSurfFromSect();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;
	case ID_SUR_CL_BOD:
		OnBnClickedSurfBodyFromSect();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;



	case ID_CS_ROOM:
		OnBnClickedScenesRoom();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;
	case ID_CS_DRILLS:
		OnBnClickedScenesDrills();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;
	case ID_CS_CLOCK:
		OnBnClickedScenesClock();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;

	case ID_TEXT1:
		OnBnClickedText1();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;
	case ID_TEXT2:
		OnBnClickedText2();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;
	case ID_DIM1:
		OnBnClickedDim1();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;
	case ID_DIM2:
		OnBnClickedDim2();
		FitToScene();
		SendMessage(m_hWnd, WM_PAINT, 0, 0);
		break;



    default:
      return CApp::OnCommand(nCmdID, nEvent); // Call default handler
  }
  return TRUE;
}
void EDA_BASE_FRAME::GetKicadAbout( wxCommandEvent& event )
{
    bool ShowAboutDialog(wxWindow * parent);
    ShowAboutDialog( this );
}
void MainWindow::ConnectSignals()
{
    connect(actionExit, SIGNAL(triggered()), SLOT(close()));
    connect(actionAbout, SIGNAL(triggered()), ui_helper_, SLOT(ShowAboutDialog()));
    connect(exportLocationPushButton, SIGNAL(clicked()), ui_helper_, SLOT(DefineExportLocation()));
}
示例#6
0
void MainCommand(HWND hWnd, int ID)
{
    switch (ID) {
	case IDCANCEL: EndDialog(hWnd, 0); break;
	case ID_OPEN: MainOpenFile(hWnd); break;
	case ID_SCRIPTMAN: ShowScriptMan(); break;
	case ID_EXIT: FireCommand(":quit\n"); break;

	/* Load one of the last 10 open files */
	case ID_MRU+0: case ID_MRU+1: case ID_MRU+2: case ID_MRU+3:
	case ID_MRU+4: case ID_MRU+5: case ID_MRU+6: case ID_MRU+7:
	case ID_MRU+8: case ID_MRU+9:
	    {
		char Command[1000];
		wsprintf(Command, ":load %s", ExpandFileName(MruGetItem(ID-ID_MRU)));
		FireCommand(Command);
	    }
	    break;

	// EDIT MENU
	case ID_CUT: RtfWindowClipboard(WM_CUT); break;
	case ID_COPY: RtfWindowClipboard(WM_COPY); break;
	case ID_PASTE: RtfWindowClipboard(WM_PASTE); break;
	case ID_CLEARSCREEN: RtfWindowClear(); break;
	case ID_DELETE: RtfWindowDelete(); break;
	case ID_SELECTALL: RtfWindowSelectAll(); break;
	case ID_GOPREVIOUS: RtfWindowHistory(-1); break;
	case ID_GONEXT: RtfWindowHistory(+1); break;


	// ACTIONS MENU
	// Reload script files
	case ID_COMPILE: case ID_MAKE: FireCommand(":reload"); break;
	case ID_CLEARALL: FireCommand(":load"); break;
	case ID_GOEDIT: FireCommand(":edit"); break;

	/* Stop program execution */
	case ID_STOP:
	    MessageBeep(0xFFFFFFFF);
	    AbortExecution();
	    break;

	/* Evaluate main expression */
	case ID_RUN:
	    {
		char Buffer[1000];
		RtfWindowGetCommand(Buffer);
		if (Buffer[0] == '\0')
			FireCommand(":main");
		else
		    FireCommand(Buffer);
	    }
	    break;

	/* Set interpreter options using dialog box */
	case ID_SETOPTIONS:
	    if (ShowOptionsDialog(hWnd))
		RtfWindowUpdateFont();
	    break;


	// BROWSE MENU
	case ID_BROWSEHIERARCHY: DrawClassesHierarchy(); break;
	case ID_BROWSECLASSES: DoBrowseClasses(); break;
	case ID_BROWSENAMES: DoBrowseNames(); break;
	case ID_BROWSETYCONS: DoBrowseTycons(); break;

	// HELP MENU
	case ID_HELPCONTENTS: ExecuteFileDocs("hugs98.chm"); break;
	case ID_HELPCOMMANDS: FireCommand(":?\n"); break;
	case ID_LIBRARIES: ExecuteFile("http://www.haskell.org/ghc/docs/latest/html/libraries/index.html"); break;
	case ID_WWWHASKELL: ExecuteFile("http://haskell.org/"); break;
	case ID_WWWHUGS: ExecuteFile("http://haskell.org/hugs/"); break;
	case ID_ABOUT: ShowAboutDialog(hWnd); break;
    }
}
示例#7
0
    VOID OnCommand(WPARAM wParam, LPARAM lParam)
    {
        WORD wCommand = LOWORD(wParam);

        if (lParam == (LPARAM) m_SearchBar->m_hWnd)
        {
            WCHAR szBuf[MAX_STR_LEN];

            switch (HIWORD(wParam))
            {
            case EN_SETFOCUS:
            {
                WCHAR szWndText[MAX_STR_LEN];

                LoadStringW(hInst, IDS_SEARCH_TEXT, szBuf, _countof(szBuf));
                m_SearchBar->GetWindowTextW(szWndText, MAX_STR_LEN);
                if (wcscmp(szBuf, szWndText) == 0)
                {
                    SearchEnabled = FALSE;
                    m_SearchBar->SetWindowTextW(L"");
                }
            }
            break;

            case EN_KILLFOCUS:
            {
                m_SearchBar->GetWindowTextW(szBuf, MAX_STR_LEN);
                if (wcslen(szBuf) < 1)
                {
                    LoadStringW(hInst, IDS_SEARCH_TEXT, szBuf, _countof(szBuf));
                    SearchEnabled = FALSE;
                    m_SearchBar->SetWindowTextW(szBuf);
                }
            }
            break;

            case EN_CHANGE:
            {
                WCHAR szWndText[MAX_STR_LEN];

                if (!SearchEnabled)
                {
                    SearchEnabled = TRUE;
                    break;
                }

                LoadStringW(hInst, IDS_SEARCH_TEXT, szBuf, _countof(szBuf));
                m_SearchBar->GetWindowTextW(szWndText, MAX_STR_LEN);
                if (wcscmp(szBuf, szWndText) != 0)
                {
                    StringCbCopy(szSearchPattern, sizeof(szSearchPattern),
                        szWndText);
                }
                else
                {
                    szSearchPattern[0] = UNICODE_NULL;
                }

                DWORD dwDelay;
                SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, &dwDelay, 0);
                SetTimer(SEARCH_TIMER_ID, dwDelay);
            }
            break;
            }

            return;
        }

        switch (wCommand)
        {
        case ID_OPEN_LINK:
            ShellExecuteW(m_hWnd, L"open", pLink, NULL, NULL, SW_SHOWNOACTIVATE);
            HeapFree(GetProcessHeap(), 0, pLink);
            break;

        case ID_COPY_LINK:
            CopyTextToClipboard(pLink);
            HeapFree(GetProcessHeap(), 0, pLink);
            break;

        case ID_SETTINGS:
            CreateSettingsDlg(m_hWnd);
            break;

        case ID_EXIT:
            PostMessageW(WM_CLOSE, 0, 0);
            break;

        case ID_INSTALL:
            if (DownloadApplication(-1))
                /* TODO: Implement install dialog
                *   if (InstallApplication(-1))
                */
                UpdateApplicationsList(-1);
            break;

        case ID_UNINSTALL:
            if (UninstallApplication(-1, FALSE))
                UpdateApplicationsList(-1);
            break;

        case ID_MODIFY:
            if (UninstallApplication(-1, TRUE))
                UpdateApplicationsList(-1);
            break;

        case ID_REGREMOVE:
            RemoveAppFromRegistry(-1);
            break;

        case ID_REFRESH:
            UpdateApplicationsList(-1);
            break;

        case ID_RESETDB:
            UpdateAppsDB();
            UpdateApplicationsList(-1);
            break;

        case ID_HELP:
            MessageBoxW(L"Help not implemented yet", NULL, MB_OK);
            break;

        case ID_ABOUT:
            ShowAboutDialog();
            break;
        }
    }
示例#8
0
MainWindow::MainWindow(QWidget *parent)
  : QMainWindow(parent), audio(NULL)
{
  /* Since the ninjam callbacks do not pass a void* opaque argument we rely on
   * a global variable.
   */
  if (MainWindow::instance) {
    fprintf(stderr, "MainWindow can only be instantiated once!\n");
    abort();
  }
  MainWindow::instance = this;

  JNL::open_socketlib();

  client.config_savelocalaudio = 0;
  client.LicenseAgreementCallback = LicenseCallbackTrampoline;
  client.ChatMessage_Callback = ChatMessageCallbackTrampoline;
  client.SetLocalChannelInfo(0, "channel0", true, 0, false, 0, true, true);
  client.SetLocalChannelMonitoring(0, false, 0.0f, false, 0.0f, false, false, false, false);

  connectAction = new QAction(tr("&Connect..."), this);
  connect(connectAction, SIGNAL(triggered()), this, SLOT(ShowConnectDialog()));

  disconnectAction = new QAction(tr("&Disconnect"), this);
  disconnectAction->setEnabled(false);
  connect(disconnectAction, SIGNAL(triggered()), this, SLOT(Disconnect()));

  audioConfigAction = new QAction(tr("Configure &audio..."), this);
  connect(audioConfigAction, SIGNAL(triggered()), this, SLOT(ShowAudioConfigDialog()));

  QAction *exitAction = new QAction(tr("E&xit"), this);
  exitAction->setShortcuts(QKeySequence::Quit);
  connect(exitAction, SIGNAL(triggered()), this, SLOT(close()));

  QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
  fileMenu->addAction(connectAction);
  fileMenu->addAction(disconnectAction);
  fileMenu->addAction(audioConfigAction);
  fileMenu->addAction(exitAction);

  QAction *aboutAction = new QAction(tr("&About..."), this);
  connect(aboutAction, SIGNAL(triggered()), this, SLOT(ShowAboutDialog()));

  QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
  helpMenu->addAction(aboutAction);

  setupStatusBar();

  setWindowTitle(tr("Wahjam"));

  chatOutput = new QTextEdit(this);
  chatOutput->setReadOnly(true);

  chatInput = new QLineEdit(this);
  chatInput->connect(chatInput, SIGNAL(returnPressed()),
                     this, SLOT(ChatInputReturnPressed()));

  channelTree = new ChannelTreeWidget(this);
  setupChannelTree();
  connect(channelTree, SIGNAL(MetronomeMuteChanged(bool)),
          this, SLOT(MetronomeMuteChanged(bool)));
  connect(channelTree, SIGNAL(MetronomeBoostChanged(bool)),
          this, SLOT(MetronomeBoostChanged(bool)));
  connect(channelTree, SIGNAL(LocalChannelMuteChanged(int, bool)),
          this, SLOT(LocalChannelMuteChanged(int, bool)));
  connect(channelTree, SIGNAL(LocalChannelBoostChanged(int, bool)),
          this, SLOT(LocalChannelBoostChanged(int, bool)));
  connect(channelTree, SIGNAL(LocalChannelBroadcastChanged(int, bool)),
          this, SLOT(LocalChannelBroadcastChanged(int, bool)));
  connect(channelTree, SIGNAL(RemoteChannelMuteChanged(int, int, bool)),
          this, SLOT(RemoteChannelMuteChanged(int, int, bool)));

  metronomeBar = new MetronomeBar(this);
  connect(this, SIGNAL(Disconnected()),
          metronomeBar, SLOT(reset()));

  QSplitter *splitter = new QSplitter(this);
  QWidget *content = new QWidget;
  QVBoxLayout *layout = new QVBoxLayout;

  layout->addWidget(chatOutput);
  layout->addWidget(chatInput);
  layout->addWidget(metronomeBar);
  content->setLayout(layout);
  content->setTabOrder(chatInput, chatOutput);

  splitter->addWidget(channelTree);
  splitter->addWidget(content);
  splitter->setOrientation(Qt::Vertical);

  setCentralWidget(splitter);

  BeatsPerIntervalChanged(0);
  BeatsPerMinuteChanged(0);

  runThread = new ClientRunThread(&clientMutex, &client);

  /* Hook up an inter-thread signal for the license agreement dialog */
  connect(runThread, SIGNAL(licenseCallback(const char *, bool *)),
          this, SLOT(LicenseCallback(const char *, bool *)),
          Qt::BlockingQueuedConnection);

  /* Hook up an inter-thread signal for the chat message callback */
  connect(runThread, SIGNAL(chatMessageCallback(char **, int)),
          this, SLOT(ChatMessageCallback(char **, int)),
          Qt::BlockingQueuedConnection);

  /* No need to block for the remote user info callback */
  connect(runThread, SIGNAL(userInfoChanged()),
          this, SLOT(UserInfoChanged()));

  /* Hook up an inter-thread signal for client status changes */
  connect(runThread, SIGNAL(statusChanged(int)),
          this, SLOT(ClientStatusChanged(int)));

  /* Hook up inter-thread signals for bpm/bpi changes */
  connect(runThread, SIGNAL(beatsPerMinuteChanged(int)),
          this, SLOT(BeatsPerMinuteChanged(int)));
  connect(runThread, SIGNAL(beatsPerIntervalChanged(int)),
          this, SLOT(BeatsPerIntervalChanged(int)));

  /* Hook up inter-thread signals for beat and interval changes */
  connect(runThread, SIGNAL(beatsPerIntervalChanged(int)),
          metronomeBar, SLOT(setBeatsPerInterval(int)));
  connect(runThread, SIGNAL(currentBeatChanged(int)),
          metronomeBar, SLOT(setCurrentBeat(int)));

  runThread->start();
}
示例#9
0
// ---------------------------------------------------------------------------
void __fastcall TCacheDemoForm::miAboutClick(TObject *Sender) {
	ShowAboutDialog();
}
示例#10
0
DWORD WINAPI MainCommandThread(LPVOID lpParam)
{
	HWND hWnd = hWndMain;
	INT ID = (INT) lpParam;

	switch (ID) {
		case IDCANCEL: 
			EndDialog(hWnd, 0); 
			break;
		case ID_FILE_LOAD: 
			LoadFileFromFileDialog(hWnd); 
			break;
		case ID_FILE_ADD: 
			AddFileFromFileDialog(hWnd); 
			break;
		case ID_EXIT: 
			SendMessage(hWndMain, WM_CLOSE,0,0); 
			break;
		/* Load one of the last 10 open files */
		case ID_MRU+0: case ID_MRU+1: case ID_MRU+2: case ID_MRU+3:
		case ID_MRU+4: case ID_MRU+5: case ID_MRU+6: case ID_MRU+7:
		case ID_MRU+8: case ID_MRU+9:
			LoadFile(GetMruFile(ID-ID_MRU));
			break;

		case ID_CUT: 
			RtfWindowClipboard(WM_CUT); 
			break;
		case ID_COPY: 
			RtfWindowClipboard(WM_COPY); 
			break;
		case ID_PASTE: 
			RtfWindowClipboard(WM_PASTE); 
			break;
		case ID_CLEARSCREEN: 
			RtfWindowClear(); 
			break;
		case ID_DELETE: 
			RtfWindowDelete(); 
			break;
		case ID_SELECTALL: 
			RtfWindowSelectAll(); 
			break;
		case ID_GOPREVIOUS: 
			RtfWindowRelativeHistory(-1); 
			break;
		case ID_GONEXT: 
			RtfWindowRelativeHistory(+1); 
			break;


		case ID_COMPILE: 
			FireCommand(TEXT(":reload")); 
			break;
		case ID_CLEARALL: 
			FireCommand(TEXT(":load")); 
			break;
		case ID_GOEDIT: 
			FireCommand(TEXT(":edit")); 
			break;

		/* Stop program execution */
		case ID_STOP:
			AbortExecution();
			break;

		case ID_TOOLS_TOOL1:
		case ID_TOOLS_TOOL2:
		case ID_TOOLS_TOOL3:
		case ID_TOOLS_TOOL4:
		case ID_TOOLS_TOOL5:
		case ID_TOOLS_TOOL6:
		case ID_TOOLS_TOOL7:
		case ID_TOOLS_TOOL8:
		case ID_TOOLS_TOOL9:
		case ID_TOOLS_TOOL10:		
			ToolFireCommand(ID-ID_TOOLS_TOOL1);
			break;

		/* Evaluate main expression */
		case ID_RUN:
			{
				#define BUFF_LEN 2048
				TCHAR Buffer[BUFF_LEN];
				RtfWindowGetCommand(Buffer,BUFF_LEN);
				if (StringIsEmpty(Buffer))
					FireCommand(TEXT(":main"));
				else
					FireCommand(Buffer);
			}
			break;

		/* Set interpreter options using dialog box */
		case ID_SETOPTIONS:
			ShowOptsDialog();
			break;

		case ID_TOOLS_CONFIGURE:
			ShowToolsDialog();
			break;

			// HELP MENU
		case ID_HELPCONTENTS:  {
			ExecuteFileDocs(TEXT("index.html"));
			break;
							   }
		case ID_HELPCOMMANDS: 
			FireCommand(TEXT(":?")); 
			break;
		case ID_LIBRARIES: 
			ExecuteFileDocs(TEXT("libraries\\index.html")); 
			break;
		case ID_WWWHASKELL: 
			ExecuteFile(TEXT("http://haskell.org/")); 
			break;
		case ID_WWWGHC: 
			ExecuteFile(TEXT("http://haskell.org/ghc/")); 
			break;
		case ID_ABOUT: 
			ShowAboutDialog(); 
			break;
	}
	return 0;
}