Example #1
0
LRESULT CVariablePage::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	ATLASSERT(m_piCurrentClass);
	START_PROFILE(VarInit);
	CreateControls();
	
	m_DDXManager.SetGlobalParams(m_hWnd, m_pModifications, m_pResManager);

	CRect r;
	m_Variables.GetClientRect(r);
	m_Variables.InsertColumn(0, _T("ID"), LVCFMT_LEFT, m_WindowSettings.m_VariableWidth, 0);
	m_Variables.InsertColumn(1, _T("Variable"), LVCFMT_LEFT, r.Width() - m_WindowSettings.m_VariableWidth - 5, 1);
	m_Variables.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT);
	START_PROFILE(VarDlg);
	for (size_t i = 0; i < m_pClassVector->GetCount(); i++)
	{
		VSClass* pCurClass = (*m_pClassVector)[i];
		if (!m_bOnlyDlgs ||
			(pCurClass->IsDialog() && !(pCurClass->m_DialogID.IsEmpty())))
		{
			int iItem = m_Classes.AddString(pCurClass->Name);
			m_Classes.SetItemData(iItem, i);
		}

	}
	END_PROFILE(VarDlg, _T("CVariablePage::OnInitDialog check dialog classes"));
	m_Classes.SetCurSel(0);
	m_ToolbarImgList.CreateFromImage(IDB_BITMAP_DDX, 18, 1, RGB(197, 200,201), IMAGE_BITMAP, LR_CREATEDIBSECTION);
	InitToolTip();
	END_PROFILE(VarInit, _T("CVariablePage::OnInitDialog"));

	return 0;
}
Example #2
0
BOOL CButtonST::PreTranslateMessage(MSG* pMsg) 
{
    InitToolTip();
    m_ToolTip.RelayEvent(pMsg);
    
    return CButton::PreTranslateMessage(pMsg);
} // End of PreTranslateMessage
BOOL CHoverButton::PreTranslateMessage(MSG* pMsg) 
{
	// TODO: Add your specialized code here and/or call the base class
	InitToolTip();
	m_ToolTip.RelayEvent(pMsg);		
	return CButton::PreTranslateMessage(pMsg);
}
Example #4
0
// ツールチップのメッセージを設定する。
void CButtonCx::SetToolTipText(LPCTSTR pText)
{
	// ツールチップを初期化する。
	InitToolTip();

	// テキストが有効?
	if (pText == NULL){ return; }

	CString toolTipText = pText;
	// テキストの内容が異なる?
	if (! toolTipText.IsEmpty() && m_ToolTipText.Find(toolTipText) == 0){ return; }
	m_ToolTipText = toolTipText;

	// ツール ヒント コントロールに登録されているツールの数は無効?
	if(m_ToolTip.GetToolCount() == 0)
	{
		// クライアント領域のサイズを取得します
		CRect rect; 
		GetClientRect(rect);
		// ツール ヒント コントロールにツールを登録します
		m_ToolTip.AddTool(this, m_ToolTipText, rect, 1);
	}
	else
	{
		// ツールにツール ヒント テキストを設定します。
		m_ToolTip.UpdateTipText(m_ToolTipText, this, 1);
	}
	// ツールチップを有効にします。
	SetToolTipActivate(TRUE);
}
Example #5
0
// コントロールに渡る前のメッセージを処理。
BOOL CButtonCx::PreTranslateMessage(MSG* pMsg) 
{
	// ツールチップを初期化する。
	InitToolTip();
	
	// ツール ヒント コントロールにメッセージを渡して処理。
	m_ToolTip.RelayEvent(pMsg);

	return CButton::PreTranslateMessage(pMsg);
}
BOOL CDlgParameterSubterranean::OnInitDialog() 
{
	CXDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	InitPipeLayList();
	InitToolTip();
	
//	GetDataToSubterraneanControl(m_nID);

 	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
BOOL COptionsBackup::OnInitDialog()
{
  COptions_PropertyPage::OnInitDialog();

  m_chkbox.SetTextColour(CR_DATABASE_OPTIONS);
  m_chkbox.ResetBkgColour(); //Use current window's background

  if (!GetMainDlg()->IsDBReadOnly())
    GetDlgItem(IDC_STATIC_DB_PREFS_RO_WARNING)->ShowWindow(SW_HIDE);

  if (m_backupsuffix_cbox.GetCount() == 0) {
    // add the strings in alphabetical order
    CString cs_text(MAKEINTRESOURCE(IDS_NONE));
    int nIndex;
    nIndex = m_backupsuffix_cbox.AddString(cs_text);
    m_backupsuffix_cbox.SetItemData(nIndex, PWSprefs::BKSFX_None);
    m_BKSFX_to_Index[PWSprefs::BKSFX_None] = nIndex;

    cs_text.LoadString(IDS_DATETIMESTRING);
    nIndex = m_backupsuffix_cbox.AddString(cs_text);
    m_backupsuffix_cbox.SetItemData(nIndex, PWSprefs::BKSFX_DateTime);
    m_BKSFX_to_Index[PWSprefs::BKSFX_DateTime] = nIndex;

    cs_text.LoadString(IDS_INCREMENTNUM);
    nIndex = m_backupsuffix_cbox.AddString(cs_text);
    m_backupsuffix_cbox.SetItemData(nIndex, PWSprefs::BKSFX_IncNumber);
    m_BKSFX_to_Index[PWSprefs::BKSFX_IncNumber] = nIndex;
  }

  m_backupsuffix_cbox.SetCurSel(m_BKSFX_to_Index[m_BackupSuffix]);

  GetDlgItem(IDC_BACKUPEXAMPLE)->SetWindowText(L"");

  CSpinButtonCtrl* pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_BKPMAXINCSPIN);

  pspin->SetBuddy(GetDlgItem(IDC_BACKUPMAXINC));
  pspin->SetRange(1, 999);
  pspin->SetBase(10);
  pspin->SetPos(m_MaxNumIncBackups);

  OnComboChanged();
  OnBackupBeforeSave();

  InitToolTip(TTS_BALLOON | TTS_NOPREFIX, 4);
  // Note naming convention: string IDS_xxx corresponds to control IDC_xxx
  AddTool(IDC_BACKUPBEFORESAVE,        IDS_BACKUPBEFORESAVE);
  AddTool(IDC_USERBACKUPOTHERLOCATION, IDS_USERBACKUPOTHERLOCATION);
  ActivateToolTip();

  return TRUE;
}
Example #8
0
void CExtButton::SetTooltipText(CString* spText, BOOL bActivate)
{
	if( spText == NULL )
		return;
	InitToolTip();
	if( m_ToolTip.GetToolCount() == 0 )
	{
		CRect rectBtn; 
		GetClientRect(rectBtn);
		m_ToolTip.AddTool(this,(LPCTSTR)*spText,rectBtn,1);
	}
	m_ToolTip.UpdateTipText((LPCTSTR)*spText,this,1);
	m_ToolTip.Activate(bActivate);
}
Example #9
0
BOOL CExtButton::PreTranslateMessage(MSG* pMsg) 
{
	if( !CExtPopupMenuWnd::IsMenuTracking() )
	{
		InitToolTip();
		m_ToolTip.RelayEvent(pMsg);
	}

//	if( CExtPopupMenuWnd::IsMenuTracking() )
//		return TRUE;
	if(		(	pMsg->message == WM_KEYDOWN
				|| pMsg->message == WM_KEYUP
			)
		&&
			(	pMsg->wParam == VK_RETURN
				|| pMsg->wParam == VK_SPACE
			)
		)
	{
		if( IsWindowEnabled() && IsWindowVisible() && (!m_bPushTracking) )
		{
			if(	(pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN)
				||
				(pMsg->message == WM_KEYUP && pMsg->wParam == VK_SPACE)
				)
			{
				if( GetCapture() == this )
					ReleaseCapture();
				m_bMouseOver = m_bPushed = m_bPushTracking = m_bKeyTracking = FALSE;
				Invalidate();
				UpdateWindow();
				_OnClick();
				return TRUE;
			}
			if(pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_SPACE)
			{
				m_bMouseOver = m_bPushed = m_bKeyTracking = TRUE;
				SetCapture();
				Invalidate();
				UpdateWindow();
				return TRUE;
			}
		} // if( IsWindowEnabled() && IsWindowVisible() && (!m_bPushTracking) )
		return TRUE;
	}

	return CButton::PreTranslateMessage(pMsg);
}
Example #10
0
bool CHexEdit::SetToolTipText(const CString& sText, bool bActivate)
{
    InitToolTip();
    // If there is no tooltip defined then add it
    if (m_tt.GetToolCount() == 0)
    {
        CRect rect;
        GetClientRect(rect);
        m_tt.AddTool(this, sText, rect, 1);
    }

    m_tt.UpdateTipText(sText, this, 1);
    m_tt.Activate(bActivate);

    return true;
}
void CButtonST::SetTooltipText(LPCTSTR lpszText, bool bActivate)
{
	// We cannot accept 0 pointer
	if (lpszText == 0) { return; }
	// Initialize ToolTip
	InitToolTip();
	// If there is no tooltip defined then add it
	if (m_ToolTip.GetToolCount() == 0)
		{
		CRect rectBtn; 
		GetClientRect(rectBtn);
		m_ToolTip.AddTool(*this, lpszText, rectBtn, 1);
		}
	// Set text for tooltip
	m_ToolTip.UpdateTipText(lpszText, *this, 1);
	m_ToolTip.Activate(bActivate);
}
Example #12
0
void CSkinButton2::SetToolTipText(CString sText, BOOL bActivate)
{
	if (sText.IsEmpty()) return;

	InitToolTip();
	m_tooltext = sText;

	if (m_pToolTip->GetToolCount() == 0)
	{
		CRect rectBtn; 
		GetClientRect(rectBtn);
		m_pToolTip->AddTool(this, m_tooltext, rectBtn, 1);
	}

	m_pToolTip->UpdateTipText(m_tooltext, this, 1);
	m_pToolTip->SetDelayTime(2000);
	m_pToolTip->Activate(bActivate);
}
Example #13
0
BOOL COptionsMisc::OnInitDialog() 
{
  COptions_PropertyPage::OnInitDialog();

  for (int i = 0; i < 2; i++) {
    m_chkbox[i].SetTextColour(CR_DATABASE_OPTIONS);
    m_chkbox[i].ResetBkgColour();//Use current window's background
  }

  OnUseDefUser();

  // For some reason, MFC calls us twice when initializing.
  // Populate the combo box only once.
  if (m_dblclk_cbox.GetCount() == 0) {
    SetupCombo(&m_dblclk_cbox);
  }

  if (m_shiftdblclk_cbox.GetCount() == 0) {
    SetupCombo(&m_shiftdblclk_cbox);
  }

  m_dblclk_cbox.SetCurSel(m_DCA_to_Index[m_DoubleClickAction]);
  m_shiftdblclk_cbox.SetCurSel(m_DCA_to_Index[m_ShiftDoubleClickAction]);

  GetDlgItem(IDC_OTHERBROWSERLOCATION)->SetWindowText(m_OtherBrowserLocation);
  GetDlgItem(IDC_OTHEREDITORLOCATION)->SetWindowText(m_OtherEditorLocation);

  CSpinButtonCtrl* pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_DADSPIN);

  pspin->SetBuddy(GetDlgItem(IDC_DB_DEF_AUTOTYPE_DELAY));
  pspin->SetRange32(1, 60000);
  pspin->SetBase(10);
  pspin->SetPos(m_AutotypeDelay);

  InitToolTip();
  // Note naming convention: string IDS_xxx corresponds to control IDC_xxx
  AddTool(IDC_MAINTAINDATETIMESTAMPS, IDS_MAINTAINDATETIMESTAMPS);
  AddTool(IDC_OTHERBROWSERLOCATION,   IDS_OTHERBROWSERLOCATION);
  AddTool(IDC_OTHEREDITORLOCATION,    IDS_OTHEREDITORLOCATION);
  ActivateToolTip();

  return TRUE;
}
Example #14
0
// Set the tooltip with a CString
void CHoverButton::SetToolTipText(CString *spText, BOOL bActivate)
{
	// We cannot accept NULL pointer
	if (spText == NULL) return;

	// Initialize ToolTip
	InitToolTip();

	// If there is no tooltip defined then add it
	if (m_ToolTip.GetToolCount() == 0)
	{
		CRect rectBtn; 
		GetClientRect(rectBtn);
		m_ToolTip.AddTool(this, (LPCTSTR)*spText, rectBtn, 1);
	}

	// Set text for tooltip
	m_ToolTip.UpdateTipText((LPCTSTR)*spText, this, 1);
	m_ToolTip.Activate(bActivate);
}
Example #15
0
// Set the tooltip with a CString
void CAudioLevelIndicator::SetToolTipText(CString spText, BOOL bActivate)
{
    // We cannot accept NULL pointer
    if (spText.IsEmpty()) return;

    // Initialize ToolTip
    InitToolTip();
    m_csToolText = spText;

    // If there is no tooltip defined then add it
    if (m_ToolTip->GetToolCount() == 0)
    {
        CRect rectBtn;
        GetClientRect(rectBtn);
        m_ToolTip->AddTool(this, m_csToolText, rectBtn, 1);
    }

    // Set text for tooltip
    m_ToolTip->UpdateTipText(m_csToolText, this, 1);
    ActivateTooltip(bActivate);
}
Example #16
0
//=============================================================================
// Set the tooltip with a CString
//=============================================================================
void CButtonBT::SetToolTipText(CString spText, BOOL bActivate)
{
	// We cannot accept NULL pointer
	if (spText.IsEmpty()) return;

	// Initialize ToolTip
	InitToolTip();
	m_tooltext = spText;

	// If there is no tooltip defined then add it
	if (m_pToolTip->GetToolCount() == 0)
	{
		CRect rectBtn; 
		GetClientRect(rectBtn);
		m_pToolTip->AddTool(this, m_tooltext, rectBtn, 1);
	}

	// Set text for tooltip
	m_pToolTip->UpdateTipText(m_tooltext, this, 1);
	m_pToolTip->SetDelayTime(2000);
	m_pToolTip->Activate(bActivate);
}
Example #17
0
//设置提示消息
void CPngButton::SetToolTipText(CString spText, BOOL bActivate)
{
	//验证传入参数
	if (spText.IsEmpty()) return;

	//初始化提示控件
	InitToolTip();
	m_tooltext = spText;

	//如果提示控件内容为空添加一个新的提示
	if (m_pToolTip.GetToolCount() == 0)
	{
		CRect rectBtn; 
		GetClientRect(rectBtn);
		m_pToolTip.AddTool(this, m_tooltext, rectBtn, 1);
	}

	//使用当前消息
	m_pToolTip.UpdateTipText(m_tooltext, this, 1);
	m_pToolTip.SetDelayTime(2000);
	m_pToolTip.Activate(bActivate);
}
Example #18
0
BOOL CDLGMap::OnInitDialog()
{
	Language_SetWndStaticText(this);
	CDialog::OnInitDialog();

	//载入原始图片
	if(srcImage)
	{
		cvReleaseImage(&srcImage);
		srcImage=NULL;
	}
	srcImage = cvLoadImage(MapPath, CV_LOAD_IMAGE_UNCHANGED);
	if(NULL==srcImage)
		MessageBox("miss map.bmp file");

	if(dstImage)
	{
		cvReleaseImage(&dstImage);
		dstImage=NULL;
	}
	dstImage=cvCloneImage(srcImage);
	if(NULL==dstImage)
	{
		MessageBox("CDLGMap::OnInitDialog error");
		return TRUE;
	}

	
	Load(10,(unsigned char*)"0123456789");

	InitToolTip();

	AutoSize();

	

	return TRUE;  // return TRUE  unless you set the focus to a control
}
Example #19
0
BOOL CHexEdit::PreTranslateMessage(MSG* pMsg)
{
    InitToolTip();
    m_tt.RelayEvent(pMsg);
    return CEdit::PreTranslateMessage(pMsg);
}
Example #20
0
BOOL COptionsMisc::OnInitDialog() 
{
  COptions_PropertyPage::OnInitDialog();

  for (int i = 0; i < 2; i++) {
    m_chkbox[i].SetTextColour(CR_DATABASE_OPTIONS);
    m_chkbox[i].ResetBkgColour(); // Use current window's background
  }

  // Database preferences - can't change in R/O mode of if no DB is open
  if (!GetMainDlg()->IsDBOpen() || GetMainDlg()->IsDBReadOnly()) {
    GetDlgItem(IDC_DEFUSERNAME)->EnableWindow(FALSE);
    GetDlgItem(IDC_STATIC_USERNAME)->EnableWindow(FALSE);
    GetDlgItem(IDC_STATIC_DEFAUTOTYPE)->EnableWindow(FALSE);
    GetDlgItem(IDC_DB_DEF_AUTOTYPE_TEXT)->EnableWindow(FALSE);
    GetDlgItem(IDC_MAINTAINDATETIMESTAMPS)->EnableWindow(FALSE);
    GetDlgItem(IDC_USEDEFUSER)->EnableWindow(FALSE);
  }

  OnUseDefUser();

  // For some reason, MFC calls us twice when initializing.
  // Populate the combo box only once.
  if (m_dblclk_cbox.GetCount() == 0) {
    SetupCombo(&m_dblclk_cbox);
  }

  if (m_shiftdblclk_cbox.GetCount() == 0) {
    SetupCombo(&m_shiftdblclk_cbox);
  }

  m_dblclk_cbox.SetCurSel(m_DCA_to_Index[m_DoubleClickAction]);
  m_shiftdblclk_cbox.SetCurSel(m_DCA_to_Index[m_ShiftDoubleClickAction]);

  GetDlgItem(IDC_OTHERBROWSERLOCATION)->SetWindowText(m_OtherBrowserLocation);
  GetDlgItem(IDC_OTHEREDITORLOCATION)->SetWindowText(m_OtherEditorLocation);

  CSpinButtonCtrl *pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_DADSPIN);

  pspin->SetBuddy(GetDlgItem(IDC_DB_DEF_AUTOTYPE_DELAY));
  pspin->SetRange32(M_prefminAutotypeDelay(), M_prefmaxAutotypeDelay());
  pspin->SetBase(10);
  pspin->SetPos(m_AutotypeDelay);

  if (InitToolTip(TTS_BALLOON | TTS_NOPREFIX, 0)) {
    m_Help1.Init(IDB_QUESTIONMARK);
    m_Help2.Init(IDB_QUESTIONMARK);
    m_Help3.Init(IDB_QUESTIONMARK);

    // Note naming convention: string IDS_xxx corresponds to control IDC_xxx_HELP
    AddTool(IDC_MAINTAINDATETIMESTAMPSHELP, IDS_MAINTAINDATETIMESTAMPS);
    AddTool(IDC_OTHERBROWSERLOCATIONHELP, IDS_OTHERBROWSERLOCATION);
    AddTool(IDC_OTHEREDITORLOCATIONHELP, IDS_OTHEREDITORLOCATION);
    ActivateToolTip();
  } else {
    m_Help1.EnableWindow(FALSE);
    m_Help1.ShowWindow(SW_HIDE);
    m_Help2.EnableWindow(FALSE);
    m_Help2.ShowWindow(SW_HIDE);
    m_Help3.EnableWindow(FALSE);
    m_Help3.ShowWindow(SW_HIDE);
  }

  return TRUE;  // return TRUE unless you set the focus to a control
}
Example #21
0
BOOL COptionsSystem::OnInitDialog() 
{
  COptions_PropertyPage::OnInitDialog();

  PWSprefs *prefs = PWSprefs::GetInstance();

  PWSprefs::ConfigOption configoption;
  StringX sx_CF = prefs->GetConfigFile(configoption).c_str();
  std::wstring  wsCO(L"");
  switch (configoption) {
    case PWSprefs::CF_NONE:
      LoadAString(sx_CF, IDS_NONE);
      break;
    case PWSprefs::CF_REGISTRY:
      LoadAString(sx_CF, IDS_REGISTRY);
      break;
    case PWSprefs::CF_FILE_RO:
      LoadAString(wsCO, IDS_READ_ONLY);
      break;
    case PWSprefs::CF_FILE_RW:
    case PWSprefs::CF_FILE_RW_NEW:
      LoadAString(wsCO, IDS_READ_WRITE);
      break;
    default:
      ASSERT(0);
  }

  CString cs_text;

  // R/W status
  GetDlgItem(IDC_STATIC_RWSTATUS)->SetWindowText(wsCO.c_str());

  // Config file name & location
  cs_text = PWSUtil::NormalizeTTT(sx_CF, 60).c_str();
  GetDlgItem(IDC_CONFIGFILE)->SetWindowText(cs_text);

  // Effective host & user used in config file
  if (configoption == PWSprefs::CF_FILE_RO || 
      configoption == PWSprefs::CF_FILE_RW ||
      configoption == PWSprefs::CF_FILE_RW_NEW) {
    stringT hn = SysInfo::GetInstance()->GetEffectiveHost();
    PWSprefs::XMLify(charT('H'), hn);
    stringT un = SysInfo::GetInstance()->GetEffectiveUser();
    PWSprefs::XMLify(charT('u'), un);

    cs_text.Format(IDS_HOSTUSER, static_cast<LPCWSTR>(hn.c_str()), static_cast<LPCWSTR>(un.c_str()));
    GetDlgItem(IDC_STATIC_HOSTUSER)->SetWindowText(cs_text);
  }

  bool bofferdeleteregistry = prefs->OfferDeleteRegistry();

  bool boffermigrate2appdata = OfferConfigMigration();

  if (!bofferdeleteregistry) {
    GetDlgItem(IDC_REGDEL)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_REGDEL)->EnableWindow(FALSE);
  }

  if (!boffermigrate2appdata) {
    GetDlgItem(IDC_MIGRATETOAPPDATA)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_MIGRATETOAPPDATA)->EnableWindow(FALSE);
  }

  if (!bofferdeleteregistry && !boffermigrate2appdata) {
    GetDlgItem(IDC_CONFIG_GRP)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_APPLYCONFIGCHANGES)->ShowWindow(SW_HIDE);
  } else {
    GetDlgItem(IDC_APPLYCONFIGCHANGES)->ShowWindow(SW_SHOW);
  }

  GetDlgItem(IDC_APPLYCONFIGCHANGES)->EnableWindow(FALSE);

  CSpinButtonCtrl *pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_RESPIN);
  pspin->SetBuddy(GetDlgItem(IDC_MAXREITEMS));
  pspin->SetRange(M_prefminREItems(), M_prefmaxREItems());
  pspin->SetBase(10);
  pspin->SetPos(m_MaxREItems);

  pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_MRUSPIN);
  pspin->SetBuddy(GetDlgItem(IDC_MAXMRUITEMS));
  pspin->SetRange(M_prefminMRU(), M_prefmaxMRU());
  pspin->SetBase(10);
  pspin->SetPos(m_MaxMRUItems);

  OnUseSystemTray();

  if (InitToolTip(TTS_BALLOON | TTS_NOPREFIX, 0)) {
    m_Help1.Init(IDB_QUESTIONMARK);
    m_Help2.Init(IDB_QUESTIONMARK);

    // Note naming convention: string IDS_xxx corresponds to control IDC_xxx_HELP
    AddTool(IDC_REGDELHELP, IDS_REGDEL);
    AddTool(IDC_MIGRATETOAPPDATAHELP, IDS_MIGRATETOAPPDATA);
    ActivateToolTip();
  } else {
    m_Help1.EnableWindow(FALSE);
    m_Help1.ShowWindow(SW_HIDE);
    m_Help2.EnableWindow(FALSE);
    m_Help2.ShowWindow(SW_HIDE);
  }

  if (!bofferdeleteregistry) {
    m_Help1.EnableWindow(FALSE);
    m_Help1.ShowWindow(SW_HIDE);
  }

  if (!boffermigrate2appdata) {
    m_Help2.EnableWindow(FALSE);
    m_Help2.ShowWindow(SW_HIDE);
  }

  return TRUE;  // return TRUE unless you set the focus to a control
}
Example #22
0
BOOL COptionsSystem::OnInitDialog() 
{
  COptions_PropertyPage::OnInitDialog();

  PWSprefs *prefs = PWSprefs::GetInstance();
  if (!m_bShowConfigFile) {
    GetDlgItem(IDC_STATIC_CONFIGFILE)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_STATIC_RWSTATUS)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_CONFIGFILE)->ShowWindow(SW_HIDE);
  } else {
    PWSprefs::ConfigOption configoption;
    std::wstring wsCF = prefs->GetConfigFile(configoption);
    std::wstring wsCO(L"");
    switch (configoption) {
      case PWSprefs::CF_NONE:
        LoadAString(wsCF, IDS_NONE);
        break;
      case PWSprefs::CF_REGISTRY:
        LoadAString(wsCF, IDS_REGISTRY);
        break;
      case PWSprefs::CF_FILE_RO:
        LoadAString(wsCO, IDS_READ_ONLY);
        break;
      case PWSprefs::CF_FILE_RW:
      case PWSprefs::CF_FILE_RW_NEW:
        LoadAString(wsCO, IDS_READ_WRITE);
        break;
      default:
        ASSERT(0);
    }
    GetDlgItem(IDC_CONFIGFILE)->SetWindowText(wsCF.c_str());
    GetDlgItem(IDC_STATIC_RWSTATUS)->SetWindowText(wsCO.c_str());
  }

  bool bofferdeleteregistry = prefs->OfferDeleteRegistry();

  bool boffermigrate2appdata = OfferConfigMigration();

  if (!bofferdeleteregistry) {
    GetDlgItem(IDC_REGDEL)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_REGDEL)->EnableWindow(FALSE);
  }

  if (!boffermigrate2appdata) {
    GetDlgItem(IDC_MIGRATETOAPPDATA)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_MIGRATETOAPPDATA)->EnableWindow(FALSE);
  }

  if (!bofferdeleteregistry && !boffermigrate2appdata) {
    GetDlgItem(IDC_CONFIG_GRP)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_APPLYCONFIGCHANGES)->ShowWindow(SW_HIDE);
  } else {
    GetDlgItem(IDC_APPLYCONFIGCHANGES)->ShowWindow(SW_SHOW);
  }

  GetDlgItem(IDC_APPLYCONFIGCHANGES)->EnableWindow(FALSE);

  CSpinButtonCtrl *pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_RESPIN);

  pspin->SetBuddy(GetDlgItem(IDC_MAXREITEMS));
  pspin->SetRange(0, ID_TRAYRECENT_ENTRYMAX - ID_TRAYRECENT_ENTRY1 + 1);
  pspin->SetBase(10);
  pspin->SetPos(m_MaxREItems);

  pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_MRUSPIN);

  pspin->SetBuddy(GetDlgItem(IDC_MAXMRUITEMS));
  pspin->SetRange(0, ID_FILE_MRU_ENTRYMAX - ID_FILE_MRU_ENTRY1 + 1);
  pspin->SetBase(10);
  pspin->SetPos(m_MaxMRUItems);

  OnUseSystemTray();

  InitToolTip(TTS_BALLOON | TTS_NOPREFIX, 2);
  AddTool(IDC_REGDEL,           IDS_REGDEL);
  AddTool(IDC_MIGRATETOAPPDATA, IDS_MIGRATETOAPPDATA);
  ActivateToolTip();

  return TRUE;  // return TRUE unless you set the focus to a control
  // EXCEPTION: OCX Property Pages should return FALSE
}
Example #23
0
LRESULT CFunctionPage::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	bHandled = TRUE;
	START_PROFILE(FuncInit);
	m_MessageMaps.Attach(GetDlgItem(IDC_COMBO_MESSAGEMAP));
	m_MessageManager.Init(m_hWnd, m_pResManager, &m_GeneralResources);
	m_FunctionManager.Init(m_hWnd);

	CreateControls();

	CImageList ImageList;
	ImageList.Create(16, 16, ILC_COLOR24 | ILC_MASK, 3, 2);
	ImageList.AddIcon(LoadIcon(_AtlModule.GetResourceInstance(), MAKEINTRESOURCE(IDI_ICON_CLOSE)));
	ImageList.AddIcon(LoadIcon(_AtlModule.GetResourceInstance(), MAKEINTRESOURCE(IDI_ICON_OPEN)));
	ImageList.AddIcon(LoadIcon(_AtlModule.GetResourceInstance(), MAKEINTRESOURCE(IDI_ICON_MESSAGE)));
	ImageList.Add(LoadBitmap(_AtlModule.GetResourceInstance(), MAKEINTRESOURCE(IDB_BITMAP_ICONS)), 0x7C00FF);

	m_Messages.SetImageList(ImageList.Detach(), TVSIL_NORMAL);
	FillTreeView();

	//построение дерева
	HTREEITEM hRoot = m_Messages.GetRootItem();
	m_Messages.Expand(hRoot);
	HTREEITEM hRootChild = m_Messages.GetChildItem(hRoot);
	while(hRootChild)
	{
		m_Messages.Expand(hRootChild);
		hRootChild = m_Messages.GetNextSiblingItem(hRootChild);
	}

	CRect r;
	m_Handlers.GetWindowRect(r);
	int width = m_WindowSettings.m_HandlerHeaderWidth; //(r.Width() * 5) / 11;
	m_Handlers.InsertColumn(0, _T("Handler"), LVCFMT_LEFT, width, 0);
	m_Handlers.InsertColumn(1, _T("Message"), LVCFMT_LEFT, r.Width() - width-5, 1);
	m_Handlers.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT);

	if (m_pClassVector->GetCount())
	{
		int iCurClass = 0;
		for (size_t i = 0; i < m_pClassVector->GetCount(); i++)
		{
			int iPos = m_ClassCombo.AddString((*m_pClassVector)[i]->Name);
			m_ClassCombo.SetItemData(iPos, i);
			if (i == *m_piCurrentClass)
				iCurClass = iPos;
		}
		m_ClassCombo.SetCurSel(iCurClass);
		UpdateClass();
	}

	LoadGeneralResources();
	m_ToolbarImgList.CreateFromImage(IDB_BITMAP_MESSAGE, 18, 6, RGB(197, 200,201), IMAGE_BITMAP, LR_CREATEDIBSECTION);
	InitToolTip();
	m_ToolTip.SetMaxTipWidth(400);
	if ((int)_AtlModule.m_eWTLVersion < eWTL75)
	{
		GetDlgItem(IDC_CHECK_REFLECT_EX).ShowWindow(SW_HIDE);
	}

	m_SplitMessages.SetFocus();
	END_PROFILE(FuncInit, _T("CFunctionPage::OnInitDialog"));
	return 0;
}
Example #24
0
BOOL COptionsBackup::OnInitDialog()
{
  COptions_PropertyPage::OnInitDialog();

  m_chkbox.SetTextColour(CR_DATABASE_OPTIONS);
  m_chkbox.ResetBkgColour(); //Use current window's background

  if (GetMainDlg()->IsDBOpen() && !GetMainDlg()->IsDBReadOnly()) {
    GetDlgItem(IDC_STATIC_DB_PREFS_RO_WARNING)->ShowWindow(SW_HIDE);
  }

  // Database preferences - can't change in R/O mode of if no DB is open
  if (!GetMainDlg()->IsDBOpen() || GetMainDlg()->IsDBReadOnly()) {
    CString cs_Preference_Warning;
    CString cs_temp(MAKEINTRESOURCE(GetMainDlg()->IsDBOpen() ? IDS_DB_READ_ONLY : IDS_NO_DB));

    cs_Preference_Warning.Format(IDS_STATIC_DB_PREFS_RO_WARNING, static_cast<LPCWSTR>(cs_temp));
    GetDlgItem(IDC_STATIC_DB_PREFS_RO_WARNING)->SetWindowText(cs_Preference_Warning);

    GetDlgItem(IDC_SAVEIMMEDIATELY)->EnableWindow(FALSE);
  }

  if (m_backupsuffix_cbox.GetCount() == 0) {
    // add the strings in alphabetical order
    CString cs_text(MAKEINTRESOURCE(IDS_NONE));
    int nIndex;
    nIndex = m_backupsuffix_cbox.AddString(cs_text);
    m_backupsuffix_cbox.SetItemData(nIndex, PWSprefs::BKSFX_None);
    m_BKSFX_to_Index[PWSprefs::BKSFX_None] = nIndex;

    cs_text.LoadString(IDS_DATETIMESTRING);
    nIndex = m_backupsuffix_cbox.AddString(cs_text);
    m_backupsuffix_cbox.SetItemData(nIndex, PWSprefs::BKSFX_DateTime);
    m_BKSFX_to_Index[PWSprefs::BKSFX_DateTime] = nIndex;

    cs_text.LoadString(IDS_INCREMENTNUM);
    nIndex = m_backupsuffix_cbox.AddString(cs_text);
    m_backupsuffix_cbox.SetItemData(nIndex, PWSprefs::BKSFX_IncNumber);
    m_BKSFX_to_Index[PWSprefs::BKSFX_IncNumber] = nIndex;
  }

  m_backupsuffix_cbox.SetCurSel(m_BKSFX_to_Index[m_BackupSuffix]);

  GetDlgItem(IDC_BACKUPEXAMPLE)->SetWindowText(L"");

  CSpinButtonCtrl* pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_BKPMAXINCSPIN);

  pspin->SetBuddy(GetDlgItem(IDC_BACKUPMAXINC));
  pspin->SetRange(1, 999);
  pspin->SetBase(10);
  pspin->SetPos(m_MaxNumIncBackups);

  OnComboChanged();
  OnBackupBeforeSave();

  if (m_BackupLocation == 1) {
    ExpandBackupPath();
  }

  if (InitToolTip(TTS_BALLOON | TTS_NOPREFIX, 0)) {
    m_Help1.Init(IDB_QUESTIONMARK);
    m_Help2.Init(IDB_QUESTIONMARK);
    m_Help3.Init(IDB_QUESTIONMARK);
    m_Help4.Init(IDB_QUESTIONMARK);

    // Note naming convention: string IDS_xxx corresponds to control IDC_xxx_HELP
    AddTool(IDC_BACKUPBEFORESAVEHELP, IDS_BACKUPBEFORESAVE);
    AddTool(IDC_USERBACKUPOTHERLOCATIONHELP, IDS_USERBACKUPOTHERLOCATION);
    AddTool(IDC_USERBACKUPOTHERLOCATIONHELP2, IDS_USERBACKUPOTHERLOCATION2);
    AddTool(IDC_SAVEIMMEDIATELYHELP, IDS_SAVEIMMEDIATELY);
    ActivateToolTip();
  } else {
    m_Help1.EnableWindow(FALSE);
    m_Help1.ShowWindow(SW_HIDE);
    m_Help2.EnableWindow(FALSE);
    m_Help2.ShowWindow(SW_HIDE);
    m_Help3.EnableWindow(FALSE);
    m_Help3.ShowWindow(SW_HIDE);
    m_Help4.EnableWindow(FALSE);
    m_Help4.ShowWindow(SW_HIDE);
  }

  return TRUE;
}