use new components functions so SetCurInstType will take affect immediately and so setting a section group's flags will affect its children too
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3856 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
c73d4d43b4
commit
d8225671ad
2 changed files with 38 additions and 31 deletions
|
@ -5,6 +5,7 @@
|
|||
#include "util.h"
|
||||
#include "state.h"
|
||||
#include "ui.h"
|
||||
#include "components.h"
|
||||
#include "exec.h"
|
||||
#include "lang.h"
|
||||
#include "resource.h"
|
||||
|
@ -161,10 +162,6 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
|||
//char *var4;
|
||||
//char *var5;
|
||||
|
||||
#ifdef NSIS_CONFIG_COMPONENTPAGE
|
||||
HWND hwSectionHack = g_SectionHack;
|
||||
#endif
|
||||
|
||||
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
// Saves 8 bytes
|
||||
HWND mainHwnd = g_hwnd;
|
||||
|
@ -1483,13 +1480,13 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
|||
else
|
||||
{
|
||||
// setting text, send the message to do it
|
||||
SendMessage(hwSectionHack,WM_NOTIFY_SECTEXT,x,parm1);
|
||||
SendMessage(g_SectionHack,WM_NOTIFY_SECTEXT,x,parm1);
|
||||
}
|
||||
((int*)sec)[parm2]=parm1;
|
||||
if (parm2)
|
||||
|
||||
if (parm3) // update flags
|
||||
{
|
||||
// update tree view
|
||||
SendMessage(hwSectionHack,WM_NOTIFY_SECFLAGS,x,0);
|
||||
SectionFlagsChanged(x);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1498,22 +1495,32 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
|||
break;
|
||||
case EW_INSTTYPESET:
|
||||
{
|
||||
int x=GetIntFromParm(0);
|
||||
int x = GetIntFromParm(0);
|
||||
|
||||
if (parm3)
|
||||
if ((unsigned int)x < (unsigned int)NSIS_MAX_INST_TYPES)
|
||||
{
|
||||
g_exec_flags.insttype_changed++;
|
||||
SendMessage(hwSectionHack,WM_NOTIFY_INSTTYPE_CHANGE,0,0);
|
||||
}
|
||||
else if ((unsigned int)x < (unsigned int)NSIS_MAX_INST_TYPES)
|
||||
{
|
||||
if (parm2) // set text
|
||||
if (parm3) // current install type
|
||||
{
|
||||
g_header->install_types[x] = parm1;
|
||||
if (parm2) // set install type
|
||||
{
|
||||
SetInstType(x);
|
||||
RefreshSectionGroups(0);
|
||||
}
|
||||
else // get install type
|
||||
{
|
||||
myitoa(var1, GetInstType(0));
|
||||
}
|
||||
}
|
||||
else // get text
|
||||
else // install type text
|
||||
{
|
||||
GetNSISString(var1,g_header->install_types[x]);
|
||||
if (parm2) // set text
|
||||
{
|
||||
g_header->install_types[x] = parm1;
|
||||
}
|
||||
else // get text
|
||||
{
|
||||
GetNSISString(var1,g_header->install_types[x]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else exec_error++;
|
||||
|
|
|
@ -5210,6 +5210,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
ent.offsets[0]=add_string(line.gettoken_str(1));
|
||||
ent.offsets[1]=add_string(line.gettoken_str(2));
|
||||
ent.offsets[2]=SECTION_FIELD_SET(flags);
|
||||
ent.offsets[3]=1;
|
||||
SCRIPT_MSG("SectionSetFlags: %s->%s\n",line.gettoken_str(1),line.gettoken_str(2));
|
||||
return add_entry(&ent);
|
||||
case TOK_SECTIONGETFLAGS:
|
||||
|
@ -5266,19 +5267,19 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
SCRIPT_MSG("SectionGetSize: %s->%s\n",line.gettoken_str(1),line.gettoken_str(2));
|
||||
return add_entry(&ent);
|
||||
case TOK_SETCURINSTTYPE:
|
||||
{
|
||||
int ret;
|
||||
ent.which=EW_INSTTYPESET;
|
||||
ent.offsets[0]=add_string(line.gettoken_str(1));
|
||||
ent.offsets[1]=0;
|
||||
ent.offsets[2]=1;
|
||||
ent.offsets[3]=1;
|
||||
SCRIPT_MSG("SetCurInstType: %s\n",line.gettoken_str(1));
|
||||
ret = add_entry_direct(EW_SETFLAG, FLAG_OFFSET(cur_insttype), add_string(line.gettoken_str(1)));
|
||||
if (ret != PS_OK) return ret;
|
||||
ret = add_entry_direct(EW_INSTTYPESET, 0, 0, 0, 1);
|
||||
if (ret != PS_OK) return ret;
|
||||
}
|
||||
return PS_OK;
|
||||
return add_entry(&ent);
|
||||
case TOK_GETCURINSTTYPE:
|
||||
ent.which=EW_GETFLAG;
|
||||
ent.offsets[0]=GetUserVarIndex(line, 1);
|
||||
ent.offsets[1]=FLAG_OFFSET(cur_insttype);
|
||||
ent.which=EW_INSTTYPESET;
|
||||
ent.offsets[0]=0;
|
||||
ent.offsets[1]=GetUserVarIndex(line,1);
|
||||
ent.offsets[2]=0;
|
||||
ent.offsets[3]=1;
|
||||
if (line.gettoken_str(1)[0] && ent.offsets[0]<0) PRINTHELP()
|
||||
SCRIPT_MSG("GetCurInstType: %s\n",line.gettoken_str(1));
|
||||
return add_entry(&ent);
|
||||
|
@ -5296,7 +5297,6 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
ERROR_MSG("Error: %s specified, NSIS_CONFIG_COMPONENTPAGE not defined.\n", line.gettoken_str(0));
|
||||
return PS_ERROR;
|
||||
#endif//!NSIS_CONFIG_COMPONENTPAGE
|
||||
// Added by Amir Szekely 29th July 2002
|
||||
#ifdef NSIS_CONFIG_ENHANCEDUI_SUPPORT
|
||||
case TOK_SETBRANDINGIMAGE:
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue