Turbo C Context File SQUARES.DEF VIEW.C SQUARES.C SFRAME.C METAVIEW.C MAIN.C GLUE.C WINIVWIN.LIB WINIV.LIB SQUARES\*.* INTERVIE\*.H A:\LIB\*.C ::nviews nviews inline SetPattern lword d:\modulex SQUARES\VIEW.C SQUARES\SFRAME.C SQUARES\METAVIEW.C SQUARES\SQUARES.C SQUARES\MAIN.C MAIN.C VIEW.C SFRAME.C METAVIEW.C SQUARES.C SQUARES.DEF WINIV.LIB WINIVWIN.LIB ffblk arraya strlen arrayb D:\BORLANDC\IV\SQUARES\METAVIEW.C A:\LIB\XPAINTER.C D:\BORLANDC\IV\PAINTERR.C D:\BORLANDC\IV\WPAINTER.C D:\BORLANDC\IV\PANNER.C D:\BORLANDC\IV\CONTROL.C A:\LIB\XPAINTER.C D:\BORLANDC\IV\PAINTERR.C D:\BORLANDC\IV\EXAMPLES\SQUARES\SQUARES.DEF D:\BORLANDC\IV\PAINTERR.C D:\BORLANDC\IV\WINTER.C D:\BORLANDC\IV\WPAINTER.C D:\BORLANDC\IV\PANNER.C D:\BORLANDC\IV\EXAMPLES\SQUARES\MAIN.C D:\BORLANDC\IV\EXAMPLES\SQUARES\METAVIEW.C pu findstr(wrk,inter,FotName); DispOneFoto(FotName); freestrlst(&inter); } /* } while((res = ask_mess("back to form?")) != 0);*/ for (wrk = 0;wrk < N_OF_ITEMS;wrk++) free((void *)vals[wrk]); static int fot_sho(int mode,int Opt) char *err ="Documents not found in fot_sho"; /* 0 */ int rc; clrscr(); $get foto record; if (info.error_status) { err_mess(err); return 1; } else { switch (Opt) case 0: ShowForm(mode); break; case 1: ShowText(); break; case 2: ShowPicture(); break; case 3: ShowForm(mode); ShowText(); ShowPicture(); break; case 4: ShowPicture(); ShowText(); break; case 5:/******** documented picure *********/ break; }/************ End of Switch *******/ return 0; } static int fot_sho(int mode,int Opt) static char *err ="Documents not found in fot_sho"; /* 0 */ int rc; clrscr(); $get foto record; if (info.error_status) { err_mess(err); return 1; } else { switch (Opt) { case 0: ShowForm(mode); break; case 1: ShowText(); break; case 2: ShowPicture(); break; case 3: ShowForm(mode); ShowText(); ShowPicture(); break; case 4: ShowPicture(); ShowText(); break; case 5:/******** documented picure *********/ break; }/************ End of Switch *******/ } return 1; void ShowForm(int mode) /* This function is used for creating the form and displaying it on screen*/ static char bn[5], ft[2], et[3], sw[61]; static char *list[10]; int qty,ind = 0; $find current of foto record; $get foto record; $find owner of mak_fots set; if ( info.error_status ) { err_mess("Owner of photo not found"); return; /* ------------------------------------------- */ $get maker record; list[ind] = (char *)calloc(sizeof(maker.mak_name),sizeof(char)); strcpy(list[ind++],maker.mak_name); /* ------------------------------------------- */ itoa(foto.fot_numb,bn,10); list[ind] = (char *)calloc(sizeof(bn),sizeof(char)); strcpy(list[ind++],bn); /* ------------------------------------------- */ setmem(ft, sizeof(ft), '\0'); ft[0] = foto.fot_type; list[ind] = (char *)calloc(sizeof(ft),sizeof(char)); strcpy(list[ind++],ft); /* ------------------------------------------- */ $find owner of dat_fots record; $get date record; if ((date.dat_num > 0) && (date.dat_num < 32)) { setmem(bn,sizeof(bn),'\0'); itoa(date.dat_num,bn); list[ind] = (char *)calloc(strlen(bn),sizeof(char)); strcpy(list[ind++],bn); } else list[ind++] = NULL; $find owner of mon_dats record; $get month record; if ((month.mon_num > 0) && (month.mon_num < 13)) { setmem(bn,sizeof(bn),'\0'); itoa(month.mon_num,bn); list[ind] = (char *)calloc(strlen(bn),sizeof(char)); strcpy(list[ind++],bn); } else list[ind++] = NULL; $find owner of yer_mons record; $get year record; list[ind] = (char *)calloc(strlen(year.yer_num),sizeof(char)); strcpy(list[ind++],year.yer_num); /* ------------------------------------------- */ setmem(class2.cl2_full, 6, '\0'); $find owner of cl2_fots set; $get class2; list[ind] = (char *)calloc(strlen(class2.cl2_full),sizeof(char)); strcpy(list[ind++],class2.cl2_full); /* ------------------------------------------- */ $find owner of pl3_fots set; $get place3 record; $find owner of pl2_pl3s set; $get place2 record; $find owner of pl1_pl2s set; $get place1 record; setmem(et,sizeof(et),'\0'); itoa(place1.pl1_code, et, 10); list[ind] = (char *)calloc(sizeof(et),sizeof(char)); strcpy(list[ind++],et); list[ind] = (char *)calloc(strlen(place2.pl2_name),sizeof(char)); strcpy(list[ind++],place2.pl2_name); list[ind] = (char *)calloc(strlen(place3.pl3_name),sizeof(char)); strcpy(list[ind++],place3.pl3_name); /* ------------------------------------------- */ setmem(sw, sizeof(sw), '\0'); $find first keylink of fot_keys set; while (!info.error_status) { $find owner of key_fots set; $get keyword; strcat(sw, keyword.txt_srch); strcat(sw, " "); $find next keylink of fot_keys set; list[ind] = (char *)calloc(strlen(sw),sizeof(char)); strcpy(list[ind++],sw); #include "d:\infotemp\foto.h" void edform(char *list[N_OF_ITEMS],int attr[],int qty,formtype type) colorpak maincolors = {2,52,52,53,79,112}; /* static char *list[N_OF_ITEMS]; to store all the attributes */ wptr wp[14]; constvals items[N_OF_ITEMS] = {NULL,"PHOTOGRAPHER NAME", "mak_name",20,23,compulsory,typein,5,3,string}, /* 0 */ {NULL,"No.","fot_numb",5,10,compulsory,typein,34,3,digchk}, /* 1 */ {NULL,"Type","fot_type",2,6,optional,typein,46,3,digital}, /* 2 */ {NULL,"YY","fot_dyer",3,6,optional,typein,56,3,digital}, /* 3 */ {NULL,"MM","fot_dmon",3,6,optional,typein,62,3,digital}, /* 4 */ {NULL,"DD","fot_ddat",3,6,optional,typein,68,3,digital}, /* 5 */ {NULL,"PHOTO NAME","fot_name",38,45,compulsory,typein,5,7,strchk}, /* 6 */ {NULL,"CLASS. CODE","cl2_full",6,15,compulsory,help,60,7,strchk}, /* 7 */ {NULL,"CONTINENT","pl1_code",3,20,optional,help,5,11,digital}, /* 8 */ {NULL,"COUNTRY NAME","pl2_name",20,25,optional,typein,25,11,string}, /* 9 */ {NULL,"CITY NAME","pl3_name",20,25,optional,typein,50,11,string}, /* 10 */ {NULL,"KEY WORDS","txt_srch",64,70,optional,typein,5,15,string}, /* 11 */ {NULL,"PICT. FILE NAME","fot_pict",20,35,compulsory,dirhelp,5,19,string}, /* 12 */ {NULL,"TEXT FILE NAME","fot_text",20,35,optional,dirhelp,40,19,string} /* 13 */ unsigned int i; char name[F_WIDTH]; clrscr(); /*---------------------------------------------------------*/ for (i = 0;i < qty;i++) { items[attr[i]].content = list[attr[i]]; popupwindow(items[attr[i]].x,items[attr[i]].y,items[attr[i]].winwd,1,items[attr[i]].header,overlap,&maincolors,&wp[i]); /*---------------------------------------------------------*/ if (type == document) { for (i = 0; i < qty, i++) { selectwindow(wp[i]); putstratr(0,0,items[atrnum[i]].content,15,items[atrnum[i]].width); } getch(); rmvwindow(&wp[0]); /*---------------------------------------------------------*/ if (type == search) { for (i = 0; i < N_OF_ITEMS; i++) { strcpy(items[attr[i]].content,""); } /*---------------------------------------------------------*/ goaround(wp,items,attr,qty,type ); /*---------------------------------------------------------*/ rmvwindow(&wp[0]); for (i = 0;i < qty; i++) { printf("list[%d] = %s\n",attr[i],items[attr[i]].content); void goaround(wptr w[],constvals items[],int atrnum[],int qty,formtype type) goaround edits a certain form. It moves from one edit field to another until F10 is pressed. TAB key moves the cursor form one window to another in a cyclic fashion. The cursor shows the active window. Returns the return code. (see smenu.h) parameters: w - pointer to the array of window structures outlist[]- pointer to the array of attributes qty - amount of fields to be entered unsigned char i,retkey; char selatr = ACTIVE_ATTR,norm,*mkname; norm = w[0]->wndatr; selectwindow(w[0]); /*---------------------------------------------------------------------------*/ /* filling the form */ i = 0; do { w[i]->wndatr = selatr; selectwindow(w[i]); prthz(0,0,"",w[i]->wndatr,items[atrnum[i]].width); retkey = getfield(w[i],items[atrnum[i]].content,items[atrnum[i]].width); if ((retkey == F1_PRESSED)) { disphelp(items,atrnum,i,0); } if ( (type == search) && (i == (qty - 1)) ) break; /*-----------------------------------------------------------------------*/ if (( retkey == TAB_PRESSED ) || (retkey == 1) || (retkey == F10_PRESSED)) { w[i]->wndatr = norm; prthz(0,0," ",norm,w[i]->xw-2); putstratr(0,0,items[atrnum[i]].content,norm,items[atrnum[i]].width); if (i == (qty - 1)) i = 0; else i++; } } while (retkey != F10_PRESSED); /*-----------------------------------------------------------------------*/ /* checking the entered values */ if (type == store) { for (i = 0;i < qty;i++) { while ((items[atrnum[i]].status == compulsory) && (!strcmp(items[atrnum[i]].content,""))) { disphelp(items,atrnum,i,1); repeat(items,atrnum,i,w); while ((strcmp(items[atrnum[i]].content,"")) && ((items[atrnum[i]].value == digital)||(items[atrnum[i]].value == digchk)) && (num_str(items[atrnum[i]].content) == 0)) { disphelp(items,atrnum,i,2); repeat(items,atrnum,i,w); do { if (items[atrnum[i]].value != digchk) break; if (strcmp(items[atrnum[i]].codname,"fot_numb") == 0) { if (chknumb(items[atrnum[i]].content,items[0].content)) break; } if (!(strcmp(items[atrnum[i]].content,"")) && ((strcmp(items[atrnum[i]].codname,"fot_type") == 0))) if ((items[atrnum[i]].content[1] == '1') ||(items[atrnum[i]].content[1] == '2') ||(items[atrnum[i]].content[1] == '3') ||(items[atrnum[i]].content[1] == '4')) break; disphelp(items,atrnum,i,3); repeat(items,atrnum,i,w); } while (1); do { if (items[atrnum[i]].value != strchk) break; if (strcmp(items[atrnum[i]].codname,"fot_name") == 0) { if (!chkname(items[atrnum[i]].content)) break; } if (strcmp(items[atrnum[i]].codname,"cl2_full") == 0) { if (chkclass(items[atrnum[i]].content)) break; } disphelp(items,atrnum,i,4); repeat(items,atrnum,i,w); } while (1); char repeat(constvals items[],int atrnum[],int i,wptr w[]) int retkey; unsigned char atrb = 95; selectwindow(w[atrnum[i]]); prthz(0,0,"",atrb,items[atrnum[i]].width); do { retkey = getfield(w[atrnum[i]],items[atrnum[i]].content,items[atrnum[i]].width); if (retkey == F1_PRESSED) { disphelp(items,atrnum,i,0); } while (retkey != 1); prthz(0,0," ",w[atrnum[i]]->wndatr,w[atrnum[i]]->xw-2); putstratr(0,0,items[atrnum[i]].content,w[atrnum[i]]->wndatr,items[atrnum[i]].width); return 1; char getfield(wptr wp1,char attr[],int width) This function fetches the field and binds it with attr the field width is windows width MINUS 3. Returns 0 if nothing is entered. parameters: wp1 - pointer to the window attr[] - pointer to attribute char c,winx=0,winy=0; char letcount = 0,i; int key,done,ins; setcursor(12,13); done = FALSE; ins = INS_ON; if (strcmp(attr,"") != NULL) { /* The string is not empty */ letcount = strlen(attr); putstratr(0,0,attr,wp1->wndatr,letcount); winx = letcount; gotoxy(winx,winy); c = getkey(&key); if ((isprint(c)) &&(key != TAB)) { setmem(attr,width,'\0'); prthz(0,0," ",wp1->wndatr,width); letcount = 0; winx = 0; winy = 0; gotoxy(winx,winy); } } else { gotoxy(winx,winy); c = getkey(&key); } while(!done) { switch (key) { case L_ARROW: if ((winx > 0) && (winy == 0)) winx--; break; case R_ARROW: if ((winx < width) && (winy == 0) && (winx < letcount)) winx++; break; case BKSP: if ((winx > 0) && (winy == 0) && (letcount > 0) && (winx <= letcount)) { for (i=winx-1;(i < letcount);i++) attr[i] = attr[i+1]; attr[letcount--] = '\0'; prthz(0,0," ",0,width); putstratr(0,0,attr,wp1->wndatr,letcount); if ( winx > 0) winx--; } break; case DEL : if ((winx >= 0) && (winy == 0) && (letcount > 0) && (winx < letcount)) { for (i=winx;(i < letcount);i++) attr[i] = attr[i+1]; attr[letcount--] = '\0'; prthz(0,0," ",0,width); putstratr(0,0,attr,wp1->wndatr,letcount); } break; case INS: if (ins) { ins = INS_OFF; setcursor(4,13); } else { ins = INS_ON; setcursor(12,13); } break; case UP_ARROW: case HOME: winx = 0; break; case DN_ARROW: case END: winx = letcount; break; case RET: done = TRUE; gotoxy(0,0); attr[letcount] = '\0'; if (letcount == 0) return 0; else return 1; case TAB: return TAB_PRESSED; /* tab key pressed */ case F10: return F10_PRESSED; case F1: return F1_PRESSED; default: if ((isprint(c)) && (winx <= letcount) && (letcount < width)) { if ((ins) && (letcount != 0)) { if ((winx != letcount) && (letcount < (width-1) )) { for (i = letcount;(i > winx);i--) { attr[i] = attr[i-1]; putchatr(i,winy,attr[i],wp1->wndatr); } attr[i] = c; putchatr(winx,winy,attr[i],wp1->wndatr); winx++; letcount++; break; } } if ((winx<=letcount)&&(winx < (width - 1))) { putchatr(winx,winy,c,wp1->wndatr); attr[winx++] = c; } if ((winx == letcount + 1) && (letcount < (width - 1))) letcount++; if (letcount == (width - 1)) { ins = INS_OFF; setcursor(4,13); } } gotoxy(winx,winy); c = getkey(&key); } if (letcount == 0) return 0; else return 1; void disphelp(constvals items[],int atrnum[],int i,int how) colorpak hlpclrs = {2,53,75,53,95,117}; wptr hw; char *fn; char *msg[4] ={"type in characters", "Filling OBLIGATORY", "only DIGITS", "NOT FOUND IN DATABASE" if (how == 0) { switch (items[atrnum[i]].message) { case typein: popupwindow(items[atrnum[i]].x,items[atrnum[i]].y+2,30,4,"help",overlap,&hlpclrs,&hw); putstratr(0,0,msg[how],hw->wndatr,hw->xw-2); putstratr(0,1,"press any key",hw->wndatr,hw->xw-2); getch(); rmvwindow(&hw); break; case help: if ((strcmp(items[atrnum[i]].codname,"cl2_full")) == 0) { clhelp(1,items[atrnum[i]].content); } else { clhelp(2,items[atrnum[i]].content); } break; case dirhelp: if (strcmp(items[atrnum[i]].codname,"fot_pict") == 0) { fn = getdir("*.hbv","choose any file",142); strncpy(items[atrnum[i]].content,fn,items[atrnum[i]].width-1); } else { fn = getdir("*.txt","choose any file",142); strncpy(items[atrnum[i]].content,fn,items[atrnum[i]].width-1); } break; } else { popupwindow(items[atrnum[i]].x,items[atrnum[i]].y+2,30,4,"help",overlap,&hlpclrs,&hw); putstratr(0,0,msg[how],hw->wndatr,hw->xw-2); putstratr(0,1,"press any key",hw->wndatr,hw->xw-2); getch(); rmvwindow(&hw); int clhelp(int type,char *cl) cl1menu creates classificator code 1 menu, when the user chooses one option, it returns the code, so the program which calls generates the second list corresponding to the chosen option. returns 0 if nothing is chosen parameters: type - whether it is for pl1 or cl2_full cl - in pointer to items.content char *help1 = "MOUNTAINS/SEAS/LAKES/RIVERS"; char *help2 = "PALACES/CATHEDRALS/HOUSES/STREETS"; char *help3 = "EXHIBITIONS/HALLS"; colorpak maincolors = {2,25,25,47,91,112}; strlist sl1,sl2; menudesc cl1,cl2; char buf[4],*cn; if ((type !=1) && (type !=2)) return 0; setmem(buf,4,'\0'); setcursor(0,0); if (type == 1) { sl1 = stol("LANDSCAPES/CITIES/MUSEUMS",0); popupmenu(45,7,1,3,sl1->hn.maxlen,sl1,"CL1",&cl1,&maincolors); else { sl1 = stol("EUROPE/N_AMERICA/S_AMERICA/ASIA/AFRICA/AUSTRALIA_OCEANIA",0); popupmenu(8,13,1,3,sl1->hn.maxlen,sl1,"CL1",&cl1,&maincolors); movearound(&cl1); cn = itoa(cl1.ans,buf,10); strncpy(cl,cn,2); rmvmenu(&cl1); return 1; movearound(&cl1); if (cl1.rcode == abortit) { rmvmenu(&cl1); return(0); switch (cl1.ans) { case 1: sl2 =stol(help1,0); break; case 2: sl2 =stol(help2,0); break; case 3: sl2 =stol(help3,0); break; popupmenu(45+sl1->hn.maxlen,MAX(sl1->hn.numelem+cl1.ans,9),1, MIN(sl2->hn.numelem,10),sl2->hn.maxlen,sl2,"CL2",&cl2,&maincolors); movearound(&cl2); if (cl2.rcode == abortit) { rmvmenu(&cl2); rmvmenu(&cl1); return 0; cn = itoa(cl1.ans,buf,10); strcpy(cl,cn); strcat(cl,"."); cn = itoa(cl2.ans,buf,10); strcat(cl,cn); rmvmenu(&cl2); rmvmenu(&cl1); return 1; int num_str(char *str) char *cp; cp = str; do { if (!isdigit(*cp)) return 0; } while(*++cp); return 1; /*void getstr(strlist strl,strlist *strl2) strlist tl,st = NULL; int key = 1; if (strl != NULL) { tl = strl->hn.first; while (tl != NULL) { appendstrlst(tl->dn.elem.data,0,key++,&st); printf("list in getstr\n"); prtstrlst(strl); prtstrlst(st); getch(); tl = tl->dn.next; } *strl2 = st; } */ char findstr(int key,strlist strl,char foto[]) strlist tl; if (strl != NULL) { tl = strl->hn.first; while (tl != NULL) { if (tl->dn.elem.key == key) { strcpy(foto,tl->dn.elem.data); return 1; } tl = tl->dn.next; } return 0; int crform(int attr[],char formname[]) formcreate function creates a form and stores it in the data base returns the number of attributes if entered otherwise 0. parameters: formname - pointer to name of the form *list[9] - pointer to the list of form attributes colorpak maincolors = {2,52,52,53,79,112}; char *Attrs = "PHOTOGRAPHER NAME/YEAR/MONTH/DATE/PHOTO NAME/CLASS.CODE/CONT.NAME/COUNTRY/CITY/KEY WORDS/END FORMATION"; strlist s1; /* string list for the form attributes*/ wptr wfname; /* window for the form name */ unsigned char count = 0; /* This counts the number of choices*/ int i,cont,ans,done; /* listmem[9] is for match form */ clrscr(); cont = TRUE; popupwindow(-1,-1,30,1,"FORM NAME",overlap,&maincolors,&wfname); if (getfield(wfname,formname,F_WIDTH) == 0) { rmvwindow(&wfname); return 0; rmvwindow(&wfname); do { s1 = stol(Attrs,0); if ((ans = formselect(s1,"Form Names")) == 0) break; else if (ans != 11) { if (count > 0) { done = FALSE; for (i = 0; i < count ;i++) { if ((attr[i] == ans + 1) || ((attr[i]) == 0) && (ans == 1)) done = TRUE; if (done == FALSE) { if (ans == 1) attr[count++] = ans -1; else attr[count++] = ans + 1; else beep(); } else { if (ans == 1) attr[count++] = ans - 1; else attr[count++] = ans + 1; } } else cont = FALSE; } while((count < 11) && (cont == TRUE)); setcursor(12,13); return count; int formselect(strlist sl,char *Title) formselect returns one choice (attribute) chosen by the user. It returns 0 if exit or ESC is pressed, otherwise the choice parameters: sl - pointer to the string list choice - pointer to string (chosen item) menudesc fcreate; /* menu for the user to enter the form name*/ colorpak maincolors = {2,52,52,53,79,112}; setcursor(0,0); popupmenu(25,5,1,10,sl->hn.maxlen,sl,Title,&fcreate,&maincolors); movearound(&fcreate); rmvmenu(&fcreate); setcursor(12,13); if (fcreate.rcode == abortit) return 0; else return fcreate.ans; int select(strlist sl,char *Title) select returns one choice (attribute) chosen by the user. It returns 0 if exit or ESC is pressed, otherwise the choice NOTE: select does NOT delete the string list parameters: sl - pointer to the string list choice - pointer to string (chosen item) menudesc fcreate; /* menu for the user to enter the form name*/ colorpak maincolors = {2,52,52,53,79,112}; setcursor(0,0); popupmenu(25,5,1,10,sl->hn.maxlen,sl,Title,&fcreate,&maincolors); movearound(&fcreate); rmvwindow(&(fcreate.w)); setcursor(12,13); if (fcreate.rcode == abortit) return 0; else return fcreate.ans; int ChooseMainMenu(void) strlist sl; char *menu1 = "STORE DOCUMENT/SELECT DOCUMENT/STORE FORM/STORE LINKS/"; char *menu2 = "STORE ROUTE/SELECT ROUTE/SERVICE FUNCTIONS/EXIT PROGRAM"; char *menuitems; clrscr(); menuitems = (char *)calloc((strlen(menu1)+strlen(menu2)+1),sizeof(char)); strcpy(menuitems,menu1); strcat(menuitems,menu2); sl = stol(menuitems,0); free((void *)menuitems); return (formselect(sl,"Main menu")); void DispOneFoto(char *Foto) fot_sho(0); printf("Photo = %s\n",Foto); getch(); void sto_rou(void) unsigned int Mode = 3,fotnum,key = 1; char RouName[20],fname[38]; char *menu = "ENTER NEW PHOTO/SEE PHOTOS/END ROUTE"; strlst sl = NULL,fotlist = NULL; wptr rwin; setmem(RouName,sizeof(route.rou_name),'\0'); popup(); if (!getfield(rwinf,RouName,sizeof(route.rou_name))) { rmvwindow(&rwin); return; } rmvwindow(&rwin); setmem(route.rou_name,sizeof(route.rou_name),'\0'); strcpy( route.rou_name,RouName ); $find route record using rou_key key; if (!info.error_status) { err_mess("Such a Route Exists"); return; } setmem(route.rou_name, sizeof(route.rou_name), '\0'); strcpy( route.rou_name,RouName ); strupr( route.rou_name ); $store route record; if (info.error_status) { err_mess("Not Possible to store this route in sto_rou"); printf("info.err_status = %d\n",info.error_status); getch(); return; sl = stol(menu); Mode = select(sl,"Route Creation"); do { switch (Mode) { case 1: popupwin(); setmem(fname,sizeof(foto.fot_name),'\0'); if (!getfield(rwin,fname,sizeof(foto.fot_name))) break; if (!chkname(fname)) { err_mess("No such photo"); break; } appendstrlst(fname,0,key++,&fotlist); setmem(foto.fot_name,sizeof(foto.fot_name),'\0'); strcpy(foto.fot_name,fname); $find foto record using fot_key key; if ( info.error_status ) { printf("info.err_status = %d\n",info.error_status); getch(); return; } $store roulink; if ( info.error_status ) { printf("cannot store the roulink for %s photo",foto.fot_name); printf("info.err_status = %d\n",info.error_status); getch(); return; } break; case 2: if (fotlist != NULL) { fotnum = select(fotlist,RouName); setmem(fname,sizeof(foto.fot_name),'\0'); findstr(fotnum,fotlist,fname); DispOneFoto(fname); } else err_mess("Nothing to show"); break; } } while (Mode != 3); void sel_rou(void) unsigned int option; char RouName[20]; option=DispRouMenu(); if (option ==0) { setmem(RouName,sizeof(route.rou_name),'\0'); setmem( route.rou_name,sizeof(route.rou_name),'\0' ); GetRouteName(RouName); strcpy( route.rou_name,RouName ); $find route record using rou_key key; if ( info.error_status ) { err_mess("No such Route available in Data Base "); return; } $get route record; $find first roulink record of rou_links set; if ( info.error_status ) { err_mess("NO PHOTOS AVAILABLE"); return; } while ( !info.error_status ) { $find owner of links_fots set; if ( info.error_status ) { err_mess("NO PHOTOS AVAILABLE"); return; } fot_sho(1,Opt); $find next roulink record of rou_links set; void goaround(wptr w[],constvals items[],int atrnum[],int qty,formtype type) goaround edits a certain form. It moves from one edit field to another until F10 is pressed. TAB key moves the cursor form one window to another in a cyclic fashion. The cursor shows the active window. Returns the return code. (see smenu.h) parameters: w - pointer to the array of window structures outlist[]- pointer to the array of attributes qty - amount of fields to be entered unsigned char i,retkey; char selatr = ACTIVE_ATTR,norm,*mkname; norm = w[0]->wndatr; selectwindow(w[0]); /*---------------------------------------------------------------------------*/ /* filling the form */ i = 0; do { w[i]->wndatr = selatr; selectwindow(w[i]); prthz(0,0,"",w[i]->wndatr,items[atrnum[i]].width); retkey = getfield(w[i],items[atrnum[i]].content,items[atrnum[i]].width); if ((retkey == F1_PRESSED)) { disphelp(items,atrnum,i,0); } if ( (type == search) && (i == (qty - 1)) ) break; /*-----------------------------------------------------------------------*/ if (( retkey == TAB_PRESSED ) || (retkey == 1) || (retkey == F10_PRESSED)) { w[i]->wndatr = norm; prthz(0,0," ",norm,w[i]->xw-2); putstratr(0,0,items[atrnum[i]].content,norm,items[atrnum[i]].width); if (i == (qty - 1)) i = 0; else i++; } } while (retkey != F10_PRESSED); /*-----------------------------------------------------------------------*/ /* checking the entered values */ if (type == store) { for (i = 0;i < qty;i++) { while ((items[atrnum[i]].status == compulsory) && (!strcmp(items[atrnum[i]].content,""))) { disphelp(items,atrnum,i,1); repeat(items,atrnum,i,w); while ((strcmp(items[atrnum[i]].content,"")) && ((items[atrnum[i]].value == digital)||(items[atrnum[i]].value == digchk)) && (num_str(items[atrnum[i]].content) == 0)) { disphelp(items,atrnum,i,2); repeat(items,atrnum,i,w); do { if (items[atrnum[i]].value != digchk) break; if (strcmp(items[atrnum[i]].codname,"fot_numb") == 0) { if (chknumb(items[atrnum[i]].content,items[0].content)) break; } if (!(strcmp(items[atrnum[i]].content,"")) && ((strcmp(items[atrnum[i]].codname,"fot_type") == 0))) if ((items[atrnum[i]].content[1] == '1') ||(items[atrnum[i]].content[1] == '2') ||(items[atrnum[i]].content[1] == '3') ||(items[atrnum[i]].content[1] == '4')) break; disphelp(items,atrnum,i,3); repeat(items,atrnum,i,w); } while (1); do { if (items[atrnum[i]].value != strchk) break; if (strcmp(items[atrnum[i]].codname,"fot_name") == 0) { if (!chkname(items[atrnum[i]].content)) break; } if (strcmp(items[atrnum[i]].codname,"cl2_full") == 0) { if (chkclass(items[atrnum[i]].content)) break; } disphelp(items,atrnum,i,4); repeat(items,atrnum,i,w); } while (1); #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include rep->Get_DC(c); HDC hMemDC = CreateCompatibleDC(rep->hDC); SelectObject(hMemDC, (HBITMAP)d->Map()); HDC hMemDC1 = CreateCompatibleDC(rep->hDC); SelectObject(hMemDC1, (HBITMAP)m->Map()); BitBlt( hMemDC, 0, 0, m->Width(), m->Height(), hMemDC1, 0, 0, SRCAND ); BitBlt( rep->hDC, dx, dy, d->Width(), d->Height(), hMemDC, 0, 0, SRCAND ); DeleteDC(hMemDC1); DeleteDC(hMemDC); rep->Release_DC(c); HDC hDC = GetDC((HWND)src->id); HDC hMemDC = CreateCompatibleDC(hDC); HBITMAP hBitmap = CreateCompatibleBitmap(hDC, w, h); SelectObject(hMemDC, hBitmap); BitBlt(hMemDC, 0, 0, w, h, hDC, sx, sy, SRCCOPY); ReleaseDC((HWND)src->id, hDC); hDC = GetDC((HWND)dst->id); BitBlt(hDC, dx, dy, w, h, hMemDC, 0, 0, SRCCOPY); ReleaseDC((HWND)dst->id, hDC); DeleteDC(hMemDC); DeleteObject(hBitmap); black 0 0 0 DarkSlateGray 47 79 79 DarkSlateGrey 47 79 79 DimGray 105 105 105 DimGrey 105 105 105 SlateGray 112 128 144 SlateGrey 112 128 144 LightSlateGray 119 136 153 LightSlateGrey 119 136 153 gray 192 192 192 grey 192 192 192 "d:\\borlandc\\iv\\temp"