Vytváranie dialógových okien pomocou nástroja Dialog Tool

Vytváranie dialógových okien pomocou nástroja Dialog Tool

Dialog widgets

1. Calendar – Provides a calendar to display the selected date

 The format for this widget is

--calendar          

The command which we  wrote in the script file is

dialog --calendar 'calendar'  5 50 30 6 2021

calendar widget

After running the script, we get the calendar as shown below.

2. Checklist – Displays multiple entries where each entry can be turned on or off.

The format for this widget is

–checklist     …

The command which we  wrote in the script file is 

dialog –checklist  ‘checklist’ 15 10 10 ‘apple’ 5 ‘on’ ‘banana’ 2 ‘off’ ‘coco’ 3 ‘on’ ‘delta’ 4 ‘off’

checklist widget

After running the script, we get the checklist as shown below.

3. Form – This allows you to build a form with labels and text fields to be filled out.

The format for this widget is

 –form

… 

 

Here, flen is the length of the field, and ilen is the length of the field that allows input to move between fields.

The command which we  wrote in the script file is

 dialog   –form “Please enter the information” 12 40 4 “Name :” 1 1 “” 1 12 15 0 “Age: ” 2 1 “” 2 12 15 0 “Mail id:” 3 1 “” 3 12 15 0

Form widget

After running the script, we get the form as shown below.

4. Gauge – Allows you to display the gauge progress window

The format for this widget is

 --gauge    []

The command which we  wrote in the script file is

dialog --gauge  "progress.." 10 20 40

gauge widget

After running the script, we get the window as shown below.

 5. Message box – Displays a message and requires the user to select an OK button

The format for this widget is

-- msgbox   

The command which we  wrote in the script file is

dialog --msgbox  "This is a message" 10 25

message box widget

After running the script, we get the message box as shown below.

6. Fselect – Provides a file selection window to browse for a file.

The format for this widget is

-- fselect   < width >

The command which we  wrote in the script file is

dialog --title "fselect" --fselect /documents 15 40

fselect widget

After running the script, we get the window as shown below.

7. Infobox – Displays a message without waiting for a response.

The format for this widget is

--infobox        

The command which we  wrote in the script file is

dialog  --infobox   "This is a message" 15 30

inforbox widget

After running the script, we get the information box as shown below.

8. Inputbox – Displays a single text form box for text entry.

The format for this widget is

 --inputbox        []

The command which we  wrote in the script file is

dialog  --inputbox "Enter the name" 15 30 'enter here'

inputbox widget

After running the script, we get the input box as shown below.

9. Inputmenu – This widget provides an editable menu.

The format for this widget is

 –inputmenu    

 

The command which we  wrote in the script file is

dialog –inputmenu “Edit if necessary” 12 45 25 1 “hello” 2 “good morning” 3 ” take care “

inputmenu widget

After running the script, we get the window to edit as shown below.

10. Menu – This widget displays a list of selections from which to choose.

The format for this widget is

–menu        

 

The command which we  wrote in the script file is

dialog –menu “Choose the option” 12 45 25 1 “apple” 2 “banana” 3 “mango”

menu widget

After running the script, we get the window to edit as shown below.

11. Pause – It displays a meter showing the status of a specified pause period.

The format for this widget is

--pause    

The command which we  wrote in the script file is

dialog --pause "pause" 20 40 30

Pause widget

After running the script, we get the window as shown below.

The timer starts running….. out of which two images are depicted below

12. Mixed form – This widget allows you to build a form with labels and text fields of different forms to be filled out.

The format for this widget is

–mixedform     …

The command which we  wrote in the script file is

dialog   –mixedform “Please enter the information” 12 40 4 “Name :” 1 1 “” 1 12 15 0 a “Age: ” 2 1 “” 2 12 15 0 a “Mail id:” 3 1 “” 3 12 15 0 a

Mixed form widget

After running the script, we get the form as shown below.

13. Mixedgauge – allows you to display the gauge progress window with multiple items.

The format for this widget is

--mixedgauge        ...

The command which we  wrote in the script file is

dialog   --mixedgauge   "Gauge box" 10 20 40 app one

Mixedgauge widget

After running the script, we get the window as shown below.

14. Password – This widget displays a single textbox that hides entered text.

The format for this widget is

--passwordbox     []

The command which we  wrote in the script file is

dialog   --passwordbox   "Password" 10 20

Password widget

After running the script, we get the window as shown below.

15. Passwordform – This widget displays a form with labels and hidden text fields.

The format for this widget is

–passwordform …

The command which we  wrote in the script file is

dialog   –passwordform “Please enter the information” 12 40 4 “Password:” 1 1 “” 1 12 15 0 “otp: ” 2 1 “” 2 12 15 0 “secret key:” 3 1 “” 3 12 15 0

Passwordform widget

After running the script, we get the window as shown below.

16. Radiolist – This widget provides a group of menu items where only one item can be selected.

The format for this widget is

–radiolist     …

The command which we  wrote in the script file is

dialog –radiolist   ‘radiolist’ 15 10 10 ‘apple’ 5 ‘off’ ‘banana’ 2 ‘off’ ‘coffee’ 3 ‘off’ ‘dessert’ 4 ‘off’

Radiolist widget

After running the script, we get the window as shown below.

17. Program box – This widget lets you display the output of the command in the dialog box.

The format for this widget is

--prgbox         

The command which we  wrote in the script file is

dialog --prgbox   "command" "ls"  10 30

Program box widget

After running the script, we get the window as shown below.

18. Textbox – This widget displays the contents of a file in a scroll window

The format for this widget is

--textbox        

The command which we  wrote in the script file is

dialog –textbox /etc/hosts 10 60

Textbox widget

After running the script, we get the window as shown below.

19. Tailbox – This widget displays text from a file in a scroll window using the tail command.

The format for this widget is

--tailbox        

The command which we  wrote in the script file is

dialog --tailbox /etc/hosts 10 60

tailbox widget

After running the script, we get the window as shown below.

20. Yes no – This widget provides a simple message with Yes and No buttons.

The format for this widget is

--yesno          

The command which we  wrote in the script file is

dialog --yesno "Do you want run the command" 10 30

yesno widgetimage widget

After running the script, we get the window as shown below.

Marek Mihók