2014-02-06 89 views
2

我使用Inno Setup創建了一個安裝程序,並且我更改了許可證頁面而不是顯示許可證,而是改爲鏈接到它。我還添加了一個StaticText來顯示一些文本,問題是當我添加太多文本時,我需要WordWrap:= true和AutoSize:= false,這使得在Setup中創建的StaticText寬度非常小。爲什麼它的大小如果AutoSize = false?當WordWrap = true時,該如何防止它最小化。改變父母?Inno setup WordWrap和Autosize

procedure InitializeWizard; 
var 
FormButton: TNewButton; 
Page: TWizardPage; 
ComboBox: TNewComboBox; 
begin 
    WizardForm.LicenseAcceptedRadio.Hide; 
    WizardForm.LicenseNotAcceptedRadio.Hide; 
    LicenseContextText := TNewStaticText.Create(WizardForm.InnerPage); 
    with LicenseContextText do 
    begin 
    Parent := WizardForm.InnerPage; 
    //TODO: check if we need 
    Left := ScaleX(250); 
    Top := ScaleY(50); 
    Height := ScaleY(100); 
    Width := ScaleX(1000); //200; 
    //Color := clBlack; 
    Font.Color := clGray; 
    //WordWrap := true; 
    //AutoSize := false; 
    Caption := 'Some content text, Some content text, Some content text';// 
    Visible := false; 
    end; 
    LicenseLinkLabel := TNewStaticText.Create(WizardForm.InnerPage); 
    with LicenseLinkLabel do 
    begin 
    Parent := WizardForm.InnerPage; 
    //TODO: check if we need 
    Left := 340; 
    Top := 240; 
    Height := 100; 
    Cursor := crHand; 
    Font.Color := clBlue; 
    Font.Style := [fsUnderline]; 
    Caption := 'the License Agreement'; 
    OnClick := @LicenseLinkLabelClick; 
    Visible := false; 
    end; 
    LicenseLinkURL := TNewCheckBox.Create(WizardForm.InnerPage); 
    with LicenseLinkURL do 
    begin 
    Parent := WizardForm.InnerPage; 
    Left := 277; 
    Top := 238; 
    Width := 60; 
    Caption := ' I accept'; 
    OnClick := @OnLicenseCheckBoxClick; 
    Visible := false; 
    end; 
end; 

procedure CurPageChanged(CurPageID: Integer); 
begin 
if (CurPageID = wpLicense) then 
begin 
    WizardForm.Bevel1.Visible := false; 
    WizardForm.MainPanel.Visible := false; 
    WizardForm.InnerNotebook.Visible := false; 
    LicenseLinkLabel.Visible := true; 
    LicenseLinkURL.Visible := true; 
    LicenseContextText.Visible := true; 
+0

..所以你的問題是什麼? – stuartd

回答

2

您設置WidthHeight屬性之前設置AutoSizeWordWrap性能。

這是不相關的,但也不是硬編碼的大小,您可能需要考慮使用相對於WizardForm中的現有元素的大小的具體值,例如。讓它自動適應表單內頁面區域的寬度。

+0

Tnx很多!我仍然認爲delphi編譯器的腳本,我的壞( – mishander