PageRenderTime 53ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 1ms

/amaya/windialogapi.c

https://github.com/pffy/Amaya-Editor
C | 4236 lines | 3601 code | 324 blank | 311 comment | 428 complexity | 251235d4c40f6a6f9ebb0a3f1a298df0 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. /*
  2. *
  3. * (c) COPYRIGHT INRIA, 1996-2005
  4. * Please first read the full copyright statement in file COPYRIGHT.
  5. *
  6. */
  7. /*
  8. * Windows Dialogue API routines for Amaya
  9. *
  10. * Authors: I. Vatton (W3C/INRIA),
  11. * R. Guetari (W3C/INRIA),
  12. * J. Kahan (W3C/INRIA)
  13. *
  14. */
  15. #ifdef _WINGUI
  16. #include <windows.h>
  17. #include "resource.h"
  18. #include "constmedia.h"
  19. #include "corrmsg.h"
  20. #define THOT_EXPORT extern
  21. #include "amaya.h"
  22. #include "constmenu.h"
  23. #include "wininclude.h"
  24. extern ThotWindow FrRef[MAX_FRAME + 2];
  25. extern int ActiveFrame;
  26. #ifndef MAX_PROPOSAL_CHKR
  27. #define MAX_PROPOSAL_CHKR 10
  28. #endif /* MAX_PROPOSAL_CHKR */
  29. #ifndef MAX_WORD_LEN
  30. #define MAX_WORD_LEN 30
  31. #endif /* MAX_WORD_LEN */
  32. #define MAX_BUFF 4096
  33. /* JK: I think that some of these widgets, which are general, should
  34. go into the thotlib, such as IDC_LANGEDIT. We have a dupblication of
  35. IDC refs between thotlib and Amaya */
  36. #define IDC_EDITRULE 20001
  37. #define IDC_LANGEDIT 20002
  38. #define IDC_CSSEDIT 20004
  39. #define OPT1 1110
  40. #define OPT2 1111
  41. #define OPT3 1112
  42. #define OPT4 1113
  43. #define OPT5 1114
  44. #define OPT6 1115
  45. #define OPT7 1116
  46. #define OPT8 1117
  47. #define OPT9 1118
  48. #define REPEAT_XY 0
  49. #define REPEAT_X 1
  50. #define REPEAT_Y 2
  51. #define NO_REPEAT 3
  52. int WIN_IndentValue;
  53. int WIN_OldLineSp;
  54. int WIN_NormalLineSpacing;
  55. extern HINSTANCE hInstance;
  56. extern HDC TtPrinterDC;
  57. extern char DocToOpen[MAX_LENGTH];
  58. extern ThotBool TtIsPrinterTrueColor;
  59. extern ThotBool bUserAbort;
  60. extern ThotBool WithToC;
  61. extern ThotBool NumberLinks;
  62. extern ThotBool PrintURL;
  63. extern ThotBool IgnoreCSS;
  64. extern HFONT DialogFont;
  65. ThotWindow ghwndAbort;
  66. ThotWindow ghwndMain;
  67. ThotWindow MakeIDHwnd;
  68. ThotBool gbAbort;
  69. Document TmpDoc; /* used to pass the Document id to the
  70. callback when setting up a menu */
  71. static HDC hDC;
  72. static HDC hMemDC;
  73. static char UrlToOpen[MAX_LENGTH];
  74. static char HrefUrl[MAX_LENGTH];
  75. static char TmpDocName[MAX_LENGTH];
  76. static char AltText[MAX_LENGTH];
  77. static char Message[300];
  78. static char Message2[300];
  79. static char Message3[300];
  80. static char WndTitle[100];
  81. static char CurrentPathName[100];
  82. static char WinCurLang[100];
  83. static char WinCurXML[100];
  84. static char CurFileToPrint[MAX_PATH];
  85. static char AttDlgTitle[100];
  86. static char MathEntName[MAX_TXT_LEN];
  87. static char SzBuffer[MAX_BUFF];
  88. static char *ClassList;
  89. static char *ItemList;
  90. static char *SavList;
  91. static char *cssList;
  92. static char *mimeType;
  93. static char *charSet;
  94. static char *string_par1;
  95. static char *string_par2;
  96. static char text[1024];
  97. static int repeatMode;
  98. static int fontNum;
  99. static int fontStyle;
  100. static int fontWeight;
  101. static int fontUnderline;
  102. static int fontSize;
  103. static int docSelect;
  104. static int dirSelect;
  105. static int currAttrVal;
  106. static int Num_zoneRecess;
  107. static int Num_zoneLineSpacing;
  108. static int Num_lang;
  109. static int XMLnum;
  110. static int Align_num;
  111. static int Indent_value;
  112. static int Indent_num;
  113. static int Old_lineSp;
  114. static int Line_spacingNum;
  115. static int attDlgNbItems;
  116. static int numCols;
  117. static int numRows;
  118. static int tBorder;
  119. static int formAlt;
  120. static int iLocation;
  121. static int iMode;
  122. static int indexImgFilter = 1;
  123. static int indexLinkFilter = 1;
  124. static int indexFilter = 1;
  125. static UINT itemIndex;
  126. static UINT nbClass;
  127. static UINT NbItem;
  128. static ThotBool saveBeforeClose;
  129. static ThotBool closeDontSave;
  130. static ThotBool isHref;
  131. static ThotBool WithEdit;
  132. static ThotBool WithCancel;
  133. static ThotBool WithBorder;
  134. static ThotBool HTMLFormat;
  135. static ThotBool ReleaseFocus;
  136. static ThotBool RequiredAttr;
  137. static OPENFILENAME OpenFileName;
  138. static char *SzFilter;
  139. static ThotWindow wndCSSList;
  140. static ThotWindow wndXMLList;
  141. static ThotWindow wndLangList;
  142. static ThotWindow wndListRule;
  143. static ThotWindow wndEditRule;
  144. static ThotWindow WndClose = NULL;
  145. static ThotWindow transURLWnd;
  146. static ThotWindow copyImgWnd;
  147. static ThotWindow WndSearchEdit;
  148. static ThotWindow GraphPal = NULL;
  149. static ThotWindow MathPal = NULL;
  150. static ThotWindow GreekPal = NULL;
  151. static ThotWindow CharacterForm = NULL;
  152. static ThotWindow FormatForm = NULL;
  153. static ThotWindow PrintForm = NULL;
  154. static ThotWindow LangForm = NULL;
  155. static ThotWindow XMLForm = NULL;
  156. static ThotWindow AttrForm = NULL;
  157. static ThotWindow SaveAsForm = NULL;
  158. static ThotWindow MimeTypeDlg = NULL;
  159. static ThotWindow InitConfirmForm = NULL;
  160. static ThotWindow DocInfo[DocumentTableLength];
  161. #include "init_f.h"
  162. /*----------------------------------------------------------------------
  163. DisplayStyleValue: update the property in Style dialog
  164. ----------------------------------------------------------------------*/
  165. void DisplayStyleValue (char *property, char *start_value, char *end_value)
  166. {
  167. }
  168. /*----------------------------------------------------------------------
  169. ReusePrinterDC()
  170. Call the Windows print dialogue or reuse the previous context.
  171. ----------------------------------------------------------------------*/
  172. void ReusePrinterDC ()
  173. {
  174. int orientation, paper;
  175. if (TtaGetPrinterDC (TRUE, &orientation, &paper))
  176. {
  177. ThotCallback (BasePrint + PPrinterName, STRING_DATA, CurFileToPrint);
  178. ThotCallback (BasePrint + FormPrint, INTEGER_DATA, (char *)1);
  179. }
  180. }
  181. /*********************************************************
  182. * *
  183. * C A L L B A C K S *
  184. * *
  185. *********************************************************/
  186. /*-----------------------------------------------------------------------
  187. AltDlgProc
  188. ------------------------------------------------------------------------*/
  189. LRESULT CALLBACK AltDlgProc (ThotWindow hwnDlg, UINT msg, WPARAM wParam,
  190. LPARAM lParam)
  191. {
  192. switch (msg)
  193. {
  194. case WM_INITDIALOG:
  195. SetWindowText (hwnDlg, TtaGetMessage (AMAYA, AM_ALT));
  196. SetWindowText (GetDlgItem (hwnDlg, IDC_ALTTEXT),
  197. TtaGetMessage (AMAYA, AM_ALT));
  198. SetWindowText (GetDlgItem (hwnDlg, ID_CONFIRM),
  199. TtaGetMessage (LIB, TMSG_LIB_CONFIRM));
  200. SetWindowText (GetDlgItem (hwnDlg, ID_DONE),
  201. TtaGetMessage (LIB, TMSG_DONE));
  202. SetDlgItemText (hwnDlg, IDC_GETALT, "");
  203. break;
  204. case WM_COMMAND:
  205. switch (LOWORD (wParam))
  206. {
  207. case ID_CONFIRM:
  208. case ID_DONE:
  209. GetDlgItemText (hwnDlg, IDC_GETALT, AltText, sizeof (AltText) - 1);
  210. ThotCallback (BaseImage + ImageAlt, STRING_DATA, AltText);
  211. if (!AltText || AltText[0] == 0)
  212. MessageBox (hwnDlg, TtaGetMessage (AMAYA, AM_ALT_MISSING),
  213. TtaGetMessage (AMAYA, AM_ALT), MB_OK | MB_ICONERROR);
  214. else
  215. EndDialog (hwnDlg, ID_CONFIRM);
  216. ThotCallback (BaseImage + FormAlt, STRING_DATA, (char *)1);
  217. break;
  218. }
  219. break;
  220. default:
  221. return FALSE;
  222. }
  223. return TRUE;
  224. }
  225. /*-----------------------------------------------------------------------
  226. XMLDlgProc
  227. ------------------------------------------------------------------------*/
  228. LRESULT CALLBACK XMLDlgProc (ThotWindow hwnDlg, UINT msg, WPARAM wParam,
  229. LPARAM lParam)
  230. {
  231. int index = 0;
  232. UINT i = 0;
  233. switch (msg)
  234. {
  235. case WM_INITDIALOG:
  236. /* get the default GUI font */
  237. /* destroy the focus of the previous open dialog */
  238. XMLForm = hwnDlg;
  239. SetWindowText (hwnDlg, TtaGetMessage (LIB, TMSG_EL_TYPE));
  240. SetWindowText (GetDlgItem (hwnDlg, ID_APPLY), TtaGetMessage (LIB, TMSG_INSERT));
  241. SetWindowText (GetDlgItem (hwnDlg, ID_DONE), TtaGetMessage (LIB, TMSG_DONE));
  242. SetWindowText (GetDlgItem (hwnDlg, IDC_XMLELEM),
  243. TtaGetMessage (LIB, TMSG_EL_TYPE));
  244. wndXMLList = GetDlgItem (hwnDlg, IDC_XMLLIST);
  245. /* set the font of the window */
  246. WIN_SetDialogfont (wndXMLList);
  247. SendMessage (wndXMLList, LB_RESETCONTENT, 0, 0);
  248. while (i < NbItem && ItemList[index] != EOS)
  249. {
  250. SendMessage (wndXMLList, LB_INSERTSTRING, i, (LPARAM) &ItemList[index]);
  251. index += strlen (&ItemList[index]) + 1;/* Longueur de l'intitule */
  252. i++;
  253. }
  254. SetWindowText (GetDlgItem (hwnDlg, IDC_XMLEDIT), "");
  255. XMLnum = -1;
  256. break;
  257. case WM_CLOSE:
  258. case WM_DESTROY:
  259. XMLForm = NULL;
  260. EndDialog (hwnDlg, ID_DONE);
  261. break;
  262. case WM_COMMAND:
  263. if (LOWORD (wParam) == 1 || HIWORD (wParam) == LBN_SELCHANGE ||
  264. HIWORD (wParam) == LBN_DBLCLK)
  265. {
  266. if (HIWORD (wParam) == LBN_SELCHANGE)
  267. {
  268. XMLnum = SendMessage (wndXMLList, LB_GETCURSEL, 0, 0);
  269. XMLnum = SendMessage (wndXMLList, LB_GETTEXT, XMLnum,
  270. (LPARAM) WinCurXML);
  271. SetWindowText (GetDlgItem (hwnDlg, IDC_XMLEDIT), WinCurXML);
  272. }
  273. else if (HIWORD (wParam) == LBN_DBLCLK)
  274. {
  275. if (LB_ERR == (XMLnum = SendMessage (wndLangList, LB_GETCURSEL, 0, 0L)))
  276. break;
  277. XMLnum = SendMessage (wndLangList, LB_GETTEXT, XMLnum,
  278. (LPARAM) WinCurLang);
  279. }
  280. SetDlgItemText (hwnDlg, IDC_XMLEDIT, WinCurXML);
  281. ThotCallback (NumSelectElemToBeCreated, STRING_DATA, WinCurXML);
  282. if (HIWORD (wParam) == LBN_DBLCLK)
  283. {
  284. /* confirm the selection */
  285. ThotCallback (NumFormElemToBeCreated, INTEGER_DATA, (char*) 1);
  286. XMLForm = NULL;
  287. EndDialog (hwnDlg, ID_DONE);
  288. return FALSE;
  289. }
  290. }
  291. switch (LOWORD (wParam))
  292. {
  293. case ID_APPLY:
  294. GetDlgItemText (hwnDlg, IDC_XMLEDIT, WinCurXML, sizeof (WinCurXML) - 1);
  295. if (WinCurXML[0] != EOS)
  296. ThotCallback (NumSelectElemToBeCreated, STRING_DATA, WinCurXML);
  297. ThotCallback (NumFormElemToBeCreated, INTEGER_DATA, (char*) 1);
  298. if (WinCurXML[0] != EOS)
  299. {
  300. /* reinitialize the list */
  301. wndXMLList = GetDlgItem (hwnDlg, IDC_XMLLIST);
  302. while (i < NbItem && ItemList[index] != EOS)
  303. {
  304. if (i == NbItem - 1)
  305. SendMessage (wndXMLList, LB_INSERTSTRING, i, (LPARAM) &ItemList[index]);
  306. index += strlen (&ItemList[index]) + 1;
  307. i++;
  308. }
  309. SetWindowText (GetDlgItem (hwnDlg, IDC_XMLEDIT), "");
  310. XMLnum = -1;
  311. }
  312. break;
  313. case ID_DONE:
  314. ThotCallback (NumFormElemToBeCreated, INTEGER_DATA, (char*) 0);
  315. XMLForm = NULL;
  316. EndDialog (hwnDlg, ID_DONE);
  317. break;
  318. case WM_CLOSE:
  319. case WM_DESTROY:
  320. XMLForm = NULL;
  321. EndDialog (hwnDlg, ID_DONE);
  322. break;
  323. }
  324. break;
  325. default: return FALSE;
  326. }
  327. return TRUE;
  328. }
  329. /*-----------------------------------------------------------------------
  330. CSSDlgProc
  331. ------------------------------------------------------------------------*/
  332. LRESULT CALLBACK CSSDlgProc (ThotWindow hwnDlg, UINT msg, WPARAM wParam,
  333. LPARAM lParam)
  334. {
  335. int index = 0;
  336. UINT i = 0;
  337. switch (msg)
  338. {
  339. case WM_INITDIALOG:
  340. SetWindowText (hwnDlg, WndTitle);
  341. SetWindowText (GetDlgItem (hwnDlg, ID_CONFIRM),
  342. TtaGetMessage (LIB, TMSG_LIB_CONFIRM));
  343. SetWindowText (GetDlgItem (hwnDlg, ID_DONE),
  344. TtaGetMessage (LIB, TMSG_DONE));
  345. SetWindowText (GetDlgItem (hwnDlg, IDC_CSSFILES),
  346. TtaGetMessage (AMAYA, AM_CSS_FILE));
  347. wndCSSList = GetDlgItem (hwnDlg, IDC_CSSLIST);
  348. /* set the font of the window */
  349. WIN_SetDialogfont (wndCSSList);
  350. SendMessage (wndCSSList, LB_RESETCONTENT, 0, 0);
  351. while (i < NbItem && cssList[index] != EOS)
  352. {
  353. SendMessage (wndCSSList, LB_INSERTSTRING, i, (LPARAM) &cssList[index]);
  354. index += strlen (&cssList[index]) + 1; /* entry length */
  355. i++;
  356. }
  357. itemIndex = SendMessage (wndCSSList, LB_SETCURSEL, (WPARAM)0, (LPARAM)0);
  358. SetDlgItemText (hwnDlg, IDC_CSSEDIT, SzBuffer);
  359. break;
  360. case WM_CLOSE:
  361. case WM_DESTROY:
  362. EndDialog (hwnDlg, ID_DONE);
  363. break;
  364. case WM_COMMAND:
  365. if (LOWORD (wParam) == IDC_CSSLIST && HIWORD (wParam) == LBN_SELCHANGE)
  366. {
  367. itemIndex = SendMessage (wndCSSList, LB_GETCURSEL, 0, 0);
  368. itemIndex = SendMessage (wndCSSList, LB_GETTEXT, itemIndex, (LPARAM) SzBuffer);
  369. SetDlgItemText (hwnDlg, IDC_CSSEDIT, SzBuffer);
  370. ThotCallback (BaseCSS + CSSSelect, STRING_DATA, SzBuffer);
  371. }
  372. switch (LOWORD (wParam))
  373. {
  374. case ID_CONFIRM:
  375. ThotCallback (BaseCSS + CSSForm, INTEGER_DATA, (char*) 1);
  376. EndDialog (hwnDlg, ID_CONFIRM);
  377. break;
  378. case IDCANCEL:
  379. case ID_DONE:
  380. ThotCallback (BaseCSS + CSSForm, INTEGER_DATA, (char*) 0);
  381. EndDialog (hwnDlg, ID_DONE);
  382. break;
  383. }
  384. break;
  385. default:
  386. return FALSE;
  387. }
  388. return TRUE;
  389. }
  390. /*-----------------------------------------------------------------------
  391. TextDlgProc
  392. ------------------------------------------------------------------------*/
  393. LRESULT CALLBACK TextDlgProc (ThotWindow hwnDlg, UINT msg, WPARAM wParam,
  394. LPARAM lParam)
  395. {
  396. switch (msg)
  397. {
  398. case WM_INITDIALOG:
  399. if (isHref)
  400. {
  401. SetWindowText (hwnDlg, TtaGetMessage (AMAYA, AM_ATTRIBUTE));
  402. SetWindowText (GetDlgItem (hwnDlg, IDC_URL_TEXT),
  403. TtaGetMessage (AMAYA, AM_HREF_VALUE));
  404. }
  405. else
  406. {
  407. SetWindowText (hwnDlg, TtaGetMessage (AMAYA, AM_CHANGE_TITLE));
  408. SetWindowText (GetDlgItem (hwnDlg, IDC_URL_TEXT),
  409. TtaGetMessage (AMAYA, AM_TITLE));
  410. }
  411. SetWindowText (GetDlgItem (hwnDlg, ID_CONFIRM),
  412. TtaGetMessage (LIB, TMSG_LIB_CONFIRM));
  413. SetWindowText (GetDlgItem (hwnDlg, ID_DONE), TtaGetMessage (LIB, TMSG_CANCEL));
  414. SetDlgItemText (hwnDlg, IDC_URLEDIT, UrlToOpen);
  415. SetFocus (GetDlgItem (hwnDlg, IDC_URLEDIT));
  416. break;
  417. case WM_CLOSE:
  418. case WM_DESTROY:
  419. EndDialog (hwnDlg, ID_DONE);
  420. break;
  421. case WM_COMMAND:
  422. switch (LOWORD (wParam))
  423. {
  424. case ID_CONFIRM:
  425. GetDlgItemText (hwnDlg, IDC_URLEDIT, UrlToOpen, sizeof (UrlToOpen) - 1);
  426. if (isHref)
  427. {
  428. AttrHREFvalue = TtaGetMemory (strlen (UrlToOpen) + 1);
  429. strcpy (AttrHREFvalue, UrlToOpen);
  430. ThotCallback (BaseDialog + AttrHREFForm, INTEGER_DATA, (char*) 1);
  431. }
  432. else
  433. {
  434. ThotCallback (BaseDialog + TitleText, STRING_DATA, UrlToOpen);
  435. ThotCallback (BaseDialog + TitleForm, INTEGER_DATA, (char*) 1);
  436. }
  437. EndDialog (hwnDlg, ID_CONFIRM);
  438. break;
  439. case ID_DONE:
  440. if (isHref)
  441. ThotCallback (BaseDialog + AttrHREFForm, INTEGER_DATA, (char*) 0);
  442. else
  443. ThotCallback (BaseDialog + TitleForm, INTEGER_DATA, (char*) 0);
  444. EndDialog (hwnDlg, ID_DONE);
  445. break;
  446. }
  447. break;
  448. default:
  449. break;
  450. }
  451. return FALSE;
  452. }
  453. /*-----------------------------------------------------------------------
  454. HRefDlgProc
  455. ------------------------------------------------------------------------*/
  456. LRESULT CALLBACK HRefDlgProc (ThotWindow hwnDlg, UINT msg, WPARAM wParam,
  457. LPARAM lParam)
  458. {
  459. switch (msg)
  460. {
  461. case WM_INITDIALOG:
  462. SetWindowText (hwnDlg, TtaGetMessage (AMAYA, AM_ATTRIBUTE));
  463. SetWindowText (GetDlgItem (hwnDlg, IDC_URLMESSAGE),
  464. TtaGetMessage (AMAYA, AM_LOCATION));
  465. SetWindowText (GetDlgItem (hwnDlg, ID_CONFIRM),
  466. TtaGetMessage (LIB, TMSG_LIB_CONFIRM));
  467. SetWindowText (GetDlgItem (hwnDlg, IDC_BROWSE), TtaGetMessage (AMAYA, AM_BROWSE));
  468. SetWindowText (GetDlgItem (hwnDlg, IDC_CLICK), TtaGetMessage (AMAYA, AM_CLICK));
  469. SetWindowText (GetDlgItem (hwnDlg, IDC_CLEAR), TtaGetMessage (AMAYA, AM_CLEAR));
  470. SetWindowText (GetDlgItem (hwnDlg, IDCANCEL), TtaGetMessage (LIB, TMSG_CANCEL));
  471. if (TmpDocName[0] != EOS)
  472. SetDlgItemText (hwnDlg, IDC_GETURL, TmpDocName);
  473. else
  474. SetDlgItemText (hwnDlg, IDC_GETURL, "");
  475. HrefUrl[0] = 0;
  476. /* set the default focus and return FALSE to validate it */
  477. SetFocus (GetDlgItem (hwnDlg, IDC_GETURL));
  478. return FALSE;
  479. break;
  480. case WM_COMMAND:
  481. if (HIWORD (wParam) == EN_UPDATE)
  482. {
  483. if (LOWORD (wParam) == IDC_GETURL)
  484. {
  485. GetDlgItemText (hwnDlg, IDC_GETURL, HrefUrl, sizeof (HrefUrl) - 1);
  486. if (HrefUrl[0] != 0)
  487. ThotCallback (BaseDialog + AttrHREFText, STRING_DATA, HrefUrl);
  488. }
  489. }
  490. switch (LOWORD (wParam))
  491. {
  492. case ID_CONFIRM:
  493. ThotCallback (BaseDialog + AttrHREFForm, INTEGER_DATA, (char*)1);
  494. EndDialog (hwnDlg, ID_CONFIRM);
  495. break;
  496. case IDC_BROWSE:
  497. OpenFileName.lStructSize = sizeof (OPENFILENAME);
  498. OpenFileName.hwndOwner = hwnDlg;
  499. OpenFileName.hInstance = hInstance;
  500. OpenFileName.lpstrFilter = (LPTSTR) SzFilter;
  501. OpenFileName.lpstrCustomFilter = (LPTSTR) NULL;
  502. OpenFileName.nMaxCustFilter = 0L;
  503. OpenFileName.nFilterIndex = indexLinkFilter;
  504. OpenFileName.lpstrFile = (LPTSTR) TmpDocName;
  505. OpenFileName.nMaxFile = MAX_LENGTH;
  506. OpenFileName.lpstrInitialDir = (LPTSTR) DirectoryName;
  507. OpenFileName.lpstrTitle = TtaGetMessage (AMAYA, AM_BROWSE);
  508. OpenFileName.nFileOffset = 0;
  509. OpenFileName.nFileExtension = 0;
  510. OpenFileName.lpstrDefExt = "html";
  511. OpenFileName.lCustData = 0;
  512. OpenFileName.Flags = OFN_SHOWHELP | OFN_HIDEREADONLY;
  513. if (GetOpenFileName (&OpenFileName))
  514. {
  515. strcpy (HrefUrl, OpenFileName.lpstrFile);
  516. indexLinkFilter = OpenFileName.nFilterIndex;
  517. }
  518. SetDlgItemText (hwnDlg, IDC_GETURL, HrefUrl);
  519. if (HrefUrl[0] != EOS)
  520. {
  521. ThotCallback (BaseDialog + AttrHREFText, STRING_DATA, HrefUrl);
  522. EndDialog (hwnDlg, ID_CONFIRM);
  523. ThotCallback (BaseDialog + AttrHREFForm, INTEGER_DATA, (char*) 1);
  524. }
  525. break;
  526. case IDC_CLICK:
  527. EndDialog (hwnDlg, IDCANCEL);
  528. ThotCallback (BaseDialog + AttrHREFForm, INTEGER_DATA, (char*) 3);
  529. break;
  530. case IDC_CLEAR:
  531. ThotCallback (BaseDialog + AttrHREFForm, INTEGER_DATA, (char*) 4);
  532. TmpDocName[0] = EOS;
  533. SetDlgItemText (hwnDlg, IDC_GETURL, "");
  534. break;
  535. case IDCANCEL:
  536. ThotCallback (BaseDialog + AttrHREFForm, INTEGER_DATA, (char*) 0);
  537. HrefUrl[0] = EOS;
  538. EndDialog (hwnDlg, IDCANCEL);
  539. break;
  540. }
  541. break;
  542. default:
  543. return FALSE;
  544. }
  545. return TRUE;
  546. }
  547. /*-----------------------------------------------------------------------
  548. HelpDlgProc
  549. ------------------------------------------------------------------------*/
  550. LRESULT CALLBACK HelpDlgProc (ThotWindow hwnDlg, UINT msg, WPARAM wParam,
  551. LPARAM lParam)
  552. {
  553. switch (msg)
  554. {
  555. case WM_INITDIALOG:
  556. SetWindowText (GetDlgItem (hwnDlg, IDC_VERSION), CurrentPathName);
  557. SetWindowText (GetDlgItem (hwnDlg, IDC_ABOUT1), Message);
  558. SetWindowText (GetDlgItem (hwnDlg, IDC_ABOUT2), Message2);
  559. SetWindowText (GetDlgItem (hwnDlg, ID_CONFIRM),
  560. TtaGetMessage (LIB, TMSG_LIB_CONFIRM));
  561. break;
  562. case WM_CLOSE:
  563. case WM_DESTROY:
  564. EndDialog (hwnDlg, ID_CONFIRM);
  565. break;
  566. case WM_COMMAND:
  567. switch (LOWORD (wParam))
  568. {
  569. case ID_CONFIRM:
  570. EndDialog (hwnDlg, ID_CONFIRM);
  571. break;
  572. }
  573. break;
  574. default:
  575. return (FALSE);
  576. }
  577. return TRUE;
  578. }
  579. /*-----------------------------------------------------------------------
  580. MathDlgProc
  581. ------------------------------------------------------------------------*/
  582. LRESULT CALLBACK MathDlgProc (ThotWindow hwnDlg, UINT msg, WPARAM wParam,
  583. LPARAM lParam)
  584. {
  585. switch (msg)
  586. {
  587. case WM_INITDIALOG:
  588. MathPal = hwnDlg;
  589. SetWindowText (hwnDlg, TtaGetMessage (AMAYA, AM_BUTTON_MATH));
  590. SetWindowText (GetDlgItem (hwnDlg, ID_DONE), TtaGetMessage (LIB, TMSG_DONE));
  591. break;
  592. case WM_CLOSE:
  593. case WM_DESTROY:
  594. MathPal = NULL;
  595. EndDialog (hwnDlg, ID_DONE);
  596. break;
  597. case WM_COMMAND:
  598. switch (LOWORD (wParam))
  599. {
  600. case ID_DONE:
  601. MathPal = NULL;
  602. EndDialog (hwnDlg, ID_DONE);
  603. break;
  604. case IDC_MATH:
  605. ThotCallback (MathsDialogue + MenuMaths, INTEGER_DATA, (char*)0);
  606. break;
  607. case IDC_ROOT:
  608. ThotCallback (MathsDialogue + MenuMaths, INTEGER_DATA, (char*)1);
  609. break;
  610. case IDC_SROOT:
  611. ThotCallback (MathsDialogue + MenuMaths, INTEGER_DATA, (char*)2);
  612. break;
  613. case IDC_DIV:
  614. ThotCallback (MathsDialogue + MenuMaths, INTEGER_DATA, (char*)3);
  615. break;
  616. case IDC_POWIND:
  617. ThotCallback (MathsDialogue + MenuMaths, INTEGER_DATA, (char*)4);
  618. break;
  619. case IDC_IND:
  620. ThotCallback (MathsDialogue + MenuMaths, INTEGER_DATA, (char*)5);
  621. break;
  622. case IDC_POW:
  623. ThotCallback (MathsDialogue + MenuMaths, INTEGER_DATA, (char*)6);
  624. break;
  625. case IDC_UPDN:
  626. ThotCallback (MathsDialogue + MenuMaths, INTEGER_DATA, (char*)7);
  627. break;
  628. case IDC_DOWN:
  629. ThotCallback (MathsDialogue + MenuMaths, INTEGER_DATA, (char*)8);
  630. break;
  631. case IDC_UP:
  632. ThotCallback (MathsDialogue + MenuMaths, INTEGER_DATA, (char*)9);
  633. break;
  634. case IDC_PAREXP:
  635. ThotCallback (MathsDialogue + MenuMaths, INTEGER_DATA, (char*)10);
  636. break;
  637. case IDC_UDLR:
  638. ThotCallback (MathsDialogue + MenuMaths, INTEGER_DATA, (char*)11);
  639. break;
  640. case IDC_MATRIX:
  641. ThotCallback (MathsDialogue + MenuMaths, INTEGER_DATA, (char*)12);
  642. break;
  643. case IDC_SYM:
  644. ThotCallback (MathsDialogue + MenuMaths, INTEGER_DATA, (char*)13);
  645. break;
  646. }
  647. SetFocus (FrRef[ActiveFrame]);
  648. break;
  649. default:
  650. return (FALSE);
  651. }
  652. return TRUE;
  653. }
  654. /*-----------------------------------------------------------------------
  655. PrintDlgProc
  656. ------------------------------------------------------------------------*/
  657. LRESULT CALLBACK PrintDlgProc (ThotWindow hwnDlg, UINT msg, WPARAM wParam,
  658. LPARAM lParam)
  659. {
  660. int orientation, paper;
  661. switch (msg)
  662. {
  663. case WM_INITDIALOG:
  664. PrintForm = hwnDlg;
  665. SetWindowText (hwnDlg, TtaGetMessage (LIB, TMSG_LIB_PRINT));
  666. SetWindowText (GetDlgItem (hwnDlg, ID_PRINT),
  667. TtaGetMessage (LIB, TMSG_BUTTON_PRINT));
  668. SetWindowText (GetDlgItem (hwnDlg, IDCANCEL),
  669. TtaGetMessage (LIB, TMSG_CANCEL));
  670. SetWindowText (GetDlgItem (hwnDlg, IDC_OPTIONS),
  671. TtaGetMessage (LIB, TMSG_OPTIONS));
  672. SetWindowText (GetDlgItem (hwnDlg, IDC_TABOFCONTENTS),
  673. TtaGetMessage (AMAYA, AM_PRINT_TOC));
  674. SetWindowText (GetDlgItem (hwnDlg, IDC_LINKS),
  675. TtaGetMessage (AMAYA, AM_NUMBERED_LINKS));
  676. SetWindowText (GetDlgItem (hwnDlg, IDC_PRINTURL),
  677. TtaGetMessage (AMAYA, AM_PRINT_URL));
  678. SetWindowText (GetDlgItem (hwnDlg, IDC_IGNORE_CSS),
  679. TtaGetMessage (AMAYA, AM_WITH_CSS));
  680. CheckDlgButton (hwnDlg, IDC_PRINTURL, PrintURL);
  681. CheckDlgButton (hwnDlg, IDC_IGNORE_CSS, IgnoreCSS);
  682. CheckDlgButton (hwnDlg, IDC_TABOFCONTENTS, WithToC);
  683. CheckDlgButton (hwnDlg, IDC_LINKS, NumberLinks);
  684. break;
  685. case WM_COMMAND:
  686. switch (LOWORD (wParam))
  687. {
  688. case IDC_TABOFCONTENTS:
  689. ThotCallback (BasePrint + PrintOptions, INTEGER_DATA, (char*) 1);
  690. break;
  691. case IDC_LINKS:
  692. ThotCallback (BasePrint + PrintOptions, INTEGER_DATA, (char*) 2);
  693. break;
  694. case IDC_PRINTURL:
  695. ThotCallback (BasePrint + PrintOptions, INTEGER_DATA, (char*) 3);
  696. break;
  697. case IDC_IGNORE_CSS:
  698. ThotCallback (BasePrint + PrintOptions, INTEGER_DATA, (char*) 4);
  699. break;
  700. case ID_PRINT:
  701. ThotCallback (BasePrint + PrintSupport, INTEGER_DATA, (char*) 0);
  702. PrintForm = NULL;
  703. EndDialog (hwnDlg, ID_PRINT);
  704. if (TtaGetPrinterDC (FALSE, &orientation, &paper))
  705. {
  706. EnableWindow (ghwndMain, FALSE);
  707. ThotCallback (BasePrint + PaperOrientation, INTEGER_DATA, (char*) orientation);
  708. ThotCallback (BasePrint + PaperFormat, INTEGER_DATA, (char*) paper);
  709. ThotCallback (BasePrint + PPrinterName, STRING_DATA,
  710. CurFileToPrint);
  711. ThotCallback (BasePrint + FormPrint, INTEGER_DATA, (char*)1);
  712. }
  713. break;
  714. case IDCANCEL:
  715. ThotCallback (BasePrint + FormPrint, INTEGER_DATA, (char*)0);
  716. PrintForm = NULL;
  717. EndDialog (hwnDlg, IDCANCEL);
  718. break;
  719. }
  720. break;
  721. default:
  722. return FALSE;
  723. }
  724. return TRUE;
  725. }
  726. /*-----------------------------------------------------------------------
  727. TableDlgProc
  728. ------------------------------------------------------------------------*/
  729. LRESULT CALLBACK TableDlgProc (ThotWindow hwnDlg, UINT msg, WPARAM wParam,
  730. LPARAM lParam)
  731. {
  732. ThotBool ok;
  733. int val;
  734. switch (msg)
  735. {
  736. case WM_INITDIALOG:
  737. SetWindowText (hwnDlg, TtaGetMessage (LIB, TMSG_BUTTON_TABLE));
  738. SetWindowText (GetDlgItem (hwnDlg, IDC_NUMCOL),
  739. TtaGetMessage (AMAYA, AM_COLS));
  740. SetWindowText (GetDlgItem (hwnDlg, IDC_NUMROWS),
  741. TtaGetMessage (AMAYA, AM_ROWS));
  742. if (WithBorder)
  743. SetWindowText (GetDlgItem (hwnDlg, IDC_BORDER),
  744. TtaGetMessage (AMAYA, AM_BORDER));
  745. SetWindowText (GetDlgItem (hwnDlg, ID_CONFIRM),
  746. TtaGetMessage (LIB, TMSG_LIB_CONFIRM));
  747. SetWindowText (GetDlgItem (hwnDlg, IDCANCEL),
  748. TtaGetMessage (LIB, TMSG_CANCEL));
  749. SetDlgItemInt (hwnDlg, IDC_NUMCOLEDIT, numCols, FALSE);
  750. SetDlgItemInt (hwnDlg, IDC_NUMROWSEDIT, numRows, FALSE);
  751. if (WithBorder)
  752. SetDlgItemInt (hwnDlg, IDC_BORDEREDIT, tBorder, FALSE);
  753. break;
  754. case WM_COMMAND:
  755. if (HIWORD (wParam) == EN_UPDATE)
  756. {
  757. if (LOWORD (wParam) == IDC_NUMCOLEDIT)
  758. {
  759. val = GetDlgItemInt (hwnDlg, IDC_NUMCOLEDIT, &ok, TRUE);
  760. if (ok)
  761. ThotCallback (BaseDialog + TableCols, INTEGER_DATA, (char*) val);
  762. }
  763. else if (LOWORD (wParam) == IDC_NUMROWSEDIT)
  764. {
  765. val = GetDlgItemInt (hwnDlg, IDC_NUMROWSEDIT, &ok, TRUE);
  766. if (ok)
  767. ThotCallback (BaseDialog + TableRows, INTEGER_DATA, (char*) val);
  768. }
  769. else if (LOWORD (wParam) == IDC_BORDEREDIT)
  770. {
  771. val = GetDlgItemInt (hwnDlg, IDC_BORDEREDIT, &ok, TRUE);
  772. if (ok)
  773. ThotCallback (BaseDialog + TableBorder, INTEGER_DATA, (char*) val);
  774. }
  775. }
  776. switch (LOWORD (wParam))
  777. {
  778. case ID_CONFIRM:
  779. UserAnswer = 1;
  780. ThotCallback (BaseDialog + TableForm, INTEGER_DATA, (char*) 1);
  781. EndDialog (hwnDlg, ID_CONFIRM);
  782. break;
  783. case IDCANCEL:
  784. UserAnswer = 0;
  785. ThotCallback (BaseDialog + TableForm, INTEGER_DATA, (char*) 0);
  786. EndDialog (hwnDlg, IDCANCEL);
  787. break;
  788. }
  789. break;
  790. default:
  791. return FALSE;
  792. }
  793. return TRUE;
  794. }
  795. /*-----------------------------------------------------------------------
  796. AttrItemsDlgProc
  797. ------------------------------------------------------------------------*/
  798. LRESULT CALLBACK AttrItemsDlgProc (ThotWindow hwnDlg, UINT msg,
  799. WPARAM wParam, LPARAM lParam)
  800. {
  801. int ndx = 0;
  802. int i = 0;
  803. int cxChar;
  804. int cyChar;
  805. HDC hDC;
  806. RECT rect;
  807. ThotWindow radio1;
  808. ThotWindow radio2;
  809. ThotWindow radio3;
  810. ThotWindow radio4;
  811. ThotWindow radio5;
  812. ThotWindow radio6;
  813. ThotWindow radio7;
  814. ThotWindow radio8;
  815. ThotWindow radio9;
  816. ThotWindow groupBx;
  817. TEXTMETRIC tm;
  818. switch (msg)
  819. {
  820. case WM_INITDIALOG:
  821. /* store the window ID to be able to destroy it from elsewhere */
  822. AttrForm = hwnDlg;
  823. GetClientRect (hwnDlg, &rect);
  824. hDC = GetDC (hwnDlg);
  825. SelectObject (hDC, DialogFont);
  826. GetTextMetrics (hDC, &tm);
  827. cxChar = tm.tmAveCharWidth;
  828. cyChar = tm.tmHeight + tm.tmExternalLeading;
  829. ReleaseDC (hwnDlg, hDC);
  830. SetWindowText (hwnDlg, TtaGetMessage (LIB, TMSG_ATTR));
  831. SetWindowText (GetDlgItem (hwnDlg, ID_APPLY),
  832. TtaGetMessage (LIB, TMSG_APPLY));
  833. if (RequiredAttr)
  834. DestroyWindow (GetDlgItem (hwnDlg, ID_DELETE));
  835. else
  836. SetWindowText (GetDlgItem (hwnDlg, ID_DELETE),
  837. TtaGetMessage (LIB, TMSG_DEL_ATTR));
  838. SetWindowText (GetDlgItem (hwnDlg, ID_DONE),
  839. TtaGetMessage (LIB, TMSG_DONE));
  840. radio1 = CreateWindow ("BUTTON", &ItemList[ndx],
  841. WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 2 * cxChar,
  842. cyChar * (1+2*i), 20 * cxChar, 7 * cyChar / 4, hwnDlg,
  843. (HMENU) OPT1, (HINSTANCE) GetWindowLong (hwnDlg, GWL_HINSTANCE), NULL);
  844. /* set the font of the window */
  845. WIN_SetDialogfont (radio1);
  846. ndx += strlen (&ItemList[ndx]) + 1;
  847. i++;
  848. radio2 = CreateWindow ("BUTTON", &ItemList[ndx],
  849. WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 2 * cxChar,
  850. cyChar * (1+2*i), 20 * cxChar, 7 * cyChar / 4, hwnDlg,
  851. (HMENU) OPT2, (HINSTANCE) GetWindowLong (hwnDlg, GWL_HINSTANCE), NULL);
  852. /* set the font of the window */
  853. WIN_SetDialogfont (radio2);
  854. ndx += strlen (&ItemList[ndx]) + 1;
  855. i++;
  856. if (attDlgNbItems > 2)
  857. {
  858. radio3 = CreateWindow ("BUTTON", &ItemList[ndx],
  859. WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 2 * cxChar,
  860. cyChar * (1+2*i), 20 * cxChar, 7 * cyChar / 4, hwnDlg,
  861. (HMENU) OPT3, (HINSTANCE) GetWindowLong (hwnDlg, GWL_HINSTANCE), NULL);
  862. /* set the font of the window */
  863. WIN_SetDialogfont (radio3);
  864. ndx += strlen (&ItemList[ndx]) + 1;
  865. i++;
  866. if (attDlgNbItems > 3)
  867. {
  868. radio4 = CreateWindow ("BUTTON", &ItemList[ndx],
  869. WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 2 * cxChar,
  870. cyChar * (1+2*i), 20 * cxChar, 7 * cyChar / 4, hwnDlg,
  871. (HMENU) OPT4, (HINSTANCE) GetWindowLong (hwnDlg, GWL_HINSTANCE), NULL);
  872. /* set the font of the window */
  873. WIN_SetDialogfont (radio4);
  874. ndx += strlen (&ItemList[ndx]) + 1;
  875. i++;
  876. if (attDlgNbItems > 4)
  877. {
  878. radio5 = CreateWindow ("BUTTON", &ItemList[ndx],
  879. WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 2 * cxChar,
  880. cyChar * (1+2*i), 20 * cxChar, 7 * cyChar / 4, hwnDlg,
  881. (HMENU) OPT5, (HINSTANCE) GetWindowLong (hwnDlg, GWL_HINSTANCE), NULL);
  882. /* set the font of the window */
  883. WIN_SetDialogfont (radio5);
  884. ndx += strlen (&ItemList[ndx]) + 1;
  885. i++;
  886. if (attDlgNbItems > 5)
  887. {
  888. radio6 = CreateWindow ("BUTTON", &ItemList[ndx],
  889. WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 2 * cxChar,
  890. cyChar * (1+2*i), 20 * cxChar, 7 * cyChar / 4, hwnDlg,
  891. (HMENU) OPT6, (HINSTANCE) GetWindowLong (hwnDlg, GWL_HINSTANCE), NULL);
  892. /* set the font of the window */
  893. WIN_SetDialogfont (radio6);
  894. ndx += strlen (&ItemList[ndx]) + 1;
  895. i++;
  896. if (attDlgNbItems > 6)
  897. {
  898. radio7 = CreateWindow ("BUTTON", &ItemList[ndx],
  899. WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 2 * cxChar,
  900. cyChar * (1+2*i), 20 * cxChar, 7 * cyChar / 4, hwnDlg,
  901. (HMENU) OPT7, (HINSTANCE) GetWindowLong (hwnDlg,
  902. GWL_HINSTANCE), NULL);
  903. /* set the font of the window */
  904. WIN_SetDialogfont (radio7);
  905. ndx += strlen (&ItemList[ndx]) + 1;
  906. i++;
  907. if (attDlgNbItems > 7)
  908. {
  909. radio8 = CreateWindow ("BUTTON", &ItemList[ndx],
  910. WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 2 * cxChar,
  911. cyChar * (1+2*i), 20 * cxChar, 7 * cyChar / 4, hwnDlg,
  912. (HMENU) OPT8, (HINSTANCE) GetWindowLong (hwnDlg, GWL_HINSTANCE), NULL);
  913. /* set the font of the window */
  914. WIN_SetDialogfont (radio8);
  915. ndx += strlen (&ItemList[ndx]) + 1;
  916. i++;
  917. if (attDlgNbItems > 8)
  918. {
  919. radio9 = CreateWindow ("BUTTON", &ItemList[ndx],
  920. WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 2 * cxChar,
  921. cyChar * (1+2*i), 20 * cxChar, 7 * cyChar / 4, hwnDlg,
  922. (HMENU) OPT9, (HINSTANCE) GetWindowLong (hwnDlg, GWL_HINSTANCE), NULL);
  923. /* set the font of the window */
  924. WIN_SetDialogfont (radio9);
  925. ndx += strlen (&ItemList[ndx]) + 1;
  926. i++;
  927. }
  928. }
  929. }
  930. }
  931. }
  932. }
  933. }
  934. groupBx = CreateWindow ("BUTTON", AttDlgTitle,
  935. WS_CHILD | WS_VISIBLE | BS_GROUPBOX, cxChar, 0,
  936. rect.right - (2 * cxChar), i * (2 * cyChar) + cyChar, hwnDlg,
  937. (HMENU) 1, (HINSTANCE) GetWindowLong (hwnDlg, GWL_HINSTANCE), NULL);
  938. /* set the font of the window */
  939. WIN_SetDialogfont (groupBx);
  940. switch (currAttrVal)
  941. {
  942. case 1: CheckRadioButton (hwnDlg, OPT1, OPT9, OPT1);
  943. break;
  944. case 2: CheckRadioButton (hwnDlg, OPT1, OPT9, OPT2);
  945. break;
  946. case 3: CheckRadioButton (hwnDlg, OPT1, OPT9, OPT3);
  947. break;
  948. case 4: CheckRadioButton (hwnDlg, OPT1, OPT9, OPT4);
  949. break;
  950. case 5: CheckRadioButton (hwnDlg, OPT1, OPT9, OPT5);
  951. break;
  952. case 6: CheckRadioButton (hwnDlg, OPT1, OPT9, OPT6);
  953. break;
  954. case 7: CheckRadioButton (hwnDlg, OPT1, OPT9, OPT7);
  955. break;
  956. case 8: CheckRadioButton (hwnDlg, OPT1, OPT9, OPT8);
  957. break;
  958. case 9: CheckRadioButton (hwnDlg, OPT1, OPT9, OPT9);
  959. break;
  960. default:
  961. break;
  962. }
  963. break;
  964. case WM_CLOSE:
  965. case WM_DESTROY:
  966. AttrForm = NULL;
  967. if (RequiredAttr)
  968. ThotCallback (NumMenuAttrRequired, INTEGER_DATA, (char*) 0);
  969. else
  970. ThotCallback (NumMenuAttr, INTEGER_DATA, (char*) 0);
  971. EndDialog (hwnDlg, IDCANCEL);
  972. break;
  973. case WM_COMMAND:
  974. if (RequiredAttr)
  975. i = NumMenuAttrEnumNeeded;
  976. else
  977. i = NumMenuAttrEnum;
  978. switch (LOWORD (wParam))
  979. {
  980. case OPT1:
  981. iLocation = 0;
  982. ThotCallback (i, INTEGER_DATA, (char*) iLocation);
  983. break;
  984. case OPT2:
  985. iLocation = 1;
  986. ThotCallback (i, INTEGER_DATA, (char*) iLocation);
  987. break;
  988. case OPT3:
  989. iLocation = 2;
  990. ThotCallback (i, INTEGER_DATA, (char*) iLocation);
  991. break;
  992. case OPT4:
  993. iLocation = 3;
  994. ThotCallback (i, INTEGER_DATA, (char*) iLocation);
  995. break;
  996. case OPT5:
  997. iLocation = 4;
  998. ThotCallback (i, INTEGER_DATA, (char*) iLocation);
  999. break;
  1000. case OPT6:
  1001. iLocation = 5;
  1002. ThotCallback (i, INTEGER_DATA, (char*) iLocation);
  1003. break;
  1004. case OPT7:
  1005. iLocation = 6;
  1006. ThotCallback (i, INTEGER_DATA, (char*) iLocation);
  1007. break;
  1008. case OPT8:
  1009. iLocation = 7;
  1010. ThotCallback (i, INTEGER_DATA, (char*) iLocation);
  1011. break;
  1012. case OPT9:
  1013. iLocation = 8;
  1014. ThotCallback (i, INTEGER_DATA, (char*) iLocation);
  1015. break;
  1016. case ID_APPLY:
  1017. if (RequiredAttr)
  1018. {
  1019. ThotCallback (NumMenuAttrRequired, INTEGER_DATA, (char*) 1);
  1020. EndDialog (hwnDlg, IDCANCEL);
  1021. }
  1022. else
  1023. ThotCallback (NumMenuAttr, INTEGER_DATA, (char*) 1);
  1024. break;
  1025. case ID_DELETE:
  1026. ThotCallback (NumMenuAttrEnum, INTEGER_DATA, (char*) -1);
  1027. ThotCallback (NumMenuAttr, INTEGER_DATA, (char*) 2);
  1028. AttrForm = NULL;
  1029. break;
  1030. case ID_DONE:
  1031. AttrForm = NULL;
  1032. if (RequiredAttr)
  1033. ThotCallback (NumMenuAttrRequired, INTEGER_DATA, (char*) 0);
  1034. else
  1035. ThotCallback (NumMenuAttr, INTEGER_DATA, (char*) 0);
  1036. EndDialog (hwnDlg, IDCANCEL);
  1037. break;
  1038. }
  1039. break;
  1040. default:
  1041. return FALSE;
  1042. }
  1043. return TRUE;
  1044. }
  1045. /*-----------------------------------------------------------------------
  1046. CharsetDlgProc
  1047. ------------------------------------------------------------------------*/
  1048. LRESULT CALLBACK CharsetDlgProc (ThotWindow hwnDlg, UINT msg, WPARAM wParam,
  1049. LPARAM lParam)
  1050. {
  1051. int index = 0;
  1052. UINT i = 0;
  1053. static ThotWindow wndMTlist;
  1054. switch (msg)
  1055. {
  1056. case WM_INITDIALOG:
  1057. /* get the default GUI font */
  1058. SetWindowText (hwnDlg, TtaGetMessage (AMAYA, AM_SELECT_CHARSET));
  1059. SetWindowText (GetDlgItem (hwnDlg, ID_APPLY), TtaGetMessage (LIB, TMSG_APPLY));
  1060. SetWindowText (GetDlgItem (hwnDlg, IDCANCEL), TtaGetMessage (LIB, TMSG_CANCEL));
  1061. if (!strcmp (UserCharset, "us-ascii"))
  1062. CheckRadioButton (hwnDlg, IDC_USASCII, IDC_ISOL1, IDC_USASCII);
  1063. if (!strcmp (UserCharset, "iso-8859-1"))
  1064. CheckRadioButton (hwnDlg, IDC_USASCII, IDC_ISOL1, IDC_ISOL1);
  1065. else
  1066. CheckRadioButton (hwnDlg, IDC_USASCII, IDC_ISOL1, IDC_UTF8);
  1067. SetFocus (GetDlgItem (hwnDlg, IDC_USASCII));
  1068. return FALSE;
  1069. break;
  1070. case WM_CLOSE:
  1071. case WM_DESTROY:
  1072. EndDialog (hwnDlg, ID_DONE);
  1073. break;
  1074. case WM_COMMAND:
  1075. switch (LOWORD (wParam))
  1076. {
  1077. case IDC_USASCII:
  1078. strcpy (SaveFormTmp, "us-ascii");
  1079. break;
  1080. case IDC_UTF8:
  1081. strcpy (SaveFormTmp, "UTF-8");
  1082. break;
  1083. case IDC_ISOL1:
  1084. strcpy (SaveFormTmp, "iso-8859-1");
  1085. break;
  1086. case ID_APPLY:
  1087. EndDialog (hwnDlg, ID_DONE);
  1088. break;
  1089. case IDCANCEL:
  1090. case WM_CLOSE:
  1091. SaveFormTmp[0] = EOS;
  1092. EndDialog (hwnDlg, ID_DONE);
  1093. break;
  1094. }
  1095. break;
  1096. default: return FALSE;
  1097. }
  1098. return TRUE;
  1099. }
  1100. /*-----------------------------------------------------------------------
  1101. MimeTypeDlgStatus
  1102. Updates the status bar of the MimeType dialog
  1103. ------------------------------------------------------------------------*/
  1104. void MimeTypeDlgStatus (char *msg)
  1105. {
  1106. if (MimeTypeDlg && msg)
  1107. SetWindowText (GetDlgItem (MimeTypeDlg, IDC_STATUS), msg);
  1108. }
  1109. /*-----------------------------------------------------------------------
  1110. MimeTypeDlgProc
  1111. ------------------------------------------------------------------------*/
  1112. LRESULT CALLBACK MimeTypeDlgProc (ThotWindow hwnDlg, UINT msg, WPARAM wParam,
  1113. LPARAM lParam)
  1114. {
  1115. int index = 0;
  1116. UINT i = 0;
  1117. static ThotWindow wndMTlist;
  1118. switch (msg)
  1119. {
  1120. case WM_INITDIALOG:
  1121. /* get the default GUI font */
  1122. MimeTypeDlg = hwnDlg;
  1123. SetWindowText (hwnDlg, TtaGetMessage (AMAYA, AM_SELECT_MIMETYPE));
  1124. SetWindowText (GetDlgItem (hwnDlg, ID_APPLY), TtaGetMessage (LIB, TMSG_APPLY));
  1125. SetWindowText (GetDlgItem (hwnDlg, IDCANCEL), TtaGetMessage (LIB, TMSG_CANCEL));
  1126. wndMTlist = CreateWindow ("listbox", NULL,
  1127. WS_CHILD | WS_VISIBLE | LBS_STANDARD | WS_VSCROLL | WS_TABSTOP,
  1128. 5, 5, 310, 100, hwnDlg, (HMENU) 1,
  1129. (HINSTANCE) GetWindowLong (hwnDlg, GWL_HINSTANCE), NULL);
  1130. /* set the font of the window */
  1131. WIN_SetDialogfont (wndMTlist);
  1132. SendMessage (wndMTlist, LB_RESETCONTENT, 0, 0);
  1133. while (i < NbItem && mimeType[index] != '\0')
  1134. {
  1135. SendMessage (wndMTlist, LB_INSERTSTRING, i, (LPARAM) &mimeType[index]);
  1136. index += strlen (&mimeType[index]) + 1;/* Longueur de l'intitule */
  1137. i++;
  1138. }
  1139. /* select the first list item */
  1140. /* SendMessage (wndMTlist, LB_SETCURSEL, 0, 0); */
  1141. /* put the focus on the first list item */
  1142. SetDlgItemText (hwnDlg, IDC_MTEDIT, UserMimeType);
  1143. SetFocus (GetDlgItem (hwnDlg, IDC_MTEDIT));
  1144. return FALSE;
  1145. break;
  1146. case WM_CLOSE:
  1147. case WM_DESTROY:
  1148. /* ThotCallback (BaseDialog + MimeTypeForm, INTEGER_DATA, (char *) 0); */
  1149. MimeTypeDlg = NULL;
  1150. EndDialog (hwnDlg, ID_DONE);
  1151. break;
  1152. case WM_COMMAND:
  1153. if (LOWORD (wParam) == 1)
  1154. {
  1155. if (HIWORD (wParam) == LBN_SELCHANGE)
  1156. {
  1157. itemIndex = SendMessage (wndMTlist, LB_GETCURSEL, 0, 0);
  1158. itemIndex = SendMessage (wndMTlist, LB_GETTEXT, itemIndex,
  1159. (LPARAM) SzBuffer);
  1160. }
  1161. else if (HIWORD (wParam) == LBN_DBLCLK)
  1162. {
  1163. if (LB_ERR == (itemIndex = SendMessage (wndMTlist, LB_GETCURSEL, 0, 0L)))
  1164. break;
  1165. itemIndex = SendMessage (wndMTlist, LB_GETTEXT, itemIndex,
  1166. (LPARAM) SzBuffer);
  1167. }
  1168. SetDlgItemText (hwnDlg, IDC_MTEDIT, SzBuffer);
  1169. if (HIWORD (wParam) == LBN_DBLCLK)
  1170. {
  1171. GetDlgItemText (hwnDlg, IDC_MTEDIT, SaveFormTmp, sizeof (SaveFormTmp) - 1);
  1172. if (SaveFormTmp[0] != EOS)
  1173. {
  1174. MimeTypeDlg = NULL;
  1175. EndDialog (hwnDlg, ID_DONE);
  1176. }
  1177. break;
  1178. }
  1179. }
  1180. switch (LOWORD (wParam))
  1181. {
  1182. case ID_APPLY:
  1183. GetDlgItemText (hwnDlg, IDC_MTEDIT, SaveFormTmp, sizeof (SaveFormTmp) - 1);
  1184. ThotCallback (BaseDialog + MimeTypeForm, INTEGER_DATA, (char *) 1);
  1185. if (SaveFormTmp[0] != EOS)
  1186. {
  1187. MimeTypeDlg = NULL;
  1188. EndDialog (hwnDlg, ID_DONE);
  1189. }
  1190. break;
  1191. case IDCANCEL:
  1192. case WM_CLOSE:
  1193. ThotCallback (BaseDialog + MimeTypeForm, INTEGER_DATA, (char *) 0);
  1194. MimeTypeDlg = NULL;
  1195. EndDialog (hwnDlg, ID_DONE);
  1196. break;
  1197. }
  1198. break;
  1199. default: return FALSE;
  1200. }
  1201. return TRUE;
  1202. }
  1203. /*-----------------------------------------------------------------------
  1204. SaveAsDlgStatus
  1205. Updates the status bar of the SaveAs dialog
  1206. ------------------------------------------------------------------------*/
  1207. void SaveAsDlgStatus (char *msg)
  1208. {
  1209. if (SaveAsForm && msg)
  1210. SetWindowText (GetDlgItem (SaveAsForm, IDC_STATUS), msg);
  1211. }
  1212. /*----------------------------------------------------------------------
  1213. WIN_ListSaveDirectory
  1214. ----------------------------------------------------------------------*/
  1215. void WIN_ListSaveDirectory (ThotWindow hwnDlg, char *title, char *fileName)
  1216. {
  1217. char *szFilter;
  1218. char szFileTitle[256];
  1219. szFilter = APPFILENAMEFILTER;
  1220. TtaExtractName (fileName, SavePath, DocumentName);
  1221. OpenFileName.lStructSize = sizeof (OPENFILENAME);
  1222. OpenFileName.hwndOwner = hwnDlg;
  1223. OpenFileName.lpstrFilter = szFilter;
  1224. OpenFileName.lpstrFile = DocumentName;
  1225. OpenFileName.nMaxFile = MAX_LENGTH;
  1226. OpenFileName.lpstrFileTitle = szFileTitle;
  1227. OpenFileName.lpstrTitle = title;
  1228. OpenFileName.nMaxFileTitle = sizeof (szFileTitle);
  1229. OpenFileName.lpstrInitialDir = SavePath;
  1230. OpenFileName.Flags = OFN_SHOWHELP | OFN_HIDEREADONLY;
  1231. if (GetSaveFileName (&OpenFileName))
  1232. strcpy (fileName, OpenFileName.lpstrFile);
  1233. }
  1234. /*-----------------------------------------------------------------------
  1235. SaveAsDlgProc
  1236. ------------------------------------------------------------------------*/
  1237. LRESULT CALLBACK SaveAsDlgProc (ThotWindow hwnDlg, UINT msg, WPARAM wParam,
  1238. LPARAM lParam)
  1239. {
  1240. char buff[500];
  1241. switch (msg)
  1242. {
  1243. case WM_INITDIALOG:
  1244. SaveAsForm = hwnDlg;
  1245. SetWindowText (hwnDlg, TtaGetMessage (AMAYA, AM_SAVE_AS));
  1246. SetWindowText (GetDlgItem (hwnDlg, IDC_DOCLOCATION),
  1247. TtaGetMessage (AMAYA, AM_DOC_LOCATION));
  1248. SetWindowText (GetDlgItem (hwnDlg, ID_CONFIRM),
  1249. TtaGetMessage (LIB, TMSG_LIB_CONFIRM));
  1250. SetWindowText (GetDlgItem (hwnDlg, ID_CLEAR), TtaGetMessage (AMAYA, AM_CLEAR));
  1251. SetWindowText (GetDlgItem (hwnDlg, IDC_BROWSE), TtaGetMessage (AMAYA, AM_BROWSE));
  1252. SetWindowText (GetDlgItem (hwnDlg, IDCANCEL), TtaGetMessage (LIB, TMSG_CANCEL));
  1253. SetDlgItemText (hwnDlg, IDC_EDITDOCSAVE, CurrentPathName);
  1254. if (HTMLFormat ||
  1255. DocumentTypes[SavingDocument] == docMath ||
  1256. DocumentTypes[SavingDocument] == docSVG ||
  1257. DocumentTypes[SavingDocument] == docXml)
  1258. {
  1259. SetWindowText (GetDlgItem (hwnDlg, IDC_COPYIMG),
  1260. TtaGetMessage (AMAYA, AM_BCOPY_IMAGES));
  1261. SetWindowText (GetDlgItem (hwnDlg, IDC_TRANSFORMURL),
  1262. TtaGetMessage (AMAYA, AM_BTRANSFORM_URL));
  1263. SetWindowText (GetDlgItem (hwnDlg, IDC_IMGLOCATION),
  1264. TtaGetMessage (AMAYA, AM_IMAGES_LOCATION));
  1265. copyImgWnd = GetDlgItem (hwnDlg, IDC_COPYIMG);
  1266. transURLWnd = GetDlgItem (hwnDlg, IDC_TRANSFORMURL);
  1267. }
  1268. if (HTMLFormat)
  1269. {
  1270. SetWindowText (GetDlgItem (hwnDlg, IDC_OUTPUTGROUP),
  1271. TtaGetMessage (LIB, TMSG_DOCUMENT_FORMAT));
  1272. SetWindowText (GetDlgItem (hwnDlg, IDC_HTML), "HTML");
  1273. SetWindowText (GetDlgItem (hwnDlg, IDC_XML), "XML");
  1274. SetWindowText (GetDlgItem (hwnDlg, IDC_TEXT),
  1275. TtaGetMessage (AMAYA, AM_TEXT));
  1276. if (SaveAsHTML)
  1277. {
  1278. CheckRadioButton (hwnDlg, IDC_HTML, IDC_XML, IDC_HTML);
  1279. EnableWindow (transURLWnd, TRUE);
  1280. EnableWindow (copyImgWnd, TRUE);
  1281. }
  1282. else if (SaveAsXML)
  1283. {
  1284. CheckRadioButton (hwnDlg, IDC_HTML, IDC_XML, IDC_XML);
  1285. EnableWindow (transURLWnd, TRUE);
  1286. EnableWindow (copyImgWnd, TRUE);
  1287. }
  1288. else if (SaveAsText)
  1289. {
  1290. CheckRadioButton (hwnDlg, IDC_HTML, IDC_XML, IDC_TEXT);
  1291. EnableWindow (transURLWnd, FALSE);
  1292. EnableWindow (copyImgWnd, FALSE);
  1293. }
  1294. if (!SaveAsText && CopyImages)
  1295. CheckRadioButton (hwnDlg, IDC_COPYIMG, IDC_COPYIMG, IDC_COPYIMG);
  1296. }
  1297. else if (DocumentTypes[SavingDocument] == docMath ||
  1298. DocumentTypes[SavingDocument] == docXml)
  1299. EnableWindow (copyImgWnd, FALSE);
  1300. if (UpdateURLs)
  1301. CheckRadioButton (hwnDlg, IDC_TRANSFORMURL, IDC_TRANSFORMURL, IDC_TRANSFORMURL);
  1302. /* mime type */
  1303. _snprintf (buff, 500, "MIME type: %s",
  1304. UserMimeType[0] != EOS ? UserMimeType : TtaGetMessage (AMAYA, AM_UNKNOWN));
  1305. SetDlgItemText (hwnDlg, IDC_MIMETYPE, buff);
  1306. SetDlgItemText (hwnDlg, ID_CHANGEMIMETYPE, TtaGetMessage (AMAYA, AM_CHANGE));
  1307. /* charset */
  1308. _snprintf (buff, 500, "Charset: %s",
  1309. UserCharset[0] != EOS ? UserCharset : TtaGetMessage (AMAYA, AM_UNKNOWN));
  1310. SetDlgItemText (hwnDlg, IDC_CHARSET, buff);
  1311. SetDlgItemText (hwnDlg, ID_CHANGECHARSET, TtaGetMessage (AMAYA, AM_CHANGE));
  1312. /* set the default focus and return FALSE to validate it */
  1313. SetFocus (GetDlgItem (hwnDlg, IDC_EDITDOCSAVE));
  1314. return FALSE;
  1315. break;
  1316. case WM_COMMAND:
  1317. if (HIWORD (wParam) == EN_UPDATE)
  1318. {
  1319. if (LOWORD (wParam) == IDC_EDITDOCSAVE)
  1320. {
  1321. GetDlgItemText (hwnDlg, IDC_EDITDOCSAVE, UrlToOpen, sizeof (UrlToOpen) - 1);
  1322. ThotCallback (BaseDialog + NameSave, STRING_DATA, UrlToOpen);
  1323. }
  1324. else if (LOWORD (wParam) == IDC_EDITIMGSAVE)
  1325. {
  1326. GetDlgItemText (hwnDlg, IDC_EDITIMGSAVE, UrlToOpen, sizeof (UrlToOpen) - 1);
  1327. ThotCallback (BaseDialog + ImgDirSave, STRING_DATA, UrlToOpen);
  1328. }
  1329. }
  1330. switch (LOWORD (wParam))
  1331. {
  1332. case IDC_HTML:
  1333. EnableWindow (transURLWnd, TRUE);
  1334. EnableWindow (copyImgWnd, TRUE);
  1335. ThotCallback (BaseDialog + RadioSave, INTEGER_DATA, (char*) 0);
  1336. SetDlgItemText (hwnDlg, IDC_EDITDOCSAVE, DocToOpen);
  1337. return 0;
  1338. case IDC_XML:
  1339. EnableWindow (transURLWnd, TRUE);
  1340. EnableWindow (copyImgWnd, TRUE);
  1341. ThotCallback (BaseDialog + RadioSave, INTEGER_DATA, (char*) 1);
  1342. SetDlgItemText (hwnDlg, IDC_EDITDOCSAVE, DocToOpen);
  1343. return 0;
  1344. case IDC_TEXT:
  1345. EnableWindow (transURLWnd, FALSE);
  1346. EnableWindow (copyImgWnd, FALSE);
  1347. ThotCallback (BaseDialog + RadioSave, INTEGER_DATA, (char*) 2);
  1348. SetDlgItemText (hwnDlg, IDC_EDITDOCSAVE, DocToOpen);
  1349. return 0;
  1350. case IDC_COPYIMG:
  1351. ThotCallback (BaseDialog + ToggleSave, INTEGER_DATA, (char*) 0);
  1352. break;
  1353. case IDC_TRANSFORMURL:
  1354. ThotCallback (BaseDialog + ToggleSave, INTEGER_DATA, (char*) 1);
  1355. break;
  1356. case ID_CHANGECHARSET:
  1357. ThotCallback (BaseDialog + SaveForm, INTEGER_DATA, (char*) 4);
  1358. if (SaveFormTmp[0] != EOS)
  1359. {
  1360. _snprintf (buff, 500, "Charset: %s", UserCharset);
  1361. SetDlgItemText (hwnDlg, IDC_CHARSET, buff);
  1362. }
  1363. break;
  1364. case ID_CHANGEMIMETYPE:
  1365. ThotCallback (BaseDialog + SaveForm, INTEGER_DATA, (char*) 5);
  1366. if (SaveFormTmp[0] != EOS)
  1367. {
  1368. _snprintf (buff, 500, "MIME type: %s", UserMimeType);
  1369. SetDlgItemText (hwnDlg, IDC_MIMETYPE, buff);
  1370. }
  1371. break;
  1372. case ID_CLEAR:
  1373. SetDlgItemText (hwnDlg, IDC_EDITDOCSAVE, "");
  1374. SetDlgItemText (hwnDlg, IDC_EDITIMGSAVE, "");
  1375. ThotCallback (BaseDialog + SaveForm, INTEGER_DATA, (char*) 3);
  1376. break;
  1377. case IDC_BROWSE:
  1378. /* by default keep the same document name */
  1379. WIN_ListSaveDirectory (hwnDlg, TtaGetMessage (AMAYA, AM_SAVE_AS), UrlToOpen);
  1380. SetDlgItemText (hwnDlg, IDC_EDITDOCSAVE, UrlToOpen);
  1381. ThotCallback (BaseDialog + NameSave, STRING_DATA, UrlToOpen);
  1382. break;
  1383. case IDCANCEL:
  1384. EndDialog (hwnDlg, IDCANCEL);
  1385. ThotCallback (BaseDialog + SaveForm, INTEGER_DATA, (char*) 0);
  1386. SaveAsForm = NULL;
  1387. break;
  1388. case ID_CONFIRM:
  1389. EndDialog (hwnDlg, ID_CONFIRM);
  1390. ThotCallback (BaseDialog + SaveForm, INTEGER_DATA, (char*) 1);
  1391. SaveAsForm = NULL;
  1392. break;
  1393. }
  1394. break;
  1395. default:
  1396. return FALSE;
  1397. }
  1398. return TRUE;
  1399. }
  1400. /*-----------------------------------------------------------------------
  1401. OpenDocDlgProc
  1402. ------------------------------------------------------------------------*/
  1403. LRESULT CALLBACK OpenDocDlgProc (ThotWindow hwnDlg, UINT msg, WPARAM wParam,
  1404. LPARAM lParam)
  1405. {
  1406. switch (msg)
  1407. {
  1408. case WM_INITDIALOG:
  1409. SetWindowText (hwnDlg, TtaGetMessage (AMAYA, AM_OPEN_URL));
  1410. SetWindowText (GetDlgItem (hwnDlg, IDC_URLMESSAGE),
  1411. TtaGetMessage (AMAYA, AM_LOCATION));
  1412. SetWindowText (GetDlgItem (hwnDlg, ID_CONFIRM),
  1413. TtaGetMessage (LIB, TMSG_LIB_CONFIRM));
  1414. SetWindowText (GetDlgItem (hwnDlg, IDC_BROWSE), TtaGetMessage (AMAYA, AM_BROWSE));
  1415. SetWindowText (GetDlgItem (hwnDlg, IDC_CLEAR), TtaGetMessage (AMAYA, AM_CLEAR));
  1416. SetWindowText (GetDlgItem (hwnDlg, IDCANCEL), TtaGetMessage (LIB, TMSG_CANCEL));
  1417. SetWindowText (hwnDlg, WndTitle);
  1418. SetDlgItemText (hwnDlg, IDC_GETURL, UrlToOpen);
  1419. /* put the focus on the first dialog item */
  1420. SetFocus (GetDlgItem (hwnDlg, IDC_GETURL));
  1421. return FALSE;
  1422. break;
  1423. case WM_COMMAND:
  1424. if (HIWORD (wParam) == EN_UPDATE)
  1425. {
  1426. if (LOWORD (wParam) == IDC_GETURL)
  1427. {
  1428. GetDlgItemText (hwnDlg, IDC_GETURL, UrlToOpen, sizeof (UrlToOpen) - 1);
  1429. if (UrlToOpen[0] != EOS)
  1430. ThotCallback (BaseDialog + URLName, STRING_DATA, UrlToOpen);
  1431. }
  1432. }
  1433. switch (LOWORD (wParam))
  1434. {
  1435. case ID_CONFIRM:
  1436. ThotCallback (BaseDialog + OpenForm, INTEGER_DATA, (char*)1);
  1437. EndDialog (hwnDlg, ID_CONFIRM);
  1438. break;
  1439. case IDC_BROWSE:
  1440. OpenFileName.lStructSize = sizeof (OPENFILENAME);
  1441. OpenFileName.hwndOwner = hwnDlg;
  1442. OpenFileName.hInstance = hInstance;
  1443. OpenFileName.lpstrFilter = (LPTSTR) SzFilter;
  1444. OpenFileName.lpstrCustomFilter = (LPTSTR) NULL;
  1445. OpenFileName.nMaxCustFilter = 0L;
  1446. OpenFileName.nFilterIndex = indexFilter;
  1447. OpenFileName.lpstrFile = (LPTSTR) TmpDocName;
  1448. OpenFileName.nMaxFile = MAX_LENGTH;
  1449. OpenFileName.lpstrInitialDir = (LPTSTR) DirectoryName;
  1450. OpenFileName.lpstrTitle = TtaGetMessage (AMAYA, AM_OPEN_URL);
  1451. OpenFileName.nFileOffset = 0;
  1452. OpenFileName.nFileExtension = 0;
  1453. OpenFileName.lpstrDefExt = "html";
  1454. OpenFileName.lCustData = 0;
  1455. OpenFileName.Flags = OFN_SHOWHELP | OFN_HIDEREADONLY;
  1456. if (GetOpenFileName (&OpenFileName))
  1457. {
  1458. strcpy (UrlToOpen, OpenFileName.lpstrFile);
  1459. indexFilter = OpenFileName.nFilterIndex;
  1460. strc

Large files files are truncated, but you can click here to view the full file