3 /////////////////////////////////////////////////////////////////////////////
5 // Copyright (c) 2002 Iain Murray, Inference Group, Cavendish, Cambridge.
7 /////////////////////////////////////////////////////////////////////////////
11 #include "PrefsPageBase.h"
12 //#include "../resource.h"
14 //#include <utility> // for std::pair
16 using namespace Dasher
;
19 // Track memory leaks on Windows to the line that new'd the memory
22 #define DEBUG_NEW new( _NORMAL_BLOCK, THIS_FILE, __LINE__ )
25 static char THIS_FILE
[] = __FILE__
;
29 CPrefsPageBase::CPrefsPageBase(HWND Parent
, CDasherInterfaceBase
*DI
, CAppSettings
*pAppSettings
)
30 :m_pDasherInterface(DI
), m_pAppSettings(pAppSettings
) {
35 LRESULT
CPrefsPageBase::WndProc(HWND Window
, UINT message
, WPARAM wParam
, LPARAM lParam
) {
40 if(!m_hwnd
) { // If this is the initial dialog for the first time
47 switch (HIWORD(wParam
)) {
50 //case CBN_SELCHANGE: // value is same as LBN_SELCHANGE
52 if(m_hPropertySheet
!= 0 && m_hwnd
!= 0) {
53 PropSheet_Changed(m_hPropertySheet
, m_hwnd
); // enables the 'Apply' button
60 pNMHDR
= (NMHDR
*)lParam
;
61 if(m_hPropertySheet
==0) {
62 m_hPropertySheet
= pNMHDR
->hwndFrom
;
64 switch (pNMHDR
->code
) {
66 // if(!m_hwnd) { // If this is the initial dialog for the first time
72 case PSN_KILLACTIVE
: // About to lose focus
73 SetWindowLong( Window
, DWL_MSGRESULT
, !Validate());
76 case PSN_APPLY
: // User clicked OK/Apply - apply the changes
78 SetWindowLong( Window
, DWL_MSGRESULT
, PSNRET_NOERROR
);
80 SetWindowLong( Window
, DWL_MSGRESULT
, PSNRET_INVALID
);