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.
    •  
      CommentAuthornewbie1
    • CommentTimeMay 25th 2011
     
    Hi there,

    I'm new at NTK. I'm trying to convert a small Clipper S87 program.
    GET,READ,PROMPT and now fancy buttons work very nicely. Congratulations to NTK people who have developed samples and tutorials.
    Right now I'm little bit stuck cause I couldn't find anything about the DBEDIT() function. Is there any replacement or similar function?
    •  
      CommentAuthorjnd
    • CommentTimeMay 26th 2011 edited
     
    Hi newbie1,

    A similar subject had already been discussed on this forum, just follow this link:
    http://www.ntkproject.com/forum_ntk/comments.php?DiscussionID=18&page=1#Item_7

    Now about your question:
    Indeed, there's no implicit Dbedit() nor Browse() in NTKRad programming language. However, it is easy to make one very quickly using the @ y,x...Browse command (based itself upon the powerful NTKTBrowse OO class).

    Anyway, just for fun, you'll find below a quick version of DBedit() function - I just develop a few minutes ago (it does not take me more than 10 mn). So, feel free to enhance it according to your own needs... (have a look to the attached screenshot)

    Hope it helps.
    BR,
    JN

    /*
    * Program:  DBedit.PRG
    * Launch:   DBedit.EXE
    * Purpose:  Mimic the DBedit() clipper function using NTKRad
    * Make:     MKRAD DBedit
    */
    
    #include "windows.ch"
    #include "ntkcmd.ch"
    
    
    Function MAIN()
    LOCAL hWndDemo
    LOCAL cWinTitle := ".:: A basic emulation for the Clipper DBedit() function ::."
    
    // Minimum Window declaration
    CREATE WINDOW hWndDemo TITLE cWinTitle
    
    // Display and put focus on current window
    ACTIVATE WINDOW hWndDemo NORMAL
    
    
    USE Product.dbf NEW // Open DB
    DBedit()            // Create a child dataGrid-object
    
    // Start processing bkg events (animate the current window)
    AUTO HANDLE EVENTS OF WINDOW hWndDemo
    
    
    // Close current window after receiving a stop signal
    CLOSE WINDOW hWndDemo
    Return(Nil)
    
    
    
    Function DBedit(nTop, nLeft, nBottom, nRight) // Maybe you can also call it Browse()
    Local oB
    
    If !used()
       Return( Nil )
    Endif
    
    Default nTop To 0
    Default nLeft To 0
    Default nBottom To __NTKMaxRow()
    Default nRight  To __NTKMaxCol()
    
    
    // --- Define a basic datagrid control browsing the current opened Dbf
    @ nTop, nLeft TO nBottom, nRight BROWSE oB
    
    
    oB:ShowAll()
    NTK_SetFocus(oB:hWnd)
    Return(oB)
    
    •  
      CommentAuthornewbie1
    • CommentTimeMay 26th 2011
     
    Hi JN,
    Thanks for your guidance, your example is exactly what I was looking for.
    I already started playing arround with the @...Browse command - seems very easy and powerful. Good job NTK Team!
    •  
      CommentAuthorGaza
    • CommentTimeJul 10th 2011
     
    Dear JN,

    I make test with DbEdit (Browse), but click mouse not working, other Keyboard Enter, ESC is working.

    Any help, attached the samples.

    Rgds,
    Gaza
    •  
      CommentAuthorjnd
    • CommentTimeJul 11th 2011 edited
     
    Dear Gaza,
    Have a look to my last post into the new thread called 'Faster Learning NTK - Gaza's ASELECT() function'.

    You'll find the answer to your question into the DoEdit() and OnKey() procedures.
    Btw, have a particular look to the followings:
    :doubleClick & :SingleClick, :KeyBlock
    The way you define those instance vars is significant regarding the datagrid object behaviour.

    Regards,
    JN