home *** CD-ROM | disk | FTP | other *** search
/ BUG 4 / BUGCD1997_05.BIN / aplic / clip4win / clip4win.exe / C4W30E.HUF / INCLUDE / DIALOG.CH < prev    next >
Text File  |  1993-11-17  |  3KB  |  111 lines

  1. ////////////////////////////
  2. //
  3. //    Clip-4-Win DIALOG GET definitions
  4. //
  5. //    Copyright (C) 1993 Skelton Software, Kendal Cottage, Hillam, Leeds, UK.
  6. //    All Rights Reserved.
  7. //
  8. //    These #command's allow GETs to be used in dialogs (as edit
  9. //    controls), as well as allowing you to specify the font to
  10. //    use, etc.
  11. //
  12. //    NOTE:  You can choose a font either using something like:
  13. //
  14. //        @ DIALOG hDlg ID ID_MYEDIT GET nVar        ;
  15. //          FONT GetStockObject(ANSI_VAR_FONT)
  16. //
  17. //    which uses one of the pre-defined fonts, or use a font from
  18. //    CreateFont() or ChooseFont().
  19. //
  20. //    You can check whether the GETs are ok (basically, whether
  21. //    a K_PGDN would be acceptable) using the IsDialogOK() function,
  22. //    as shown below.  You can quit the GETs using CANCEL DIALOG as
  23. //    shown.
  24. //
  25. //    case nMsg == WM_COMMAND
  26. //        do case
  27. //        case nwParam == IDD_OK        ;
  28. //        .or. nwParam == IDOK        ;
  29. //        .or. nwParam == IDYES
  30. //            if IsDialogOK(hWndDlg, nwParam)
  31. //                EndDialog(hWndDlg, nwParam)
  32. //            endif
  33. //        case nwParam == IDCANCEL    ;
  34. //        .or. nwParam == IDABORT        ;
  35. //        .or. nwParam == IDNO
  36. //            CANCEL DIALOG hWndDlg
  37. //            EndDialog(hWndDlg, nwParam)
  38. //        endcase
  39. //
  40. //
  41. ////////////////////////////
  42.  
  43.  
  44. #ifndef    C4W_DIALOG_CH
  45. #define    C4W_DIALOG_CH
  46.  
  47.  
  48. #command @ DIALOG <hWndDlg>                        ;
  49.            ID <nId>                            ;
  50.            GET <var>                            ;
  51.            [PICTURE <pic>]                        ;
  52.            [VALID <valid>]                        ;
  53.            [WHEN <when>]                        ;
  54.            [FONT <hFont>]                        ;
  55.            [SEND <msg>]                            ;
  56.       => SetPos(500, 1)                            ;
  57.        ; AAdd(                                                          ;
  58.                GetList,                                                 ;
  59.                _GET_( <var>, <(var)>, <pic>, <{valid}>, <{when}> )      ;
  60.              )                                ;
  61.        ; DReadSetInfo( <hWndDlg>, <nId>, GetList, Len(GetList) )    ;
  62.       [; DReadSetFont( <hFont> ) ]                    ;
  63.        ; _DlogAddGet( <hWndDlg>, <nId>, GetList, Len(GetList) )        ;
  64.       [; ATail(GetList):<msg>]
  65.  
  66.  
  67. #command @ DIALOG <hWndDlg>                        ;
  68.            ID <nId>                            ;
  69.            GET [USING] BLOCK <bGetSet>                    ;
  70.            [NAME <cName>]                        ;
  71.            [ROW <nRow>]                            ;
  72.            [COLUMN <nCol>]                        ;
  73.            [PICTURE <pic>]                        ;
  74.            [COLOR <colour>]                        ;
  75.            [FONT <hFont>]                        ;
  76.            [SEND <msg>]                            ;
  77.       => AAdd(                                                          ;
  78.                GetList,                                                 ;
  79.                GetNew( 500, 1, <bGetSet>, <cName>, <pic>, <colour> )    ;
  80.              )                                ;
  81.        ; DReadSetInfo( <hWndDlg>, <nId>, GetList, Len(GetList) )    ;
  82.       [; DReadSetFont( <hFont> ) ]                    ;
  83.        ; _DlogAddGet( <hWndDlg>, <nId>, GetList, Len(GetList) )        ;
  84.       [; ATail(GetList):<msg>]
  85.  
  86.  
  87. #command @ DIALOG <hWndDlg>                        ;
  88.            ID <nId>                            ;
  89.            GET <var>                            ;
  90.            [<clauses,...>]                        ;
  91.            RANGE <lo>, <hi>                        ;
  92.            [<moreClauses,...>]                        ;
  93.       => @ DIALOG <hWndDlg>                        ;
  94.            ID <nId>                            ;
  95.            GET <var>                            ;
  96.            [<clauses>]                            ;
  97.            VALID {|_1| DRangeCheck(_1, , <lo>, <hi>)}            ;
  98.            [<moreClauses>]
  99.  
  100.  
  101. #xtranslate IsDialogOK( <hDlg> [, <nId> ] )                ;
  102.       => IsDReadOK( <hDlg> [, <nId> ] )        // .t. if valid GETs
  103.  
  104.  
  105. #command CANCEL DIALOG <hDlg>                        ;
  106.       => DReadCancel( <hDlg> )            // like K_ESC
  107.  
  108.  
  109. #endif    // C4W_DIALOG_CH
  110.  
  111.