Ejemplo n.º 1
0
LRESULT CTaskDialog::OnButtonClicked(UINT /* nCode */, int nID, HWND /* hWnd */)
{
	if (nID == IDC_CHECK)
		return OnVerificationChecked();

	for (DWORD cButton = 0; cButton < config_.cRadioButtons; cButton++) {
		if (nID == config_.pRadioButtons[cButton].nButtonID)
			return OnRadioButtonClicked(nID);
	}

	for (DWORD cButton = 0; cButton < config_.cButtons; cButton++) {
		if (nID == config_.pButtons[cButton].nButtonID)
			return OnButtonClicked(nID);
	}

	if (nID >= IDOK && nID <= IDCLOSE)
		return OnButtonClicked(nID);

	return 0L;
}
HRESULT CNewTreeConflictEditorDlg::OnNotify(HWND hWnd, UINT uNotification, WPARAM wParam, LPARAM)
{
    switch (uNotification)
    {
    case TDN_DIALOG_CONSTRUCTED:
        return OnDialogConstructed(hWnd);
    case TDN_BUTTON_CLICKED:
        return OnButtonClicked(hWnd, (int) wParam);
    default:
        return S_OK;
    }
}
Ejemplo n.º 3
0
LRESULT CSetPgUpdate::OnInitDialog(HWND hDlg, bool abInitial)
{
	ConEmuUpdateSettings* p = &gpSet->UpdSet;

	SetDlgItemText(hDlg, tUpdateVerLocation, p->UpdateVerLocation());

	checkDlgButton(hDlg, cbUpdateCheckOnStartup, p->isUpdateCheckOnStartup);
	checkDlgButton(hDlg, cbUpdateCheckHourly, p->isUpdateCheckHourly);
	checkDlgButton(hDlg, cbUpdateConfirmDownload, !p->isUpdateConfirmDownload);
	checkRadioButton(hDlg, rbUpdateStableOnly, rbUpdateLatestAvailable,
		(p->isUpdateUseBuilds==1) ? rbUpdateStableOnly : (p->isUpdateUseBuilds==3) ? rbUpdatePreview : rbUpdateLatestAvailable);

	checkDlgButton(hDlg, cbUpdateInetTool, p->isUpdateInetTool);
	SetDlgItemText(hDlg, tUpdateInetTool, p->GetUpdateInetToolCmd());

	checkDlgButton(hDlg, cbUpdateUseProxy, p->isUpdateUseProxy);
	SetDlgItemText(hDlg, tUpdateProxy, p->szUpdateProxy);
	SetDlgItemText(hDlg, tUpdateProxyUser, p->szUpdateProxyUser);
	SetDlgItemText(hDlg, tUpdateProxyPassword, p->szUpdateProxyPassword);

	OnButtonClicked(hDlg, NULL, cbUpdateInetTool); // Enable/Disable command field, button '...' and ‘Proxy’ fields

	int nPackage = p->UpdateDownloadSetup(); // 1-exe, 2-7zip
	checkRadioButton(hDlg, rbUpdateUseExe, rbUpdateUseArc, (nPackage==1) ? rbUpdateUseExe : rbUpdateUseArc);
	wchar_t szCPU[4] = L"";
	SetDlgItemText(hDlg, tUpdateExeCmdLine, p->UpdateExeCmdLine(szCPU));
	SetDlgItemText(hDlg, tUpdateArcCmdLine, p->UpdateArcCmdLine());
	SetDlgItemText(hDlg, tUpdatePostUpdateCmd, p->szUpdatePostUpdateCmd);
	enableDlgItem(hDlg, (nPackage==1) ? tUpdateArcCmdLine : tUpdateExeCmdLine, FALSE);
	// Show used or preferred installer bitness
	CEStr szFormat, szTitle; INT_PTR iLen;
	if ((iLen = GetString(hDlg, rbUpdateUseExe, &szFormat.ms_Val)) > 0)
	{
		if (wcsstr(szFormat.ms_Val, L"%s") != NULL)
		{
			wchar_t* psz = szTitle.GetBuffer(iLen+4);
			if (psz)
			{
				_wsprintf(psz, SKIPLEN(iLen+4) szFormat.ms_Val, (nPackage == 1) ? szCPU : WIN3264TEST(L"x86",L"x64"));
				SetDlgItemText(hDlg, rbUpdateUseExe, szTitle);
			}
		}
	}

	checkDlgButton(hDlg, cbUpdateLeavePackages, p->isUpdateLeavePackages);
	SetDlgItemText(hDlg, tUpdateDownloadPath, p->szUpdateDownloadPath);

	return 0;
}
QmitkColorWidget::QmitkColorWidget(QWidget *parent)
  : QWidget(parent), m_LineEdit(new QLineEdit), m_Button(new QToolButton)
{
  m_LineEdit->setText(m_Color.name());
  m_Button->setText("...");

  QHBoxLayout *layout = new QHBoxLayout;
  layout->setContentsMargins(0, 0, 0, 0);
  layout->setSpacing(0);

  layout->addWidget(m_LineEdit);
  layout->addWidget(m_Button);

  this->setFocusProxy(m_LineEdit);
  this->setLayout(layout);

  connect(m_LineEdit, SIGNAL(editingFinished()), this, SLOT(OnLineEditEditingFinished()));
  connect(m_Button, SIGNAL(clicked()), this, SLOT(OnButtonClicked()));
}
Ejemplo n.º 5
0
HRESULT CTextConflictEditorDlg::OnNotify(HWND hWnd, UINT uNotification, WPARAM wParam, LPARAM)
{
    switch (uNotification)
    {
        case TDN_DIALOG_CONSTRUCTED:
        return OnDialogConstructed(hWnd);
        case TDN_BUTTON_CLICKED:
        return OnButtonClicked(hWnd, (int)wParam);
        case TDN_TIMER:
        return OnTimer(hWnd);
        case TDN_HELP:
            if (!CAppUtils::StartHtmlHelp(IDD_CONFLICTRESOLVE + 0x20000))
            {
                AfxMessageBox(AFX_IDP_FAILED_TO_LAUNCH_HELP);
            }
            break;
        default:
        break;
    }
    return S_OK;
}
Ejemplo n.º 6
0
void CIATestMainWindow::AddEntityButton(std::string sName,bool bSelect)
{
	SGameRect buttonRect(2,2,100,20);
	buttonRect.y+=(buttonRect.h+5.0)*m_mEntityButtons.size();

	CButtonWrapper *pButton=new CButtonWrapper;
	pButton->Create("GameGUI","CGameGUIButton",sName);
	pButton->m_piButton->InitWindow(this,false);
	pButton->m_piButton->SetText(sName);
	pButton->m_piButton->SetHorizontalAlignment(eTextAlignment_Center);
	pButton->m_piButton->SetVerticalAlignment(eTextAlignment_Center);
	pButton->m_piButton->SetTextColor(CVector(0,0,0),1);
	pButton->m_piButton->SetBackgroundColor(CVector(0.5,0.5,0.5),1);
	pButton->m_piButton->SetReferenceSystem(eGameGUIReferenceSystem_Absolute);
	pButton->m_piButton->SetRect(&buttonRect);
	pButton->m_piButton->Activate(true);
	SUBSCRIBE_TO_CAST(pButton->m_piButton,IGameGUIButtonEvents);
	m_mEntityButtons[sName]=pButton;

	if(bSelect){OnButtonClicked(pButton->m_piButton);}
}
Ejemplo n.º 7
0
bool ptChoice::eventFilter(QObject *obj, QEvent *event) {
  if (event->type() == QEvent::ContextMenu) {
    // reset to default value
    if (m_HaveDefault && m_ComboBox->isEnabled())
      OnButtonClicked();
    return true;

  } else if (event->type() == QEvent::Wheel
             && ((QMouseEvent*)event)->modifiers()==Qt::AltModifier)
  {
    // send Alt+Wheel to parent
    if (FIsNewSchool)
      QApplication::sendEvent(this->parentWidget(), event);
    else
      QApplication::sendEvent(m_Parent, event);
    return true;

  } else {
    // pass the event on to the parent class
    return ptWidget::eventFilter(obj, event);
  }
}
Ejemplo n.º 8
0
bool CDialog::OnCommand(int code, int itemID, LPARAM lParam)
{
  if (code == BN_CLICKED)
    return OnButtonClicked(itemID, (HWND)lParam);
  return false;
}
Ejemplo n.º 9
0
INT_PTR CSetPgApps::PageDlgProc(HWND hDlg, UINT messg, WPARAM wParam, LPARAM lParam)
{
	INT_PTR iRc = 0;

	if (!mh_Child && ((messg == WM_INITDIALOG) || (messg == mn_ActivateTabMsg)))
	{
		if (!CreateChildDlg())
		{
			return 0;
		}
	}

	if ((messg == WM_INITDIALOG) || (messg == mn_ActivateTabMsg))
	{
		// Return here! Do not pass to mb_Redraw/mb_Refill routines!
		return OnInitDialog(hDlg, (messg == WM_INITDIALOG));
	}
	else switch (messg)
	{
	case WM_NOTIFY:
		{
			LPNMHDR phdr = (LPNMHDR)lParam;

			if (phdr->code == TTN_GETDISPINFO)
			{
				return gpSetCls->ProcessTipHelp(hDlg, messg, wParam, lParam);
			}

			break;
		}

	case WM_COMMAND:
		{
			_ASSERTE(mh_Child && IsWindow(mh_Child));
			_ASSERTE(hDlg == mh_Dlg);

			if (HIWORD(wParam) == BN_CLICKED)
			{
				OnButtonClicked(hDlg, (HWND)lParam, LOWORD(wParam));
			}
			else if (HIWORD(wParam) == EN_CHANGE)
			{
				OnEditChanged(hDlg, LOWORD(wParam));
			}
			else if (HIWORD(wParam) == LBN_SELCHANGE)
			{
				OnComboBox(hDlg, LOWORD(wParam), HIWORD(wParam));
			}

		} // WM_COMMAND
		break;
	} // switch (messg)


	if (mb_Redraw)
	{
		mb_Redraw = false;
		NotifyVCon();
	}


	if (mb_Refill)
	{
		mb_Refill = false;

		MSetter lockSelChange(&mb_SkipSelChange);
		MSetter lockEditSet(&mb_SkipEditSet);

		INT_PTR iSel = SendDlgItemMessage(hDlg, lbAppDistinct, LB_GETCURSEL, 0,0);
		OnInitDialog(hDlg, false);
		SendDlgItemMessage(hDlg, lbAppDistinct, LB_SETCURSEL, iSel,0);

	} // mb_Refill


	// To be sure
	mb_Refill = false;
	mb_Redraw = false;

	return iRc;
}
Ejemplo n.º 10
0
LRESULT CTaskDialog::OnCancel(UINT /* nCode */, int /* nID */, HWND /* hWnd */)
{
	if ((::GetKeyState(VK_ESCAPE) & 0x80000) == 0 || HasFlag(TDF_ALLOW_DIALOG_CANCELLATION))
		return OnButtonClicked(IDCANCEL);
	return 0L;
}