If you select a video file that 4D Workshop can't handle because of its size or format, the IDE could crash (as of version 4.0.2.16). At this point, it's wise to save your progress. The next order of business is to use the video widget to import a video. This line gives the names of the resources that you're storing on the uSD card. If it can't, then it will flash the error message "Drive not mounted." hndl := file_LoadImageControl("NoName1.dat", "NoName1.gci", 1) This routine checks to see if the display module can access the uSD card. This will uncomment the following two chunks of code: putstr("Mounting.\n") Right off the bat, we already know that we'll have to access some images, so we'll go ahead and remove the block comment symbols. Finally, there's an empty forever loop, which you can fill with the infinitely repeating code of your choice. Underneath the uSD stuff there's a call to gfx_Set(), which is just to set up the screen mode. Because you won't always need to pull strings, fonts, or images from the uSD, these lines are commented out by default. It looks like a lot of code for a simple framework, but, once you dive into it, you'll find that it's mostly routines related to pulling resources from the uSD card. Hndl := file_LoadImageControl("NoName1.dat", "NoName1.gci", 1) hstrings := file_Open("NoName1.txf", 'r') // Open handle to access uSD strings, uncomment if required hFontn := file_LoadImageControl("NoName1.dan", "NoName1.gcn", 1) // Open handle to access uSD fonts, uncomment if required and change n to font number dropping a and c if > 9 Uncomment the following if uSD images, fonts or strings used. var hFontx // Handle to access uSD fonts, uncomment if required and change n to font number var hstrings // Handle to access uSD strings, uncomment if required Program Skeleton 1.0 generated 10:25:58 AM Before we get ahead of ourselves, though, let's take a look at that skeleton code: #platform "uLCD-32PTU" In fact, using the ViSi editor, you can click and drag widgets onto the target device the same way you would in the Genie. This will be familiar to anyone who has used the ViSi Genie. Nifty! To the right you'll see a picture of the target device. You'll notice that there's already an outline of a program there, which was generated by 4D Workshop and includes a library specific to your target device. The large text input field is where you'll write the 4DGL code that controls the screen.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |