Exemplo n.º 1
0
// **************************************************************************
// SelectItem ()
//
// Description:
//	Called to select an item.
//
// Parameters:
//  int			nIndex		Index of item to select.
//
// Returns:
//  void
// **************************************************************************
void CKItemPropertiesDlg::SelectItem (int nIndex)
	{
	// Apply changes to currently selected item:
	OnApply ();

	// Select the new item:
	CKItem *pItem = NULL;

	m_nSelIndex = nIndex;
	ASSERT (m_nSelIndex <= m_cnItems);

	// Item list object array gives us a pointer to the CKItem object 
	// assocated with the selection:
	pItem = (CKItem *) m_pItemList->GetAt (m_nSelIndex);
	ASSERT (pItem != NULL);

	// Update the member variables associated with controls:
	m_strAccessPath = pItem->GetAccessPath ();
	m_bActive = pItem->IsActive ();
	m_vtDataType = pItem->GetDataType ();
	m_strItemID = pItem->GetItemID ();

	// Update control status:
	UpdateStatus ();
	}
Exemplo n.º 2
0
LRESULT COptionsSystem::OnQuerySiblings(WPARAM wParam, LPARAM )
{
  UpdateData(TRUE);

  // Have any of my fields been changed?
  switch (wParam) {
    case PP_DATA_CHANGED:
      if (M_UseSystemTray()     != m_UseSystemTray     ||
          M_HideSystemTray()    != m_HideSystemTray    ||
          (m_UseSystemTray      == TRUE &&
           M_MaxREItems()       != m_MaxREItems)       ||
          M_Startup()           != m_Startup           ||
          M_MaxMRUItems()       != m_MaxMRUItems       ||
          M_MRUOnFileMenu()     != m_MRUOnFileMenu     ||
          M_DefaultOpenRO()     != m_DefaultOpenRO     ||
          M_MultipleInstances() != m_MultipleInstances ||
          m_saveDeleteRegistry  != m_DeleteRegistry    ||
          m_saveMigrate2Appdata != m_Migrate2Appdata)
        return 1L;
      break;
    case PP_UPDATE_VARIABLES:
      // Since OnOK calls OnApply after we need to verify and/or
      // copy data into the entry - we do it ourselfs here first
      if (OnApply() == FALSE)
        return 1L;
  }
  return 0L;
}
Exemplo n.º 3
0
BOOL CALLBACK PropPageDlgProc ( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
BOOL bRet = FALSE;

    switch ( uMsg )
        {
        case WM_INITDIALOG:
            bRet = OnInitDialog ( hwnd, lParam );
        break;

        case WM_NOTIFY:
            {
            NMHDR* phdr = (NMHDR*) lParam;

            switch ( phdr->code )
                {
                case PSN_APPLY:
                    bRet = OnApply ( hwnd, (PSHNOTIFY*) phdr );
                break;

                case DTN_DATETIMECHANGE:
                    // If the user changes any of the DTP controls, enable
                    // the Apply button.

                    SendMessage ( GetParent(hwnd), PSM_CHANGED, (WPARAM) hwnd, 0 );
                break;
                }
            }
        break;
        }

    return bRet;
}
Exemplo n.º 4
0
/**
 * フレームワークは、イベントがコントロールに発生する場合や、コントロールが一部の種類の情報を要求するコントロールを親ウィンドウに通知するために、このメンバー関数を呼び出します
 * @param[in] wParam メッセージがコントロールからそのメッセージを送信するコントロールを識別します
 * @param[in] lParam 通知コードと追加情報を含む通知メッセージ (NMHDR) の構造体へのポインター
 * @param[out] pResult メッセージが処理されたとき結果を格納するコードする LRESULT の変数へのポインター
 * @retval TRUE メッセージを処理した
 * @retval FALSE メッセージを処理しなかった
 */
BOOL CPropPageProc::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
	NMHDR* pNMHDR = reinterpret_cast<NMHDR*>(lParam);

	// allow message map to override
	if (CDlgProc::OnNotify(wParam, lParam, pResult))
	{
		return TRUE;
	}

	// don't handle messages not from the page/sheet itself
	if (pNMHDR->hwndFrom != m_hWnd && pNMHDR->hwndFrom != ::GetParent(m_hWnd))
	{
		return FALSE;
	}

	// handle default
	switch (pNMHDR->code)
	{
		case PSN_APPLY:
			*pResult = OnApply() ? PSNRET_NOERROR : PSNRET_INVALID_NOCHANGEPAGE;
			break;

		case PSN_RESET:
			OnReset();
			break;

		default:
			return FALSE;   // not handled
	}

	return TRUE;    // handled
}
LRESULT COptionsBackup::OnQuerySiblings(WPARAM wParam, LPARAM )
{
  UpdateData(TRUE);

  // Have any of my fields been changed?
  switch (wParam) {
    case PP_DATA_CHANGED:
      if (M_UserBackupPrefix()        != m_UserBackupPrefix        ||
          M_UserBackupOtherLocation() != m_UserBackupOtherLocation ||
          M_SaveImmediately()         != m_SaveImmediately         ||
          M_BackupBeforeSave()        != m_BackupBeforeSave        ||
          M_BackupPrefix()            != m_BackupPrefix            ||
          M_BackupSuffix()            != m_BackupSuffix            ||
          M_BackupLocation()          != m_BackupLocation          ||
          M_MaxNumIncBackups()        != m_MaxNumIncBackups)
        return 1L;
      break;
    case PP_UPDATE_VARIABLES:
      // Since OnOK calls OnApply after we need to verify and/or
      // copy data into the entry - we do it ourselfs here first
      if (OnApply() == FALSE)
        return 1L;
  }
  return 0L;
}
void PHPProjectSettingsDlg::OnOK(wxCommandEvent& event)
{
    if(IsDirty()) {
        OnApply(event);
    }
    EndModal(wxID_OK);
}
Exemplo n.º 7
0
LRESULT COptionsDisplay::OnQuerySiblings(WPARAM wParam, LPARAM )
{
  UpdateData(TRUE);
  // Have any of my fields been changed?
  switch (wParam) {
    case PP_DATA_CHANGED:
      if (M_AlwaysOnTop()             != m_AlwaysOnTop             ||
          M_ShowUsernameInTree()      != m_ShowUsernameInTree      ||
          M_ShowPasswordInTree()      != m_ShowPasswordInTree      ||
          M_ShowNotesAsTipsInViews()  != m_ShowNotesAsTipsInViews  ||
          M_ExplorerTypeTree()        != m_ExplorerTypeTree        ||
          M_EnableGrid()              != m_EnableGrid              ||
          M_ShowPasswordInEdit()      != m_ShowPasswordInEdit      ||
          M_NotesShowInEdit()         != m_ShowNotesInEdit         ||
          M_WordWrapNotes()           != m_WordWrapNotes           ||
          M_PreExpiryWarn()           != m_PreExpiryWarn           ||
          (m_PreExpiryWarn            == TRUE &&
           M_PreExpiryWarnDays()      != m_PreExpiryWarnDays)      ||
          M_TreeDisplayStatusAtOpen() != m_TreeDisplayStatusAtOpen ||
          M_TrayIconColour()          != m_TrayIconColour          ||
          M_HighlightChanges()        != m_HighlightChanges)
        return 1L;
      break;
    case PP_UPDATE_VARIABLES:
      // Since OnOK calls OnApply after we need to verify and/or
      // copy data into the entry - we do it ourselves here first
      if (OnApply() == FALSE)
        return 1L;
  }
  return 0L;
}
Exemplo n.º 8
0
GL3DScales::GL3DScales(QWidget *parent)
{
	setWindowTitle(tr("3D Scales Settings"));

	SetupLayout();

	SetControls();

	connect(ApplyButton, SIGNAL(clicked()),this, SLOT(OnApply()));

	connect(m_pctrlAutoCpScale, SIGNAL(clicked()), this, SLOT(OnCpScale()));
	connect(m_pctrlLegendMin, SIGNAL(editingFinished()), this, SLOT(OnCpScale()));
	connect(m_pctrlLegendMax, SIGNAL(editingFinished()), this, SLOT(OnCpScale()));

	connect(m_pctrlLiftScaleSlider, SIGNAL(sliderMoved(int)), this, SLOT(OnLiftScale(int)));
	connect(m_pctrlDragScaleSlider, SIGNAL(sliderMoved(int)), this, SLOT(OnDragScale(int)));
	connect(m_pctrlVelocityScaleSlider, SIGNAL(sliderMoved(int)), this, SLOT(OnVelocityScale(int)));
	connect(m_pctrlVelocityScaleSlider, SIGNAL(sliderReleased()), this, SLOT(OnVelocitySet()));

	connect(m_pctrlLE,   SIGNAL(clicked()), this, SLOT(OnStreamParams()));
	connect(m_pctrlTE,   SIGNAL(clicked()), this, SLOT(OnStreamParams()));
	connect(m_pctrlYLine, SIGNAL(clicked()), this, SLOT(OnStreamParams()));
	connect(m_pctrlZLine, SIGNAL(clicked()), this, SLOT(OnStreamParams()));
	connect(m_pctrlXOffset, SIGNAL(editingFinished()), this, SLOT(OnStreamParams()));
	connect(m_pctrlYOffset, SIGNAL(editingFinished()), this, SLOT(OnStreamParams()));
	connect(m_pctrlZOffset, SIGNAL(editingFinished()), this, SLOT(OnStreamParams()));
	connect(m_pctrlNXPoint, SIGNAL(editingFinished()), this, SLOT(OnStreamParams()));
	connect(m_pctrlDeltaL,  SIGNAL(editingFinished()), this, SLOT(OnStreamParams()));
	connect(m_pctrlXFactor, SIGNAL(editingFinished()), this, SLOT(OnStreamParams()));
}
Exemplo n.º 9
0
LRESULT COptionsSecurity::OnQuerySiblings(WPARAM wParam, LPARAM lParam)
{
  UpdateData(TRUE);

  // Misc has asked for ClearClipboardOnMinimize value
  switch (wParam) {
    case PPOPT_GET_CCOM:
    {
      BOOL *pCCOM = (BOOL *)lParam;
      ASSERT(pCCOM != NULL);
      *pCCOM = (BOOL)m_ClearClipboardOnMinimize;
      return 1L;
    }
    case PP_DATA_CHANGED:
      if (M_ClearClipboardOnMinimize() != m_ClearClipboardOnMinimize ||
          M_ClearClipboardOnExit()     != m_ClearClipboardOnExit     ||
          M_LockOnMinimize()           != m_LockOnMinimize           ||
          M_ConfirmCopy()              != m_ConfirmCopy              ||
          M_LockOnWindowLock()         != m_LockOnWindowLock         ||
          M_LockOnIdleTimeout()        != m_LockOnIdleTimeout        ||
          M_CopyPswdBrowseURL()        != m_CopyPswdBrowseURL        ||
          (m_LockOnIdleTimeout         == TRUE &&
           M_IdleTimeOut()             != m_IdleTimeOut))
        return 1L;
      break;
    case PP_UPDATE_VARIABLES:
      // Since OnOK calls OnApply after we need to verify and/or
      // copy data into the entry - we do it ourselves here first
      if (OnApply() == FALSE)
        return 1L;
    default:
      break;
  }
  return 0L;
}
Exemplo n.º 10
0
void CSettingGitRemote::OnLbnSelchangeListRemote()
{
    CWaitCursor wait;

    if(m_ChangedMask)
    {
        if(CMessageBox::Show(NULL, IDS_PROC_GITCONFIG_SAVEREMOTE, IDS_APPNAME, 1, IDI_QUESTION, IDS_SAVEBUTTON, IDS_DISCARDBUTTON) == 1)
            OnApply();
    }
    SetModified(FALSE);

    CString cmd,output;
    int index;
    index = this->m_ctrlRemoteList.GetCurSel();
    if(index<0)
    {
        m_strUrl.Empty();
        m_strRemote.Empty();
        m_strPuttyKeyfile.Empty();
        this->UpdateData(FALSE);
        return;
    }
    CString remote;
    m_ctrlRemoteList.GetText(index,remote);
    this->m_strRemote=remote;

    cmd.Format(_T("remote.%s.url"),remote);
    m_strUrl.Empty();
    m_strUrl = g_Git.GetConfigValue(cmd);

    cmd.Format(_T("remote.%s.puttykeyfile"),remote);

    this->m_strPuttyKeyfile = g_Git.GetConfigValue(cmd);

    m_ChangedMask=0;


    cmd.Format(_T("remote.%s.tagopt"), remote);
    CString tagopt = g_Git.GetConfigValue(cmd);
    index = 0;
    if (tagopt == "--no-tags")
        index = 1;
    else if (tagopt == "--tags")
        index = 2;
    m_ctrlTagOpt.SetCurSel(index);

    CString pushDefault = g_Git.GetConfigValue(_T("remote.pushdefault"));
    m_bPushDefault = pushDefault == remote ? TRUE : FALSE;
    cmd.Format(_T("remote.%s.prune"), remote);
    CString prune = g_Git.GetConfigValue(cmd);
    m_bPrune = prune == _T("true") ? TRUE : prune == _T("false") ? FALSE : 2;
    CString pruneAll = g_Git.GetConfigValue(_T("fetch.prune"));
    m_bPruneAll = pruneAll == _T("true") ? TRUE : FALSE;

    GetDlgItem(IDC_BUTTON_ADD)->EnableWindow(TRUE);
    GetDlgItem(IDC_BUTTON_REMOVE)->EnableWindow(TRUE);
    GetDlgItem(IDC_BUTTON_RENAME_REMOTE)->EnableWindow(TRUE);
    this->UpdateData(FALSE);

}
Exemplo n.º 11
0
void
PlayerDlg::ExecFrame()
{
	if (Keyboard::KeyDown(VK_RETURN)) {
		OnApply(0);
	}
}
Exemplo n.º 12
0
void TwoDPanelDlg::keyPressEvent(QKeyEvent *event)
{
	// Prevent Return Key from closing App
	switch (event->key())
	{
		case Qt::Key_Escape:
		{
			done(0);
			return;
		}
		case Qt::Key_Return:
		case Qt::Key_Enter:
		{
			if(!OKButton->hasFocus() && !CancelButton->hasFocus())
			{
				OnApply();
				OKButton->setFocus();
				m_bApplied  = true;
			}
			else
			{
				event->ignore();
			}
			break;
		}
		default:
			event->ignore();
			break;
	}
}
Exemplo n.º 13
0
BOOL
CALLBACK
PropPageDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    BOOL bRet = FALSE;

    switch (uMsg) {
    case WM_INITDIALOG:
        bRet = OnInitDialog(hwnd, lParam);
        break;

    case WM_NOTIFY:
    {
        NMHDR* phdr = (NMHDR*)lParam;

        switch (phdr->code) {
        case PSN_APPLY:
            bRet = OnApply(hwnd, (PSHNOTIFY*)phdr);
            break;
        }
    }
    break;
    }

    return bRet;
}
Exemplo n.º 14
0
IEncConverter*  CAutoConfigDlg::InsureApplyAndInitializeEncConverter()
{
	// in case it wasn't done, update the variables now (i.e. do "OnApply")
	if( IsModified() && !OnApply() )
		return NULL;

	return InitializeEncConverter();
}
Exemplo n.º 15
0
void
CmdMsgDlg::ExecFrame()
{
    if (Keyboard::KeyDown(VK_RETURN)) {
        OnApply(0);
    }

    if (Keyboard::KeyDown(VK_ESCAPE)) {
        if (!exit_latch)
        OnApply(0);

        exit_latch = true;
    }
    else {
        exit_latch = false;
    }
}
Exemplo n.º 16
0
// **************************************************************************
// OnOK ()
//
// Description:
//	OK button event handler.
//
// Parameters:
//  none
//
// Returns:
//  void
// **************************************************************************
void CKItemPropertiesDlg::OnOK () 
	{
	// Apply current changes:
	OnApply ();

	// Perform default processing:
	CDialog::OnOK ();
	}
Exemplo n.º 17
0
//------------------------------------------------------------------------------
// virtual bool PrepareObjectNameChange()
//------------------------------------------------------------------------------
bool GroundTrackPlotPanel::PrepareObjectNameChange()
{
   // Save GUI data
   wxCommandEvent event;
   OnApply(event);
   
   return GmatPanel::PrepareObjectNameChange();
}
Exemplo n.º 18
0
//------------------------------------------------------------------------------
// virtual bool PrepareObjectNameChange()
//------------------------------------------------------------------------------
bool CallFunctionPanel::PrepareObjectNameChange()
{
   // Save GUI data
   wxCommandEvent event;
   OnApply(event);
   
   return GmatPanel::PrepareObjectNameChange();
}
Exemplo n.º 19
0
	UINT_PTR FontDialog::CFHookProc(HWND hdlg,UINT uiMsg,WPARAM wParam,LPARAM lParam)
	{
		if((uiMsg==WM_COMMAND)&&(HIWORD(wParam)==BN_CLICKED)&&(LOWORD(wParam)==0x402))//点关闭按钮也会触发取消BTN按下的消息.
		{
			wchar_t name[32],shap[4],size[4];
			HWND h = GetDlgItem(hdlg,0x470);
			::GetWindowText(h,name,32);
			WcsCopy(LogFont->lfFaceName,name,32);

			h = GetDlgItem(hdlg,0x471);
			::GetWindowText(h,shap,4);
			if(WcsEqual(shap,L"斜体"))LogFont->lfItalic = 1,LogFont->lfWeight = 400;
			else if(WcsEqual(shap,L"粗体"))LogFont->lfItalic = 0,LogFont->lfWeight = 900;
			else if(WcsEqual(shap,L"粗斜体"))LogFont->lfItalic = 1,LogFont->lfWeight = 900;
			else LogFont->lfItalic = 0,LogFont->lfWeight = 0;

			h = GetDlgItem(hdlg,0x472);
			::GetWindowText(h,size,4);
			if(WcsEqual(size,L"初号")) LogFont->lfHeight = -56;
			else if(WcsEqual(size,L"小初")) LogFont->lfHeight = -48; 
			else if(WcsEqual(size,L"一号")) LogFont->lfHeight = -35; 
			else if(WcsEqual(size,L"小一")) LogFont->lfHeight = -32; 
			else if(WcsEqual(size,L"二号")) LogFont->lfHeight = -29; 
			else if(WcsEqual(size,L"小二")) LogFont->lfHeight = -24; 
			else if(WcsEqual(size,L"三号")) LogFont->lfHeight = -21; 
			else if(WcsEqual(size,L"小三")) LogFont->lfHeight = -20; 
			else if(WcsEqual(size,L"四号")) LogFont->lfHeight = -19; 
			else if(WcsEqual(size,L"小四")) LogFont->lfHeight = -16; 
			else if(WcsEqual(size,L"五号")) LogFont->lfHeight = -14; 
			else if(WcsEqual(size,L"小五")) LogFont->lfHeight = -12; 
			else if(WcsEqual(size,L"六号")) LogFont->lfHeight = -10; 
			else if(WcsEqual(size,L"小六")) LogFont->lfHeight = -9; 
			else if(WcsEqual(size,L"七号")) LogFont->lfHeight = -7; 
			else if(WcsEqual(size,L"八号")) LogFont->lfHeight = -7; 
			else{
				String str(size);
				LogFont->lfHeight = str.ToInt32(10);
			}
			if(LogFont->lfHeight==0) LogFont->lfHeight = 9;

			h = GetDlgItem(hdlg,0x411);
			if(BST_CHECKED==SendMessage(h,BM_GETCHECK,0,0)) LogFont->lfUnderline = 1;
			else LogFont->lfUnderline = 0;

			h = GetDlgItem(hdlg,0x410);
			if(BST_CHECKED==SendMessage(h,BM_GETCHECK,0,0)) LogFont->lfStrikeOut = 1;
			else LogFont->lfStrikeOut = 0;

			LogFont->lfCharSet = DEFAULT_CHARSET;

			OnApply(LogFont.Handle(),this);
			return 1;
		}else if(uiMsg==WM_INITDIALOG){
			HWND h = GetDlgItem(hdlg,0x470);
			::SetWindowText(h,LogFont->lfFaceName);
		}
		return 0;
	}
Exemplo n.º 20
0
static inline void SendPSChanged(HWND hDlg){
	if(m_transition==-1) return;
	g_bApplyClock = 1;
	g_bApplyTaskbar = 1;
	SendMessage(GetParent(hDlg), PSM_CHANGED, (WPARAM)(hDlg), 0);
	
	OnApply(hDlg,1);
	SendMessage(g_hwndClock, CLOCKM_REFRESHCLOCKPREVIEW, 0, 0);
}
Exemplo n.º 21
0
// virtual 
void UC_RenderLightDlg::OnOK()
{
	// Apply the setting
	OnApply();

	ASSERT(m_pCmd);
	// UC_RenderLightCmd::OnTerminate will destroy the window
	m_pCmd->OnTerminate();
}
BOOL CPPageAccelTbl::PreTranslateMessage(MSG* pMsg)
{
	if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN
			&& (pMsg->hwnd == m_WinLircEdit.m_hWnd || pMsg->hwnd == m_UIceEdit.m_hWnd)) {
		OnApply();
		return TRUE;
	}

	return __super::PreTranslateMessage(pMsg);
}
Exemplo n.º 23
0
void CNetDragonDlg::OnFileClose()
{
	if(GetDlgItem(IDC_APPLY)->IsWindowEnabled())
	{
		if(AfxMessageBox("要保存所做的修改吗?", MB_YESNO) == IDYES)
		{
			OnApply();
		}
	}
	Shell_NotifyIcon(NIM_DELETE,&nid);	//在托盘区删除图标
	exit(0);
}
Exemplo n.º 24
0
//================================================================================================
//---------------------------------------------+++--> Dialog Procedure of Miscellaneous Tab Dialog:
INT_PTR CALLBACK Page_Misc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)   //------+++-->
{
	switch(message) {
	case WM_INITDIALOG:
		OnInit(hDlg);
		return TRUE;
		
	case WM_COMMAND: {
			WORD id, code;
			id = LOWORD(wParam);
			code = HIWORD(wParam);
			
			if(id==IDCB_CLOSECAL) {
				if(IsDlgButtonChecked(hDlg, IDCB_CALTOPMOST))
					CheckDlgButton(hDlg, IDCB_CALTOPMOST, FALSE);
			}else if(id==IDCB_CALTOPMOST) {
				if(IsDlgButtonChecked(hDlg, IDCB_CLOSECAL))
					CheckDlgButton(hDlg, IDCB_CLOSECAL, FALSE);
			}else if(id==IDCB_USECALENDAR) {
				UINT iter,enable=IsDlgButtonChecked(hDlg,IDCB_USECALENDAR);
				for(iter=GROUP_CALENDAR; iter<=GROUP_CALENDAR_END; ++iter) EnableDlgItem(hDlg,iter,enable);
				SendPSChanged(hDlg);
				return TRUE;
			}else if(id==IDC_CALCOLORS) {
				INITCOMMONCONTROLSEX icex = {sizeof(icex), ICC_DATE_CLASSES};
				InitCommonControlsEx(&icex);
				DialogBox(NULL, MAKEINTRESOURCE(IDD_CALENDAR_COLOR), hDlg, Window_CalendarColorConfigDlg);
			}
			
			if((id==IDC_FIRSTWEEK&&code==CBN_SELCHANGE) || (id==IDC_FIRSTDAY&&code==CBN_SELCHANGE) || (id==IDC_CALMONTHS&&code==EN_CHANGE) || (id==IDC_CALMONTHSPAST&&code==EN_CHANGE) || id==IDC_OLDCALENDAR)
				SendPSChanged(hDlg);
			else if(((id==IDCB_CLOSECAL) ||  // IF Anything Happens to Anything,
				(id==IDCB_SHOWWEEKNUMS) || //--+++--> Send Changed Message.
				(id==IDCB_SHOW_DOY) ||
				(id==IDCB_TRANS2KICONS) ||
				(id==IDCB_MONOFF_ONLOCK) ||
				(id==IDCB_MULTIMON) ||
				(id==IDCB_CALTOPMOST)) && (code==BST_CHECKED||code==BST_UNCHECKED)) {
				SendPSChanged(hDlg);
			}
			
			return TRUE;
		}
		
	case WM_NOTIFY:
		switch(((NMHDR*)lParam)->code) {
		case PSN_APPLY:
			OnApply(hDlg);
		}
		return TRUE;
	}
	return FALSE;
}
Exemplo n.º 25
0
	bool FontDialog::Show(HWND hWnd,bool apply,bool effects){
		if(effects) ChooseFont->Flags |= CF_EFFECTS;
		if(apply) ChooseFont->Flags |= CF_APPLY|CF_ENABLEHOOK;
		if((LogFont->lfWeight<0x200)&&(!LogFont->lfItalic)) WcsCopy(ChooseFont->lpszStyle,L"常规");
		else if((LogFont->lfItalic)&&(LogFont->lfWeight<0x200)) WcsCopy(ChooseFont->lpszStyle,L"斜体");
		else if((LogFont->lfItalic)&&(LogFont->lfWeight>=0x200)) WcsCopy(ChooseFont->lpszStyle,L"粗斜体");
		else WcsCopy(ChooseFont->lpszStyle,L"粗体");
		ChooseFont->hwndOwner = hWnd;
		bool r = ::ChooseFont(ChooseFont.Handle())!=0;
		if(r) OnApply(LogFont.Handle(),this);
		return r;
	}
Exemplo n.º 26
0
void TwoDPanelDlg::OnOK()
{
	if(!m_bModified)
	{
		done(0);
	}
	else
	{
		OnApply();
		done(1);
	}
}
Exemplo n.º 27
0
void CNetDragonDlg::OnBnClickedAnnul()
{
	
	if(GetDlgItem(IDC_APPLY)->IsWindowEnabled())
	{
		if(AfxMessageBox("要保存所做的修改吗?", MB_YESNO) == IDYES)
		{
			OnApply();
		}
	}
	Shell_NotifyIcon(NIM_DELETE,&nid);	//在托盘区删除图标
	CDialog::OnCancel();
}
Exemplo n.º 28
0
/*------------------------------------------------
   Dialog Procedure for the "Format" page
--------------------------------------------------*/
INT_PTR CALLBACK PageFormatProc(HWND hDlg, UINT message,
	WPARAM wParam, LPARAM lParam)
{
	switch(message)
	{
		case WM_INITDIALOG:
			OnInit(hDlg);
			return TRUE;
		case WM_COMMAND:
		{
			WORD id, code;
			id = LOWORD(wParam); code = HIWORD(wParam);
			switch(id)
			{
				case IDC_LOCALE:
					if(code == CBN_SELCHANGE)
						OnLocale(hDlg);
					break;
				case IDC_FORMAT:
#if TC_ENABLE_SYSINFO
				case IDC_SYSII:
#endif
					if(code == EN_CHANGE)
						SendPSChanged(hDlg);
					break;
				case IDC_CUSTOM:
					OnCustom(hDlg, TRUE);
					break;
				case IDC_12HOUR:
					On12Hour(hDlg);
					break;
				case IDC_FORMATDETAIL:
					OnDetail(hDlg);
					break;
			}
			if(IDC_YEAR4 <= id && id <= IDC_AMPM)
				OnFormatCheck(hDlg, id);
			return TRUE;
		}
		case WM_NOTIFY:
			switch(((NMHDR *)lParam)->code)
			{
				case PSN_APPLY: OnApply(hDlg); break;
				case PSN_HELP: MyHelp(GetParent(hDlg), "Format"); break;
			}
			return TRUE;
	}
	return FALSE;
}
Exemplo n.º 29
0
void CPPgNTService::OnBnClickedInstall()
{
	OnApply(); // MORPH - Added by Stulle, Adjustable NT Service Strings
	if (CmdInstallService((IsDlgButtonChecked(IDC_SVC_STARTWITHSYSTEM))==BST_CHECKED )==0)
	{
		FillStatus();
		if(AfxMessageBox(GetResString(IDS_APPLY_SETTINGS),MB_YESNO) == IDYES)
			OnBnAllSettings();
		SetModified();
		if (thePrefs.m_nCurrentUserDirMode == 0) // my documents and running as a service is not a good idea. but leave it to user
			AfxMessageBox(GetResString(IDS_CHANGEUSERASSERVICE),MB_OK);
	}
	else
		SetDlgItemText(IDC_SVC_CURRENT_STATUS,GetResString(IDS_SVC_INSTALLFAILED)); 
}
Exemplo n.º 30
0
/*-------------------------------------------
  dialog procedure
---------------------------------------------*/
INT_PTR CALLBACK DlgProc(HWND hDlg, UINT message,
	WPARAM wParam, LPARAM lParam)

{
	switch(message)
	{
		case WM_INITDIALOG:
			OnInitDialog(hDlg);
			return TRUE;
		case WM_COMMAND:
		{
			WORD id; // , code;
			id = LOWORD(wParam); // code = HIWORD(wParam);
			switch(id)
			{
				case IDC_APPLY:
					OnApply(hDlg);
					break;
				case IDC_MYHELP:
					OnHelp(hDlg);
					break;
				case IDOK:
					OnOK(hDlg);
				case IDCANCEL:
					if(g_hfontDialog)
						DeleteObject(g_hfontDialog);
					SetMyRegLong(NULL, "LastTreeItem", m_lastTreeItem);
					EndDialog(hDlg, id);
					break;
			}
			return TRUE;
		}
		case WM_NOTIFY:
		{
			NM_TREEVIEW* pNMTV = (NM_TREEVIEW *)lParam;
			if(pNMTV->hdr.code == TVN_SELCHANGED)
			{
				OnTVChanged(hDlg, (int)pNMTV->itemNew.lParam);
				return TRUE;
			}
			break;
		}
		case PSM_CHANGED:
			EnableDlgItem(hDlg, IDC_APPLY, TRUE);
			return TRUE;
	}
	return FALSE;
}