1
0

sps_configdlg.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. #ifndef SPS_CONFIGDLG_IMPL
  2. BOOL CALLBACK SPS_configWindowProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
  3. #else
  4. #ifdef SPS_CONFIGDLG_HIDEABLE_EDITOR
  5. static void showHideSliders(HWND hwndDlg, SPSEffectContext *ctx)
  6. {
  7. int x;
  8. x=(SPS_CONFIGDLG_HIDEABLE_EDITOR || ctx->curpreset.slider_labels[0][0][0])?SW_SHOWNA:SW_HIDE;
  9. ShowWindow(GetDlgItem(hwndDlg,IDC_SLIDER1),x);
  10. ShowWindow(GetDlgItem(hwndDlg,IDC_SLIDER1_LABEL1),x);
  11. ShowWindow(GetDlgItem(hwndDlg,IDC_SLIDER1_LABEL2),x);
  12. ShowWindow(GetDlgItem(hwndDlg,IDC_SLIDER1_LABEL3),x);
  13. x=(SPS_CONFIGDLG_HIDEABLE_EDITOR || ctx->curpreset.slider_labels[1][0][0])?SW_SHOWNA:SW_HIDE;
  14. ShowWindow(GetDlgItem(hwndDlg,IDC_SLIDER2),x);
  15. ShowWindow(GetDlgItem(hwndDlg,IDC_SLIDER2_LABEL1),x);
  16. ShowWindow(GetDlgItem(hwndDlg,IDC_SLIDER2_LABEL2),x);
  17. ShowWindow(GetDlgItem(hwndDlg,IDC_SLIDER2_LABEL3),x);
  18. x=(SPS_CONFIGDLG_HIDEABLE_EDITOR || ctx->curpreset.slider_labels[2][0][0])?SW_SHOWNA:SW_HIDE;
  19. ShowWindow(GetDlgItem(hwndDlg,IDC_SLIDER3),x);
  20. ShowWindow(GetDlgItem(hwndDlg,IDC_SLIDER3_LABEL1),x);
  21. ShowWindow(GetDlgItem(hwndDlg,IDC_SLIDER3_LABEL2),x);
  22. ShowWindow(GetDlgItem(hwndDlg,IDC_SLIDER3_LABEL3),x);
  23. x=(SPS_CONFIGDLG_HIDEABLE_EDITOR || ctx->curpreset.slider_labels[3][0][0])?SW_SHOWNA:SW_HIDE;
  24. ShowWindow(GetDlgItem(hwndDlg,IDC_SLIDER4),x);
  25. ShowWindow(GetDlgItem(hwndDlg,IDC_SLIDER4_LABEL1),x);
  26. ShowWindow(GetDlgItem(hwndDlg,IDC_SLIDER4_LABEL2),x);
  27. ShowWindow(GetDlgItem(hwndDlg,IDC_SLIDER4_LABEL3),x);
  28. }
  29. static void showHideEditor(HWND hwndDlg, int isInit)
  30. {
  31. int en=0;
  32. static int lw;
  33. RECT r;
  34. GetWindowRect(hwndDlg,&r);
  35. if (isInit)
  36. {
  37. lw=r.right-r.left;
  38. }
  39. if (!SPS_CONFIGDLG_HIDEABLE_EDITOR)
  40. {
  41. SetDlgItemText(hwndDlg,IDC_EDIT,WASABI_API_LNGSTRING(IDS_SHOW_EDITOR));
  42. RECT r2;
  43. GetWindowRect(GetDlgItem(hwndDlg,IDC_SAVE),&r2);
  44. SetWindowPos(hwndDlg,NULL,0,0,r2.left-r.left,r.bottom-r.top,SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOMOVE);
  45. }
  46. else
  47. {
  48. if (!isInit)
  49. {
  50. SetWindowPos(hwndDlg,NULL,0,0,lw,r.bottom-r.top,SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOMOVE);
  51. }
  52. SetDlgItemText(hwndDlg,IDC_EDIT,WASABI_API_LNGSTRING(IDS_HIDE_EDITOR));
  53. en=1;
  54. }
  55. UINT tab[] = {
  56. IDC_SLIDER1_LABEL1,
  57. IDC_SLIDER1_LABEL2,
  58. IDC_SLIDER1_LABEL3,
  59. IDC_SLIDER2_LABEL1,
  60. IDC_SLIDER2_LABEL2,
  61. IDC_SLIDER2_LABEL3,
  62. IDC_SLIDER3_LABEL1,
  63. IDC_SLIDER3_LABEL2,
  64. IDC_SLIDER3_LABEL3,
  65. IDC_SLIDER4_LABEL1,
  66. IDC_SLIDER4_LABEL2,
  67. IDC_SLIDER4_LABEL3,
  68. };
  69. for (int x = 0; x < sizeof(tab)/sizeof(UINT); x ++)
  70. {
  71. EnableWindow(GetDlgItem(hwndDlg,tab[x]),en);
  72. }
  73. UINT tab2[]={
  74. IDC_SAVE,
  75. IDC_SHOWHELP,
  76. IDC_INIT,
  77. IDC_ONSLIDERCHANGE,
  78. IDC_PERSAMPLE,
  79. };
  80. for (int x = 0; x < sizeof(tab2)/sizeof(UINT); x++)
  81. {
  82. ShowWindow(GetDlgItem(hwndDlg,tab2[x]),en?SW_SHOWNA:SW_HIDE);
  83. }
  84. }
  85. #endif
  86. char* BuildFilterString(void)
  87. {
  88. static char filterStr[MAX_PATH] = {0};
  89. if(!filterStr[0])
  90. {
  91. char* temp = filterStr;
  92. //"SPS presets\0*.sps\0All files\0*.*\0"
  93. WASABI_API_LNGSTRING_BUF(IDS_SPS_PRESETS,filterStr,128);
  94. temp += lstrlen(filterStr)+1;
  95. lstrcpyn(temp, "*.sps", MAX_PATH);
  96. temp = temp + lstrlen(temp) + 1;
  97. lstrcpyn(temp, WASABI_API_LNGSTRING(IDS_ALL_FILES), 128);
  98. temp = temp + lstrlen(temp) + 1;
  99. lstrcpyn(temp, "*.*", MAX_PATH);
  100. *(temp = temp + lstrlen(temp) + 1) = 0;
  101. }
  102. return filterStr;
  103. }
  104. static void updatePresetText(HWND hwndDlg, SPSEffectContext *ctx)
  105. {
  106. char *p=strrchr(ctx->curpreset_name,'\\');
  107. if (!p) p=ctx->curpreset_name;
  108. else p++;
  109. char *p2=strrchr(p,'.');
  110. if (p2) *p2=0;
  111. SetDlgItemText(hwndDlg,IDC_PRESET,p);
  112. if (p2) *p2='.';
  113. }
  114. static void dosavePreset(HWND hwndDlg, SPSEffectContext *ctx)
  115. {
  116. char temp[2048] = {0};
  117. OPENFILENAME l={sizeof(l),0};
  118. char buf1[2048],buf2[2048];
  119. GetCurrentDirectory(sizeof(buf2),buf2);
  120. strcpy(buf1,g_path);
  121. l.hwndOwner = hwndDlg;
  122. l.lpstrFilter = BuildFilterString();
  123. l.lpstrFile = temp;
  124. strcpy(temp,ctx->curpreset_name);
  125. l.nMaxFile = 2048-1;
  126. l.lpstrTitle = WASABI_API_LNGSTRING(IDS_SAVE_PRESET);
  127. l.lpstrDefExt = "SPS";
  128. l.lpstrInitialDir = buf1;
  129. l.Flags = OFN_HIDEREADONLY|OFN_EXPLORER|OFN_OVERWRITEPROMPT;
  130. if (GetSaveFileName(&l))
  131. {
  132. strcpy(ctx->curpreset_name,temp);
  133. SPS_save_preset(ctx,ctx->curpreset_name,"SPS PRESET");
  134. updatePresetText(hwndDlg,ctx);
  135. }
  136. SetCurrentDirectory(buf2);
  137. }
  138. static void presetToDialog(HWND hwndDlg, SPSEffectContext *ctx)
  139. {
  140. SendDlgItemMessage(hwndDlg,IDC_SLIDER1,TBM_SETPOS,1,1000-ctx->curpreset.sliderpos[0]);
  141. SendDlgItemMessage(hwndDlg,IDC_SLIDER2,TBM_SETPOS,1,1000-ctx->curpreset.sliderpos[1]);
  142. SendDlgItemMessage(hwndDlg,IDC_SLIDER3,TBM_SETPOS,1,1000-ctx->curpreset.sliderpos[2]);
  143. SendDlgItemMessage(hwndDlg,IDC_SLIDER4,TBM_SETPOS,1,1000-ctx->curpreset.sliderpos[3]);
  144. SetDlgItemText(hwndDlg,IDC_SLIDER1_LABEL1,ctx->curpreset.slider_labels[0][0]);
  145. SetDlgItemText(hwndDlg,IDC_SLIDER1_LABEL2,ctx->curpreset.slider_labels[0][1]);
  146. SetDlgItemText(hwndDlg,IDC_SLIDER1_LABEL3,ctx->curpreset.slider_labels[0][2]);
  147. SetDlgItemText(hwndDlg,IDC_SLIDER2_LABEL1,ctx->curpreset.slider_labels[1][0]);
  148. SetDlgItemText(hwndDlg,IDC_SLIDER2_LABEL2,ctx->curpreset.slider_labels[1][1]);
  149. SetDlgItemText(hwndDlg,IDC_SLIDER2_LABEL3,ctx->curpreset.slider_labels[1][2]);
  150. SetDlgItemText(hwndDlg,IDC_SLIDER3_LABEL1,ctx->curpreset.slider_labels[2][0]);
  151. SetDlgItemText(hwndDlg,IDC_SLIDER3_LABEL2,ctx->curpreset.slider_labels[2][1]);
  152. SetDlgItemText(hwndDlg,IDC_SLIDER3_LABEL3,ctx->curpreset.slider_labels[2][2]);
  153. SetDlgItemText(hwndDlg,IDC_SLIDER4_LABEL1,ctx->curpreset.slider_labels[3][0]);
  154. SetDlgItemText(hwndDlg,IDC_SLIDER4_LABEL2,ctx->curpreset.slider_labels[3][1]);
  155. SetDlgItemText(hwndDlg,IDC_SLIDER4_LABEL3,ctx->curpreset.slider_labels[3][2]);
  156. SetDlgItemText(hwndDlg,IDC_INIT,ctx->curpreset.code_text[0]);
  157. SetDlgItemText(hwndDlg,IDC_PERSAMPLE,ctx->curpreset.code_text[1]);
  158. SetDlgItemText(hwndDlg,IDC_ONSLIDERCHANGE,ctx->curpreset.code_text[2]);
  159. updatePresetText(hwndDlg,ctx);
  160. #ifdef SPS_CONFIGDLG_HIDEABLE_EDITOR
  161. showHideSliders(hwndDlg,ctx);
  162. #endif
  163. }
  164. static int m_help_lastpage=4;
  165. static char *m_localtext;
  166. static void _dosetsel(HWND hwndDlg)
  167. {
  168. HWND tabwnd=GetDlgItem(hwndDlg,IDC_TAB1);
  169. int sel=TabCtrl_GetCurSel(tabwnd);
  170. char *text="";
  171. m_help_lastpage=sel;
  172. text=SPSHELP_gethelptext(sel);
  173. if (!text && sel == 4 && m_localtext) text=m_localtext;
  174. SetDlgItemText(hwndDlg,IDC_EDIT1,text);
  175. }
  176. static BOOL CALLBACK evalHelpDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam)
  177. {
  178. switch (uMsg)
  179. {
  180. case WM_INITDIALOG:
  181. {
  182. TCITEM item;
  183. HWND tabwnd=GetDlgItem(hwndDlg,IDC_TAB1);
  184. helpWnd=hwndDlg;
  185. item.mask=TCIF_TEXT;
  186. item.pszText=WASABI_API_LNGSTRING(IDS_GENERAL);
  187. TabCtrl_InsertItem(tabwnd,0,&item);
  188. item.pszText=WASABI_API_LNGSTRING(IDS_OPERATORS);
  189. TabCtrl_InsertItem(tabwnd,1,&item);
  190. item.pszText=WASABI_API_LNGSTRING(IDS_FUNCTIONS);
  191. TabCtrl_InsertItem(tabwnd,2,&item);
  192. item.pszText=WASABI_API_LNGSTRING(IDS_CONSTANTS);
  193. TabCtrl_InsertItem(tabwnd,3,&item);
  194. // fucko: context specific stuff
  195. m_localtext=0;
  196. if (lParam)
  197. {
  198. item.pszText=(char *)lParam;
  199. m_localtext=item.pszText + strlen(item.pszText)+1;
  200. TabCtrl_InsertItem(tabwnd,4,&item);
  201. }
  202. else if (m_help_lastpage > 3) m_help_lastpage=0;
  203. TabCtrl_SetCurSel(tabwnd,m_help_lastpage);
  204. _dosetsel(hwndDlg);
  205. }
  206. return 0;
  207. case WM_COMMAND:
  208. if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
  209. {
  210. EndDialog(hwndDlg,1);
  211. helpWnd = 0;
  212. }
  213. return 0;
  214. case WM_NOTIFY:
  215. {
  216. LPNMHDR p=(LPNMHDR) lParam;
  217. if (p->idFrom == IDC_TAB1 && p->code == TCN_SELCHANGE) _dosetsel(hwndDlg);
  218. }
  219. return 0;
  220. }
  221. return 0;
  222. }
  223. BOOL CALLBACK SPS_configWindowProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
  224. {
  225. SPSEffectContext *ctx;
  226. if ( uMsg == WM_INITDIALOG )
  227. SetWindowLong( hwndDlg, DWL_USER, lParam );
  228. ctx = (SPSEffectContext *) GetWindowLong( hwndDlg, DWL_USER );
  229. if ( ctx )
  230. {
  231. switch ( uMsg )
  232. {
  233. case WM_INITDIALOG:
  234. SetWindowText( hwndDlg, hdr.description );
  235. SendDlgItemMessage( hwndDlg, IDC_SLIDER1, TBM_SETTICFREQ, 100, 0 );
  236. SendDlgItemMessage( hwndDlg, IDC_SLIDER2, TBM_SETTICFREQ, 100, 0 );
  237. SendDlgItemMessage( hwndDlg, IDC_SLIDER3, TBM_SETTICFREQ, 100, 0 );
  238. SendDlgItemMessage( hwndDlg, IDC_SLIDER4, TBM_SETTICFREQ, 100, 0 );
  239. SendDlgItemMessage( hwndDlg, IDC_SLIDER1, TBM_SETRANGEMIN, 0, 0 );
  240. SendDlgItemMessage( hwndDlg, IDC_SLIDER1, TBM_SETRANGEMAX, 0, 1000 );
  241. SendDlgItemMessage( hwndDlg, IDC_SLIDER2, TBM_SETRANGEMIN, 0, 0 );
  242. SendDlgItemMessage( hwndDlg, IDC_SLIDER2, TBM_SETRANGEMAX, 0, 1000 );
  243. SendDlgItemMessage( hwndDlg, IDC_SLIDER3, TBM_SETRANGEMIN, 0, 0 );
  244. SendDlgItemMessage( hwndDlg, IDC_SLIDER3, TBM_SETRANGEMAX, 0, 1000 );
  245. SendDlgItemMessage( hwndDlg, IDC_SLIDER4, TBM_SETRANGEMIN, 0, 0 );
  246. SendDlgItemMessage( hwndDlg, IDC_SLIDER4, TBM_SETRANGEMAX, 0, 1000 );
  247. #ifdef SPS_CONFIGDLG_HIDEABLE_EDITOR
  248. showHideEditor( hwndDlg, TRUE );
  249. showHideSliders( hwndDlg, ctx );
  250. #else
  251. ShowWindow( GetDlgItem( hwndDlg, IDC_EDIT ), SW_HIDE );
  252. #endif
  253. if ( !ctx->bypass )
  254. CheckDlgButton( hwndDlg, IDC_BYPASS, BST_CHECKED );
  255. presetToDialog( hwndDlg, ctx );
  256. return 0;
  257. case WM_USER + 0x80:
  258. ShowWindow( hwndDlg, SW_SHOW );
  259. SetForegroundWindow( hwndDlg );
  260. return 0;
  261. case WM_COMMAND:
  262. {
  263. int w = 0;
  264. switch ( LOWORD( wParam ) )
  265. {
  266. case IDC_SLIDER1_LABEL1: w++;
  267. case IDC_SLIDER1_LABEL2: w++;
  268. case IDC_SLIDER1_LABEL3: w++;
  269. case IDC_SLIDER2_LABEL1: w++;
  270. case IDC_SLIDER2_LABEL2: w++;
  271. case IDC_SLIDER2_LABEL3: w++;
  272. case IDC_SLIDER3_LABEL1: w++;
  273. case IDC_SLIDER3_LABEL2: w++;
  274. case IDC_SLIDER3_LABEL3: w++;
  275. case IDC_SLIDER4_LABEL1: w++;
  276. case IDC_SLIDER4_LABEL2: w++;
  277. case IDC_SLIDER4_LABEL3: w++;
  278. if ( HIWORD( wParam ) == EN_CHANGE )
  279. {
  280. w = 12 - w;
  281. GetDlgItemText( hwndDlg, LOWORD( wParam ), ctx->curpreset.slider_labels[ w / 3 ][ w % 3 ], MAX_LABEL_LEN );
  282. }
  283. break;
  284. #ifdef SPS_CONFIGDLG_HIDEABLE_EDITOR
  285. case IDC_EDIT:
  286. SPS_CONFIGDLG_HIDEABLE_EDITOR = !SPS_CONFIGDLG_HIDEABLE_EDITOR;
  287. showHideEditor( hwndDlg, FALSE );
  288. showHideSliders( hwndDlg, ctx );
  289. break;
  290. #endif
  291. case IDC_BYPASS:
  292. ctx->bypass = !IsDlgButtonChecked( hwndDlg, IDC_BYPASS );
  293. break;
  294. case IDC_LOAD:
  295. {
  296. SendMessage( mod.hwndParent, WM_WA_IPC, 0, IPC_PUSH_DISABLE_EXIT );
  297. char temp[ 2048 ] = { 0 };
  298. OPENFILENAME l = { sizeof( l ),0 };
  299. char buf1[ 2048 ], buf2[ 2048 ];
  300. GetCurrentDirectory( sizeof( buf2 ), buf2 );
  301. strcpy( buf1, g_path );
  302. l.lpstrInitialDir = buf1;
  303. l.hwndOwner = hwndDlg;
  304. l.lpstrFilter = BuildFilterString();
  305. l.lpstrFile = temp;
  306. l.nMaxFile = 2048 - 1;
  307. l.lpstrTitle = WASABI_API_LNGSTRING( IDS_LOAD_PRESET );
  308. l.lpstrDefExt = "SPS";
  309. l.Flags = OFN_HIDEREADONLY | OFN_EXPLORER;
  310. if ( GetOpenFileName( &l ) )
  311. {
  312. SPS_load_preset( ctx, temp, "SPS PRESET" );
  313. presetToDialog( hwndDlg, ctx );
  314. }
  315. SetCurrentDirectory( buf2 );
  316. SendMessage( mod.hwndParent, WM_WA_IPC, 0, IPC_POP_DISABLE_EXIT );
  317. }
  318. break;
  319. case IDC_NEW:
  320. char title[ 32 ];
  321. if ( MessageBox( hwndDlg, WASABI_API_LNGSTRING( IDS_CLEAR_CURRENT_SETTINGS ),
  322. WASABI_API_LNGSTRING_BUF( IDS_CONFIRMATION, title, 32 ), MB_YESNO ) == IDYES )
  323. {
  324. EnterCriticalSection( &ctx->code_cs );
  325. memset( &ctx->curpreset, 0, sizeof( ctx->curpreset ) );
  326. ctx->code_needrecompile = 7;
  327. memset( &ctx->triggers, 0, sizeof( ctx->triggers ) );
  328. ctx->curpreset_name[ 0 ] = 0;
  329. LeaveCriticalSection( &ctx->code_cs );
  330. presetToDialog( hwndDlg, ctx );
  331. }
  332. break;
  333. case IDC_SAVE:
  334. SendMessage( mod.hwndParent, WM_WA_IPC, 0, IPC_PUSH_DISABLE_EXIT );
  335. dosavePreset( hwndDlg, ctx );
  336. SendMessage( mod.hwndParent, WM_WA_IPC, 0, IPC_POP_DISABLE_EXIT );
  337. break;
  338. case IDC_INIT:
  339. if ( HIWORD( wParam ) == EN_CHANGE )
  340. {
  341. KillTimer( hwndDlg, 100 );
  342. SetTimer( hwndDlg, 100, 250, NULL );
  343. }
  344. break;
  345. case IDC_PERSAMPLE:
  346. if ( HIWORD( wParam ) == EN_CHANGE )
  347. {
  348. KillTimer( hwndDlg, 101 );
  349. SetTimer( hwndDlg, 101, 250, NULL );
  350. }
  351. break;
  352. case IDC_ONSLIDERCHANGE:
  353. if ( HIWORD( wParam ) == EN_CHANGE )
  354. {
  355. KillTimer( hwndDlg, 102 );
  356. SetTimer( hwndDlg, 102, 250, NULL );
  357. }
  358. break;
  359. case IDC_SHOWHELP:
  360. WASABI_API_DIALOGBOX( IDD_EVAL_HELP, hwndDlg, evalHelpDlgProc );
  361. break;
  362. case IDC_TRIGGER1:
  363. ctx->triggers[ 0 ]++;
  364. break;
  365. case IDC_TRIGGER2:
  366. ctx->triggers[ 1 ]++;
  367. break;
  368. case IDC_TRIGGER3:
  369. ctx->triggers[ 2 ]++;
  370. break;
  371. case IDC_TRIGGER4:
  372. ctx->triggers[ 3 ]++;
  373. break;
  374. }
  375. return 0;
  376. }
  377. case WM_TIMER:
  378. if ( wParam == 100 || wParam == 101 || wParam == 102 )
  379. {
  380. KillTimer( hwndDlg, wParam );
  381. EnterCriticalSection( &ctx->code_cs );
  382. GetDlgItemText( hwndDlg, wParam == 100 ? IDC_INIT : ( wParam == 101 ? IDC_PERSAMPLE : IDC_ONSLIDERCHANGE ), ctx->curpreset.code_text[ wParam - 100 ], MAX_CODE_LEN );
  383. ctx->code_needrecompile |= 1 << ( wParam - 100 );
  384. LeaveCriticalSection( &ctx->code_cs );
  385. }
  386. return 0;
  387. case WM_CLOSE:
  388. #ifdef SPS_CONFIGDLG_ON_WM_CLOSE
  389. SPS_CONFIGDLG_ON_WM_CLOSE
  390. #endif
  391. return 0;
  392. case WM_VSCROLL:
  393. {
  394. HWND swnd = (HWND) lParam;
  395. int t = (int) SendMessage( swnd, TBM_GETPOS, 0, 0 );
  396. if ( swnd == GetDlgItem( hwndDlg, IDC_SLIDER1 ) )
  397. {
  398. ctx->curpreset.sliderpos[ 0 ] = 1000 - t;
  399. ctx->sliderchange = 1;
  400. }
  401. if ( swnd == GetDlgItem( hwndDlg, IDC_SLIDER2 ) )
  402. {
  403. ctx->curpreset.sliderpos[ 1 ] = 1000 - t;
  404. ctx->sliderchange = 1;
  405. }
  406. if ( swnd == GetDlgItem( hwndDlg, IDC_SLIDER3 ) )
  407. {
  408. ctx->curpreset.sliderpos[ 2 ] = 1000 - t;
  409. ctx->sliderchange = 1;
  410. }
  411. if ( swnd == GetDlgItem( hwndDlg, IDC_SLIDER4 ) )
  412. {
  413. ctx->curpreset.sliderpos[ 3 ] = 1000 - t;
  414. ctx->sliderchange = 1;
  415. }
  416. }
  417. break;
  418. }
  419. return 0;
  420. }
  421. }
  422. #endif