Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

644 lines
17 KiB

  1. /**************************************************/
  2. /* */
  3. /* */
  4. /* Reference other characters */
  5. /* (Dialog) */
  6. /* */
  7. /* */
  8. /* Copyright (c) 1997-1999 Microsoft Corporation. */
  9. /**************************************************/
  10. #include "stdafx.h"
  11. #include "eudcedit.h"
  12. #include "refrdlg.h"
  13. #include "util.h"
  14. #define STRSAFE_LIB
  15. #include <strsafe.h>
  16. #ifdef _DEBUG
  17. #undef THIS_FILE
  18. static char BASED_CODE THIS_FILE[] = __FILE__;
  19. #endif
  20. BOOL CodeFocus;
  21. BOOL CharFocus;
  22. BOOL CompFinalized;
  23. CHOOSEFONT chf;
  24. extern LOGFONT ReffLogFont;
  25. extern LOGFONT EditLogFont;
  26. extern BOOL TitleFlag;
  27. static BOOL CALLBACK ComDlg32DlgProc(HWND hDlg, UINT uMsg,
  28. WPARAM wParam, LPARAM lParam);
  29. LRESULT CALLBACK EditCharProc( HWND hwnd, UINT uMsg,
  30. WPARAM wParam, LPARAM lParam);
  31. HIMC hImcCode = NULL;
  32. BEGIN_MESSAGE_MAP(CRefrDlg, CDialog)
  33. //{{AFX_MSG_MAP(CRefrDlg)
  34. ON_BN_CLICKED(IDC_BUTTOMFONT, OnClickedButtomfont)
  35. ON_EN_CHANGE(IDC_EDITCODE, OnChangeEditcode)
  36. ON_EN_SETFOCUS(IDC_EDITCODE, OnSetfocusEditcode)
  37. ON_EN_KILLFOCUS(IDC_EDITCODE, OnKillfocusEditcode)
  38. ON_EN_SETFOCUS(IDC_EDITCHAR, OnSetfocusEditchar)
  39. ON_EN_KILLFOCUS(IDC_EDITCHAR, OnKillfocusEditchar)
  40. ON_EN_CHANGE(IDC_EDITCHAR, OnChangeEditchar)
  41. ON_WM_DESTROY()
  42. //}}AFX_MSG_MAP
  43. END_MESSAGE_MAP()
  44. LRESULT CALLBACK EditCharProc( HWND hwnd, UINT uMsg,
  45. WPARAM wParam, LPARAM lParam)
  46. {
  47. switch (uMsg)
  48. {
  49. case WM_CHAR:
  50. {
  51. //
  52. // We always delete whatever in edit window before
  53. // proceeding to avoid multiple characters in the
  54. // window
  55. //
  56. SetWindowText(hwnd, TEXT(""));
  57. CompFinalized = TRUE;
  58. break;
  59. }
  60. case WM_IME_COMPOSITION:
  61. {
  62. if (lParam & CS_INSERTCHAR)
  63. {
  64. // This is KOR ime only. We want to clear the edit
  65. // window when the first and only the first composition
  66. // char is entered.
  67. //
  68. if (CompFinalized)
  69. {
  70. SetWindowText(hwnd, TEXT(""));
  71. }
  72. CompFinalized = FALSE;
  73. }
  74. break;
  75. }
  76. }
  77. return(AfxWndProc(hwnd, uMsg, wParam, lParam));
  78. }
  79. /****************************************/
  80. /* */
  81. /* Default Constructor */
  82. /* */
  83. /****************************************/
  84. CRefrDlg::CRefrDlg( CWnd* pParent)
  85. : CDialog(CRefrDlg::IDD, pParent)
  86. {
  87. //{{AFX_DATA_INIT(CRefrDlg)
  88. //}}AFX_DATA_INIT
  89. }
  90. /****************************************/
  91. /* */
  92. /* MESSAGE "WM_INITDIALOG" */
  93. /* */
  94. /****************************************/
  95. BOOL
  96. CRefrDlg::OnInitDialog()
  97. {
  98. CString DialogTitle;
  99. LOGFONT LogFont;
  100. CWnd *ViewWnd;
  101. CRect CharViewRect;
  102. HWND hWndCode;
  103. HWND hWndChar;
  104. HRESULT hresult;
  105. CDialog::OnInitDialog();
  106. // Implement "?" in this dialog.
  107. LONG WindowStyle = GetWindowLong( this->GetSafeHwnd(), GWL_EXSTYLE);
  108. WindowStyle |= WS_EX_CONTEXTHELP;
  109. SetWindowLong( this->GetSafeHwnd(), GWL_EXSTYLE, WindowStyle);
  110. // Set Dialog title name.
  111. if( !TitleFlag)
  112. DialogTitle.LoadString( IDS_REFERENCE_DLGTITLE);
  113. else DialogTitle.LoadString( IDS_CALL_DLGTITLE);
  114. this->SetWindowText( DialogTitle);
  115. // Subclass Dialog Control Item
  116. m_CodeList.SubclassDlgItem( ID_REFERCODE, this);
  117. m_RefListFrame1.SubclassDlgItem( IDC_LISTFRAME1, this);
  118. m_RefInfoFrame.SubclassDlgItem( IDC_INFOFRAME, this);
  119. m_ColumnHeadingR.SubclassDlgItem( IDC_COLUMNHEADINGR, this);
  120. m_EditChar.SubclassDlgItem( IDC_EDITCHAR, this);
  121. hWndChar = this->GetDlgItem(IDC_EDITCHAR)->GetSafeHwnd();
  122. if (GetWindowLongPtr(hWndChar, GWLP_WNDPROC) == (LONG_PTR)AfxWndProc)
  123. {
  124. SetWindowLongPtr(hWndChar, GWLP_WNDPROC, (LONG_PTR)EditCharProc);
  125. }
  126. hWndCode = GetDlgItem(IDC_EDITCODE)->GetSafeHwnd();
  127. if (hWndCode && ::IsWindow(hWndCode))
  128. {
  129. hImcCode = ImmAssociateContext(hWndCode, NULL);
  130. }
  131. GetFont()->GetObject( sizeof(LOGFONT), &LogFont);
  132. m_CodeList.SysFFont.CreateFontIndirect( &LogFont);
  133. m_CodeList.CalcCharSize();
  134. m_CodeList.SendMessage( WM_SETFONT,
  135. (WPARAM)m_CodeList.SysFFont.GetSafeHandle(),
  136. MAKELPARAM( TRUE, 0));
  137. m_ColumnHeadingR.SysFFont.CreateFontIndirect( &LogFont);
  138. ViewWnd = this->GetDlgItem( IDC_EDITCHAR);
  139. ViewWnd->GetClientRect( &CharViewRect);
  140. if( CharViewRect.Width() >= CharViewRect.Height())
  141. vHeight = CharViewRect.Height() - 10;
  142. else vHeight = CharViewRect.Width() - 10;
  143. if( !TitleFlag){
  144. memcpy( &m_CodeList.rLogFont, &ReffLogFont, sizeof( LOGFONT));
  145. m_CodeList.rLogFont.lfHeight = vHeight;
  146. m_CodeList.ViewFont.CreateFontIndirect( &m_CodeList.rLogFont);
  147. if( m_CodeList.CharSize.cx >= m_CodeList.CharSize.cy)
  148. m_CodeList.rLogFont.lfHeight = m_CodeList.CharSize.cy-2;
  149. else m_CodeList.rLogFont.lfHeight = m_CodeList.CharSize.cx-2;
  150. m_CodeList.CharFont.CreateFontIndirect( &m_CodeList.rLogFont);
  151. //*STRSAFE* lstrcpy( (TCHAR *)FontName,(const TCHAR *)m_CodeList.rLogFont.lfFaceName);
  152. hresult = StringCchCopy((TCHAR *)FontName , ARRAYLEN(FontName), (const TCHAR *)m_CodeList.rLogFont.lfFaceName);
  153. if (!SUCCEEDED(hresult))
  154. {
  155. return FALSE;
  156. }
  157. AdjustFontName();
  158. this->SetDlgItemText( IDC_EDITFONT, (LPTSTR)FontName);
  159. }else{
  160. memcpy( &m_CodeList.cLogFont, &EditLogFont, sizeof( LOGFONT));
  161. m_CodeList.cLogFont.lfHeight = vHeight;
  162. m_CodeList.ViewFont.CreateFontIndirect( &m_CodeList.cLogFont);
  163. if( m_CodeList.CharSize.cx >= m_CodeList.CharSize.cy)
  164. m_CodeList.cLogFont.lfHeight = m_CodeList.CharSize.cy-2;
  165. else m_CodeList.cLogFont.lfHeight = m_CodeList.CharSize.cx-2;
  166. m_CodeList.CharFont.CreateFontIndirect( &m_CodeList.cLogFont);
  167. //*STRSAFE* lstrcpy( (TCHAR *)FontName,(const TCHAR *)m_CodeList.cLogFont.lfFaceName);
  168. hresult = StringCchCopy((TCHAR *)FontName , ARRAYLEN(FontName), (const TCHAR *)m_CodeList.cLogFont.lfFaceName);
  169. if (!SUCCEEDED(hresult))
  170. {
  171. return FALSE;
  172. }
  173. AdjustFontName();
  174. this->SetDlgItemText( IDC_EDITFONT, (LPTSTR)FontName);
  175. }
  176. m_CodeList.SetCodeRange();
  177. SetViewFont();
  178. m_CodeList.EnableScrollBar(SB_VERT, ESB_ENABLE_BOTH);
  179. m_CodeList.Invalidate( FALSE);
  180. m_CodeList.UpdateWindow();
  181. CodeFocus = FALSE;
  182. CharFocus = FALSE;
  183. CompFinalized=TRUE;
  184. this->SendDlgItemMessage(IDC_EDITCODE, EM_LIMITTEXT,
  185. (WPARAM)4, (LPARAM)0);
  186. this->SendDlgItemMessage(IDC_EDITCHAR, EM_LIMITTEXT,
  187. (WPARAM)1, (LPARAM)0);
  188. return TRUE;
  189. }
  190. void
  191. CRefrDlg::OnDestroy()
  192. {
  193. if (hImcCode)
  194. {
  195. HWND hWndCode;
  196. hWndCode = GetDlgItem(IDC_EDITCODE)->GetSafeHwnd();
  197. if (hWndCode && ::IsWindow(hWndCode))
  198. {
  199. ImmAssociateContext(hWndCode, hImcCode);
  200. hImcCode = NULL;
  201. }
  202. }
  203. }
  204. /****************************************/
  205. /* */
  206. /* Set font on ViewEdit */
  207. /* */
  208. /****************************************/
  209. void
  210. CRefrDlg::SetViewFont()
  211. {
  212. HWND hWnd;
  213. hWnd = ::GetDlgItem( this->GetSafeHwnd(), IDC_EDITCHAR);
  214. ::SendMessage( hWnd, WM_SETFONT,
  215. (WPARAM)m_CodeList.ViewFont.m_hObject, MAKELPARAM(TRUE,0));
  216. }
  217. /****************************************/
  218. /* */
  219. /* COMMAND "FONT" */
  220. /* */
  221. /****************************************/
  222. void
  223. CRefrDlg::OnClickedButtomfont()
  224. {
  225. HDC hDC;
  226. HRESULT hresult;
  227. hDC = ::GetDC( this->GetSafeHwnd());
  228. chf.hDC = ::CreateCompatibleDC( hDC);
  229. ::ReleaseDC( this->GetSafeHwnd(), hDC);
  230. if( !TitleFlag){
  231. m_CodeList.rLogFont.lfHeight = 40;
  232. chf.lpLogFont = &m_CodeList.rLogFont;
  233. }else{
  234. m_CodeList.cLogFont.lfHeight = 40;
  235. chf.lpLogFont = &m_CodeList.cLogFont;
  236. }
  237. chf.lStructSize = sizeof(CHOOSEFONT);
  238. chf.hwndOwner = this->GetSafeHwnd();
  239. chf.rgbColors = GetSysColor(COLOR_WINDOWTEXT); //COLOR_BLACK;
  240. chf.lCustData = 0;
  241. chf.hInstance = AfxGetInstanceHandle();
  242. chf.lpszStyle = (LPTSTR)NULL;
  243. chf.nFontType = SCREEN_FONTTYPE;
  244. chf.lpfnHook = (LPCFHOOKPROC)(FARPROC)ComDlg32DlgProc;
  245. chf.lpTemplateName = (LPTSTR)MAKEINTRESOURCE(FORMATDLGORD31);
  246. chf.Flags = CF_SCREENFONTS | CF_NOSIMULATIONS | CF_ENABLEHOOK |
  247. CF_ENABLETEMPLATE | CF_INITTOLOGFONTSTRUCT;
  248. if( ChooseFont( &chf ) == FALSE){
  249. ::DeleteDC( chf.hDC);
  250. return ;
  251. }
  252. ::DeleteDC( chf.hDC);
  253. m_CodeList.SetCodeRange();
  254. m_CodeList.ResetParam();
  255. this->SetDlgItemText( IDC_EDITCODE, TEXT(""));
  256. this->SetDlgItemText( IDC_EDITCHAR, TEXT(""));
  257. m_CodeList.CharFont.DeleteObject();
  258. m_CodeList.ViewFont.DeleteObject();
  259. if( !TitleFlag){
  260. //*STRSAFE* lstrcpy( (TCHAR *)FontName,(const TCHAR *)m_CodeList.rLogFont.lfFaceName);
  261. hresult = StringCchCopy((TCHAR *)FontName , ARRAYLEN(FontName), (const TCHAR *)m_CodeList.rLogFont.lfFaceName);
  262. if (!SUCCEEDED(hresult))
  263. {
  264. return ;
  265. }
  266. AdjustFontName();
  267. this->SetDlgItemText( IDC_EDITFONT, FontName);
  268. m_CodeList.rLogFont.lfHeight = vHeight;
  269. m_CodeList.rLogFont.lfQuality = PROOF_QUALITY;
  270. m_CodeList.ViewFont.CreateFontIndirect( &m_CodeList.rLogFont);
  271. if( m_CodeList.CharSize.cx >= m_CodeList.CharSize.cy)
  272. m_CodeList.rLogFont.lfHeight = m_CodeList.CharSize.cy-2;
  273. else m_CodeList.rLogFont.lfHeight = m_CodeList.CharSize.cx-2;
  274. m_CodeList.CharFont.CreateFontIndirect( &m_CodeList.rLogFont);
  275. }else{
  276. //*STRSAFE* lstrcpy(FontName, (const TCHAR *)m_CodeList.cLogFont.lfFaceName);
  277. hresult = StringCchCopy(FontName , ARRAYLEN(FontName), (const TCHAR *)m_CodeList.cLogFont.lfFaceName);
  278. if (!SUCCEEDED(hresult))
  279. {
  280. return ;
  281. }
  282. AdjustFontName();
  283. this->SetDlgItemText( IDC_EDITFONT, FontName);
  284. m_CodeList.cLogFont.lfHeight = vHeight;
  285. m_CodeList.cLogFont.lfQuality = PROOF_QUALITY;
  286. m_CodeList.ViewFont.CreateFontIndirect( &m_CodeList.cLogFont);
  287. if( m_CodeList.CharSize.cx >= m_CodeList.CharSize.cy)
  288. m_CodeList.cLogFont.lfHeight = m_CodeList.CharSize.cy-2;
  289. else m_CodeList.cLogFont.lfHeight = m_CodeList.CharSize.cx-2;
  290. m_CodeList.CharFont.CreateFontIndirect( &m_CodeList.cLogFont);
  291. }
  292. SetViewFont();
  293. m_CodeList.Invalidate( TRUE);
  294. m_CodeList.UpdateWindow();
  295. CWnd *cWnd = GetDlgItem( ID_REFERCODE);
  296. GotoDlgCtrl( cWnd);
  297. return;
  298. }
  299. /****************************************/
  300. /* */
  301. /* Adjust Font Name */
  302. /* */
  303. /****************************************/
  304. void
  305. CRefrDlg::AdjustFontName()
  306. {
  307. CClientDC dc(this);
  308. CRect ViewFontRect;
  309. CSize FontNameSize, CharSize;
  310. int i;
  311. CWnd *cWnd = GetDlgItem( IDC_EDITFONT);
  312. cWnd->GetClientRect( &ViewFontRect);
  313. GetTextExtentPoint32( dc.GetSafeHdc(), (const TCHAR *)FontName,
  314. lstrlen((const TCHAR *)FontName), &FontNameSize);
  315. if( ViewFontRect.Width() <= FontNameSize.cx){
  316. GetTextExtentPoint32( dc.GetSafeHdc(), TEXT("<<"), 2, &CharSize);
  317. i = ( ViewFontRect.Width() /CharSize.cx) * 2;
  318. FontName[i-2] = '.';
  319. FontName[i-1] = '.';
  320. FontName[i] = '\0';
  321. }
  322. }
  323. /****************************************/
  324. /* */
  325. /* jump Reference code */
  326. /* */
  327. /****************************************/
  328. void CRefrDlg::JumpReferCode()
  329. {
  330. if( !m_CodeList.CodeButtonClicked())
  331. {
  332. if (CharFocus && !CompFinalized)
  333. {
  334. //
  335. // We want to cancel ime composition with wParam = 0, lParam
  336. // contains CS_INSERTCHAR.
  337. //
  338. this->SendDlgItemMessage(IDC_EDITCHAR,
  339. WM_IME_COMPOSITION,
  340. 0,
  341. CS_INSERTCHAR | CS_NOMOVECARET |
  342. GCS_COMPSTR | GCS_COMPATTR);
  343. }
  344. OutputMessageBox( this->GetSafeHwnd(),
  345. IDS_ILLEGALCODE_TITLE,
  346. IDS_ILLEGALCODE_MSG, TRUE);
  347. }else{
  348. if (CharFocus)
  349. {
  350. //
  351. // We don't want to highlight an interim KOR IME composition.
  352. //
  353. if (CompFinalized)
  354. {
  355. this->SendDlgItemMessage(IDC_EDITCHAR, EM_SETSEL, 0, -1);
  356. }
  357. }
  358. else
  359. {
  360. this->SendDlgItemMessage(IDC_EDITCODE, EM_SETSEL, 0, -1);
  361. }
  362. }
  363. }
  364. /****************************************/
  365. /* */
  366. /* COMMAND "IDOK" */
  367. /* */
  368. /****************************************/
  369. void
  370. CRefrDlg::OnOK()
  371. {
  372. if( !m_CodeList.SelectCode){
  373. OutputMessageBox( this->GetSafeHwnd(),
  374. IDS_REFERENCE_DLGTITLE,
  375. IDS_NOTSELCHARACTER_MSG, TRUE);
  376. return;
  377. }
  378. if( !TitleFlag){
  379. memcpy( &ReffLogFont, &m_CodeList.rLogFont, sizeof( LOGFONT));
  380. }else{
  381. memcpy( &EditLogFont, &m_CodeList.cLogFont, sizeof( LOGFONT));
  382. }
  383. CDialog::OnOK();
  384. }
  385. /****************************************/
  386. /* */
  387. /* COMMAND "IDCANCEL" */
  388. /* */
  389. /****************************************/
  390. void
  391. CRefrDlg::OnCancel()
  392. {
  393. m_CodeList.SelectCode = 0;
  394. CDialog::OnCancel();
  395. }
  396. /****************************************/
  397. /* */
  398. /* MESSAGE "EM_CHANGE" */
  399. /* */
  400. /****************************************/
  401. void CRefrDlg::OnChangeEditcode()
  402. {
  403. TCHAR EditCode[5];
  404. int i;
  405. EditCode[0] = '\0';
  406. this->GetDlgItemText(IDC_EDITCODE, EditCode, sizeof(EditCode)/sizeof(TCHAR));
  407. for (i=0; i<lstrlen(EditCode); i++)
  408. {
  409. if ( EditCode[i] < TEXT('0') ||
  410. (EditCode[i] > TEXT('9') && EditCode[i] < TEXT('A')) ||
  411. (EditCode[i] > TEXT('F') && EditCode[i] < TEXT('a')) ||
  412. EditCode[i] > TEXT('f'))
  413. {
  414. OutputMessageBox( this->GetSafeHwnd(),
  415. IDS_ILLEGALCODE_TITLE,
  416. IDS_ILLEGALCODE_MSG, TRUE);
  417. this->SendDlgItemMessage(IDC_EDITCODE, EM_SETSEL, 0, -1);
  418. return;
  419. }
  420. }
  421. if( lstrlen( EditCode) == 4 && CodeFocus)
  422. {
  423. JumpReferCode();
  424. }
  425. }
  426. /****************************************/
  427. /* */
  428. /* MESSAGE "WM_SETFOCUS" */
  429. /* */
  430. /****************************************/
  431. void
  432. CRefrDlg::OnSetfocusEditcode()
  433. {
  434. this->SendDlgItemMessage(IDC_EDITCODE, EM_SETSEL, 0, -1);
  435. CodeFocus = TRUE;
  436. }
  437. /****************************************/
  438. /* */
  439. /* MESSAGE "WM_KILLFOCUS" */
  440. /* */
  441. /****************************************/
  442. void
  443. CRefrDlg::OnKillfocusEditcode()
  444. {
  445. CodeFocus = FALSE;
  446. }
  447. /****************************************/
  448. /* */
  449. /* MESSAGE "WM_SETFOCUS" */
  450. /* */
  451. /****************************************/
  452. void
  453. CRefrDlg::OnSetfocusEditchar()
  454. {
  455. if (CompFinalized)
  456. {
  457. this->SendDlgItemMessage( IDC_EDITCHAR, EM_SETSEL, 0, -1);
  458. }
  459. CharFocus = TRUE;
  460. }
  461. /****************************************/
  462. /* */
  463. /* MESSAGE "WM_KILLFOCUS" */
  464. /* */
  465. /****************************************/
  466. void
  467. CRefrDlg::OnKillfocusEditchar()
  468. {
  469. CharFocus = FALSE;
  470. }
  471. /****************************************/
  472. /* */
  473. /* MESSAGE "EM_CHANGE" */
  474. /* */
  475. /****************************************/
  476. void
  477. CRefrDlg::OnChangeEditchar()
  478. {
  479. WCHAR EditChar[5] = {0};
  480. EditChar[0]=TEXT('\0');
  481. #ifdef UNICODE
  482. ::GetDlgItemTextW(this->GetSafeHwnd(),IDC_EDITCHAR, (LPWSTR)EditChar, sizeof(EditChar)/sizeof(WCHAR));
  483. #else
  484. CHAR eChar[5];
  485. int nchar = ::GetDlgItemText(this->GetSafeHwnd(),IDC_EDITCHAR, (LPSTR)eChar, sizeof(eChar));
  486. MultiByteToWideChar(CP_ACP, 0, eChar, nchar, EditChar, sizeof(EditChar)/sizeof(EditChar[0]));
  487. #endif
  488. if( CharFocus && EditChar[0] != TEXT('\0') )
  489. {
  490. int iPos = 1;
  491. /*
  492. #ifndef UNICODE
  493. if (IsDBCSLeadByte(EditChar[0]))
  494. {
  495. iPos = 2;
  496. }
  497. #endif
  498. */
  499. EditChar[iPos]=TEXT('\0');
  500. JumpReferCode();
  501. }
  502. }
  503. /****************************************/
  504. /* */
  505. /* Callback function */
  506. /* */
  507. /****************************************/
  508. static BOOL CALLBACK
  509. ComDlg32DlgProc(
  510. HWND hDlg,
  511. UINT uMsg,
  512. WPARAM wParam,
  513. LPARAM lParam)
  514. {
  515. switch (uMsg)
  516. {
  517. case WM_INITDIALOG:
  518. long WindowStyle;
  519. WindowStyle = GetWindowLong( hDlg, GWL_EXSTYLE);
  520. WindowStyle |= WS_EX_CONTEXTHELP;
  521. SetWindowLong( hDlg, GWL_EXSTYLE, WindowStyle);
  522. break;
  523. default:
  524. return FALSE;
  525. }
  526. return TRUE;
  527. }
  528. static DWORD aIds[] =
  529. {
  530. ID_REFERCODE, IDH_EUDC_REFLIST,
  531. IDC_COLUMNHEADINGR, IDH_EUDC_REFLIST,
  532. IDC_STATICC, IDH_EUDC_REFCODE,
  533. IDC_EDITCODE, IDH_EUDC_REFCODE,
  534. IDC_STATICS, IDH_EUDC_REFCHAR,
  535. IDC_EDITCHAR, IDH_EUDC_REFCHAR,
  536. IDC_STATICF, IDH_EUDC_REFFONT,
  537. IDC_EDITFONT, IDH_EUDC_REFFONT,
  538. IDC_INFOFRAME, IDH_EUDC_REFFONT,
  539. IDC_BUTTOMFONT, IDH_EUDC_FONT,
  540. // IDOK, IDH_EUDC_OK,
  541. // IDCANCEL, IDH_EUDC_CANCEL,
  542. 0,0
  543. };
  544. static DWORD aIdsCall[] =
  545. {
  546. ID_REFERCODE, IDH_EUDC_CALLLIST,
  547. IDC_COLUMNHEADINGR, IDH_EUDC_CALLLIST,
  548. IDC_STATICC, IDH_EUDC_CALLCODE,
  549. IDC_EDITCODE, IDH_EUDC_CALLCODE,
  550. IDC_STATICS, IDH_EUDC_CALLCHAR,
  551. IDC_EDITCHAR, IDH_EUDC_CALLCHAR,
  552. IDC_STATICF, IDH_EUDC_CALLFONT,
  553. IDC_EDITFONT, IDH_EUDC_CALLFONT,
  554. IDC_INFOFRAME, IDH_EUDC_CALLFONT,
  555. IDC_BUTTOMFONT, IDH_EUDC_FONT,
  556. // IDOK, IDH_EUDC_OK,
  557. // IDCANCEL, IDH_EUDC_CANCEL,
  558. 0,0
  559. };
  560. /****************************************/
  561. /* */
  562. /* Window procedure */
  563. /* */
  564. /****************************************/
  565. LRESULT
  566. CRefrDlg::WindowProc(
  567. UINT message,
  568. WPARAM wParam,
  569. LPARAM lParam)
  570. {
  571. if( message == WM_HELP){
  572. ::WinHelp((HWND)((LPHELPINFO)lParam)->hItemHandle,
  573. HelpPath, HELP_WM_HELP, (DWORD_PTR)(LPTSTR)(TitleFlag ? aIdsCall:aIds));
  574. return(0);
  575. }
  576. if( message == WM_CONTEXTMENU){
  577. ::WinHelp((HWND)wParam, HelpPath,
  578. HELP_CONTEXTMENU, (DWORD_PTR)(LPTSTR)(TitleFlag ? aIdsCall : aIds));
  579. return(0);
  580. }
  581. return CDialog::WindowProc( message, wParam, lParam);
  582. }