Kotyarko_O Posted December 26, 2014 Share Posted December 26, 2014 , ну на новой странице будет примерно так: [Files] Source: "..."; DestDir: "{app}\..."; Flags: ignoreversion recursesubdirs createallsubdirs; Check: CheckBoxChecked(0); Source: "..."; DestDir: "{app}\..."; Flags: ignoreversion recursesubdirs createallsubdirs; Check: CheckBoxChecked(1); [Code] var CustomPage: TWizardPage; CustomListBox: TNewCheckListBox; Procedure CreateCustomPage(PreviousPageId: Integer); begin CustomPage := CreateCustomPage(PreviousPageId, 'Caption', 'Description'); CustomListBox := TNewCheckListBox.Create(CustomPage); CustomListBox.Parent := CustomPage.Surface; CustomListBox.SetBounds(.., .., .., ..); и т.д. CustomListBox.AddCheckBox('0', '90.6 Мб', 0, True, True, True, False, nil); CustomListBox.AddCheckBox('1', '90.6 Мб', 1, True, True, True, True, nil); end; Function CheckBoxChecked(Idx: Integer): Boolean; begin case Idx of 0: Result := CustomListBox.Checked[0]; 1: Result := CustomListBox.Checked[1]; и т.д. end; Procedure InitializeWizard(); begin CreateCustomPage(wpSelectComponents); end; Кстати, там же ты спрашивал о логе. Дам подсказку: через функцию UpdateReadyMemo добавляешь имена компонентов со страницы твикера (тут я писал, как можно достать имя). А в лог можно записывать способом легче, чем пример от AtotIK`а. Вот так: WizardForm.ReadyMemo.Lines.SaveToFile(ExpandConstant('{app}\Log.txt')). @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted December 26, 2014 Share Posted December 26, 2014 , ну на новой странице будет примерно так: [Files] Source: "..."; DestDir: "{app}\..."; Flags: ignoreversion recursesubdirs createallsubdirs; Check: CheckBoxChecked(0); Source: "..."; DestDir: "{app}\..."; Flags: ignoreversion recursesubdirs createallsubdirs; Check: CheckBoxChecked(1); [Code] var CustomPage: TWizardPage; CustomListBox: TNewCheckListBox; Procedure CreateCustomPage(PreviousPageId: Integer); begin CustomPage := CreateCustomPage(PreviousPageId, 'Caption', 'Description'); CustomListBox := TNewCheckListBox.Create(CustomPage); CustomListBox.Parent := CustomPage.Surface; CustomListBox.SetBounds(.., .., .., ..); и т.д. CustomListBox.AddCheckBox('0', '90.6 Мб', 0, True, True, True, False, nil); CustomListBox.AddCheckBox('1', '90.6 Мб', 1, True, True, True, True, nil); end; Function CheckBoxChecked(Idx: Integer): Boolean; begin case Idx of 0: Result := CustomListBox.Checked[0]; 1: Result := CustomListBox.Checked[1]; и т.д. end; Procedure InitializeWizard(); begin CreateCustomPage(wpSelectComponents); end; Кстати, там же ты спрашивал о логе. Дам подсказку: через функцию UpdateReadyMemo добавляешь имена компонентов со страницы твикера (тут я писал, как можно достать имя). А в лог можно записывать способом легче, чем пример от AtotIK`а. Вот так: WizardForm.ReadyMemo.Lines.SaveToFile(ExpandConstant('{app}\Log.txt')). ща буду пробовать,а такой вариант лога не подходит мне и то я уже сделал @Kotyarko_O ошибка тут CustomPage := CreateCustomPage(PreviousPageId, 'Caption', 'Description'); @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted December 26, 2014 Share Posted December 26, 2014 ошибка тут Написано "на коленке". Скрин ошибки. @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted December 26, 2014 Share Posted December 26, 2014 Написано "на коленке". Скрин ошибки. @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted December 26, 2014 Share Posted December 26, 2014 (edited) , я забыл, что "CreateCustomPage" - зарезервированная функция. Пробуй так: [Code] var CustomPage: TWizardPage; CustomListBox: TNewCheckListBox; Procedure CreateNewPage(PreviousPageId: Integer); begin CustomPage := CreateCustomPage(PreviousPageId, 'Caption', 'Description'); CustomListBox := TNewCheckListBox.Create(CustomPage); CustomListBox.Parent := CustomPage.Surface; CustomListBox.SetBounds(.., .., .., ..); и т.д. CustomListBox.AddCheckBox('0', '90.6 Мб', 0, True, True, True, False, nil); CustomListBox.AddCheckBox('1', '90.6 Мб', 1, True, True, True, True, nil); end; Function CheckBoxChecked(Idx: Integer): Boolean; begin case Idx of 0: Result := CustomListBox.Checked[0]; 1: Result := CustomListBox.Checked[1]; end; Procedure InitializeWizard(); begin CreateNewPage(wpSelectComponents); end; Edited December 26, 2014 by Kotyarko_O @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted December 26, 2014 Share Posted December 26, 2014 , я забыл, что "CreateCustomPage" - зарезервированная функция. Пробуй так: [Code] var CustomPage: TWizardPage; CustomListBox: TNewCheckListBox; Procedure CreateNewPage(PreviousPageId: Integer); begin CustomPage := CreateCustomPage(PreviousPageId, 'Caption', 'Description'); CustomListBox := TNewCheckListBox.Create(CustomPage); CustomListBox.Parent := CustomPage.Surface; CustomListBox.SetBounds(.., .., .., ..); и т.д. CustomListBox.AddCheckBox('0', '90.6 Мб', 0, True, True, True, False, nil); CustomListBox.AddCheckBox('1', '90.6 Мб', 1, True, True, True, True, nil); end; Function CheckBoxChecked(Idx: Integer): Boolean; begin case Idx of 0: Result := CustomListBox.Checked[0]; 1: Result := CustomListBox.Checked[1]; end; Procedure InitializeWizard(); begin CreateNewPage(wpSelectComponents); end; ок а почему сначала рисуется вторая стр,а потом первая? [Code] var CustomPage: TWizardPage; CustomListBox,CustomListBox1: TNewCheckListBox; Procedure CreateNewPage(PreviousPageId: Integer); begin CustomPage := CreateCustomPage(PreviousPageId, 'первая', 'стр'); CustomListBox := TNewCheckListBox.Create(CustomPage); CustomListBox.Parent := CustomPage.Surface; CustomListBox.Left:=ScaleX(0); CustomListBox.Top:=ScaleY(23); CustomListBox.Width:=ScaleX(729); CustomListBox.Height:=ScaleY(248); CustomListBox.Cursor:=crHand; CustomListBox.BorderStyle:=bsSingle; CustomListBox.Color:=clWindow; CustomListBox.DragCursor:=crHand; CustomListBox.DragMode:=dmAutomatic; CustomListBox.Flat:=True; CustomListBox.Font.Color:=clBlue; CustomListBox.Font.Height:=-12; CustomListBox.Font.Name:='@Arial Unicode MS'; CustomListBox.ParentFont:=False; CustomListBox.ShowLines:=True; CustomListBox.TreeViewStyle:=True; CustomListBox.ItemHeightFixed:=True; CustomListBox.AddCheckBox('0', '90.6 Мб', 0, True, True, True, False, nil); CustomListBox.AddCheckBox('1', '90.6 Мб', 1, True, True, True, True, nil); end; Procedure CreateNewPage1(PreviousPageId: Integer); begin CustomPage := CreateCustomPage(PreviousPageId, 'вторая', 'стр'); CustomListBox1 := TNewCheckListBox.Create(CustomPage); CustomListBox1.Parent := CustomPage.Surface; CustomListBox1.Left:=ScaleX(0); CustomListBox1.Top:=ScaleY(23); CustomListBox1.Width:=ScaleX(729); CustomListBox1.Height:=ScaleY(248); CustomListBox1.Cursor:=crHand; CustomListBox1.BorderStyle:=bsSingle; CustomListBox1.Color:=clWindow; CustomListBox1.DragCursor:=crHand; CustomListBox1.DragMode:=dmAutomatic; CustomListBox1.Flat:=True; CustomListBox1.Font.Color:=clBlue; CustomListBox1.Font.Height:=-12; CustomListBox1.Font.Name:='@Arial Unicode MS'; CustomListBox1.ParentFont:=False; CustomListBox1.ShowLines:=True; CustomListBox1.TreeViewStyle:=True; CustomListBox1.ItemHeightFixed:=True; CustomListBox1.AddCheckBox('2', '90.6 Мб', 0, True, True, True, False, nil); CustomListBox1.AddCheckBox('3', '90.6 Мб', 1, True, True, True, True, nil); end; Function CheckBoxChecked1(Idx: Integer): Boolean; begin case Idx of 0: Result := CustomListBox.Checked[0]; 1: Result := CustomListBox.Checked[1]; end; end; Function CheckBoxChecked2(Idx: Integer): Boolean; begin case Idx of 0: Result := CustomListBox1.Checked[0]; 1: Result := CustomListBox1.Checked[1]; end; end; Function CheckBoxChecked(Idx: Integer): Boolean; begin CheckBoxChecked1(Idx); CheckBoxChecked2(Idx); end; Procedure InitializeWizard(); begin CreateNewPage(wpSelectComponents); CreateNewPage1(wpSelectComponents); end; @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted December 26, 2014 Share Posted December 26, 2014 а почему сначала рисуется вторая стр,а потом первая? Как тут перечислено: Procedure InitializeWizard(); begin CreateNewPage(wpSelectComponents); CreateNewPage1(wpSelectComponents); end; так и создаётся. @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted December 26, 2014 Share Posted December 26, 2014 (edited) Как тут перечислено: Procedure InitializeWizard(); begin CreateNewPage(wpSelectComponents); CreateNewPage1(wpSelectComponents); end; так и создаётся. ну тут сначала первая а потом вторая Edited December 26, 2014 by Dark_Knight_MiX @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted December 26, 2014 Share Posted December 26, 2014 ну тут сначала первая а потом вторая Ну, надо по-другому - меняй местами. @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted December 26, 2014 Share Posted December 26, 2014 (edited) Ну, надо по-другому - меняй местами. а почему менять,странно как то не логично Edited December 26, 2014 by Dark_Knight_MiX @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted December 26, 2014 Share Posted December 26, 2014 (edited) а почему менять,странно как то не логично Это ты не логичный) То, что ты прописываешь само создание страниц (или чего-либо другого), ничего не сделает, пока ты не применишь это в какой-то внешней функции. И неважно, в каком порядке прописано то, что ты написал. Программа всё выполнит по очереди, из внешней функции. Edited December 26, 2014 by Kotyarko_O @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted December 26, 2014 Share Posted December 26, 2014 (edited) Это ты не логичный) То, что ты прописываешь само создание страниц (или чего-либо другого), ничего не сделает, пока ты не применишь это в какой-то внешней функции. И неважно, в каком порядке прописано то, что ты написал. Программа всё выполнит по очереди, из внешней функции. а что не так? чего то не хватает? это чтоль procedure CurPageChanged(CurPageID: Integer); begin if CurPageID = wpSelectComponents then end; Edited December 26, 2014 by Dark_Knight_MiX @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted December 26, 2014 Share Posted December 26, 2014 а что не так? чего то не хватает? это чтоль procedure CurPageChanged(CurPageID: Integer); begin if CurPageID = wpSelectComponents then end; Ты о чём? @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted December 26, 2014 Share Posted December 26, 2014 Ты о чём? в какую функцию надо записать? @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted December 26, 2014 Share Posted December 26, 2014 в какую функцию надо записать? Ну ёпт. Что записать?? @ Quote Link to comment Short link Share on other sites More sharing options...
Pokaritel_VBR Posted December 26, 2014 Share Posted December 26, 2014 пост 129 спасибо @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted December 26, 2014 Share Posted December 26, 2014 пока ты не применишь это в какой-то внешней функции. И неважно, в каком порядке прописано то, что ты написал. Программа всё выполнит по очереди, из внешней функции. вот я про это @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted December 26, 2014 Share Posted December 26, 2014 (edited) вот я про это Мая твая нипанимать. Я так и не уловил суть того, что ты хочешь. Там по ссылке перечислены все внешние, какую из них применять - зависит от твоих потребностей. Edited December 26, 2014 by Kotyarko_O @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted December 26, 2014 Share Posted December 26, 2014 (edited) а можно вместо номера компонента сделать его название? [Code] type TComponentDesc = record Description: String; Index: Integer; end; var Descs: array of TComponentDesc; Info: TNewStaticText; InfoCaption: TNewStaticText; InfoPanel: TPanel; Indx: Integer; procedure ShowDescription(Sender: TObject; X, Y, Index: Integer; Area: TItemArea); var i: Integer; begin Indx:=-1; for i:= 0 to GetArrayLength(Descs)-1 do begin if (Descs[i].Index=Index) then begin Indx:=i; Break end; end; if (Indx >=0)and(Area=iaItem) then Info.Caption:= Descs[Indx].Description else Info.Caption:= ExpandConstant('{cm:ComponentsInfoPanel2}'); end; procedure AddDescription(AIndex: Integer; ADescription: String); var i, k: Integer; begin i:= GetArrayLength(Descs); SetArrayLength(Descs, i+1); Descs[i].Description:= ADescription; Descs[i].Index:= AIndex-1 end; procedure InitializeWizard(); begin WizardForm.TypesCombo.Visible:=False; WizardForm.ComponentsList.Height := ScaleY(181) - WizardForm.TypesCombo.Top; WizardForm.ComponentsList.Top := WizardForm.TypesCombo.Top; WizardForm.ComponentsList.Width := ScaleX(417); WizardForm.ComponentsList.OnItemMouseMove:= @ShowDescription InfoPanel := TPanel.Create(WizardForm); InfoPanel.Parent := WizardForm.SelectComponentsPage; InfoPanel.Caption := ''; InfoPanel.Top := ScaleY(190); InfoPanel.Left := ScaleX(0); InfoPanel.Width := ScaleX(417); InfoPanel.Height := ScaleY(40); InfoPanel.BevelInner := bvRaised; InfoPanel.BevelOuter := bvLowered; InfoCaption := TNewStaticText.Create(WizardForm); InfoCaption.Parent := WizardForm.SelectComponentsPage; InfoCaption.Caption := ExpandConstant('{cm:ComponentsInfoPanel1}'); InfoCaption.Left := ScaleX(7); InfoCaption.Top := InfoPanel.Top - ScaleY(6); InfoCaption.Font.Color := clActiveCaption; Info := TNewStaticText.Create(WizardForm); Info.Parent := InfoPanel; Info.AutoSize := False; Info.Left := ScaleX(6); Info.Width := ScaleX(403); Info.Top := ScaleY(12); Info.Height := ScaleY(24); Info.Caption := ExpandConstant('{cm:ComponentsInfoPanel2}'); Info.WordWrap := true; AddDescription(1, 'Справка'); //первый параметр - это номер компонента, идет последовательно от начала записи компонентов AddDescription(2, 'Английская справка'); //Второй параметр - это собственно описание компонента AddDescription(3, 'Русская справка'); AddDescription(4, 'Плагины'); AddDescription(5, 'Внутреннего просмотра'); AddDescription(6, 'Архиваторные'); AddDescription(13, 'Системные'); AddDescription(8, 'CanonCam'); AddDescription(9, 'PluginManager'); AddDescription(10, 'Registry'); AddDescription(11, 'Services'); AddDescription(12, 'StartupGuard'); AddDescription(7, 'Другие'); как сделать так что бы наоборот при снятии галочки появлялось окно? [Components] Name: comp1; Description: "Установить ..."; Types: full; Name: comp2; Description: "Удалить ..."; [Code] procedure ComponentsListOnClickCheck(Sender: TObject); begin if (WizardForm.ComponentsList.ItemIndex = 0) and IsComponentSelected('comp1') then MsgBox('Comp1 on click', mbInformation, MB_YESNO); end; procedure InitializeWizard; begin WizardForm.ComponentsList.OnClickCheck:=@ComponentsListOnClickCheck; end; Edited December 26, 2014 by Dark_Knight_MiX @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted December 26, 2014 Share Posted December 26, 2014 как сделать так что бы наоборот при снятии галочки появлялось окно? [Components] Name: comp1; Description: "Установить ..."; Types: full; Name: comp2; Description: "Удалить ..."; [Code] procedure ComponentsListOnClickCheck(Sender: TObject); begin if (WizardForm.ComponentsList.ItemIndex = 0) and not IsComponentSelected('comp1') then MsgBox('Comp1 on click', mbInformation, MB_YESNO); end; procedure InitializeWizard; begin WizardForm.ComponentsList.OnClickCheck:=@ComponentsListOnClickCheck; end; @ Quote Link to comment Short link Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.