Added LicenseForceSelection radiobuttons|checkbox

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2362 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2003-03-26 17:47:46 +00:00
parent 8d4d9c0856
commit 5afc7ec7d4
13 changed files with 175 additions and 47 deletions

View file

@ -553,7 +553,7 @@ nextPage:
SetWindowLong(hwndtmp,GWL_STYLE,GetWindowLong(hwndtmp,GWL_STYLE)&~BS_DEFPUSHBUTTON);
ShowWindow(hwndtmp,this_page->button_states&SW_SHOWNA);// SW_HIDE = 0, SW_SHOWNA = 8
EnableWindow(hwndtmp,this_page->button_states&2);
EnableWindow(m_hwndOK,1);
EnableWindow(m_hwndOK,!(this_page->button_states&16));
EnableWindow(m_hwndCancel,this_page->button_states&4);
mystrcpy(g_tmp,g_caption);
@ -678,6 +678,12 @@ static BOOL CALLBACK LicenseProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
if (uMsg == WM_INITDIALOG)
{
EDITSTREAM es={(DWORD)LANG_STR(LANG_LICENSE_DATA),0,StreamLicense};
SetUITextFromLang(IDC_LICENSEAGREE,LANG_BTN_LICENSE_AGREE);
SetUITextFromLang(IDC_LICENSEDISAGREE,LANG_BTN_LICENSE_DISAGREE);
SendMessage(GetUIItem(IDC_LICENSEAGREE+!hwLicense), BM_SETCHECK, BST_CHECKED, 0);
EnableWindow(m_hwndOK, (BOOL)hwLicense | !(inst_flags&CH_FLAGS_LICENSE_FORCE_SELECTION));
hwLicense=GetUIItem(IDC_EDIT1);
SendMessage(hwLicense,EM_AUTOURLDETECT,TRUE,0);
SendMessage(hwLicense,EM_SETBKGNDCOLOR,0,g_inst_header->license_bg>=0?g_inst_header->license_bg:GetSysColor(COLOR_BTNFACE));
@ -692,6 +698,10 @@ static BOOL CALLBACK LicenseProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
return FALSE;
//End Xge
}
if (uMsg == WM_COMMAND && HIWORD(wParam) == BN_CLICKED) {
if (inst_flags&CH_FLAGS_LICENSE_FORCE_SELECTION)
EnableWindow(m_hwndOK, IsDlgButtonChecked(hwndDlg, IDC_LICENSEAGREE) & BST_CHECKED);
}
if (uMsg == WM_NOTIFY) {
#define nmhdr ((NMHDR *)lParam)
#define enlink ((ENLINK *)lParam)

View file

@ -310,6 +310,9 @@ typedef struct
#define CH_FLAGS_COMP_ONLY_ON_CUSTOM 256
#define CH_FLAGS_NO_CUSTOM 512
#endif
#ifdef NSIS_CONFIG_LICENSEPAGE
#define CH_FLAGS_LICENSE_FORCE_SELECTION 1024
#endif
// Settings common to both installers and uninstallers
typedef struct
@ -361,6 +364,8 @@ typedef struct
int licensetext; // license page text
int licensedata; // license text
int licensebutton; // license button text
int licensebuttonagree; // agree check box/radio button
int licensebuttondisagree; // disagree check box/radio button
#endif//NSIS_CONFIG_LICENSEPAGE
#else
int foo;

View file

@ -58,6 +58,8 @@
#define LANG_LICENSE_TEXT (INSTALL_STR(licensetext))
#define LANG_LICENSE_DATA (INSTALL_STR(licensedata))
#define LANG_BTN_LICENSE (INSTALL_STR(licensebutton))
#define LANG_BTN_LICENSE_AGREE (INSTALL_STR(licensebuttonagree))
#define LANG_BTN_LICENSE_DISAGREE (INSTALL_STR(licensebuttondisagree))
#define UNINSTALL_STR(x) (~((sizeof(common_strings) + FIELD_OFFSET(uninstall_strings, x)) / sizeof(int)))

View file

@ -37,6 +37,8 @@
#define IDC_ULICON 1031
#define IDC_TREE1 1032
#define IDC_BRANDIMAGE 1033
#define IDC_LICENSEAGREE 1034
#define IDC_LICENSEDISAGREE 1035
// Next default values for new objects
//
@ -44,7 +46,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 112
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1034
#define _APS_NEXT_CONTROL_VALUE 1036
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif