Changeset 46
- Timestamp:
- 01/27/08 19:10:06 (8 months ago)
- Files:
-
- public/trunk/pmfb/client/win/dialog/RegisterDialog.cpp (modified) (5 diffs)
- public/trunk/pmfb/client/win/dialog/RegisterDialog.h (modified) (2 diffs)
- public/trunk/pmfb/client/win/pmfb-vc/install/PlayMaker Football.nsi (modified) (1 diff)
- public/trunk/pmfb/client/win/pmfb-vc/pmfb.rc (modified) (3 diffs)
- public/trunk/pmfb/client/win/pmfb-vc/resource.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
public/trunk/pmfb/client/win/dialog/RegisterDialog.cpp
r44 r46 32 32 //{{AFX_DATA_INIT(CRegister) 33 33 mKeyCode = _T(""); 34 mUserName = _T("");35 34 //}}AFX_DATA_INIT 36 35 } … … 42 41 //{{AFX_DATA_MAP(CRegister) 43 42 DDX_Text(pDX, IDC_KEY_CODE, mKeyCode); 44 DDV_MaxChars(pDX, mKeyCode, 14);45 DDX_Text(pDX, IDC_USER_NAME, mUserName);46 DDV_MaxChars(pDX, mUserName, 31);47 43 //}}AFX_DATA_MAP 48 44 } … … 51 47 BEGIN_MESSAGE_MAP(CRegister, CDialog) 52 48 //{{AFX_MSG_MAP(CRegister) 53 ON_BN_CLICKED(IDC_GENERATE, OnGenerate)54 49 //}}AFX_MSG_MAP 50 ON_BN_CLICKED(IDOK, OnBnClickedOk) 55 51 END_MESSAGE_MAP() 56 52 … … 61 57 { 62 58 CDialog::OnInitDialog(); 63 mUserName = AfxGetApp()->GetProfileString(_T("Registration"),_T("UserName")); 64 mGenerateState = AfxGetApp()->GetProfileInt(_T("Registration"),_T("GenerateState"),kUserNameActive); 65 GetDlgItem(IDC_USER_NAME)->SetWindowText(mUserName); 66 SetGenerateState(); 59 // SetGenerateState(); 67 60 68 61 return FALSE; // return TRUE unless you set the focus to a control … … 70 63 } 71 64 72 void CRegister:: SetGenerateState()65 void CRegister::OnBnClickedOk() 73 66 { 74 GetDlgItem(IDC_USER_NAME)->EnableWindow(mGenerateState == kUserNameActive); 75 GetDlgItem(IDC_KEY_CODE)->EnableWindow(mGenerateState == kUserNameInactive); 76 GetDlgItem(IDOK)->EnableWindow(mGenerateState == kUserNameInactive); 77 if (mGenerateState == kUserNameActive) 78 { 79 GetDlgItem(IDC_GENERATE)->SetWindowText(CString(MAKEINTRESOURCE(IDS_REGISTER_GENERATE_ID))); 80 GetDlgItem(IDC_KEY_CODE)->SetWindowText(_T("")); 81 GetDlgItem(IDC_PERSONAL_ID)->SetWindowText(_T("")); 82 this->GotoDlgCtrl(GetDlgItem(IDC_USER_NAME)); 83 } 84 else 85 { 86 GetDlgItem(IDC_GENERATE)->SetWindowText(CString(MAKEINTRESOURCE(IDS_REGISTER_CHANGE_NAME))); 87 GetDlgItem(IDC_USER_NAME)->GetWindowText(mUserName); 88 #if 0 89 this->GetDlgItem(IDC_PERSONAL_ID)->SetWindowText(RegisterUserValidationKey((char*)(LPCTSTR)mUserName)); 90 #endif // 0 91 this->GotoDlgCtrl(GetDlgItem(IDCANCEL)); 92 } 67 // TODO: Add your control notification handler code here 68 GetDlgItem(IDC_KEY_CODE)->GetWindowText(mKeyCode); 69 int error = db::Connection::addLicense((char*)(LPCTSTR)mKeyCode); 70 OnOK(); 93 71 } 94 95 void CRegister::OnGenerate()96 {97 mGenerateState = !mGenerateState;98 SetGenerateState();99 }100 101 void CRegister::OnCancel()102 {103 GetDlgItem(IDC_USER_NAME)->GetWindowText(mUserName);104 AfxGetApp()->WriteProfileString(_T("Registration"),_T("UserName"),mUserName);105 AfxGetApp()->WriteProfileInt(_T("Registration"),_T("GenerateState"),mGenerateState);106 107 CDialog::OnCancel();108 }public/trunk/pmfb/client/win/dialog/RegisterDialog.h
r44 r46 27 27 enum { IDD = IDD_REGISTER }; 28 28 CString mKeyCode; 29 CString mUserName;30 29 //}}AFX_DATA 31 32 30 33 31 // Overrides … … 44 42 //{{AFX_MSG(CRegister) 45 43 virtual BOOL OnInitDialog(); 46 afx_msg void OnGenerate();47 virtual void OnCancel();48 44 //}}AFX_MSG 49 45 DECLARE_MESSAGE_MAP() 50 46 51 void SetGenerateState(); 52 enum {kUserNameActive = 0, kUserNameInactive = 1};53 int mGenerateState;47 public: 48 afx_msg void OnEnChangeKeyCode(); 49 afx_msg void OnBnClickedOk(); 54 50 }; 55 51 public/trunk/pmfb/client/win/pmfb-vc/install/PlayMaker Football.nsi
r8 r46 81 81 CreateDirectory "$DOCUMENTS\PlayMaker Football\Sessions" 82 82 CreateDirectory "$LOCALAPPDATA\PlayMaker\License" 83 CreateDirectory "$LOCALAPPDATA\PlayMaker\License\private" 83 84 SectionEnd 84 85 public/trunk/pmfb/client/win/pmfb-vc/pmfb.rc
r36 r46 1057 1057 END 1058 1058 1059 IDD_REGISTER DIALOG 0, 0, 197, 2101059 IDD_REGISTER DIALOGEX 0, 0, 287, 187 1060 1060 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 1061 1061 CAPTION "Register PlayMaker Football" 1062 FONT 8, "MS Sans Serif" 1063 BEGIN 1064 EDITTEXT IDC_USER_NAME,71,10,114,12,ES_AUTOHSCROLL 1065 PUSHBUTTON "",IDC_GENERATE,71,28,75,14 1066 PUSHBUTTON "&Waiting",IDCANCEL,80,120,50,14 1067 EDITTEXT IDC_KEY_CODE,71,164,114,12,ES_AUTOHSCROLL 1068 DEFPUSHBUTTON "&Register",IDOK,80,183,50,14 1069 LTEXT "User Name",IDC_STATIC,30,12,36,8 1070 LTEXT "Personal ID",IDC_STATIC,30,51,38,8 1071 LTEXT "",IDC_PERSONAL_ID,71,50,113,10,SS_SUNKEN 1072 LTEXT "Key Code",IDC_STATIC,30,166,32,8 1073 CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,25,5,165,60 1074 CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,25,145,165,58 1075 CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,25,70,165,70 1076 LTEXT "Provide your order information, including your Personal ID, to PlayMaker to obtain a Key Code. If you have done this and are still waiting for your Key Code to arive, click the Waiting button below.", 1077 IDC_STATIC,30,75,155,40 1078 LTEXT "1.",IDC_STATIC,10,31,8,8 1079 LTEXT "2.",IDC_STATIC,10,100,8,8 1080 LTEXT "3.",IDC_STATIC,10,166,8,8 1081 LTEXT "Enter Key Code and click Register.",IDC_STATIC,30,150, 1082 111,8 1062 FONT 8, "MS Sans Serif", 0, 0, 0x0 1063 BEGIN 1064 PUSHBUTTON "Cancel",IDCANCEL,7,166,50,14 1065 DEFPUSHBUTTON "&Register",IDOK,61,166,50,14 1066 LTEXT "Enter Key Code and click Register.",IDC_STATIC,7,7,111, 1067 8 1068 EDITTEXT IDC_KEY_CODE,7,23,272,134,ES_MULTILINE | ES_AUTOHSCROLL 1083 1069 END 1084 1070 … … 1325 1311 BEGIN 1326 1312 LEFTMARGIN, 7 1327 RIGHTMARGIN, 1901328 TOPMARGIN, 7 1329 BOTTOMMARGIN, 2031313 RIGHTMARGIN, 280 1314 TOPMARGIN, 7 1315 BOTTOMMARGIN, 180 1330 1316 END 1331 1317 … … 1643 1629 kRegisterFailString "The registration information entered is invalid. Please make sure the Key Code you entered exactly matches the one that was provided to you when you registered. Or, to register your copy, lookup ""Registration"" in the buit-in help under the Help menu." 1644 1630 IDS_REGISTER_FAIL_NAME "The registration information entered is invalid. Please make sure the User Name you entered exactly matches the one that was provided to you when you registered. Or, to register your copy, lookup ""Registration"" in the buit-in help under the Help menu." 1645 IDS_REGISTER_GENERATE_ID " Generate Personal ID"1646 IDS_REGISTER_CHANGE_NAME "Change User Name"1631 IDS_REGISTER_GENERATE_ID "Create Certificate Request" 1632 IDS_REGISTER_CHANGE_NAME "Change User Information" 1647 1633 IDS_REGISTER_READONLY "You cannot register this application as long as it is read-only. If you want to register it, exit the application and make sure that the read-only attribute on the file is not set and that it is on writable media." 1648 1634 kRegisterGameUnavailableString public/trunk/pmfb/client/win/pmfb-vc/resource.h
r3 r46 1 1 //{{NO_DEPENDENCIES}} 2 // Microsoft Developer Studiogenerated include file.2 // Microsoft Visual C++ generated include file. 3 3 // Used by pmfb.rc 4 4 // … … 130 130 #define IDC_KEY_CODE 1017 131 131 #define IDC_LIGHT 1018 132 #define IDC_USER_EMAIL 1018 132 133 #define IDC_DARK 1019 134 #define IDC_USER_CITY 1019 133 135 #define IDC_BOTTOM_TO_TOP 1020 136 #define IDC_USER_STATE 1020 134 137 #define IDC_TOP_TO_BOTTOM 1021 138 #define IDC_USER_COUNTRY 1021 139 #define IDC_USER_CERT 1022 135 140 #define IDC_SWITCH_AT_QUARTER 1023 136 141 #define IDC_YARD_LINE_SPINNER 1024 … … 388 393 #define IDS_REGISTER_READONLY 42925 389 394 #define kRegisterGameUnavailableString 42926 390 #define kErrorDiskString 42937391 #define kErrorMemoryString 42938392 #define kErrorPlaybookFullString 42939395 #define kErrorDiskString 42937 396 #define kErrorMemoryString 42938 397 #define kErrorPlaybookFullString 42939 393 398 #define IDW_CUSTOM_BAR 0xE804 394 399 #define IDW_PRACTICE_CONTROL_BAR 0xE805
