| version 1.14, 2007/10/26 14:38:34 | version 1.18, 2011/03/07 09:54:11 | 
| Line 1 | Line 1 | 
| #include        "compiler.h" | /** | 
| #include        <commctrl.h> | * @file        d_screen.cpp | 
| #include        <prsht.h> | * @brief       Screen configure dialog procedure | 
| #include        "strres.h" | * | 
| #include        "resource.h" | * @author      $Author$ | 
| #include        "np2.h" | * @date        $Date$ | 
| #include        "oemtext.h" | */ | 
| #include        "scrnmng.h" |  | 
| #include        "sysmng.h" | #include "compiler.h" | 
| #include        "np2class.h" | #include <commctrl.h> | 
| #include        "dialog.h" | #include <prsht.h> | 
| #include        "dialogs.h" | #include "strres.h" | 
| #include        "pccore.h" | #include "resource.h" | 
| #include        "iocore.h" | #include "np2.h" | 
| #include        "scrndraw.h" | #include "oemtext.h" | 
| #include        "palettes.h" | #include "scrnmng.h" | 
|  | #include "sysmng.h" | 
|  | #include "np2class.h" | 
| static const TCHAR str_scropt[] = _T("Screen option"); | #include "dialog.h" | 
|  | #include "dialogs.h" | 
|  | #include "pccore.h" | 
|  | #include "iocore.h" | 
|  | #include "scrndraw.h" | 
|  | #include "palettes.h" | 
|  |  | 
|  | #if !defined(__GNUC__) | 
|  | #pragma comment(lib, "comctl32.lib") | 
|  | #endif  // !defined(__GNUC__) | 
 |  |  | 
 | static LRESULT CALLBACK Scropt1DlgProc(HWND hWnd, UINT msg, | static LRESULT CALLBACK Scropt1DlgProc(HWND hWnd, UINT msg, | 
 | WPARAM wp, LPARAM lp) { | WPARAM wp, LPARAM lp) { | 
| Line 264  static LRESULT CALLBACK Scropt3DlgProc(H | Line 272  static LRESULT CALLBACK Scropt3DlgProc(H | 
 | return(FALSE); | return(FALSE); | 
 | } | } | 
 |  |  | 
| static const TCHAR *pszZoom[] = { | static const CBPARAM cpZoom[] = | 
| MAKEINTRESOURCE(IDS_ZOOM_NONE), | { | 
| MAKEINTRESOURCE(IDS_ZOOM_FIXEDASPECT), | {MAKEINTRESOURCE(IDS_ZOOM_NONE),                        0}, | 
| MAKEINTRESOURCE(IDS_ZOOM_ADJUSTASPECT), | {MAKEINTRESOURCE(IDS_ZOOM_FIXEDASPECT),         1}, | 
| MAKEINTRESOURCE(IDS_ZOOM_FULL)}; | {MAKEINTRESOURCE(IDS_ZOOM_ADJUSTASPECT),        2}, | 
|  | {MAKEINTRESOURCE(IDS_ZOOM_FULL),                        3}, | 
|  | }; | 
 |  |  | 
 | static LRESULT CALLBACK ScroptFullScreenDlgProc(HWND hWnd, UINT uMsg, | static LRESULT CALLBACK ScroptFullScreenDlgProc(HWND hWnd, UINT uMsg, | 
 | WPARAM wParam, LPARAM lParam) | WPARAM wParam, LPARAM lParam) | 
 | { | { | 
 | UINT8   c; | UINT8   c; | 
 | UINT    uUpdate; |  | 
 |  |  | 
 | switch(uMsg) | switch(uMsg) | 
 | { | { | 
| Line 284  static LRESULT CALLBACK ScroptFullScreen | Line 293  static LRESULT CALLBACK ScroptFullScreen | 
 | (c & FSCRNMOD_SAMEBPP)); | (c & FSCRNMOD_SAMEBPP)); | 
 | SetDlgItemCheck(hWnd, IDC_FULLSCREEN_SAMERES, | SetDlgItemCheck(hWnd, IDC_FULLSCREEN_SAMERES, | 
 | (c & FSCRNMOD_SAMERES)); | (c & FSCRNMOD_SAMERES)); | 
| dlgs_setdroplistitem(hWnd, IDC_FULLSCREEN_ZOOM, | dlgs_setcbitem(hWnd, IDC_FULLSCREEN_ZOOM, | 
| pszZoom, NELEMENTS(pszZoom)); | cpZoom, NELEMENTS(cpZoom)); | 
| dlgs_setdroplistnumber(hWnd, IDC_FULLSCREEN_ZOOM, (c & 3)); | dlgs_setcbcur(hWnd, IDC_FULLSCREEN_ZOOM, (c & 3)); | 
 | EnableWindow(GetDlgItem(hWnd, IDC_FULLSCREEN_ZOOM), | EnableWindow(GetDlgItem(hWnd, IDC_FULLSCREEN_ZOOM), | 
 | (c & FSCRNMOD_SAMERES) != 0); | (c & FSCRNMOD_SAMERES) != 0); | 
 | return(TRUE); | return(TRUE); | 
| Line 313  static LRESULT CALLBACK ScroptFullScreen | Line 322  static LRESULT CALLBACK ScroptFullScreen | 
 | { | { | 
 | c |= FSCRNMOD_SAMERES; | c |= FSCRNMOD_SAMERES; | 
 | } | } | 
| c |= (dlgs_getdroplistnumber(hWnd, IDC_FULLSCREEN_ZOOM) & 3); | c |= dlgs_getcbcur(hWnd, IDC_FULLSCREEN_ZOOM, 0); | 
 | if (np2oscfg.fscrnmod != c) | if (np2oscfg.fscrnmod != c) | 
 | { | { | 
 | np2oscfg.fscrnmod = c; | np2oscfg.fscrnmod = c; | 
| uUpdate |= SYS_UPDATEOSCFG; | sysmng_update(SYS_UPDATEOSCFG); | 
 | } | } | 
 | sysmng_update(uUpdate); |  | 
 | return(TRUE); | return(TRUE); | 
 | } | } | 
 | break; | break; | 
| Line 327  static LRESULT CALLBACK ScroptFullScreen | Line 335  static LRESULT CALLBACK ScroptFullScreen | 
 | return(FALSE); | return(FALSE); | 
 | } | } | 
 |  |  | 
| void dialog_scropt(HWND hWnd) { | void dialog_scropt(HWND hWnd) | 
|  | { | 
| HINSTANCE               hinst; | HINSTANCE               hInstance; | 
 | PROPSHEETPAGE   psp; | PROPSHEETPAGE   psp; | 
 | PROPSHEETHEADER psh; | PROPSHEETHEADER psh; | 
 | HPROPSHEETPAGE  hpsp[4]; | HPROPSHEETPAGE  hpsp[4]; | 
 |  | TCHAR                   szTitle[128]; | 
 |  |  | 
| hinst = (HINSTANCE)GetWindowLongPtr(hWnd, GWLP_HINSTANCE); | hInstance = (HINSTANCE)GetWindowLongPtr(hWnd, GWLP_HINSTANCE); | 
 |  |  | 
 | ZeroMemory(&psp, sizeof(psp)); | ZeroMemory(&psp, sizeof(psp)); | 
 | psp.dwSize = sizeof(PROPSHEETPAGE); | psp.dwSize = sizeof(PROPSHEETPAGE); | 
 | psp.dwFlags = PSP_DEFAULT; | psp.dwFlags = PSP_DEFAULT; | 
| psp.hInstance = hinst; | psp.hInstance = hInstance; | 
 |  |  | 
 | psp.pszTemplate = MAKEINTRESOURCE(IDD_SCROPT1); | psp.pszTemplate = MAKEINTRESOURCE(IDD_SCROPT1); | 
 | psp.pfnDlgProc = (DLGPROC)Scropt1DlgProc; | psp.pfnDlgProc = (DLGPROC)Scropt1DlgProc; | 
| Line 357  void dialog_scropt(HWND hWnd) { | Line 366  void dialog_scropt(HWND hWnd) { | 
 | psp.pfnDlgProc = (DLGPROC)ScroptFullScreenDlgProc; | psp.pfnDlgProc = (DLGPROC)ScroptFullScreenDlgProc; | 
 | hpsp[3] = CreatePropertySheetPage(&psp); | hpsp[3] = CreatePropertySheetPage(&psp); | 
 |  |  | 
 |  | loadstringresource(IDS_SCREENOPTION, szTitle, NELEMENTS(szTitle)); | 
 |  |  | 
 | ZeroMemory(&psh, sizeof(psh)); | ZeroMemory(&psh, sizeof(psh)); | 
 | psh.dwSize = sizeof(PROPSHEETHEADER); | psh.dwSize = sizeof(PROPSHEETHEADER); | 
 | psh.dwFlags = PSH_NOAPPLYNOW | PSH_USEHICON | PSH_USECALLBACK; | psh.dwFlags = PSH_NOAPPLYNOW | PSH_USEHICON | PSH_USECALLBACK; | 
 | psh.hwndParent = hWnd; | psh.hwndParent = hWnd; | 
| psh.hInstance = hinst; | psh.hInstance = hInstance; | 
| psh.hIcon = LoadIcon(hinst, MAKEINTRESOURCE(IDI_ICON2)); | psh.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON2)); | 
 | psh.nPages = 4; | psh.nPages = 4; | 
 | psh.phpage = hpsp; | psh.phpage = hpsp; | 
| psh.pszCaption = str_scropt; | psh.pszCaption = szTitle; | 
 | psh.pfnCallback = np2class_propetysheet; | psh.pfnCallback = np2class_propetysheet; | 
 | PropertySheet(&psh); | PropertySheet(&psh); | 
| InvalidateRect(hWndMain, NULL, TRUE); | InvalidateRect(hWnd, NULL, TRUE); | 
 | } | } | 
 |  |  |