예제 #1
0
void ParkOrdDlg::CreateToolTips()
{
	if (!m_ToolTip.Create(this,TTS_NOPREFIX|TTS_BALLOON /*|TTS_ALWAYSTIP*/))
		return;
	
	m_ToolTip.SetFont(GetFont());
	
	if (::SendMessage(m_ToolTip.m_hWnd,TTM_SETTITLE,TTI_INFO, (LPARAM)(LPCTSTR)LoadStr(IDS_MY_TIPS)))
	{ AddToolTips(this,&m_ToolTip); }
}
예제 #2
0
BOOL CMainDialog::OnInitDialog()
{
  CDialog::OnInitDialog();

  CreateSizeGrip(true);
  CreateToolTip();

  // IDM_ABOUTBOX must be in the system command range.

  ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
  ASSERT(IDM_ABOUTBOX < 0xF000);

  // Add "About..." menu item to system menu.

  CMenu *pSysMenu = GetSystemMenu(FALSE);
  if (pSysMenu != NULL) {
    CString strAboutMenu;

    strAboutMenu.LoadString(IDS_ABOUTBOX);
    if (!strAboutMenu.IsEmpty()) {
      pSysMenu->AppendMenu(MF_SEPARATOR);
      pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
    }
  }

  // Set the icon for this dialog. The framework does this automatically
  // when the application's main window is not a dialog.

  SetIcon(m_icon, TRUE);                                             // Set big icon.
  SetIcon(m_icon, FALSE);                                            // Set small icon.

  // Tell our Rich-Text field that it shall reflect its messages
  // to this dialog. I'm to lazy to make an extra subclass.

  m_example_text.SetEventMask(ENM_MOUSEEVENTS);

  m_example_text.SetWindowText(_T("Das ist ein schöner Test-Text.\n1234567890"));

  GetFontsList();

  m_height   = 50;
  m_weight   = FW_NORMAL;
  m_facename = _T("");

  m_combo_weight.SelectString(-1, _T("Normal"));
  m_combo_height.SelectString(-1, _T("50"));

  m_spin_weight.SetBuddy(&m_combo_weight);
  m_spin_height.SetBuddy(&m_combo_height);

  if (m_fonts_list.GetCount() > 0) {
    m_fonts_list.SetCurSel(0);                                       // Select first font in list.

    OnLbnSelchangeFontsList();
  }

  AddToolTips();

  m_tooltip.AddTool(this, _T("TEST"));
  m_tooltip.AddTool(GetDlgItem(IDOK), _T("OKAY"));

  return TRUE;                                                       // Return TRUE, unless you set the focus to a control.
}