--- np2/win9x/dialog/d_screen.cpp 2003/10/16 17:59:00 1.1 +++ np2/win9x/dialog/d_screen.cpp 2005/02/07 15:39:27 1.8 @@ -1,17 +1,18 @@ #include "compiler.h" #include #include -#include "resource.h" #include "strres.h" +#include "resource.h" #include "np2.h" #include "scrnmng.h" #include "sysmng.h" +#include "np2class.h" +#include "dialog.h" +#include "dialogs.h" #include "pccore.h" #include "iocore.h" #include "scrndraw.h" #include "palettes.h" -#include "dialog.h" -#include "dialogs.h" static const char str_scropt[] = "Screen option"; @@ -20,8 +21,8 @@ static const char str_scropt[] = "Screen static LRESULT CALLBACK Scropt1DlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) { char work[32]; - WORD ret; - BYTE b; + UINT16 ret; + UINT8 b; int renewal; switch(msg) { @@ -40,7 +41,7 @@ static LRESULT CALLBACK Scropt1DlgProc(H return(TRUE); case WM_COMMAND: - switch (LOWORD(wp)) { + switch(LOWORD(wp)) { case IDC_LCD: EnableWindow(GetDlgItem(hWnd, IDC_LCDX), GetDlgItemCheck(hWnd, IDC_LCD)); @@ -51,7 +52,7 @@ static LRESULT CALLBACK Scropt1DlgProc(H case WM_HSCROLL: switch(GetDlgCtrlID((HWND)lp)) { case IDC_SKIPLIGHT: - ret = (WORD)SendDlgItemMessage(hWnd, IDC_SKIPLIGHT, + ret = (UINT16)SendDlgItemMessage(hWnd, IDC_SKIPLIGHT, TBM_GETPOS, 0, 0); wsprintf(work, str_d, ret); SetDlgItemText(hWnd, IDC_LIGHTSTR, work); @@ -60,14 +61,14 @@ static LRESULT CALLBACK Scropt1DlgProc(H break; case WM_NOTIFY: - if ((((NMHDR *)lp)->code) == PSN_APPLY) { + if ((((NMHDR *)lp)->code) == (UINT)PSN_APPLY) { renewal = 0; b = GetDlgItemCheck(hWnd, IDC_SKIPLINE); if (np2cfg.skipline != b) { np2cfg.skipline = b; renewal = 1; } - if ((ret = (WORD)SendDlgItemMessage(hWnd, IDC_SKIPLIGHT, + if ((ret = (UINT16)SendDlgItemMessage(hWnd, IDC_SKIPLIGHT, TBM_GETPOS, 0, 0)) > 255) { ret = 255; } @@ -86,8 +87,8 @@ static LRESULT CALLBACK Scropt1DlgProc(H renewal = 1; } if (renewal) { - sysmng_update(SYS_UPDATECFG); scrndraw_redraw(); + sysmng_update(SYS_UPDATECFG); } return(TRUE); } @@ -101,7 +102,7 @@ static const int gdcchip[4] = {IDC_GRCGN static LRESULT CALLBACK Scropt2DlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) { - BYTE b; + UINT8 b; UINT update; switch(msg) { @@ -114,10 +115,18 @@ static LRESULT CALLBACK Scropt2DlgProc(H } SetDlgItemCheck(hWnd, gdcchip[np2cfg.grcg & 3], TRUE); SetDlgItemCheck(hWnd, IDC_PC980124, np2cfg.color16); +#if defined(SUPPORT_PC9821) + EnableWindow(GetDlgItem(hWnd, IDC_GCBOX), FALSE); + EnableWindow(GetDlgItem(hWnd, IDC_GRCGNON), FALSE); + EnableWindow(GetDlgItem(hWnd, IDC_GRCG), FALSE); + EnableWindow(GetDlgItem(hWnd, IDC_GRCG2), FALSE); + EnableWindow(GetDlgItem(hWnd, IDC_EGC), FALSE); + EnableWindow(GetDlgItem(hWnd, IDC_PC980124), FALSE); +#endif return(TRUE); case WM_NOTIFY: - if ((((NMHDR *)lp)->code) == PSN_APPLY) { + if ((((NMHDR *)lp)->code) == (UINT)PSN_APPLY) { update = 0; b = GetDlgItemCheck(hWnd, IDC_GDC72020); if (np2cfg.uPD72020 != b) { @@ -149,8 +158,8 @@ static LRESULT CALLBACK Scropt3DlgProc(H WPARAM wp, LPARAM lp) { char work[32]; - BYTE value[6]; - BYTE b; + UINT8 value[6]; + UINT8 b; UINT update; switch(msg) { @@ -186,25 +195,25 @@ static LRESULT CALLBACK Scropt3DlgProc(H case WM_HSCROLL: switch(GetDlgCtrlID((HWND)lp)) { case IDC_TRAMWAIT: - b = (BYTE)SendDlgItemMessage(hWnd, IDC_TRAMWAIT, + b = (UINT8)SendDlgItemMessage(hWnd, IDC_TRAMWAIT, TBM_GETPOS, 0, 0); wsprintf(work, str_u, b); SetDlgItemText(hWnd, IDC_TRAMSTR, work); break; case IDC_VRAMWAIT: - b = (BYTE)SendDlgItemMessage(hWnd, IDC_VRAMWAIT, + b = (UINT8)SendDlgItemMessage(hWnd, IDC_VRAMWAIT, TBM_GETPOS, 0, 0); wsprintf(work, str_u, b); SetDlgItemText(hWnd, IDC_VRAMSTR, work); break; case IDC_GRCGWAIT: - b = (BYTE)SendDlgItemMessage(hWnd, IDC_GRCGWAIT, + b = (UINT8)SendDlgItemMessage(hWnd, IDC_GRCGWAIT, TBM_GETPOS, 0, 0); wsprintf(work, str_u, b); SetDlgItemText(hWnd, IDC_GRCGSTR, work); break; case IDC_REALPAL: - b = (BYTE)SendDlgItemMessage(hWnd, IDC_REALPAL, + b = (UINT8)SendDlgItemMessage(hWnd, IDC_REALPAL, TBM_GETPOS, 0, 0); wsprintf(work, str_d, (int)b - 32); SetDlgItemText(hWnd, IDC_REALPALSTR, work); @@ -212,20 +221,20 @@ static LRESULT CALLBACK Scropt3DlgProc(H break; case WM_NOTIFY: - if ((((NMHDR *)lp)->code) == PSN_APPLY) { + if ((((NMHDR *)lp)->code) == (UINT)PSN_APPLY) { update = 0; ZeroMemory(value, sizeof(value)); - value[0] = (BYTE)SendDlgItemMessage(hWnd, IDC_TRAMWAIT, + value[0] = (UINT8)SendDlgItemMessage(hWnd, IDC_TRAMWAIT, TBM_GETPOS, 0, 0); if (value[0]) { value[1] = 1; } - value[2] = (BYTE)SendDlgItemMessage(hWnd, IDC_VRAMWAIT, + value[2] = (UINT8)SendDlgItemMessage(hWnd, IDC_VRAMWAIT, TBM_GETPOS, 0, 0); if (value[2]) { value[3] = 1; } - value[4] = (BYTE)SendDlgItemMessage(hWnd, IDC_GRCGWAIT, + value[4] = (UINT8)SendDlgItemMessage(hWnd, IDC_GRCGWAIT, TBM_GETPOS, 0, 0); if (value[4]) { value[5] = 1; @@ -236,7 +245,7 @@ static LRESULT CALLBACK Scropt3DlgProc(H update |= SYS_UPDATECFG; } } - b = (BYTE)SendDlgItemMessage(hWnd, IDC_REALPAL, + b = (UINT8)SendDlgItemMessage(hWnd, IDC_REALPAL, TBM_GETPOS, 0, 0); if (np2cfg.realpal != b) { np2cfg.realpal = b; @@ -278,12 +287,14 @@ void dialog_scropt(HWND hWnd) { ZeroMemory(&psh, sizeof(psh)); psh.dwSize = sizeof(PROPSHEETHEADER); - psh.dwFlags = PSH_NOAPPLYNOW; + psh.dwFlags = PSH_NOAPPLYNOW | PSH_USEHICON | PSH_USECALLBACK; psh.hwndParent = hWnd; psh.hInstance = hinst; + psh.hIcon = LoadIcon(hinst, MAKEINTRESOURCE(IDI_ICON2)); psh.nPages = 3; psh.phpage = hpsp; psh.pszCaption = str_scropt; + psh.pfnCallback = np2class_propetysheet; PropertySheet(&psh); InvalidateRect(hWndMain, NULL, TRUE); }