Layout Example

The following script will create a dialog box, where you can change the layout of a sample text and see the results in a new dialog box.

To try the script, you need to download this image for the picture in the dialog box. Press right click and Save target as:

/Dialog Examples to show the different formats and layouts
/ initialize strings
$STRING to_exit 'YES'
$STRING font_size '11'
$STRING your_text 'Hello World'
$ CONSTANT #comp 1
/Initializing the state for the forward and backward buttons
$cons #state 0
  $while #state<2
    $if #state==0
      $DIALOG START 'Layout example dialog box'
        $groupbox START 'Color Definition Table' Horizontal 1
          $DISPLAYLINE 'layout_example_palette.png;500;'
          $displayline '<div align="center">Image too small ? Press for<a href="file:&comipath&\layout_example_palette.png"> Larger Image</a></div>'
        $groupbox STOP
        $groupbox START 'Choose your Layout' 
          $PROMPT font_size '<span style="font-size: 12pt"><b> F</b>ont Size </span>' '11 22 33 44 55 66 77' +EDIT
          $PROMPT font_color '<font size=3><b><font color=#FF0033>C</font><font color=#0066cc>O</font><font color=#330066>L</font><font color=#990066>O</font><font color=#663300>R </font></b></font>'  +EDIT
          $PROMPT alignment 'Alignment' 'left center right justify' -EDIT
          $ask #bold 'Bold' Checkbox -Edit
          $PROMPT your_text '<b>Your text</b>'
        $groupbox STOP
      $cons #state #state+VF_ButtonPressed
    $end if
    $if #state==1
      $DIALOG START 'Test-Display of the given Text'
        $groupbox START 'Result' vertical 4
          $if #bold          
            $DISPLAYLINE '<nobr><font color="#&font_color&"><div align="&alignment&" style="font-size: &font_size&pt;font-weight:bold"> &your_text& </div></nobr>'
            $DISPLAYLINE '<nobr><font color="#&font_color&"><div align="&alignment&" style="font-size: &font_size&pt"> &your_text& </div></nobr>'
          $end if
        $groupbox STOP
        $DISPLAYLINE ''
        $groupbox START
          $PROMPT to_exit '<b>Do it again?</b>' 'Yes, No' -EDIT
        $groupbox STOP
      $cons #state #state+VF_ButtonPressed
      $CONSTANT #comp %COMPARE(&to_exit&,Yes)
      $IF (#comp==0)&&(VF_ButtonPressed==1)
          $DISPLAYLINE '<nobr><font size=6>You selected <b>Yes</b> so we do it again ?</font></nobr>'
          $cons #state 1
      $end if
    $end if
  $end while
scripts/dialogs/layout_example.txt · Last modified: 2013/07/23 14:27 by henschel Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0