NTK and The NTK Project
are properties of Jn Dechereux
Home | Documentation | FAQ.

Vanilla 1.1.8 is a product of Lussumo. More Information: Documentation, Community Support.

Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthorohaldi
    • CommentTimeFeb 22nd 2017 edited
     
    Hello,
    Je suis nouveau avec NTK
    Après bien des lectures, je commence quelques exercices.
    Mais, j'ai un problème avec les get's.
    Dans mon petit exercice ci-dessous, les gets ne s'activent pas!
    Pas d'erreur de compilation et le programme se lance correctement.
    Avec la compilation harbour %1 -m -n -q -w -i%HB_INSTALL%\include;%WNTK_INSTALL%\include
    -w pour warning,
    Cela m'affiche au niveau des lignes GET les erreurs suivantes:
    Ligne : @ 100,10 GET vLarg ID GET_LARG SIZE 200,250 PICTURE "999999"
    D:\XhbNTK\Bobine\Main.prg(71) Warning W0001 Ambiguous reference: 'COLDCLR'
    D:\XhbNTK\Bobine\Main.prg(71) Warning W0001 Ambiguous reference: '_NTKDEFFGCOLOR'
    D:\XhbNTK\Bobine\Main.prg(71) Warning W0001 Ambiguous reference: '_NTKDEFBGCOLOR'
    D:\XhbNTK\Bobine\Main.prg(71) Warning W0001 Ambiguous reference: 'COLDCLR'

    J'ai cherché dans le fichiers includes, mais je ne trouve rien!
    Merci d'avance pour votre aide.
    Otto


    Mon exercice (sans toutes les fonctions):
    #include "windows.ch" // Classic windows constant include
    #include "ntkacc.ch" // Include all that you need to set your acceleration key
    #include "wNtk.ch" // Common NTK include file
    #include "ntkcmd.ch" // Common NTK include file
    #include "ntkcmdEx.ch" // Common NTK include file
    #include "wNtkKeys.ch" // Include constant for define key
    #include "ntkmenus.ch" // Include all that you need to create windows menu
    #include "ntkedget.ch" // Include for Edit Get


    #define GET_LARG 7001 // id get Largueur
    #define GET_TWO 7002 // id get Largueur
    #define CR CHR(13)

    Static hLogoNtk, hLogoBmp
    Memvar hWnd,aGetlist,vLarg,vString

    FUNCTION MAIN()
    Local aMenu,aPopupMenu,lMenRet
    Private hLogoNtk := NTK_ReadPictureToBmp( "images/Ntk.jpg" )
    Private hWnd,vLarg,vString
    Private aGetList := {} // Must be here!

    // Variables pour les get's
    vString := Space(20)
    vLarg := 1

    CREATE WINDOW hWnd ;
    TITLE "Bobine" ;
    STYLE WS_OVERLAPPEDWINDOW;
    ON PAINT DoRePaint()

    IF EMPTY( hWnd )
    NTK_MsgBox( , "Impossible de créer la fenètre principal" )
    RETURN Nil
    ENDIF

    aMenu := NtkCreateMenu()
    aPopupMenu := NtkCreatePopupMenu()
    NtkAppendMenu(aPopupMenu, "PRINT", MF_ENABLED + MF_STRING, "&Print", {|| DOABOUT(hwnd) }, "Impression" )
    NtkAppendMenu(aPopupMenu, "", MF_SEPARATOR)
    NtkAppendMenu(aPopupMenu, "QUIT", MF_ENABLED + MF_STRING, "E&xit", {|| DoExit(hWnd) }, "Quitte le programme" )
    NtkAppendMenu(aMenu, "FILE", MF_ENABLED + MF_POPUP, "&Files", aPopupMenu, "Files operations..." )
    NtkAppendMenu(aMenu, "ABOUT", MF_ENABLED + MF_STRING, "&?", {|| DoAbout() }, "About this program..." )

    lMenRet := NtkSetMenu(hWnd, aMenu)

    @ 123,125 GET vString ID GET_TWO ;
    SIZE 22,250 ;
    VALID TESTGET(hWnd) ;
    STYLE GS_3DSUNKEN ;
    TEXTCOLOR NTK_RGB(0,0,128) ;
    BACKCOLOR TRANSPARENT ;
    MESSAGE "Enter un nom"

    @ 100,10 GET vLarg ID GET_LARG SIZE 200,250 PICTURE "999999"

    ACTIVATE WINDOW hWnd NORMAL // Affiche la fenètre courante
    AUTO HANDLE EVENTS OF WINDOW hWnd // Lance le traitement des énévenements

    // Fin du programme
    NTK_DeleteObject( hLogoBmp )
    CLOSE WINDOW hWnd

    Return(nil)
    •  
      CommentAuthorxbasefan
    • CommentTimeFeb 22nd 2017 edited
     
    nothing to do with compilation flags.
    same as clipper: to animate get objects you must use READ - not auto_handle_
    see also auto_handle_ 'special note' in your rad doc.
    btw: it is always a good idea to specify the parent owner for each get or any other kind of child-control. hth.
    wilson

    the following code works fine here - built with mkrad and default options.
    #include "windows.ch" // Classic windows constant include
    #include "ntkacc.ch" // Include all that you need to set your acceleration key
    #include "wNtk.ch" // Common NTK include file
    #include "ntkcmd.ch" // Common NTK include file
    #include "ntkcmdEx.ch" // Common NTK include file
    #include "wNtkKeys.ch" // Include constant for define key
    #include "ntkmenus.ch" // Include all that you need to create windows menu
    #include "ntkedget.ch" // Include for Edit Get
    
    
    #define GET_LARG 7001 // id get Largueur
    #define GET_TWO 7002 // id get Largueur
    #define CR CHR(13)
    
    Static hLogoNtk, hLogoBmp
    /*Memvar hWnd,aGetlist,vLarg,vString */
    
    FUNCTION MAIN()
    Local aMenu,aPopupMenu,lMenRet
    Private hLogoNtk := NTK_ReadPictureToBmp( "images/Ntk.jpg" )
    Private hWnd,vLarg,vString
    Private aGetList := {} // Must be here!
    
    // Variables pour les get's
    vString := Space(20)
    vLarg := 1
    
    CREATE WINDOW hWnd ;
    TITLE "Bobine" ;
    STYLE WS_OVERLAPPEDWINDOW;
    ON PAINT DoRePaint()
    
    IF EMPTY( hWnd )
    NTK_MsgBox( , "Impossible de créer la fenètre principal" )
    RETURN Nil
    ENDIF
    
    aMenu := NtkCreateMenu()
    aPopupMenu := NtkCreatePopupMenu()
    NtkAppendMenu(aPopupMenu, "PRINT", MF_ENABLED + MF_STRING, "&Print", {|| DOABOUT(hwnd) }, "Impression" )
    NtkAppendMenu(aPopupMenu, "", MF_SEPARATOR)
    NtkAppendMenu(aPopupMenu, "QUIT", MF_ENABLED + MF_STRING, "E&xit", {|| DoExit(hWnd) }, "Quitte le programme" )
    NtkAppendMenu(aMenu, "FILE", MF_ENABLED + MF_POPUP, "&Files", aPopupMenu, "Files operations..." )
    NtkAppendMenu(aMenu, "ABOUT", MF_ENABLED + MF_STRING, "&?", {|| DoAbout() }, "About this program..." )
    
    lMenRet := NtkSetMenu(hWnd, aMenu)
    
    /*@ 123,125 GET vString ID GET_TWO; */
    @ 123,325 GET vString ID GET_TWO;
    SIZE 22,250 ;
    VALID TESTGET(hWnd) ;
    STYLE GS_3DSUNKEN ;
    TEXTCOLOR NTK_RGB(0,0,128) ;
    BACKCOLOR TRANSPARENT ;
    OF hWnd ;
    MESSAGE "Enter un nom"
    
    @ 100,10 GET vLarg ID GET_LARG SIZE 200,250 PICTURE "999999" OF hWnd
    
    ACTIVATE WINDOW hWnd NORMAL // Affiche la fenètre courante
    /* AUTO HANDLE EVENTS OF WINDOW hWnd // Lance le traitement des énévenements  */
    
    //READ
    READ INTO hWnd TOOLTIP
    
    
    // Fin du programme
    NTK_DeleteObject( hLogoBmp )
    CLOSE WINDOW hWnd
    
    Return(nil)
    
    
    FUNCTION DoExit(hWnd,nMsg,nWParam,nLParam)
       IF NTK_MsgBox( hWnd,;
                      "Are you sure to quit ?",;
                      "Warning !",;
                      MB_OKCANCEL+MB_ICONQUESTION  ) == IDOK
          NTK_ReadEscape()
          NTK_SendCloseEvent()
          RETURN(.T.)
       ENDIF
    RETURN(.F.)       // Do not quit, keep on current task
    
    
    Function DoRepaint(hWnd, nMsg, nWParam, nLParam, hDC)
    SET COLOR TO W+/B
    @ 0,00 SAY "Hello Otto!" SIZE 50,__NtkMaxCol() STYLE DT_SINGLELINE+DT_CENTER+DT_VCENTER INTO CONTEXT hDC
    Return(0)
    
    Proc TestGet(hWnd)
    Return(.T.)
    
    Proc DoAbout( hWnd)
    Return(Nil)
    
    •  
      CommentAuthorohaldi
    • CommentTimeFeb 23rd 2017
     
    Hello

    Many thanks for your help
    >READ INTO hWnd TOOLTIP
    So simple....

    I still check .prg files with the -w option. With NTK, I have a lot of warning!
    Many include files have duplicate definition!
    I don't like this.
    Raison that I have the following line: /*Memvar hWnd,aGetlist,vLarg,vString */
    But I can find out the raison of the following warnings:
    D:\XhbNTK\Bobine\Main.prg(71) Warning W0001 Ambiguous reference: 'COLDCLR'
    D:\XhbNTK\Bobine\Main.prg(71) Warning W0001 Ambiguous reference: '_NTKDEFFGCOLOR'
    D:\XhbNTK\Bobine\Main.prg(71) Warning W0001 Ambiguous reference: '_NTKDEFBGCOLOR'
    D:\XhbNTK\Bobine\Main.prg(71) Warning W0001 Ambiguous reference: 'COLDCLR'
    Best regards
    Otto