Автор: chelobey
Дата сообщения: 21.12.2008 00:05
		Про мод от ResTools... штука хорошая, но без описания сложновато. 
  
 Проблему с построением дополнительной страницы компонентов решил... 
 а как привязать результаты выбора к файлам...? 
  
 Так же в моем [more=скрипте] 
  
 Setup 
 AppName=Program 
 AppVerName=Program 
 AlwaysShowComponentsList=true 
 DefaultDirName={pf}\My Program 
 ComponentsListTVStyle=true 
  
 Components 
 Name: prog; Description: program; Types: var1; Flags: exclusive 
 Name: cfg1; Description: program+config 1; Types: var2; Flags: exclusive 
  
 Types 
 Name: var1; Description: program 
 Name: var2; Description: program+config; Flags: iscustom 
  
 Code 
 var 
   Page1, Page2, Page3: TWizardPage; 
   CheckListBox, CheckListBox2, CheckListBox3, CheckListBox4: TNewCheckListBox; 
   Info: TNewStaticText; 
  
 procedure ItemMouseMove(Sender: TObject; X, Y: Integer; Index: Integer; Area: TItemArea); 
 var 
   AbsIndex, AreaStr: String; 
 begin 
   if Index = -1 then 
   begin 
     Info.Caption := 'Info'; 
     Info.Enabled := False; 
   end else begin 
     case Area of 
     iaButton: AreaStr := 'Button'; 
     iaCheckmark: AreaStr := 'Checkmark'; 
     iaItem: AreaStr := 'Item'; 
     iaSubItem: AreaStr := 'SubItem'; 
     else AreaStr := 'Other'; 
     end; 
     Info.Caption := 'AbsIndex: ' + IntToStr(Index) + #13 + 'Area: ' + AreaStr + #13 
          + 'Captin: ' + CheckListBox.ItemCaption[Index] + #13 + 'SubCaption: ' 
          + CheckListBox.ItemSubItem[Index]; 
     Info.Enabled := True; 
   end; 
 end; 
  
 procedure ButtonOnClick(Sender: TObject); 
 begin 
   MsgBox('CheckListBox.ItemCount: ' + IntToStr(CheckListBox.ItemCount), mbInformation, MB_OK); 
 end; 
  
 procedure Button2OnClick(Sender: TObject); 
 begin 
   MsgBox('CheckListBox.AbsItemIndex: ' + IntToStr(CheckListBox.AbsItemIndex), mbInformation, MB_OK); 
 end; 
  
 procedure Button3OnClick(Sender: TObject); 
 begin 
   if CheckListBox.AbsItemIndex > -1 then 
     CheckListBox.ItemExpanded[CheckListBox.AbsItemIndex] := not CheckListBox.ItemExpanded[CheckListBox.AbsItemIndex]; 
 end; 
  
 procedure CheckListBox2_OnClickCheck(Sender: TObject); 
 begin 
   case CheckListBox2.AbsItemIndex of 
     1: CheckListBox.TreeViewStyle := CheckListBox2.Checked[1]; 
     2: CheckListBox.Showroot := CheckListBox2.Checked[2]; 
     3: CheckListBox.ItemHeightFixed := CheckListBox2.Checked[3]; 
     4: CheckListBox.HideSelection := CheckListBox2.Checked[4]; 
   end; 
 end; 
  
 procedure CheckListBox4_OnClickCheck(Sender: TObject); 
 begin 
   case CheckListBox4.AbsItemIndex of 
     1: CheckListBox.TreeViewStyle := CheckListBox4.Checked[1]; 
     2: CheckListBox.Showroot := CheckListBox4.Checked[2]; 
     3: CheckListBox.ItemHeightFixed := CheckListBox4.Checked[3]; 
     4: CheckListBox.HideSelection := CheckListBox4.Checked[4]; 
   end; 
 end; 
  
 procedure CreateTheWizardPages; 
 var 
   Page: TWizardPage; 
   Button: TButton; 
   InfoPanel: TPanel; 
   InfoCaption: TNewStaticText; 
  
 begin 
   Page1:= CreateCustomPage(wpSelectComponents, 'TNewCheckListBox', 'page2') 
   CheckListBox := TNewCheckListBox.Create(Page1); 
   CheckListBox.Width := Page1.SurfaceWidth - ScaleX(115); 
   CheckListBox.Height := Page1.SurfaceHeight - ScaleY(30); 
   CheckListBox.Flat := True; 
   CheckListBox.Parent := Page1.Surface; 
   CheckListBox.AddCheckBox('CheckBox1', 'box1', 0, True, True, True, True, nil, True); 
   CheckListBox.AddRadioButton('radiobutton1_1', 'type1', 1, True, True, nil, False); 
   CheckListBox.AddRadioButton('radiobutton1_2', 'type2', 1, True, True, nil, False); 
   CheckListBox.AddCheckBox('CheckBox2', 'box2', 0, True, True, True, True, nil, True); 
   CheckListBox.AddRadioButton('radiobutton2_1', 'type1', 1, True, True, nil, False); 
   CheckListBox.AddRadioButton('radiobutton2_2', 'type2', 1, True, True, nil, False); 
   CheckListBox.AddGroup('group1', 'group', 0, nil, True); 
   CheckListBox.AddRadioButton('radiobutton_g_1', 'type1', 1, True, True, nil, False); 
   CheckListBox.AddRadioButton('radiobutton_g_2', 'type2', 1, False, True, nil, False); 
   CheckListBox.OnItemMouseMove := @ItemMouseMove; 
  
   CheckListBox2 := TNewCheckListBox.Create(Page1); 
   CheckListBox2.Left := Page1.SurfaceWidth - ScaleX(110); 
   CheckListBox2.Width := ScaleX(110); 
   CheckListBox2.Height := ScaleY(80); 
   CheckListBox2.Parent := Page1.Surface; 
   CheckListBox2.BorderStyle := bsNone; 
   CheckListBox2.ParentColor := True; 
   CheckListBox2.ShowLines := False; 
   CheckListBox2.WantTabs := True; 
   CheckListBox2.AddGroup('Property', '', 1, nil, False); 
   CheckListBox2.AddCheckBox('TreeViewStyle', '', 0, False, True, False, True, nil, True); 
   CheckListBox2.AddCheckBox('Showroot', '', 0, True, True, False, True, nil, True); 
   CheckListBox2.AddCheckBox('ItemHeightFixed', '', 0, False, True, False, True, nil, True); 
   CheckListBox2.AddCheckBox('HideSelection', '', 0, True, True, False, True, nil, True); 
   CheckListBox2.OnClickCheck := @CheckListBox2_OnClickCheck; 
   CheckListBox2.ItemHeightFixed := True; 
  
   InfoPanel := TPanel.Create(Page); 
   InfoPanel.Parent := Page1.Surface; 
   InfoPanel.Caption := ''; 
   InfoPanel.Top := ScaleY(90); 
   InfoPanel.Left := Page1.SurfaceWidth - ScaleX(110); 
   InfoPanel.Width := ScaleX(110); 
   InfoPanel.Height := ScaleY(145); 
   InfoPanel.BevelInner := bvRaised; 
   InfoPanel.BevelOuter := bvLowered; 
   InfoCaption := TNewStaticText.Create(Page); 
   InfoCaption.Parent := Page1.Surface; 
   InfoCaption.Caption := 'ÃèÊö'; 
   InfoCaption.Left := Page1.SurfaceWidth - ScaleX(105); 
   InfoCaption.Top := InfoPanel.Top - ScaleY(5); 
   InfoCaption.Font.Color := clActiveCaption; 
    
 end; 
  
 Procedure InitializeWizard(); 
 var 
   b: TBitmapImage; 
   p: TPen; 
  
 begin 
   CreateTheWizardPages; 
    
 end; 
  
 function ShouldSkipPage(PageID: Integer): Boolean; 
 begin 
   Case PageID of 
     Page1.ID,Page1.ID: Result:= not IsComponentSelected('cfg1'); 
   end; 
 end; 
  
 [/more] при наведении курсора на компонент (после чего должно появиться описание) появляется ошибка. не знаю, как исправить. 
 И еще, таких дополнительных страниц можно создать великое множество в procedure CreateTheWizardPages, но подскажите, как сделать в коде при их (страниц) наличии больше одной, чтобы корректно работало отображение описания элементов...