2012-07-30 8 views
10

मैं इंस्टॉलर के स्थापना चरण में नीचे दी गई छवि जैसे सामग्री को दिखाना चाहता हूं ... मैंने सामग्री दिखाने के लिए ज्ञापन का उपयोग किया है .. लेकिन ज्ञापन उचित नियंत्रण नहीं है .. तो यह .. एक पाठ बॉक्स की तरह लग रहा है, तो उपयोगकर्ता डालता ज्ञापन क्षेत्र पर ध्यान केंद्रित ... छवि के नीचे देखने के लिए जब उपयोगकर्ता इस कदम के लिए आता है, पहले ज्ञापन क्षेत्र का चयन किया गया ... installation typeinno सेट अप इंस्टॉलर में multiline सामग्री दिखाने के लिए नियंत्रण

+3

'TLabel' या' TNewStaticText' का उपयोग करें और उन्हें 'वर्डप्रेस' को सही और 'ऑटोसाइज' को गलत पर सेट करें। – TLama

उत्तर

8

उपयोग या तो TLabel या TNewStaticText घटक (

  • : TNewStaticText) InnoSetup के अंदर पसंद किया और यह सेट करने के लिए निम्न लगता है
  • AutoSize संपत्ति False कोसंपत्ति को True

तो बस अपने वांछित स्थिति में घटक खिंचाव और पाठ कि सीमा के लिए फिट होगा, बस इस उदाहरण में दिखाया गया पसंद:

[Setup] 
AppName=My Program 
AppVersion=1.5 
DefaultDirName={pf}\My Program 

[Code]  
const 
    LoremIpsum = 
    'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin mauris ' + 
    'lorem, ullamcorper sit amet tincidunt ac, varius at ante. Aenean pretium, ' + 
    'tortor non congue pharetra, ante urna consectetur mi, vitae congue arcu est ' + 
    'eleifend nisl.'; 

procedure InitializeWizard; 
var 
    CustomPage: TWizardPage; 
    StandardDescLabel: TLabel; 
    StandardRadioButton: TNewRadioButton; 
    AdvancedDescLabel: TLabel; 
    AdvancedRadioButton: TNewRadioButton; 
begin 
    CustomPage := CreateCustomPage(wpWelcome, 'Installation type', ''); 
    StandardRadioButton := TNewRadioButton.Create(WizardForm); 
    StandardRadioButton.Parent := CustomPage.Surface; 
    StandardRadioButton.Checked := True; 
    StandardRadioButton.Top := 16; 
    StandardRadioButton.Width := CustomPage.SurfaceWidth; 
    StandardRadioButton.Font.Style := [fsBold]; 
    StandardRadioButton.Font.Size := 9; 
    StandardRadioButton.Caption := 'Standard Installation' 
    StandardDescLabel := TLabel.Create(WizardForm); 
    StandardDescLabel.Parent := CustomPage.Surface; 
    StandardDescLabel.Left := 8; 
    StandardDescLabel.Top := StandardRadioButton.Top + StandardRadioButton.Height + 8; 
    StandardDescLabel.Width := CustomPage.SurfaceWidth; 
    StandardDescLabel.Height := 40; 
    StandardDescLabel.AutoSize := False; 
    StandardDescLabel.Wordwrap := True; 
    StandardDescLabel.Caption := LoremIpsum; 
    AdvancedRadioButton := TNewRadioButton.Create(WizardForm); 
    AdvancedRadioButton.Parent := CustomPage.Surface; 
    AdvancedRadioButton.Top := StandardDescLabel.Top + StandardDescLabel.Height + 16; 
    AdvancedRadioButton.Width := CustomPage.SurfaceWidth; 
    AdvancedRadioButton.Font.Style := [fsBold]; 
    AdvancedRadioButton.Font.Size := 9; 
    AdvancedRadioButton.Caption := 'Advanced Installation' 
    AdvancedDescLabel := TLabel.Create(WizardForm); 
    AdvancedDescLabel.Parent := CustomPage.Surface; 
    AdvancedDescLabel.Left := 8; 
    AdvancedDescLabel.Top := AdvancedRadioButton.Top + AdvancedRadioButton.Height + 8; 
    AdvancedDescLabel.Width := CustomPage.SurfaceWidth; 
    AdvancedDescLabel.Height := 40; 
    AdvancedDescLabel.AutoSize := False; 
    AdvancedDescLabel.Wordwrap := True; 
    AdvancedDescLabel.Caption := LoremIpsum; 
end; 

और परिणाम:

enter image description here

+0

'ऑटोसाइज' को 'गलत' पर सेट करना [डॉक्स] के अनुसार अनावश्यक है (http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/StdCtrls_TLabel_AutoSize.html)। और मैंने अभी इसका परीक्षण किया और यह 'ट्रू' पर 'ऑटोसाइज' के साथ ठीक काम करता प्रतीत होता है। – Ignitor

+0

@ इग्निटर, मैं इसे वहां रखूंगा। बस यही वह मामला है जब लेबल को ऑटोसाइज किया जाना चाहिए। जैसा कि दस्तावेज़ों में उल्लेख किया गया है, * "जब भी पाठ बदलता है लेबल लेबल का आकार बदलता है" * और मैं इसे बदल रहा हूं, है ना? – TLama

+0

ठीक है, प्रश्न वांछित है: यदि आप नहीं चाहते कि लेबल स्वचालित रूप से समायोजित हो ** यह ऊंचाई ** है, तो आप 'ऑटोसाइज' को 'गलत' पर सेट करें। 'ऑटोसाइज: = ट्रू' के साथ भी, 'वर्डवार्प' सक्षम होने पर लेबल widthnot को इसकी चौड़ाई__ समायोजित नहीं करेगा। हालांकि, मैं मुख्य रूप से यह इंगित करना चाहता था कि ** 'वर्डप्रेस: ​​= ट्रू' के लिए 'ऑटोसाइज: = गलत' सेट करना आवश्यक नहीं है **। – Ignitor