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.
    •  
      CommentAuthoral660130
    • CommentTimeJun 29th 2010
     
    Hi All,

    Background:
    I have a successful clipper application which manages road haulage companies transport management and invoicing.
    The program was initiated more than 20 years ago (Clipper summer87) and although constantly being updated it is now time to move to a win32 API application for this useful business application.

    Now:
    JN has supported the choice of NTK by contributing many useful ideas.
    We hope to initiate the first phase of the database migration and JN is providing his valuable time, ensuring we move ahead successfully .

    My learning of Win32-API has begun with some simple modifications of sample NTKRad apps
    For example I tried modify NTKRad-getdmo.prg to copy and paste selected array items into the memo box

    JN has kindly pointed out my omission of chr(10) Linefeed causing the pasted array items to appear on the same line.

    FOR i := 1 to len(aVar6)
    cData := cData + aVar6[i] + chr(13)+ chr(10)
    NEXT
    NTK_PutClipbText( hWinGet, cData )

    I will now try JN's suggestion, hopefully, with success.

    Future:
    I look forward to sharing the progress of the Loads Program migration with NTKProject community

    Alastair
    •  
      CommentAuthoral660130
    • CommentTimeJun 29th 2010
     
    Hi
    Was trying to use "NTK_PutClipbText()" to move data around active read arrays.
    - seemed tough, until I found "NTK_SetGetValue()"
    - wow, now it easy!

    I can wait to learn all the NTK_ commands
    (JN when are you going to finish the help file?)

    I now need to save my edited memo field to a text file. Does anyone have (or could tell me where to find) a sample of code with typical "file" "save-as" directory browser / file name get ?

    bye Al.
    •  
      CommentAuthorxbasefan
    • CommentTimeJun 30th 2010
     
    Al,

    try the NTK_GetSaveFileName() function - doc'ed in ntkcore_part1.pdf manual.

    good luck for your migration.

    bye
    Wilson.
    •  
      CommentAuthoral660130
    • CommentTimeJun 30th 2010 edited
     
    Wilson thanks for this. I will have some fun tonight.

    also

    I have had success copying my selected 'array gets' into my 'memo get' (that's working nicely now). Is there a way to instruct the memo field to paint a horizontal scroll bar rather than wrapping long lines - I can make my get box bigger but would rather no?

    another one (sorry for all this)

    When I write the memo text to a text file called 'invoices.cdf' I'd like to help the operator by launching 'windows notepad' (with the output file open). I'm trying:

    DoRun("NOTEPAD.EXE", "invoices.cdf")

    without success

    any thoughts?

    cheers
    Al
    •  
      CommentAuthoral660130
    • CommentTimeJun 30th 2010
     
    I'm flying now

    after using

    cFile = NTK_GetSaveFileName( hWndGet , "invoice.cdf" )

    I'm finding notepad opens great with

    //DoRun("NOTEPAD.EXE", "invoices.cdf", )
    run("NOTEPAD.EXE", cFile )

    cheers
    Al
    •  
      CommentAuthorAbbougaga
    • CommentTimeJun 30th 2010 edited
     
    Hi Al,

    Glad to see you're coming along with NTK.

    >I have had success copying my selected 'array gets' into my 'memo get' (that's working nicely now). Is
    >there a way to instruct the memo field to paint a horizontal scroll bar rather than wrapping long lines
    >I can make my get box bigger but would rather no?

    I think you should add the WS_HSCROLL to your memo style.


    >I'm finding notepad opens great with
    >run("NOTEPAD.EXE", cFile )

    NTK_Run() or NTK_ShellExecute() work both very well.
    Personally, my favorite is the RUN command. (NTKRAD.PDF, chap 0.36)

    e.g.
    RUN ( cMyReport ) AND WAIT


    Hope it helps.

    Cheers,
    Ab.
    •  
      CommentAuthorxbasefan
    • CommentTimeJul 1st 2010
     
    hi there,
    being of clip4win background, i am still using the winexec function (coming with c4w2ntk.ch), and apparently no problem with it.
    i am wondering if winexec|ntk_winexec is better or worse than ntk_shellexecute in NTK environment?
    should i continue using it or should i change?

    TIA,
    Wilson.
    •  
      CommentAuthoral660130
    • CommentTimeJul 1st 2010
     
    Hi each

    Ab - WS_HSCROLL works beautifully. Thanks for pointing-out this very basic stuff

    Luckily my 'petzold' book has just arrive - wow (it's enormous!!)
    When I've read (a bit of it) I should be better able to discuss win32 programming also (hopefully) produce some better code.

    Wilson - run( "NOTEPAD.EXE", cFile )is working just great (thanks). I'll concentrate on learning some more basics before I look at these other methods.

    I would like to add that (being just a few-days-in) I'm really enjoying using NTK and I really admire the work which that has been done in producing this library of very good and powerful functions.

    I'm not sure if all win32 programming platforms are this was. However, mistakes in clipper 'annoyingly' halt the program 'with the dreaded red box'.
    Where as as my mistakes in NTK (there's lots just now) 'invisibly' just fail to work, leaving all the other bits still running!! (this is very encouraging for a new starter like me!)

    thanks everyone
    •  
      CommentAuthoral660130
    • CommentTimeJul 1st 2010
     
    Hi all,

    I've a quick question.

    I'm busy modifying 'getdmo.prg' with good success(?).

    I'd like to remove 'some' entries from a get array (after their copied)

    I know NTK_SetGetValue() changes the selected list

    Can I remove an item from the 'CAPTION' array (aLbChoices) whilst the READ is live. If I can what.s the best procedure?


    @ 40, 10 GET aVar6 ID ID_GETLBOX6 ;
    SIZE 150,600 ;
    CAPTION aLbChoices ;
    TYPE GXT_LISTBOX ;
    FONT NTK_GetStockObject(ANSI_FIXED_FONT) ;
    TEXTCOLOR NTK_RGB(000,000,128) ;
    BACKCOLOR NTK_RGB(255,255,128) ;
    STYLE GS_3DRAISED + WS_VSCROLL + LBS_NOTIFY + ;
    LBS_MULTIPLESEL ;
    MESSAGE ""


    Thanks

    bye Al
    •  
      CommentAuthorjnd
    • CommentTimeJul 1st 2010 edited
     
    Hi everyone,

    To Alastair:
    Al, thank you very much for your kind words about NTK. I do appreciate. :peace:


    To All:
    And yes, NTK is the result of many years of big effort - not only from me as the main author, but also from other NTK Team members: Sylvain, Marco and Jne (even if sometimes life is forcing us to go different ways) who have spent lot of their spare time testing, debugging and writting the basic NTKCore and NTKRad tutorials, and so on...

    Also,
    I don't forget the very first NTK members/donators like Ab or Dieter for their precious support, ideas and also for their smart contribs.

    Your comments are welcome, your support and encouragments too.

    Cheers,
    Jean-Noël.
    •  
      CommentAuthorAbbougaga
    • CommentTimeJul 1st 2010
     
    Hi, JN
    Thanks to you for sharing your time and knowledge with the rest of NTK community.

    Cheers,
    Ab

    little feedback:
    I am very happy with our AdoRddNtk. Hope not speaking too soon, but the mySql remote access seems to work as expected and even more! I just need to complete the Maintainance module in order to get rid definitively of phpMyAdmin (very useful until now, I must admit).
    •  
      CommentAuthorAbbougaga
    • CommentTimeJul 1st 2010 edited
     
    Hi Al,


    >Can I remove an item from the 'CAPTION' array (aLbChoices) whilst the READ is live. If I can what.s the best procedure?

    I've exhumed the followings from my own libs:

     
    function LB_RemoveItem( nGetID, aLbChoices, nItemIdx )
    // Retrieve the handle to the list box
    local hWndLB := NTK_GiveGetHandle(aGetList, nGetID)
    
    // Remove the item from the NTK/xHarbour array
    aDel(aLbChoices, nItemIdx)
    aSize(aLbChoices, Len(aLbChoices)-1)
    
    
    // Tell Windows to delete the concerned item in the list box.
    // (Note: Win32 LB arrays are always zero based)
    NTK_SendMessage( hWndLB, LB_DELETESTRING, nItemIdx-1, 0)
    
    Return( aLbChoices )
    
    
    function LB_InsertItem( nGetID, aLbChoices, nItemIdx, cItem )
    // Retrieve the handle to the list box
    local hWndLB := NTK_GiveGetHandle(aGetList, nGetID)
    
    // Insert new item to the NTK/xHarbour array
    aSize(aLbChoices, Len(aLbChoices)+1)
    aIns(aLbChoices, cItem)
    
    
    // Tell Windows to insert the new item in the list box.
    // (Note: Win32 LB arrays are always zero based)
    NTK_SendMessage( hWndLB, LB_INSERTSTRING, nItemIdx-1, @cItem)
    
    Return( aLbChoices )
    
    


    ////////////////////////////////////////////////////////////////////////////

    Use this for removing an item:
    // { "Plum", "Banana", "Apple", "Peach" } // , "Apricot" }
    aLbChoices := LB_RemoveItem( ID_GETLBOX6, aLbChoices, 5 )
    REFRESH GET ID ID_GETLBOX6
    



    or this for inserting a new item:
    // { "Plum", "Banana", "Coconut", "Apple", "Peach" }
    aLbChoices := LB_InsertItem( ID_GETLBOX6, aLbChoices, 3, "Coconut" )
    REFRESH GET ID ID_GETLBOX6
    


    Hope it helps.

    Ab.
    •  
      CommentAuthoral660130
    • CommentTimeJul 1st 2010
     
    Ab.
    Thats great.
    Many thanks
    Al
    •  
      CommentAuthorjnd
    • CommentTimeJul 1st 2010 edited
     
    Al,
    Congratulation for buying your Petzold book. IMO, you won't regret your purchase, it's really worth its weight (in gold)! :wink:
    More seriously, this book is a must and a real gold mine for everyone wanting to go deeper in Win32 world.

    Happy bedtime reading. :wink:
    JN
    •  
      CommentAuthorjnd
    • CommentTimeJul 1st 2010 edited
     
    Wilson,
    I moved your question about winexec in a new appropriated thread called: 'winexec vs ntk_shellexcute'.
    You also find there the reply.

    Bye,
    JN
    •  
      CommentAuthorjnd
    • CommentTimeJul 2nd 2010 edited
     
    Hi Ab,

    >I am very happy with our AdoRddNtk. Hope not speaking too soon, but the mySql remote access seems to work
    >as expected and even more! I just need to complete the Maintainance module in order to get rid
    >definitively of phpMyAdmin (very useful until now, I must admit).

    That's good news - feel free to keep us in touch with your lastest news about this technology.
    (Maybe I will have to use it in some future developments)

    Cheers,
    Jean-Noël


    P.S. Never say never. :wink:
    •  
      CommentAuthoral660130
    • CommentTimeOct 4th 2010 edited
     
    Hi everyone

    Clipper loads program migration to NTK has begun, with Jn's help, and we have a very nice looking (partially complete) application foundation called "FL32"

    Whilst Jn does the tricky stuff I have been rewriting one or two fragments of clipper code inside very small NTK app windows, my progress is slow, although I am making progress, mostly when searching and reading existing code inside NTK (thanks contributors).

    I have one lingering problem which hopefully someone may be able to help me with...

    I have a "do while" loop, where I read data from an open dbf and, after some processing, insert it in a new field in a NTK list box.

    My problem is that, after a few seeming successful seconds, as the list box begings to be populated with data, my windows 7 displays: (Not Responding) in the window title and any new entries in my list box from then on are frozen. Then, after what seems like forever, my "do while" loop completes and the list box comes to life, with 2 or 3 hundred correct entries...

    I have tried disabiling keyboard and mouse (with NTK_enablewindow ) whilst the loop runs - without success
    I am now trying NtkWaitBox - but haven't got this working, yet

    I look forward to any guidance
    regards
    Al
    •  
      CommentAuthorAbbougaga
    • CommentTimeOct 4th 2010
     
    Hi Al,

    I don't think you're experimenting any Windows OS issues. I would opt for cpu resources hogging, due to a long treatment. Keep in mind Windows is a multitask system. Did you try to put something like IF NTK_PeekMessage(...); NTK_GetMessage(...) or simply NtkInkey(-1) in your 'Do While' loop? (just to tell Windows: 'hey, I am still a living process!')
    Cheers,
    Ab
    •  
      CommentAuthoral660130
    • CommentTimeOct 4th 2010
     
    Ab,
    I've speeded-up my loop by creating a temporary index then using dbseek(), which seems to be keeping windows happy. No more (Not Responding)!! I guess the OS now assumes my process is still alive!
    Thanks for your guidance.
    Cheers
    Al
    •  
      CommentAuthoral660130
    • CommentTimeOct 5th 2010
     
    Hi everyone

    My NTK app is growing nicely..

    However, I'm going around in circles with one item.

    Can anyone suggest where i need to look...

    My app is cloned from "getdemo" (I used it's main page CREATE WINDOW etc)

    I've added my own buttons and written a nice data capture function (Which is working nicely).


    However, because my data takes some time to load (was causing "Not Responding") I wanted to create a pop-up a child window showing progress (and to see if I could implement tgauge progress...)

    Only, I'm not quite there yet!

    When NTK_updatewindow()runs it duplicates my main window buttons in both the main window and also in my new child window....?

    I have checked the syntax and names of CREATE WINDOW - ON INIT and ON PAINT, which seem correct and unique.

    What do I do in order to separate their refresh content.... ???

    ID and INSTANCE parameters remain unspecified in each CREATE WINDOW call. is this right??

    (main window)
    CREATE WINDOW hWndP ;
    TITLE "FASTLANE - Sagemake11" ;
    AT 10,10 SIZE 800,600 ;
    ON INIT DoInit() ;
    ON PAINT DoRePaint() ;
    ON EXIT DoExit() ;
    ON MSG DoHandleMsg()


    (child window)
    CREATE WINDOW hWndPG ;
    CHILD OF hWndP ;
    TITLE "test" ;
    AT 0,0 ;
    SIZE 630,250 ;
    ON PAINT doChildPaint() ;
    ON EXIT myWndExit()


    thanks if you suggest where I need to look
    Al
    •  
      CommentAuthorjnd
    • CommentTimeOct 5th 2010 edited
     
    Hi Al,

    After reading of previous posts, I confirm that Ab is right. By speeding up your loop you've only moved the problem, but in no cases you solved it! Indeed, you have to handle events of your long process in an asynchroneous way.

    So, you'll find in the attached file a reusable source code (I wrote some years ago), which is treating this kind of problem. Basically, wNtkDict.prg is a set of UDFs designed to manage NTKDIC's indexbase and infobase directly from your app. e.g. implementing a complete reindexing system (with a nice progressbar) in just a few line of code, as the following:

    . . .
    PRIVATE B := {}
    AADD( B, { "  No (Esc)  "   , K_ESC   } )
    AADD( B, { "  Yes (Enter)  ", K_ENTER } )
    nKey := NtkWarnBox( nil, nil, 7, 75, "Database's reindexing operation may take a while! "+CR+CR+;
    "DO YOU WANT TO CONTINUE?",;
    B, C_WE, "rDlgBkg01", IDI_QUESTION, APP_hICOFONT )
    
    IF nKey == K_ESC
       RETURN(Nil)
    ENDIF
    
    // Syntaxe: IndexBaseCheckUp( hWndP, cIdcName, cCheckMode, cPathDest,  UserCancel, lDoInform )
    IndexBaseCheckUp( hWndP, APP_PATH+"PLANN.IDC", NTK_DBIDC_PACKANDINDEX, APP_FILES, .T., .F. )
    
    RETURN(Nil)
    



    Feel free to inspire you from this code, then adapt it in order to make your own working routine for managing long processus in a proper way.

    Hope it helps.

    BR,
    JN

    P.S.
    I joined the screenshot that illustrates my purposes.
    •  
      CommentAuthoral660130
    • CommentTimeOct 7th 2010
     
    Hey Guys

    When I'm GETing an array list

    How do I know when one or more selections have been made... So I can enable/disable one of my buttons?

    Again, sorry for these basic questions. My learning curve is quite a long one!

    regards
    Al
    •  
      CommentAuthorjnd
    • CommentTimeOct 7th 2010
     
    Hi Al,

    >How do I know when one or more selections have been made...

    I presume you're talking about a listbox GET similar to the following?
     
    Private aVar6 := { "Banana", "Peach" }
    Private aLbChoices  := { "Plum", "Banana", "Apple", "Peach", "Apricot" }  // or only "Orange"
    
    ...
    
    @ 180, 400 GET aVar6 ID      ID_GETLBOX6                                 ;          
                         SIZE    100,150                                     ;
                         CAPTION aLbChoices                                  ;
                         TYPE    GXT_LISTBOX                                 ;
                         FONT    hGetFont                                    ;
                         TEXTCOLOR NTK_RGB(000,000,128)                      ;
                         BACKCOLOR NTK_RGB(255,255,128)                      ;
                         STYLE   GS_3DRAISED + WS_VSCROLL + LBS_NOTIFY +     ;
                                 LBS_MULTIPLESEL                             ;
                         MESSAGE "Select one or more fruits ..."
    ...
    


    if yes, just read items of your aVar.
    e.g.
    For nS := 1 to Len(aVar6)
    NTK_MsgBox( , aVar6[nS], "user Selections:", MB_TOPMOST )
    Next


    >So I can enable/disable one of my buttons?
    According to NTKRad manual, you have two different ways of doing that: by ID or by Handle.

    0.51.3 NTK_EnableBtn()
    Enable or Disable a button using its handle.
    NTK EnableBtn( hBtnWnd, lEnable ) -> lBtnState

    OR

    0.51.4 NTK_EnableBtnID()
    Enable or Disable a button using its ID.
    NTK EnableBtnID( nBtnID, lEnable ) -> nBtnState

    >Again, sorry for these basic questions.
    Why being sorry? When you don't know something, it's quite normal to ask others. :wink:

    Hope it helps,
    JN
    •  
      CommentAuthoral660130
    • CommentTimeOct 8th 2010
     
    Good Morning Jn

    Thank you for this helpfull feedback.

    Yes, I am using a listbox GET (as you've presumed).

    I am also using NTK_EnableBtnID() to control my button avaliability.

    My question now is:

    How, whilst the user is selecting (or de-selecting) from a 300 array element listbox GET, do I monitor "aVar"?

    I need to be able to trigger a routine from keyboard or mouse activity whilst reading this GET....
    If we dont monitor the keyboard & mouse. How can I set a shared process running to watch aVar?

    Al
    •  
      CommentAuthorjnd
    • CommentTimeOct 8th 2010
     
    Bonjour Al,

    Maybe you should add a ONEVENT clause to your listbox GET declaration. Thus, you will be able to detect events occured on the lisbox GET, using the NTK_LastGetEvent()function.

    To learn more, just have look to your NTKRad Manual:
    Chap. 0.8 @...GET
    and
    Chap. 0.53.19 NTK LastGetEvent()

    Hope this helps.

    By for now.
    JN


    P.S.
    Don't forget to include NTKDLG.ch to your prg. This file contains all needed flag- definitions regarding listbox+combox notification codes ; whilst EN_* constants for normal GETs (edit controls) are included in WINDOW.CH
    •  
      CommentAuthoral660130
    • CommentTimeOct 8th 2010
     
    Hi Jn
    Thanks for this
    You've guided me in another direction

    I was busy writing some tests in my message handler, trying to workout which process I was in and which WM_? to look at (WM_KeyDown looked hopeful??)

    but

    OnEvent sounds much more like the one I need ;-)

    bye
    Al
    •  
      CommentAuthoral660130
    • CommentTimeOct 10th 2010
     
    Guys

    I have implemented the "OnEvent" clause in my GXT_LISTBOX GET to call a small function which, hopefully counts "Selected" GTX_LISTBOX items.

    I am having trouble indenifying the live status of GTX_LISTBOX...

    I know that my GET field (aVAR) doesn't updated until I move to the next GET field, which doesn't help me. So, I'm trying to use NTK_ED_GetBuffer(NTK_GiveGetHandle()), without success, Yet (It's been a long weekend)!

    Is it possible to access the current GET fields data whilst I am in the function called by the "OnEvent" handler.
    If it is, do I use NTK_ED_GetBuffer() if I do, how do I get it working?? (can't find much about it in the help files or sample code)

    regards
    Al
    •  
      CommentAuthorAbbougaga
    • CommentTimeOct 11th 2010 edited
     
    Hi Al,


    sorry JN, don't want to interfer your discussion, but like Al
    I experimented the same situation a while ago. Here is what I wrote:

     
    FUNCTION LB_GetSelItem(hWndLB)
    local nItemIdx, nItemMax, nItemLen, cItemBuf
    local nItemSel, aItemSel, xRetItem
    
    aItemSel := {}
    nItemMax := NTK_SendMessage( hWndLB, LB_GETCOUNT, 0, 0 )
    for nItemIdx := 1 TO nItemMax
        // (Note: Win32 LB arrays are always zero based)
        xItemRet := NTK_SendMessage( hWndLB, LB_GETSEL, nItemIdx-1, 0 )
        if xItemRet # 0
           nItemLen := NTK_SendMessage( hWndLB, LB_GETTEXTLEN, nItemIdx-1, 0 )
           cItemBuf := SPACE(nItemLen)
           NTK_SendMessage( hWndLB, LB_GETTEXT, nItemIdx-1, @cItemBuf )
           AADD( aItemSel, STRTRAN(cItemBuf, chr(0), "") ) // cut C NULL strings
        endif
    next
    
    Return( aItemSel )
    
    
    FUNCTION LB_EventCatch(nGetID)
    local nI
    local nEvCode
    local hWndLB := NTK_GiveGetHandle(aGetList, nGetID)
    local aItemSel := {}
    local cOutputTest := ""
    
    nEvCode := NTK_LastGetEvent()
    
    if nEvCode==LBN_SELCHANGE  // .OR. nEvCode==LBN_DBLCLK
       // Retrieves all selected items in the LB
       aItemSel :=  LB_GetSelItem(hWndLB)
     
    /*
     * Uncomment the following code to show the selected item list.
       for nI := 1 TO LEN(aItemSel)
           cOutputTest := cOutputTest + aItemSel[nI] +CR
       next
    
       if empty(aItemSel)
          NTK_MessageBox( , "None", "Selected Item(s):", MB_OK)
       else
          NTK_MessageBox( , cOutputTest, "Selected Item(s):", MB_OK)
       endif
    */
    endif
    
    Return( .T. )
    


    Of course, don't forget to add something like 'ONEVENT LB_EventCatch(nYourGetID)' to your GET declaration.

    Hope you'll find it useful.
    Ab
    •  
      CommentAuthoral660130
    • CommentTimeOct 11th 2010
     
    Ab,

    Thank you for this copy of your code which interogates my GXT_LISTBOX "on-the-fly".

    I have adapted these lines into my program and now have my list-box working exactly how wanted - GREAT!

    Thanks again
    Al
    •  
      CommentAuthorjnd
    • CommentTimeOct 11th 2010
     
    Hi Guys,

    To Ab:
    >sorry JN, don't want to interfer your discussion, but like Al
    Interfer? Are you joking? Ab, you're always welcome young IT man!
    Your answers are often relevant. Furthermore, as I am currently very busy with my work, I do really appreciate that you take the time to share your experience on our newsgroup. :peace:

    P.S. very nice code, congratulations!


    To Al:
    >I have adapted these lines into my program and now have my list-box working exactly how wanted - >GREAT!
    That's really great - U are progressing by leaps and bounds... :wink:


    Bye for now.
    JN
    •  
      CommentAuthoral660130
    • CommentTimeOct 15th 2010
     
    Hi Guys,

    update - list box is app is working very well.... I'm printing impressive looking reports(I think?)

    My Crystal Reports are tending towards doing most of the report calculations inside my NTK app. Then I'm building a single (temporary) database file to perform my Crystal report from - this way I don't need to program too many Crysal formulas :-)

    Also - I've made my main window resizeable, which I like :-). Does anyone have any smart code to re-size my listbox GET when called from my main window message handler????

    If not could anyone point me to any contrib app doing this (I've searched but can't find)

    thanks
    Al
    •  
      CommentAuthorMarkus II
    • CommentTimeOct 18th 2010
     
    Hi Al,

    In the new NTKDIC, I resize a ListBox with this method

    // Parameters : Handleobject, X,Y, Width, Height, Flag repaint )
    NTK_MoveWindow( NTK_GetDlgItem(hWnd, GET_LISTBOX), X, Y, (NewSizeX-DefSizeX+WidthListBox), HeightListBox, .T. ))

    You must call this function before Repaint your window.
    You can use this method with any object.

    Create a function for replace and resize all your objects of your window and call it when your window is resize.

    I hope that's help you.

    Markus II
    •  
      CommentAuthoral660130
    • CommentTimeOct 19th 2010 edited
     
    Hi Markus,

    Thank you for this method..

    I have followed you advice and placed a call to do this from my window message handler and now I (very nicely) re-size my live "GET Listbox" to its parent windows-size (great!)

    I notice however that my new size appears only after I click my parent windows border (or title bar). I have placed a call to NTK_RedrawWindow/NT_SelectWindow/NTK_UpdateWindow trying to overcome this but only clicking the outside actually performs the update.

    I shall now go back to my Petzold book (which is heavy going!) to learn some more about updating windows (where I expect to find the answer), Unless it's really easy and someone can advise me?? (I'm embarrassed again)

    bye
    Al
    •  
      CommentAuthoral660130
    • CommentTimeOct 28th 2010
     
    Thanks Jn

    NTK_SendMessage( hWndLB, LB_SETHORIZONTALEXTENT, nWidth, 0 )

    great fix! - it turns-on the illusive horizonatal scroll bar in ListBox Gets (with WS_HSCROLL STYLE)


    ....I did think I would spend until xmas learning NTKRAD - not a chance!
    Everyday I'm dipping into NTKCORE and reading MSDN forums (and loving every bit) - thanks guys

    bye
    Al
    •  
      CommentAuthorjnd
    • CommentTimeOct 28th 2010
     
    Ok Al,

    I'm happy U get it working. In fact, this afternoon, I was not sure to correctly remember the workaround. So, glad to see that my memory is still in good shape, too! :wink: :wink:

    A+
    JN


    P.S. Thanks for your kind words.
    •  
      CommentAuthoral660130
    • CommentTimeNov 26th 2010 edited
     
    Hi all,


    I have a NtkTBrowse() question...
    (I've looked but haven't found a solution in help files or sample programs.)


    I would like to color the background of more than one NtkTBrowse rows when the customer is the same as the one in the selected cell. Then, clear the colors when the selected cell changes.


    I am calling my function like this:



    oCol[X]:bgColor := {|| mysetbgcolor( oB_WB ) }





    FUNCTION mysetbgcolor( oB_WB )
    LOCAL bgcolor
    LOCAL aCellData := oB_WB:getCellData() // getCellData(nRow,nCol) -> {xData , Picture}
    LOCAL xCellvalue // cell content

    xCellValue := aCellData[1] // content of cell curently being given color to be compared with selected cell customer

    bgcolor := {|| IIF((oB_WB:alias)->customer == xCellvalue, NTK_RGB(255,0,0), ntk_rgb(0,0,255)) }

    RETURN bgcolor




    This function not working. It's colouring the complete column (not the ones where customer = selected cell customer). I guess (oB_WB:alias)->customer is looking at the cell being painted not the cell which is selected.

    Can I use oB_WB: nCurRec???

    I look forward to your useful guidance
    Thanks
    Al

    Oh. how do you guys paste your code into this forum the way you do???
    •  
      CommentAuthorAbbougaga
    • CommentTimeDec 1st 2010 edited
     
    Hi Al,

    Before all, try with RETURN EVAL(bgcolor).
    Well, I'm not sure but using the 'selectBlock' property could help solving the problem exposed.

    Ab

    Oh. how do you guys paste your code into this forum the way you do???

    really easy! just insert your code snippet between [code] tags like this:
    [code lang="xbase"]
    // your code here
    [/code]

    Learn more reading the 'Good to know' sticky thread:
    http://www.ntkproject.com/forum_ntk/comments.php?DiscussionID=2&page=1#Item_1
    •  
      CommentAuthoral660130
    • CommentTimeDec 31st 2010
     
    Hi all,

    December 2010 has been a good learning period and lots of progress has been made (99% thanks to JN).

    I am now developing a user interface using the powerful NtkTBrowse class for one module of the project, which is called 'workbook' (WB).

    1. I am doing quite a lot of database interrogation when a cell is selected (in-order to change background colours etc..)
    Unfortunately this makes scroll bar movements slow (when bigger databases are viewed).
    Is there any way to avoid changing selected cell (i.e. freeze selection) when a scroll bar movement is undertaken.... So we only change cell selection with a mouse click or arrow movement??

    2. WB database is shared by several users. Some users would like to view different groups within the database.
    Setting-up stared index files with numerous filter-on configurations will be too complicated!
    I would like to either set individual NTKBrowse row heights (0 = hide data) or else use a logical array which tells NtkTBrowse if a row is visible....... is this possible??


    Happy new year and best wishes for 2011.

    Al
    •  
      CommentAuthoral660130
    • CommentTimeJan 4th 2011 edited
     
    Ab - are you there?

    We have used your very nice PROMPMNU contribution in our new app (thanks 4 this).

    Unfortunately, however, I have a bug which is proving difficult to fix.

    In my small (4 choice) menu using PROMPMNU on the second, and then every subsequent, click of item 3 I receive value = 0, insted of 3.

    Jn finds the same result. So, I've looked at your source and added a message within your __MenuToBeforeEvent function, successfully verifying this eronious zero.


    I'd like to delve some more however the content of aPromptList is very complicated.

    Can you help me with some de-buging advice?

    cheers
    Al
    •  
      CommentAuthorAbbougaga
    • CommentTimeJan 5th 2011
     
    To all: Happy new year and best wishes, too!


    To Al:

    It's always a pleasure to hear that my small contribution to NTK-Project is useful for someone :bigsmile:

    Yes, I'm aware of this problem. Jn sent me a private e-mail a few days ago. As I told him I can't work on this for now, because I'm very busy with my job at my company. But don't worry, I will probe the PromptMenu source code as soon as possible.

    Cheers,
    Ab
    •  
      CommentAuthorAbbougaga
    • CommentTimeJan 5th 2011 edited
     
    Al,
    Finally I found time to indentify the tiny bug. The needed correction has been made.
    Feel free to download my new Promptmnu's files v1.03 below.
    enjoy!


    To Jn: Many thanks for the clues :wink:

    To all:
    For those who are interested in the complete package (source+examples), I will upload a new update to my personal webpage in the next few days.

    direct access from the 'NTK - Knowledge' section:
    http://www.ntkproject.com/forum_ntk/comments.php?DiscussionID=7&page=1#Item_1


    Cheers,
    Ab
    •  
      CommentAuthoral660130
    • CommentTimeFeb 19th 2011 edited
     
    Hi guys

    I've got a quickie - ( Jn knows what this means ;-) )


    My daybook app displays a single list of drivers using NtkTBrowse.
    (This is works well)

    However, I'm trying to expand this to show up to 3 columns(one at a time)... (Switching the viewed by clicking column heading).


    I've added two more colums to make the tbrowse hold three
    and I've set nubHeadBlock to call a function to (hopefuly) change the selected cell.
    This works, but only when all three colmns are small enough to be visable!!

    The moment I widen any column to show only 1 visable, moving to the next column, using oB:right(), gets stuck!!



    My thought, to make this work and keep all three columns visable, is to use "oB:SetColWidth" and to make unselected columns very narrow.



    I tried calling oB:SetColumnWidth( nColPos, nWidth)

    but every time I get an error saying:

    Variable does not exist: OBRW
    Called from NTKTBROWSE:SETCOLWIDTH(2494)


    Does anyone have any suggestions of how I can overcome this or a better way to fulfil what I'm trying to do her??


    (also Ab & Jn, this version of PrompMnu works great - thanks)


    A+
    Al


    code lang="xbase"
    STATIC FUNCTION OnClickSwitchColumn(oB)
    LOCAL nThisCol := oB:ColPos

    // make all three narrow so visable
    oB:SetColWidth( 1, 2)
    oB:SetColWidth( 2, 2)
    oB:SetColWidth( 3, 2)

    oB:Configure()
    oB:RefreshAll()

    // move selected column right (or back to 1)and widen selected column
    If nThiscol >= 03
    oB:Panhome()
    oB:SetColWidth( 1, 22)
    Else
    oB:Right()
    oB:SetColWidth( nThiscol+1, 22)
    EndIf

    oB:Configure()
    oB:RefreshAll()

    RETURN(Nil)
    /code
    •  
      CommentAuthoral660130
    • CommentTimeFeb 19th 2011 edited
     
    Ab -
    Pasting code between code tags didn't work 4me
    (I tried with square brackets too)
    ....?
    :cry:
    •  
      CommentAuthorAbbougaga
    • CommentTimeFeb 21st 2011
     
    Hi Al,

    hmmm sounds like the oBRW var used to intialize your Tbrowse object is not existing anymore when you invoke the setcolwidth() method? Did you try to declare oBRW Static or Private?

    regards,
    Ab





    It works fine for me.
    STATIC FUNCTION OnClickSwitchColumn(oB)
    LOCAL nThisCol := oB:ColPos
    
    // some code here . . .
    
    RETURN(Nil)
    


    I think you forgot to check the 'SyntaxHighlighter' option in place of default 'Html' option.
    •  
      CommentAuthoral660130
    • CommentTimeFeb 21st 2011
     
    Hi Ab,

    Thanks for your thoughts (I'm pissed that I can't make code samples look like yours:shamed:)

    Re: setcolwidth. I've tried declaring 'oBRW' locally (it wasn't before).

    Eventually, when declared PRIVATE, the error generated changes to:

    "Variable does not exist: NCOLEMUL"


    I have searched around other contrib code but can't find an example being used.
    So, I'm 'none-the-wiser' upon how to configure it successfully...

    Perhaps I just need to build three NtkTBrowse objects (on top of each other) to be able to switch between lists as I'd like the app to work??

    Maybe I'll ask Jn to give me a clue. Although, I have been pestering him lots (to get where I am [thanks Jn]) So, I think he deseves for me to just 'read-up' and get on with things...

    Bye
    Al
    •  
      CommentAuthoral660130
    • CommentTimeFeb 21st 2011 edited
     
    For i := 1 to 10
       ? i
    NEXT
    
    •  
      CommentAuthoral660130
    • CommentTimeFeb 21st 2011
     
    Oh Ab...
    ok!!! it was just exactly as you said
    •  
      CommentAuthorjnd
    • CommentTimeFeb 21st 2011 edited
     
    Hi Guys!

    Please, *** do not search anymore for this mysterious 'oBRW' variable!***
    This is my mistake - I forgot to remove or comment a couple lines of testing code last time I made improvements in NTKBRWSE.LIB.
    I'm a little bit confuse.:shamed: So, I apologise for the inconvenient.

    However, the issue is now fixed - the ::SetColWidth() method is working fine again!
    Feel free to connect to the NTKWIP space, a new fixed NTKBRWSE.LIB is available for download.

    Also, take advantage of this slight counter-time for downloading the whole update (libs+includes). Do not hesitate to glance at [http://www.ntkproject.com/ntkwip/lastestversion/changelog.txt] in order to learn more about lastest NTK-Pro fixes and improvements.

    Kind regards,
    JN
    •  
      CommentAuthoral660130
    • CommentTimeFeb 22nd 2011 edited
     
    :bigsmile::bigsmile:

     
    FUNCTION OnClickSwitchColumn(oB)
    
    oB:MoveColumn( 3, 1)
    oB:Configure()
    
    RETURN(Nil)
    


    this simple 'two liner' does exactly what I was trying to do

    I thought it would be slow... No. It's good:wink:
    •  
      CommentAuthoral660130
    • CommentTimeApr 4th 2011 edited
     
    Hi Guys,

    Can anyone provide me with the detail of the specification of array: 'aCellData', (returned by oB:getcelldata())?

    I'd like to detect the presence of :Bitmap in the cell....

    thanks
    Alastair