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.
#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)
1 to 3 of 3