can you pre-select a checkbox when scripting using AskCustom?

Post Reply
mjbiggs
Posts: 22
Joined: 01 Oct 10 20:50

can you pre-select a checkbox when scripting using AskCustom?

Post by mjbiggs »

Hello

Referring to the example script 'Say and Ask.psc' from the script repository, and in particular the 'AskCustomChecked' example, is it possible to pre-select one of the checkbox items, so it appears already checked?

following code from 'Say and Ask.psc':

Code: Select all

procedure AskCustomChecked;
var
  ASl: TTntStringList;
  AChecked: Boolean;
  ARes: Integer;
begin
  AChecked := True;
  ASl := TTntStringList.Create;
  ASl.Add('?john');
  ASl.Add('?jane');
  ASl.Add('?baby');
  ASl.Add('?janie');
  ASl.Add('?johnny');
  ARes := AskCustom(
            'select option',
            'sub text',
            '',   // 'info text'
            '',   // 'check this'
            AChecked,
            ASl
          );
  if ARes <> -1 then
  begin
    Say(ASl.Text);
  end;
  ASl.Free;
end;
AskCustomChecked;
Thanks
Last edited by mjbiggs on 31 Jul 21 5:15, edited 1 time in total.
mjbiggs
Posts: 22
Joined: 01 Oct 10 20:50

Re: can you pre-select a checkbox when scripting using AskCustom?

Post by mjbiggs »

...further to my last...

How do you display radio buttons instead of checkboxes, and can you pre-select one of them?

thanks again
Hert
Posts: 7871
Joined: 13 Sep 03 6:24

Re: can you pre-select a checkbox when scripting using AskCustom?

Post by Hert »

AskCustom in the scripter doesn't allow default checks, nor radio buttons.

You can always construct your own form if needed.
This is a user-to-user forum. If you have suggestions, requests or need support then please send a message
mjbiggs
Posts: 22
Joined: 01 Oct 10 20:50

Re: can you pre-select a checkbox when scripting using AskCustom?

Post by mjbiggs »

Ok, that's great. Will investigate forms.
Many thanks for your reply.
Post Reply