如何在 Inno Setup 中创建一个可滚动的单选按钮列表?
How to create a scrollable radio button list in Inno Setup?
I create a wizard to allow user choose from the selection from radio button but I encounter the problem when the selection is more then a dialog size, it will not show the rest of the selection as figure below:
我想使用向下滚动条,但网上很难找到教程。有人可以帮忙吗?
for code := 0 to 9 do
begin
CheckBox := TNewCheckListBox.Create(Page);
CheckBox.Parent := Page.Surface;
CheckBox.AddCheckBox('test', '', 0, True, False, False, True, nil);
CheckBox.AddRadioButton('1', '', 1, True, True, nil );
CheckBox.AddRadioButton('2', '', 1, False,True, nil );
end
为所有复选框和单选按钮创建一个大 TNewCheckListBox
,而不是为每组创建一个单独的框。如果内容不适合,TNewCheckListBox
将自动显示滚动条。
function CustomPage(var Page:TWizardPage;PageId:Integer):Integer;
var
CheckListBox: TNewCheckListBox;
begin
Page:=CreateCustomPage(PageId,ExpandConstant('AAA'),ExpandConstant('BBB'));
CheckListBox:=TNewCheckListBox.Create(Page);
with CheckListBox do begin
Parent:=Page.Surface;
Left:=ScaleX(0);
Top:=ScaleY(50);
Width:=ScaleX(413);
Height:=ScaleY(153);
AddCheckBox(ExpandConstant('Test'),'',0,False,True,False,True,Nil);
AddRadioButton(ExpandConstant('1'),'',1,True,True,Nil);
AddRadioButton(ExpandConstant('2'),'',1,False,True,Nil);
AddCheckBox(ExpandConstant('Test'),'',0,False,True,False,True,Nil);
AddRadioButton(ExpandConstant('1'),'',1,True,True,Nil);
AddRadioButton(ExpandConstant('2'),'',1,False,True,Nil);
AddCheckBox(ExpandConstant('Test'),'',0,False,True,False,True,Nil);
AddRadioButton(ExpandConstant('1'),'',1,True,True,Nil);
AddRadioButton(ExpandConstant('2'),'',1,False,True,Nil);
AddCheckBox(ExpandConstant('Test'),'',0,False,True,False,True,Nil);
AddRadioButton(ExpandConstant('1'),'',1,True,True,Nil);
AddRadioButton(ExpandConstant('2'),'',1,False,True,Nil);
end;
Result:=Page.ID;
end;
procedure InitializeWizard();
var
NewPage: TWizardPage;
NewPageID:Integer;
begin
NewPageID:=CustomPage(NewPage,wpWelcome);
end;
示例 2:
function CustomPage(var Page:TWizardPage;PageId:Integer):Integer;
var
CheckBox: TNewCheckListBox;
I:Integer;
begin
Page:=CreateCustomPage(PageId,ExpandConstant('AAA'),ExpandConstant('BBB'));
CheckBox:=TNewCheckListBox.Create(Page);
with CheckBox do begin
Parent:=Page.Surface;
Left := ScaleX(0);
Top := ScaleY(56);
Width := ScaleX(413);
Height := ScaleY(153);
for I:=0 to 9 do begin
AddCheckBox('test', '', 0, True, False, False, True, nil);
AddRadioButton('1', '', 1, True, True, nil );
AddRadioButton('2', '', 1, False,True, nil );
end;
end;
end;
I create a wizard to allow user choose from the selection from radio button but I encounter the problem when the selection is more then a dialog size, it will not show the rest of the selection as figure below:
我想使用向下滚动条,但网上很难找到教程。有人可以帮忙吗?
for code := 0 to 9 do
begin
CheckBox := TNewCheckListBox.Create(Page);
CheckBox.Parent := Page.Surface;
CheckBox.AddCheckBox('test', '', 0, True, False, False, True, nil);
CheckBox.AddRadioButton('1', '', 1, True, True, nil );
CheckBox.AddRadioButton('2', '', 1, False,True, nil );
end
为所有复选框和单选按钮创建一个大 TNewCheckListBox
,而不是为每组创建一个单独的框。如果内容不适合,TNewCheckListBox
将自动显示滚动条。
function CustomPage(var Page:TWizardPage;PageId:Integer):Integer;
var
CheckListBox: TNewCheckListBox;
begin
Page:=CreateCustomPage(PageId,ExpandConstant('AAA'),ExpandConstant('BBB'));
CheckListBox:=TNewCheckListBox.Create(Page);
with CheckListBox do begin
Parent:=Page.Surface;
Left:=ScaleX(0);
Top:=ScaleY(50);
Width:=ScaleX(413);
Height:=ScaleY(153);
AddCheckBox(ExpandConstant('Test'),'',0,False,True,False,True,Nil);
AddRadioButton(ExpandConstant('1'),'',1,True,True,Nil);
AddRadioButton(ExpandConstant('2'),'',1,False,True,Nil);
AddCheckBox(ExpandConstant('Test'),'',0,False,True,False,True,Nil);
AddRadioButton(ExpandConstant('1'),'',1,True,True,Nil);
AddRadioButton(ExpandConstant('2'),'',1,False,True,Nil);
AddCheckBox(ExpandConstant('Test'),'',0,False,True,False,True,Nil);
AddRadioButton(ExpandConstant('1'),'',1,True,True,Nil);
AddRadioButton(ExpandConstant('2'),'',1,False,True,Nil);
AddCheckBox(ExpandConstant('Test'),'',0,False,True,False,True,Nil);
AddRadioButton(ExpandConstant('1'),'',1,True,True,Nil);
AddRadioButton(ExpandConstant('2'),'',1,False,True,Nil);
end;
Result:=Page.ID;
end;
procedure InitializeWizard();
var
NewPage: TWizardPage;
NewPageID:Integer;
begin
NewPageID:=CustomPage(NewPage,wpWelcome);
end;
示例 2:
function CustomPage(var Page:TWizardPage;PageId:Integer):Integer;
var
CheckBox: TNewCheckListBox;
I:Integer;
begin
Page:=CreateCustomPage(PageId,ExpandConstant('AAA'),ExpandConstant('BBB'));
CheckBox:=TNewCheckListBox.Create(Page);
with CheckBox do begin
Parent:=Page.Surface;
Left := ScaleX(0);
Top := ScaleY(56);
Width := ScaleX(413);
Height := ScaleY(153);
for I:=0 to 9 do begin
AddCheckBox('test', '', 0, True, False, False, True, nil);
AddRadioButton('1', '', 1, True, True, nil );
AddRadioButton('2', '', 1, False,True, nil );
end;
end;
end;