void AdvancedCompilerOptionsDlg::OnExtChange(wxCommandEvent& WXUNUSED(event))
{
	CheckForChanges();
	int cmd = XRCCTRL(*this, "lstCommands", wxChoice)->GetSelection();
	int ext = XRCCTRL(*this, "lstExt", wxChoice)->GetSelection();
    DisplayCommand(cmd, ext);
}
void AdvancedCompilerOptionsDlg::OnCommandsChange(wxCommandEvent& WXUNUSED(event))
{
	CheckForChanges();
	int cmd = XRCCTRL(*this, "lstCommands", wxChoice)->GetSelection();
	ReadExtensions(cmd); // can change the extension cmb list !!!!!!!!!!!!!!!
	int ext = XRCCTRL(*this, "lstExt", wxChoice)->GetSelection();
    DisplayCommand(cmd, ext);
} // end of OnCommandsChange
void AdvancedCompilerOptionsDlg::EndModal(int retCode)
{
    if (retCode == wxID_OK)
    {
    	m_bDirty = true;
        Compiler* compiler = CompilerFactory::GetCompiler(m_CompilerId);

        // make sure we update the first command, if it changed
        CheckForChanges();
        // write options
        WriteCompilerOptions();
        // save regexes
        SaveRegexDetails(m_SelectedRegex);
        compiler->SetRegExArray(m_Regexes);
    }
    wxScrollingDialog::EndModal(retCode);
} // end of EndModal
示例#4
0
static INT_PTR CALLBACK DlgProcOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	PFolderItem item;

	switch (msg) {
	case WM_INITDIALOG:
		lastItem = NULL;
		TranslateDialogDefault(hWnd);
		bInitializing = 1;
		LoadRegisteredFolderSections(hWnd);
		bInitializing = 0;
		break;

	case WM_COMMAND:
		switch (LOWORD(wParam)) {
		case IDC_FOLDER_EDIT:
			switch (HIWORD(wParam)) {
			case EN_CHANGE:
				RefreshPreview(hWnd);
				if (!bInitializing)
					SendMessage(GetParent(hWnd), PSM_CHANGED, 0, 0); //show the apply button.
			}
			break;

		case IDC_REFRESH_BUTTON:
			RefreshPreview(hWnd);
			break;

		case IDC_HELP_BUTTON:
			ShowWindow( CreateDialog(hInstance, MAKEINTRESOURCE(IDD_VARIABLES_HELP), hWnd, DlgProcVariables), SW_SHOW);
			break;

		case IDC_FOLDERS_SECTIONS_LIST:
			switch (HIWORD(wParam)) {
			case LBN_SELCHANGE:
				CheckForChanges(hWnd);
				LoadRegisteredFolderItems(hWnd);
				lastItem = NULL;
				SetEditText(hWnd, L"");
				RefreshPreview(hWnd);
			}
			break;

		case IDC_FOLDERS_ITEMS_LIST:
			switch (HIWORD(wParam)) {
			case LBN_SELCHANGE:
				item = GetSelectedItem(hWnd);
				if (item != NULL) {
					CheckForChanges(hWnd);
					LoadItem(hWnd, item);
				}
				lastItem = item;
			}
		}
		break;

	case WM_NOTIFY:
		switch(((LPNMHDR)lParam)->idFrom) {
		case 0:
			switch (((LPNMHDR)lParam)->code) {
			case PSN_APPLY:
				item = GetSelectedItem(hWnd);
				if (item) {
					SaveItem(hWnd, item, FALSE);
					LoadItem(hWnd, item);
				}

				for (int i=0; i < lstRegisteredFolders.getCount(); i++)
					lstRegisteredFolders[i].Save();
				CallPathChangedEvents();
			}
		}
		break;
	}

	return 0;
}