home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 16 / CD_ASCQ_16_0994.iso / news / 4611 / fw16d.ins / SAMPLES / TESTCLIP.PRG < prev    next >
Text File  |  1994-01-16  |  2KB  |  86 lines

  1. //----------------------------------------------------------------------------//
  2. //  FiveWin 1.0 - Ejemplos
  3. //  (c) A.Linares, F.Pulpón 1993
  4. //
  5. // Construir con BUILD TestClip
  6. //----------------------------------------------------------------------------//
  7.  
  8. // Ejemplos de utilización del ClipBoard de Windows.
  9. // ¡Para FiveWin el ClipBoard de Windows es tambien un Objeto!
  10.  
  11. #include "FiveWin.ch"
  12.  
  13. static oWnd, oClp
  14.  
  15. //----------------------------------------------------------------------------//
  16.  
  17. function Main()
  18.  
  19.    DEFINE WINDOW oWnd FROM 1, 1 TO 20, 70 ;
  20.       TITLE "Usando el PortaPapeles de Windows" ;
  21.       MENU BuildMenu()
  22.  
  23.    DEFINE CLIPBOARD oClp OF oWnd
  24.  
  25.    SET MESSAGE OF oWnd ;
  26.       TO OemToAnsi( "FiveWin 1.0 - (C) A.Linares, F.Pulpón 1993" )
  27.  
  28.    ACTIVATE WINDOW oWnd
  29.  
  30. return
  31.  
  32. //----------------------------------------------------------------------------//
  33.  
  34. function BuildMenu()
  35.  
  36.    local oMenu
  37.  
  38.    MENU oMenu
  39.       MENUITEM "&Manejo del PortaPapeles"
  40.       MENU
  41.          MENUITEM OemToAnsi( "&Poner algún texto..." ) ;
  42.             ACTION PlaceSomeText()
  43.  
  44.          MENUITEM "&Coger el texto que haya..." ;
  45.             ACTION GetSomeText()
  46.  
  47.          SEPARATOR
  48.  
  49.          MENUITEM "&Limpiar el PortaPapeles"  ACTION oClp:Clear()
  50.          SEPARATOR
  51.          MENUITEM "Bye, bye..."               ACTION oWnd:End()
  52.       ENDMENU
  53.  
  54.       MENUITEM "Llamar al &PortaPapeles"      ACTION WinExec( "ClipBrd" )
  55.    ENDMENU
  56.  
  57. return oMenu
  58.  
  59. //----------------------------------------------------------------------------//
  60.  
  61. function PlaceSomeText()
  62.  
  63.    local cText := Space( 30 )
  64.  
  65.    if MsgGet( "De acuerdo...", OemToAnsi( "¡ Escribe algo !" ), @cText )
  66.       oClp:SetText( cText )
  67.    endif
  68.  
  69. return
  70.  
  71. //----------------------------------------------------------------------------//
  72.  
  73. function GetSomeText()
  74.  
  75.    local cText := oClp:GetText()
  76.  
  77.    if Empty( cText )
  78.       nMsgBox( OemToAnsi( "Ahí no hay nada..." ), "Lo siento" )
  79.    else
  80.       nMsgBox( cText, OemToAnsi( "¡¡¡ Tachannn !!!" ) )
  81.    endif
  82.  
  83. return
  84.  
  85. //----------------------------------------------------------------------------//
  86.