Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FreshWin (c) Fresh Technologies - <b>frdialog() miscellaneous function</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  FRDIALOG()                                          Miscellaneous Function
 Purpose..: Pop up a dialogue box
-------------------------------------------------------------------------------
 Syntax...: frDialog( [<cTitle>] , <aPrompt>, [<aHot>],  ;
                      [<aSay>], [<cTClr>], [<cPClr>],    ;
                      [<cSClr>], [<cHClr>],              ;
                      [<nShad>], [<nChoice>], [<lBox>] ) --> nPick

 Arguments: [<cTitle>]    = dialogue box title.
            <aPrompt>     = one or more prompt text set up in a comma
                            delimited format (comparable to a menu choice).
            [<aHot>]      = one or more hot key position numbers
                            set up in comma delimited format. Each
                            position starts at one.
            [<aSay>]      = one or more dialogue box content text set
                            up in comma delimited format.

            [<cTClr>]     = title color string.
            [<cPClr>]     = prompt color string.
            [<cSClr>]     = content text color string.
            [<cHClr>]     = hot key color string.

            [<nShad>]     = choice of shadow size. The default is S_FULL.

            Shadow Type Manifest Constants as found in FW_BOX.CH
            ---------------------------------------------------
            Value  FW_BOX.CH    Description
            ---------------------------------------------------
            1      S_FULL       Full size transparent shadows.
            2      S_HALF       Half size non-transparent shadows.
            ---------------------------------------------------

            [<nChoice>]   = choice where cursor is placed initially.

            [<lBox>]      = choice to frame the dialogue box.
                            If TRUE, the the box is framed, otherwise
                            a no border box is used.

 Returns..: nPick is the value chosen via the dialogue box
            which can be used to execute an option.

 Source...: DIALOG.PRG
-------------------------------------------------------------------------------
 Example..: . The example displays a portion of a program
              which contains a dialogue box. But first, here's
              the translated #xcommand which can be found in FW_MENU.CH.
              It's an easier and clearer way to use the function.

           #xcommand POPUP DIALOG               ;
                           [<lBox:NOBORDERS>]   ;
                           [TITLE <cTitle>]     ;
                           [TCOLOR <cTClr>]     ;
                           PROMPT <cPrompt,...> ;
                           [PCOLOR <cPClr >]    ;
                           [HOTKEY <nHot,...>]  ;
                           [HCOLOR <cHClr,...>] ;
                           [SAYTEXT <cSay,...>] ;
                           [SCOLOR <cSClr>]     ;
                           [SHADOW <nShad>]     ;
                           TO <n> ;
                     =>;
          <n> := frDialog( [<cTitle>],  ;
                           {<cPrompt>}, ;
                           [{<nHot>}],  ;
                           [{<cSay>}],  ;
                           [<cTClr>],[<cPClr>],[<cSClr>],[<cHClr>];
                           ,[<nShad>],<n>,iif( <.lBox.>, .f., .t. ) )

            . Here's a portion of a program
              which contains a dialogue box.

   POPUP DIALOG                                         ;
         NOBORDERS                                      ;
         TITLE   " Which Day Is It? "                   ;
         TCOLOR  "GR+/RB"                               ;
         PROMPT  " Monday  ", " Tuesday "               ;
         PCOLOR  "W+/RB, W+/B"                          ;
         HOTKEY  2, 2                                   ;
         HCOLOR  "W+/R, W+/R"                           ;
         SAYTEXT "", "If you pick the ",                ;
                 "Monday option the back drop will ",   ;
                 "change.  The purpose is to remind ",  ;
                 "YOU that a backup should ",           ;
                 "be done....", ""                      ;
         SCOLOR  "W+/RB"                                ;
         TO      nChoice

   if nChoice == 1

      for n :=1 to wLength( "Dos" )
         wScroll( "Dos",,,,,-1)
      next

      for n := 1 to wLength( "Dos" ) step 4
                wPos( ,n  , 0 )
                wOut( ,replicate( "DO THE BACKUP  *  ",;
                       int( ( wWidth()+1 )/10 ) ) )

                   wPos( ,n+2, 0 )
                wOut( ,replicate( " *  TODAY'S MONDAY", ;
                      int( ( wWidth()+1 )/10 ) ) )
      next
   endif

 Note.....: The use of NOBORDER will create a dialogue box with
            shadowed prompts instead of boxed prompts. As well, the
            dialogue box will have no frame but rather will be displayed
            using the title style, WT_BAR. Further details can be found
            in the wFrame() entry.

See Also: wFrame()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson