View Single Post
  #3  
Old 17-10-2012, 00:49
johnnyusa johnnyusa is offline
Registered User
 
Join Date: Oct 2011
Location: Romania
Posts: 20
Thanks: 4
Thanked 1 Time in 1 Post
johnnyusa is on a distinguished road
yener, i have a few questions if i may.

Let's say i want all Components unchecked by default when starting the Installer.

I've modified the code to look like this:

Code:
    ComponentsPage.ID:
    begin
      SelectComponentsLabel.Show
      ComponentsDiskSpaceLabel.Show;
      Components1.Checked := False;
      Components2.Checked := False;
      Components3.Checked := False;
      Components4.Checked := False;
      if not FileExists(ExpandConstant('{tmp}\Checkbox.png')) then begin
      Components1.Visible := Components1V;
      Components2.Visible := Components2V;
      Components3.Visible := Components3V;
      Components4.Visible := Components4V;
      Components5.Visible := Components5V;
      Components6.Visible := Components6V;
      Components7.Visible := Components7V;
      Components8.Visible := Components8V;
      end;
      BtnSetVisibility(Components1Check,Components1V);
      BtnSetVisibility(Components2Check,Components2V);
      BtnSetVisibility(Components3Check,Components3V);
      BtnSetVisibility(Components4Check,Components4V);
      BtnSetVisibility(Components5Check,Components5V);
      BtnSetVisibility(Components6Check,Components6V);
      BtnSetVisibility(Components7Check,Components7V);
      BtnSetVisibility(Components8Check,Components8V);
      Components1Label.Visible := Components1V;
      Components2Label.Visible := Components2V;
      Components3Label.Visible := Components3V;
      Components4Label.Visible := Components4V;
      Components5Label.Visible := Components5V;
      Components6Label.Visible := Components6V;
      Components7Label.Visible := Components7V;
      Components8Label.Visible := Components8V;
    end;
Maybe you have another solution?

Also, i want to add some conditional checks. For example. If i check Component2, Component3 should uncheck automatically and if i check Component3, Component2 should uncheck automatically.

I've modified the following code:

Code:
procedure UpdateComponentsPage;
var TempInt: Integer; TempStr:String;
begin
TempInt := 0;
if Components1.Checked then
TempInt := TempInt + GetIniInt('ComponentsSettings', 'Component1Size', 0,0,0, ExpandConstant('{tmp}\Setup.ini'));
//if Components2.Checked then
//TempInt := TempInt + GetIniInt('ComponentsSettings', 'Component2Size', 0,0,0, ExpandConstant('{tmp}\Setup.ini'));
//if Components3.Checked then
//TempInt := TempInt + GetIniInt('ComponentsSettings', 'Component3Size', 0,0,0, ExpandConstant('{tmp}\Setup.ini'));

//*************** Teste **************///

if Components2.Checked then
                       begin
                        Components3.Checked:=False;
                        BtnSetChecked(Components3Check,False);
                        TempInt := TempInt + GetIniInt('ComponentsSettings', 'Component2Size', 0,0,0, ExpandConstant('{tmp}\Setup.ini'));
                       end;                    
if Components3.Checked then
                       begin
                        Components2.Checked:=False;
                        BtnSetChecked(Components2Check,False);
                        TempInt := TempInt + GetIniInt('ComponentsSettings', 'Component3Size', 0,0,0, ExpandConstant('{tmp}\Setup.ini'));
                       end;

//*************** Teste **************///
............... ................
But doesnt work like i want it to work.

Any hints? Thanks in advance.

Last edited by johnnyusa; 17-10-2012 at 00:51.