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.
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 )
// { "Plum", "Banana", "Apple", "Peach" } // , "Apricot" } aLbChoices := LB_RemoveItem( ID_GETLBOX6, aLbChoices, 5 ) REFRESH GET ID ID_GETLBOX6
// { "Plum", "Banana", "Coconut", "Apple", "Peach" } aLbChoices := LB_InsertItem( ID_GETLBOX6, aLbChoices, 3, "Coconut" ) REFRESH GET ID ID_GETLBOX6
. . . 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)
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 ..." ...
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. )
STATIC FUNCTION OnClickSwitchColumn(oB) LOCAL nThisCol := oB:ColPos // some code here . . . RETURN(Nil)
For i := 1 to 10 ? i NEXT
FUNCTION OnClickSwitchColumn(oB) oB:MoveColumn( 3, 1) oB:Configure() RETURN(Nil)