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 SortCode(pcKode, pcField1, pcField2, pcArea, pnT, pnL, pnB, pnR) Local cReturn := Spac(Len((pcArea)->&pcField1)), nSel := 0, nJ := 0 Local aNo := {} (pcArea)->(dbGoTop()) While TRUE If (pcArea)->(dbSeek(AllTrim(pcKode))) While (AllTrim(pcKode) = SubS((pcArea)->&pcField1, 1,; Len(AllTrim(pcKode))) .and. ! (pcArea)->(Eof())) nJ++ aAdd(aNo, Spac(Len((pcArea)->&pcField1))) aNo[nJ] := AllTrim((pcArea)->&pcField1)+; " "+AllTrim((pcArea)->&pcField2) (pcArea)->(dbSkip(1)) Enddo Else Exit Endif If nJ > 20 nJ := 20 Endif nSel := ASELECT(pnT+1, pnT+1, pnT+nJ, pnR-1, aNo, .T.) If Empty(nSel) cReturn := Spac(Len((pcArea)->&pcField1)) Else cReturn := SubS(aNo[nSel], 1, 5) Endif Exit End Return(cReturn) //------------------------------------------- #xtrans SayTxt(<row>,<col>,<xpr> [,<c>]) => ; SetPos(<row>,<col>); DispOut(<xpr>[,<c>]) FUNCTION ASELECT(pnTop, pnLeft, pnBottom, pnRight, aMenu, aLog) Local oBrw, nKey, oCol, nLen, nNew, nInit, nWin, nWidth, nSub Local nRet, nAct nLen := Len( aMenu ) cWar := "n/bg,w+/br,w+/r" If ValType(aLog) != "A" // No logical array aLog := Array(nLen) // so, create one! AFill( aLog, .T. ) Endi nInit := 0 nWin := pnBottom - pnTop nWidth := pnRight - pnLeft - 1 nRet := 0 bBlk := {|| .F.} Scroll(pnTop-1, pnLeft-1, pnBottom+1, pnRight+1) DispBox(pnTop-1, pnLeft-1, pnBottom+1, pnRight+1) DispBox(pnTop, pnRight+1, pnBottom, pnRight+1, Chr(176), "w/g") SayTxt(pnTop, pnRight+1, Chr(18), "w+/r") oBrw:=TBrowseNew(pnTop, pnLeft, pnBottom, pnRight) oBrw:colorSpec := cWar nSub := 1 oBrw:goTopBlock := {|| nSub := 1 } oBrw:goBottomBlock := {|| nSub := nLen } oBrw:skipBlock := {|nI| nAct := if(Abs(nI) >= if(nI >= 0,; nLen - nSub, nSub - 1), if(nI >= 0, nLen - nSub,; 1 - nSub),nI), nSub += nAct, nAct } oCol := TBColumnNew(, {|| aMenu[nSub]}) oCol:colorBlock := {|| if(aLog[nSub], {1,2}, {1,3})} oCol:width := nWidth oBrw:addColumn(oCol) While .T. DispBegin() While !oBrw:stabilize() Enddo DispEnd() If (oBrw:hitTop .or. oBrw:hitBottom ) Tone(87.3,1) Tone(40,3.5) Endif nNew := nWin / (nLen / nSub) // Update Bar Gauge If nSub == 1 nNew := 0 Elseif nSub == nLen nNew := nWin Endif If ( nInit != nNew ) SayTxt(pnTop+nInit, pnRight+1, Chr(176), "w/g") SayTxt(pnTop+nNew, pnRight+1, Chr(18), "w+/r") nInit := nNew Endif While ((nKey := InKey(0.1)) == 0) Eval(bBlk) Enddo If ( nKey == K_DOWN ) oBrw:Down() ElseIf ( nKey == K_UP ) oBrw:Up() ElseIf ( nKey == K_PGDN ) oBrw:PageDown() ElseIf ( nKey == K_PGUP ) oBrw:PageUp() ElseIf ( nKey == K_ESC ) Exit Elseif ( nKey == K_ENTER ) If aLog[nSub] // Is the item selectable...? nRet := nSub // If so, return array subscript Exit // for the element Endif Endif Enddo Return(nRet)
PROCEDURE PRTMENU_EMPL(hWndP) LOCAL nChoix LOCAL hFontMenu := NTK_GetStockObject(ANSI_VAR_FONT) LOCAL aMenuTitle := { "- Votre Choix ? -" } LOCAL aMenuData := { "Editer la Fiche courrante ",; "Liste des employés (couleur) ",; "Liste détaillée des employés " } LOCAL aCfg := {} // array of settings to be passed to NtkArrayView() AADD( aCfg, { "sbHorz" , .F. }) AADD( aCfg, { "sbVert" , .F. }) AADD( aCfg, { "colGrids" , .F. }) AADD( aCfg, { "ShowNumbers" , .T. }) AADD( aCfg, { "NubColor" , NTK_RGB(064,064,255) }) AADD( aCfg, { "nuBAlign" , DT_RIGHT }) AADD( aCfg, { "nubWidth" , -1 }) AADD( aCfg, { "headFont" , hFontMenu }) SET RGB COLOR TEXT C_BLACK ; // Define your own blend on fly... BACKGND C_BKGMENU // Syntax: // NtkArrayView( hWnd, nTop, nLeft, nBottom, nRight, cWinTitle, aRowHeaders, aRowDatas, aRowSizes, aCfg, nWinStyle ) nChoix := NtkArrayView( hWndP, 06,68 , (06+08), (68+36),; "MENU IMPRESSION...",; aMenuTitle, aMenuData, Nil,; aCfg, WND_FIXED ) // WS_DLGFRAME ) CLEAR TYPEAHEAD IF nChoix==1 PRT_EMPL_FORM() ELSEIF nChoix==2 PRT_EMPL_LIST(2) // Liste Couleurs ELSEIF nChoix==3 PRT_EMPL_LIST(1) // Liste Détaillée ENDIF RETURN
// Do edit routine oB:doubleClick := { |oB,nMsg,nWparam,nLparam| EditCell_dgv(oB) } // Exit from the active get session (if any), when user singleclick... oB:singleClick := { |oB,nMsg,nWparam,nLparam| NtkTBAutoExitCell(oB) }
1 to 12 of 12