home *** CD-ROM | disk | FTP | other *** search
- How to modify an application to make the windows internal procedures instead
- of storing them in an external window, (.DBW), file.
-
- We will convert the "CASHCODE" tutorial database application for use as a
- common reference.
-
-
- Step 1 Convert the windows to procedures.
-
- Use the DataBoss utility "PROCWIN.EXE" that will allow you to view a ".DBW"
- file and will generate the code for the windows.
-
- Load CASHCODE.DBW then Choose "C Function" followed by "All Windows".
- You are prompted for the DOS name of the file to write the code into, enter
- CASHCODE.WF into the box provided. Now you are prompted for the base name
- for the procedures to be written, into the bow type:-- InternalWindow
- this means that you will get two functions, (as there are two windows),
- called InternalWindow1 and InternalWindow2.
-
- Now quit back to DOS.
-
-
- Step 2 Create a custom skeleton.
-
- Copy DBC.SKL to CASHCODE.SKL then make the following modifications just
- before and inside the "do_menu()" Function.
-
-
- #include "cashcode.wf" /* Include the code for the windows */
-
- void do_menu(void)
- {
- int b; /* modified from byte to int */
- uchar ctlkey;
- int err;
- string ts;
- uchar yes[2],tpic[2];
-
- set_addmember(ExitSet,AltX);
- if (initdbm()) {
- for (b = 0; b < def1.anchor; b++) swapmenu();
- strcat(strcpy(uw.wfnam,applname),".DBW");
-
- /* Generally initialize the screen and window variables */
- /**/ uw.scrmode = 25;
- /**/ backfillch = '░';
- /**/ winscr.wincolr = 31;/* High Intensity White Forground/Blue Background */
- /**/ uw.bgw = NULL; uw.bfchar = backfillch; uw.bfcolr = winscr.wincolr;
- /**/ for (b = 0; b <= MaxWins; b++) uw.wa[b] = NULL;
-
- /* Set the variables specifically for the CASHCODE example */
- /**/ uw.bgw = InternalWindow1(); /* Background window */
- /**/ mdate.m = 0; mdate.x = 24; mdate.y = 1; /* Date display */
- /**/ mtime.m = 1; mtime.x = 68; mtime.y = 2; /* Time display */
- /**/ mksta.m = 0; mksta.x = 63; mksta.y = 23; /* Key status display */
- /**/ mpath.m = 0; mpath.x = 2; mpath.y = 3; /* Path display */
- /**/ uw.wa[1] = InternalWindow2(); /* The first entry form */
- /**/ err = 0; /* Clear "Error" flag */
-
- /** err = initwin(&uw); **/ /* Comment out old initialization function */
- if (err == 0) {
-
-
- Step 3 Generate compile and run the modified application.
-
- Just follow the usual DataBoss generation steps for CASHCODE except remember
- to change the generate screen so the skeleton used is CASHCODE.SKL in place
- of DBC.SKL.
-