Пример #1
0
/*---------------------------------------------------------------------------
                               CmdMarkFind
---------------------------------------------------------------------------*/
void CmdMarkFind( WNDATTR *wndattr )
{
 LPELEM *current;
 int     offset;

    WinDlgBox( HWND_DESKTOP,
               wndattr->Client,
               FindWndProc,
               NULLHANDLE,
               ID_FINDDLG,
               NULL );

    if (strlen( FindDat.text )) {
        current = wndattr->list;
        offset = FindIt( wndattr->list, current, FNEXT );
        while (offset) {
            current = LPElemTrack( wndattr->list, current, offset );
            if (current != wndattr->list)
               LPElemMark( wndattr->list, current );
            offset = FindIt( wndattr->list, current, FNEXT );
        }
        WinInvalidateRect( wndattr->Client, NULL, TRUE );
    }

 return;
}
Пример #2
0
/*---------------------------------------------------------------------------
                                  CmdFind
---------------------------------------------------------------------------*/
void CmdFind( WNDATTR *wndattr )
{
 int offset;

    WinDlgBox( HWND_DESKTOP,
               wndattr->Client,
               FindWndProc,
               NULLHANDLE,
               ID_FINDDLG,
               NULL );

    if (strlen( FindDat.text )) {
        offset = FindIt( wndattr->list, wndattr->current, FNEXT );
        CorrectScroll( wndattr, offset );
    }

 return;
}
Пример #3
0
int main(){
int size;
printf("\nEnter size : ");
scanf("%d",&size);
TNode* testRoot=(TNode*)malloc(sizeof(TNode));
if(!testRoot){
printf("\nError\n\n");
}
testRoot->Q1=(QNode*)malloc(sizeof(QNode));
if(!testRoot->Q1){
printf("\nError");
}
testRoot->Q1->front=-1;
testRoot->Q1->rear=-1;
testRoot->Q1->capacity=size;
testRoot->Q1->Array=(int*)malloc(sizeof(int)*testRoot->Q1->capacity);
if(!testRoot->Q1->Array){
printf("\nError");
}
testRoot->Q2=(QNode*)malloc(sizeof(QNode));
if(!testRoot->Q2){
printf("\nError");
}
testRoot->Q2->front=-1;
testRoot->Q2->rear=-1;
testRoot->Q2->capacity=size;
testRoot->Q2->Array=(int*)malloc(sizeof(int)*testRoot->Q2->capacity);
if(!testRoot->Q2->Array){
printf("\nError");
}

testRoot->Q3=(QNode*)malloc(sizeof(QNode));
if(!testRoot->Q3){
printf("\nError");
}
testRoot->Q3->front=-1;
testRoot->Q3->rear=-1;
testRoot->Q3->capacity=size;
testRoot->Q3->Array=(int*)malloc(sizeof(int)*testRoot->Q3->capacity);
if(!testRoot->Q3->Array){
printf("\nError");
}

/*
CreateQueue(testRoot->Q1,size);
CreateQueue(testRoot->Q2,size);
CreateQueue(testRoot->Q3,size);
*/

int* Array=(int*)malloc(sizeof(int)*size);
if(!Array){
printf("\nError\n\n");
}
int i;
for(i=0;i<size;i++){
printf("\nEnter elm : ");
scanf("%d",&Array[i]);
}


printf("\n%d elements inserted..",i);
getch();

printf("\nSorting array");
qsort(Array,size,sizeof(int),Cmp);
printf("\nSorted array is : \n\n");
for(i=0;i<size;i++){
printf("%d  ",Array[i]);
}


getch();

printf("\nProceed to find max 3 mul \n");
getch();
FindIt(testRoot,Array,size);

return 0;
}
Пример #4
0
/*-------------------------------------------------------------------------
                              ActMsgCommand
--------------------------------------------------------------------------*/
MRESULT ActMsgCommand( WNDATTR *wndattr, MPARAM mp1, MPARAM mp2 )
{
 USHORT cmd;
 int    offset;

   cmd = SHORT1FROMMP( mp1 );

   switch (cmd) {
      case CMD_APPEND:
         CmdAppendFile( wndattr );
         break;
      case CMD_SAVE:
         CmdSaveAs( wndattr );
         break;
      case CMD_COPY:
         CmdCopy( wndattr );
         break;
      case CMD_PASTE:
         CmdPaste( wndattr );
         break;
      case CMD_UNMARK:
         CmdUnmark( wndattr );
         break;
      case CMD_REARRANGE:
         CmdRearrange( wndattr );
         break;
      case CMD_ABOUT:
         CmdAbout( wndattr );
         break;
      case CMD_ACCUM:
         CmdAccum( wndattr );
         break;
      case CMD_FIND:
         CmdFind( wndattr );
         break;
      case CMD_MARKFIND:
         CmdMarkFind( wndattr );
         break;
      case CMD_FINDNEXT:
         offset = FindIt( wndattr->list, wndattr->current, FNEXT );
         CorrectScroll( wndattr, offset );
         break;
      case CMD_FINDPREV:
         offset = FindIt( wndattr->list, wndattr->current, FPREV );
         CorrectScroll( wndattr, offset );
         break;
      case CMD_NEXTMARK:
         MoveToMark( wndattr, FNEXT );
         break;
      case CMD_PREVMARK:
         MoveToMark( wndattr, FPREV );
         break;
      case CMD_MATE:
         CmdMate( wndattr );
         break;
      case CMD_SPAWN:
         CmdSpawn( wndattr );
         break;
      case CMD_QUIT:
         CmdQuit( wndattr );
         break;
      default:
         return MRFROMSHORT( TRUE );
         break;
   }

   return MRFROMSHORT( FALSE );
}