2013-03-01 53 views
1

当我试图更改TasksListParent时,我得到一个空列表作为结果。TasksList - 如何将TasksList移动​​到其他WizardForm页面并保留其内容?

​​
+0

我知道我可以创建自定义复选框并更换TasksList。但我很好奇,如果我可以简单地将TasksList移动​​到不同的WizardPage。 – RobeN 2013-03-01 12:52:39

+1

尽管您可能能够在物理上更改其容器控件,但无法将该控件的任何处理移动到其他页面。你最好的选择是自定义存在页面,或者从头开始创建一个页面,然后更新真实页面。 – Deanna 2013-03-01 13:10:08

+0

它会和'Components'一样吗? – RobeN 2013-03-01 13:38:35

回答

2

替代的解决方案是为任务创建自己的复选框:

[Icons] 
Name: "{group}\{#MyAppName1}"; Filename: "{app}\{#MyAppName1}\{#MyAppExeName}"; WorkingDir: "{app}\{#MyAppName1}"; Check: menuicons; Components: G3EE; 
Name: "{group}\{#MyAppName2}"; Filename: "{app}\{#MyAppName2}\{#MyAppExeName2}"; WorkingDir: "{app}\{#MyAppName2}"; Check: menuicons; Components: G3ZBEE; 
Name: "{commondesktop}\{#MyAppName2}"; Filename: "{app}\{#MyAppName2}\{#MyAppExeName2}"; WorkingDir: "{app}\{#MyAppName2}"; Check: desktopicon; Components: G3ZBEE; 
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName2}"; Filename: "{app}\{#MyAppName2}\{#MyAppExeName2}"; WorkingDir: "{app}\{#MyAppName2}"; Check: quicklaunchicon; Components: G3ZBEE; 

[Code] 
Var 
DesktopIconCheckBox: TCheckBox; 
StartMenuCheckBox: TCheckBox; 
QuickStartCheckBox: TCheckBox; 

function desktopicon(): Boolean; 
begin 
    Result := DesktopIconCheckBox.Checked; 
end; 

function menuicons(): Boolean; 
begin 
    Result := StartMenuCheckBox.Checked; 
end; 

function quicklaunchicon(): Boolean; 
begin 
    if GetWindowsVersion < $06000000 then begin 
     Result := QuickStartCheckBox.Checked; 
    end; 
end; 

procedure InitializeWizard(); 
var 
    ItemsGap: Integer; 
begin 
    ItemsGap := WizardForm.DirBrowseButton.Left - (WizardForm.DirEdit.Left + WizardForm.DirEdit.Width); 
    DesktopIconCheckBox := TCheckBox.Create(WizardForm.DirEdit.Owner); 
    DesktopIconCheckBox.Visible := true; 
    DesktopIconCheckBox.Checked := true; 
    StartMenuCheckBox := TCheckBox.Create(WizardForm.DirEdit.Owner); 
    StartMenuCheckBox.Visible := true; 
    StartMenuCheckBox.Checked := true; 
    if GetWindowsVersion < $06000000 then begin 
     QuickStartCheckBox := TCheckBox.Create(WizardForm.DirEdit.Owner); 
    QuickStartCheckBox.Visible := true; 
     QuickStartCheckBox.Checked := false; 
end; 
    if true then 
    begin 
    DesktopIconCheckBox.Top := WizardForm.DirEdit.Top + WizardForm.DirEdit.Height + ItemsGap/2; 
    DesktopIconCheckBox.Width := WizardForm.DirEdit.Width; 
     DesktopIconCheckBox.Caption := ExpandConstant('{cm:CreateDesktopIcon}'); 
     DesktopIconCheckBox.Parent := WizardForm.DirEdit.Parent; 
     StartMenuCheckBox.Top := DesktopIconCheckBox.Top + DesktopIconCheckBox.Height + ItemsGap/2; 
    StartMenuCheckBox.Width := WizardForm.DirEdit.Width; 
     StartMenuCheckBox.Caption := ExpandConstant('{cm:MenuStartIcons}'); 
     StartMenuCheckBox.Parent := WizardForm.DirEdit.Parent; 
     if GetWindowsVersion < $06000000 then begin 
      QuickStartCheckBox.Top := StartMenuCheckBox.Top + StartMenuCheckBox.Height + ItemsGap/2; 
     QuickStartCheckBox.Width := WizardForm.DirEdit.Width; 
      QuickStartCheckBox.Caption := ExpandConstant('{cm:CreateQuickLaunchIcon}');//SetupMessage(msgNoProgramGroupCheck2); 
      QuickStartCheckBox.Parent := WizardForm.DirEdit.Parent; 
     end; 
    end; 
end;