1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

scroll phone book (just scroll body)

Discussion in 'C++' started by imported_Isa, Aug 26, 2011.

  1. imported_Isa

    imported_Isa New Member

    Joined:
    Sep 1, 2010
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Bachelor
    Location:
    shahi(search in fb)
    Code:
    do   // scroll show name and number in phone book
    {
          // all page organize 
          gotoxy(L_P_id, 7);  
          cprintf("id        Name                          Number");
          gotoxy(L_P_id, 8);
          cprintf("-- --------------------          --------------------");
          for (int i=min_id, point= 9; i<= max_id; point++, i++)
          {
             if (take.contact[i].validity== true)
             {
                  gotoxy(L_P_id, point);       
       	      cprintf("%i",x[index].id);     
                  gotoxy(L_P_nam, point);    
       	      cprintf(x[index].name);      
        	      gotoxy(L_P_num, point);    
    	      cprintf(x[index].number);   
             }
             else i++;
          }        
          textcolor(15);                        //red backgrand
          textbackground(12);              // ** it show the selected case
          gotoxy(L_P_nam, pointer);      //write highlight backgrand
          cprintf("                                                  ");
          if (x[index].validity== true)      
         { 
                      // since i do not remove the invisible items 
                      // i most check always i wanna show that  
    		   gotoxy(L_P_nam, pointer);      //  means 
    		   cprintf(x[index].name);          //  while a case 
    		   gotoxy(L_P_num, pointer);      //  is valid 
    		   cprintf(x[index].number);        //   show it
          }
          k= getch();
          k1= char(0);
          if (!k)                          
          	   k1= getch();
          textcolor(15);                   //color change
          textbackground(11);
          gotoxy(2, pointer);              //clean list
          cprintf("                                             ");
          if ((k==char(0)) && (k1==char(80)))//DOWN  get down pointer
          {
               index++;
               if (pointer >= downlimmit)
               {
                    min_id++;
                    max_id++;
                    if (max_id> big_id)
                    {
         	      	       pointer= uplimmit;
          	               min_id= small_id;
               	       index= min_id;
                           max_id= small_id+ 14;
         	        }
         	   }
                else   pointer++;
          }
          else  if  ((k==char(0)) && (k1==char(72)))//UP   get up pointer
          {
         	   index--;
    	   if (pointer <= uplimmit)
              {
                    min_id--;
               	max_id--;
                    if (min_id< small_id)
      	     	{
    		     pointer= downlimmit;
                         max_id= big_id;
                         showid= max_id;
      	     	     min_id= big_id- 14;
         	     	}
              }
      	  else   pointer--;
          }
          else if ((k==char(13)) && (k1==char(0)))//ENTER   Edit
          {
               // add all key that you like , like this ;)
          }
          else if (k==char(8) && k1== char(0))
          if (areyou('e'))  // 'e' means  Exit
                validExit= true;
    }
    while  (!validExit);
    
     
  2. Delois

    Delois New Member

    Joined:
    Aug 6, 2011
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    Hey mate thanks for share this, it is really useful
     
  3. imported_Isa

    imported_Isa New Member

    Joined:
    Sep 1, 2010
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Bachelor
    Location:
    shahi(search in fb)
    :D
    من انگلیسیم خوب نیست فارسی میگم ، خواهش میکنم ، قابلی نداشت
    my english is not well , i say in persian : your welcom , it have not your price .
     

Share This Page