Changeset 117 for branches/v2.9_Lars
- Timestamp:
- Oct 6, 2023, 2:27:09 AM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/v2.9_Lars/mediafolder/c/helper/launchpad.cpp
r57 r117 18 18 */ 19 19 20 #define INCL_WIN 21 #define INCL_GPILCIDS 22 #define INCL_GPIPRIMITIVES 23 #define INCL_GPIBITMAPS 24 20 #define INC_WIN 21 #define INCL_PM 22 #define INCL_GPI 25 23 26 24 #include "mediafolder.hh" 27 25 #include "launchpad.hh" 26 #include "cwcdtrack.hh" 28 27 29 28 #include <os2.h> … … 57 56 MRESULT EXPENTRY shadowProc(HWND hwnd, ULONG msg,MPARAM mp1,MPARAM mp2 ); 58 57 58 59 BOOL APIENTRY myDrgDeleteDraginfoStrHandles(PDRAGINFO pDragInfo) 60 { 61 /* a replacement for DrgDeleteDraginfoStrHandles */ 62 /* because that routine will fail if any one hstr is invalid */ 63 64 ULONG i,ulItems; 65 PDRAGITEM pDragItem; 66 67 ulItems = DrgQueryDragitemCount(pDragInfo); 68 for (i=0;i<ulItems;i++) 69 { 70 pDragItem = DrgQueryDragitemPtr(pDragInfo,i); 71 DrgDeleteStrHandle(pDragItem->hstrType); 72 DrgDeleteStrHandle(pDragItem->hstrRMF); 73 DrgDeleteStrHandle(pDragItem->hstrContainerName); 74 DrgDeleteStrHandle(pDragItem->hstrSourceName); 75 DrgDeleteStrHandle(pDragItem->hstrTargetName); 76 } 77 return TRUE; 78 } 79 80 59 81 /******************************************************************************/ 60 82 /* New button procedure which handles the context menu stuff for the objects */ … … 75 97 switch (msg) 76 98 { 77 #if 078 case WM_BEGINDRAG:79 if(SHORT1FROMMP(mp2)||1) {80 // DosBeep(5000,130);81 lpo=(LPObject*)WinQueryWindowULong(hwnd,QWL_USER);82 if(lpo) {83 wpObject=lpo->wpObject;84 if(somIsObj(wpObject)) {85 #if 086 DragItem.hwndItem=hwnd;87 DragItem.ulItemID=(ULONG)wpObject;88 DragItem.hstrType=DrgAddStrHandle("DRT_UNKNOWN");89 DragItem.hstrRMF=DrgAddStrHandle("DRM_OBJECT");90 DragItem.hstrContainerName=DrgAddStrHandle("E:\\CD-Brenner\\ADC_050\\!AUDIOCD_TOOLBAR!");91 DragItem.hstrSourceName=DrgAddStrHandle("E:\\CD-Brenner\\ADC_050\\");92 #endif93 wpObject->wpFormatDragItem(&DragItem);94 // DragItem.fsSupportedOps=DO_LINKABLE;95 DragInfo=DrgAllocDraginfo(1);96 97 DrgSetDragitem(DragInfo, &DragItem,(ULONG)sizeof(DragItem),0);98 memset(&DragImage, 0, sizeof(DragImage));99 DragImage.cb=sizeof(DragImage);100 DragImage.fl=DRG_ICON;101 DragImage.hImage=wpObject->wpQueryIcon();102 103 104 if(DrgDrag(hwnd, DragInfo, &DragImage, 1, VK_ENDDRAG, NULL)) {105 lpo->lpParent->lpRefreshLaunchPad();106 }107 108 /* Free DragInfo here!!!!!!!!!!! */109 //DrgDeleteDraginfoStrHandles(pDragInfo);110 // ????? DrgFreeDraginfo(DragInfo);111 return (MRESULT)TRUE;112 }/* somIsObj() */113 }/* lpo */114 }115 break;116 117 case DM_ENDCONVERSATION:118 case DM_DRAGFILECOMPLETE:119 case DM_DROPNOTIFY:120 case DM_FILERENDERED:121 case DM_RENDERCOMPLETE:122 DosBeep(500,500);123 break;124 return (MRESULT)FALSE;125 case WM_ENDDRAG:126 DosBeep(500,500);127 return (MRESULT)TRUE;128 break;129 #endif130 99 case WM_PAINT: 131 100 lpo=(LPObject*)WinQueryWindowULong(hwnd,QWL_USER); … … 166 135 { 167 136 BOOL bReturn=FALSE; 168 137 169 138 TRY_LOUD(LP_DRAGOVER) { 170 lpo=(LPObject*)WinQueryWindowULong(hwnd,QWL_USER);171 if(lpo) {172 wpObject=lpo->wpObject;173 if(somIsObj(wpObject)) {174 char chrClassName[10];175 LONG lLength;176 177 pDragInfo=(PDRAGINFO) mp1;178 hwndMenu=pDragInfo->hwndSource;179 lLength=sizeof(chrClassName);180 WinQueryClassName(hwndMenu, lLength, chrClassName);181 if(strcmp(chrClassName,"#37"))182 hwndMenu=NULL;/* Source isn't a container */183 if(!bDrawn) {184 HPS hps;185 RECTL rectl;186 SWP swp;187 188 /* Draw the rect */189 hps=DrgGetPS(hwnd);190 WinQueryWindowPos(hwnd,&swp);191 rectl.xLeft=1;192 rectl.yBottom=1;193 rectl.xRight=swp.cx-1;194 rectl.yTop=swp.cy-1;195 //WinDrawBorder(hps,&rectl, 3, 3, 0, 0, DB_STANDARD|DB_PATINVERT);196 DrgReleasePS(hps);197 //bDrawn=TRUE;198 }199 bReturn=TRUE;200 }201 }139 lpo=(LPObject*)WinQueryWindowULong(hwnd,QWL_USER); 140 if(lpo) { 141 wpObject=lpo->wpObject; 142 if(somIsObj(wpObject)) { 143 char chrClassName[10]; 144 LONG lLength; 145 146 pDragInfo=(PDRAGINFO) mp1; 147 hwndMenu=pDragInfo->hwndSource; 148 lLength=sizeof(chrClassName); 149 WinQueryClassName(hwndMenu, lLength, chrClassName); 150 if(strcmp(chrClassName,"#37")) 151 hwndMenu=NULL;/* Source isn't a container */ 152 if(!bDrawn) { 153 HPS hps; 154 RECTL rectl; 155 SWP swp; 156 157 /* Draw the rect */ 158 hps=DrgGetPS(hwnd); 159 WinQueryWindowPos(hwnd,&swp); 160 rectl.xLeft=1; 161 rectl.yBottom=1; 162 rectl.xRight=swp.cx-1; 163 rectl.yTop=swp.cy-1; 164 //WinDrawBorder(hps,&rectl, 3, 3, 0, 0, DB_STANDARD|DB_PATINVERT); 165 DrgReleasePS(hps); 166 //bDrawn=TRUE; 167 } 168 bReturn=TRUE; 169 } 170 } 202 171 } 203 172 CATCH(LP_DRAGOVER) 204 205 206 207 208 173 { 174 } END_CATCH; 175 if(bReturn) 176 return wpObject->wpDragOver(hwndMenu,(PDRAGINFO) mp1); 177 break; 209 178 } 210 179 case DM_DRAGLEAVE: … … 213 182 SWP swp; 214 183 HPS hps; 215 184 216 185 /* Remove target emphasis here */ 217 186 hps=DrgGetPS(hwnd); … … 221 190 rectl.xRight=swp.cx-1; 222 191 rectl.yTop=swp.cy-1; 223 // WinDrawBorder(hps,&rectl,3, 3, 0, 0, DB_STANDARD|DB_PATINVERT); 192 // WinDrawBorder(hps,&rectl,3, 3, 0, 0, DB_STANDARD|DB_PATINVERT); 224 193 bDrawn=FALSE; 225 194 DrgReleasePS(hps); … … 238 207 if(lpo) { 239 208 wpObject=lpo->wpObject; 240 if(somIsObj(wpObject)) { 209 if(somIsObj(wpObject)) { 241 210 pDragInfo=(PDRAGINFO) mp1; 242 211 pDragItem=DrgQueryDragitemPtr(pDragInfo, 0); … … 264 233 if(somIsObj(wpObject)) { 265 234 if((SHORT)0x6d==SHORT1FROMMP(mp1)) { 266 /* Delete menu item */ 235 /* Delete menu item */ 267 236 if(wpObject->wpDelete(CONFIRM_DELETE|CONFIRM_DELETEFOLDER ) == OK_DELETE) 268 237 lpo->lpParent->lpRemoveButton(lpo); … … 272 241 }/* end of if(somIsObj(wpObject)) */ 273 242 } 274 } 243 } 275 244 CATCH(LP_COMMAND) 276 245 { … … 288 257 static MRESULT handleDragOver(HWND hwnd, MPARAM mp1, MPARAM mp2) 289 258 { 290 MRESULT mResult;291 259 ULONG ulNumberOfObjects; 292 260 PDRAGINFO pDragInfo; … … 294 262 RECTL rectl; 295 263 SWP swp; 296 297 mResult = MRFROM2SHORT( DOR_NODROPOP, DO_LINK);298 264 USHORT usIndicator=DOR_NEVERDROP,usOp=0; 265 WPObject *wpObject = NULL; 266 299 267 /* Get access to the dragInfo */ 300 268 pDragInfo=(PDRAGINFO)mp1; 301 DrgAccessDraginfo(pDragInfo); 302 /* Get number of items */ 303 ulNumberOfObjects = DrgQueryDragitemCount( pDragInfo); 304 305 if(ulNumberOfObjects>1) { 306 /* Free the draginfo */ 307 DrgFreeDraginfo(pDragInfo); 308 return MRFROM2SHORT( DOR_NODROPOP, DO_LINK); 269 if (DrgAccessDraginfo(pDragInfo)) { 270 PDRAGITEM pDragItem = NULL; 271 272 /* Get number of items */ 273 ulNumberOfObjects = DrgQueryDragitemCount( pDragInfo); 274 275 if(ulNumberOfObjects>1) { 276 usIndicator = DOR_NODROP; 277 usOp = 0; 278 goto quit; 279 } 280 281 /* check if a WPS object was dropped, we do not accept anything else */ 282 pDragItem = DrgQueryDragitemPtr(pDragInfo,0); 283 if (!DrgVerifyRMF(pDragItem,"DRM_OBJECT","DRF_OBJECT")) { 284 usIndicator = DOR_NEVERDROP; 285 usOp = 0; 286 goto quit; 287 } /* endif */ 288 289 /* 290 refuse drop if WPS object pointer is not valid or if the object is 291 a descendant of MMCDTrack class (see Netlabs ticket #19) 292 */ 293 wpObject = (WPObject *)OBJECT_FROM_PREC(pDragItem->ulItemID); 294 if (!somIsObj(wpObject) || wpObject->somIsA(MMCDTrack::__ClassObject)) { 295 usIndicator = DOR_NEVERDROP; 296 usOp = 0; 297 goto quit; 298 } /* endif */ 299 300 switch(pDragInfo->usOperation) 301 { 302 case DO_DEFAULT: 303 case DO_LINK: 304 if(!bDrawn) { 305 POINTL ptl; 306 launchPad * lp; 307 308 ptl.x=SHORT1FROMMP(mp2); 309 ptl.y=SHORT2FROMMP(mp2); 310 /* Pos in window coords */ 311 WinMapWindowPoints(HWND_DESKTOP, hwnd, &ptl, 1); 312 313 hps=DrgGetPS(hwnd); 314 WinQueryWindowPos(hwnd,&swp); 315 316 rectl.xLeft=swp.cx;//-swp.cy; 317 318 lp=(launchPad*)WinQueryWindowULong(hwnd,QWL_USER); 319 if(lp) { 320 if(lp->lpQueryNumObjects()==0) { 321 rectl.xLeft=0; 322 } 323 } 324 325 rectl.yTop=swp.cy-1; 326 rectl.yBottom=1; 327 if(ptl.x<rectl.xLeft) { 328 int numB; 329 330 numB=(ptl.x-xButtonOffset)/(swp.cy+xButtonDelta); 331 rectl.xLeft=((ptl.x-numB*swp.cy) > swp.cy/2 ? numB+1: numB); 332 rectl.xLeft*=(swp.cy+xButtonDelta); 333 rectl.xLeft-=(xButtonDelta)-xButtonOffset+xButtonDelta; 334 rectl.xRight=rectl.xLeft+(xButtonDelta*2); 335 } 336 else { 337 rectl.xRight=swp.cx-1; 338 } 339 rclDrawn=rectl; 340 WinDrawBorder(hps,&rectl, 2, 2, 0, 0, DB_STANDARD|DB_PATINVERT); 341 bDrawn=TRUE; 342 343 DrgReleasePS(hps); 344 } 345 usIndicator = DOR_DROP; 346 usOp = DO_LINK; 347 break; 348 default: 349 usIndicator = DOR_NODROPOP; 350 usOp = DO_LINK; 351 break; 352 } 353 quit: 354 /* Free the draginfo */ 355 DrgFreeDraginfo(pDragInfo); 309 356 } 310 311 switch(pDragInfo->usOperation) 312 { 313 case DO_DEFAULT: 314 case DO_LINK: 315 if(!bDrawn) { 316 POINTL ptl; 317 launchPad * lp; 318 319 ptl.x=SHORT1FROMMP(mp2); 320 ptl.y=SHORT2FROMMP(mp2); 321 /* Pos in window coords */ 322 WinMapWindowPoints(HWND_DESKTOP, hwnd, &ptl, 1); 323 324 hps=DrgGetPS(hwnd); 325 WinQueryWindowPos(hwnd,&swp); 326 327 rectl.xLeft=swp.cx;//-swp.cy; 328 329 lp=(launchPad*)WinQueryWindowULong(hwnd,QWL_USER); 330 if(lp) { 331 if(lp->lpQueryNumObjects()==0) { 332 rectl.xLeft=0; 333 } 334 } 335 336 rectl.yTop=swp.cy-1; 337 rectl.yBottom=1; 338 if(ptl.x<rectl.xLeft) { 339 int numB; 340 341 numB=(ptl.x-xButtonOffset)/(swp.cy+xButtonDelta); 342 rectl.xLeft=((ptl.x-numB*swp.cy) > swp.cy/2 ? numB+1: numB); 343 rectl.xLeft*=(swp.cy+xButtonDelta); 344 rectl.xLeft-=(xButtonDelta)-xButtonOffset+xButtonDelta; 345 rectl.xRight=rectl.xLeft+(xButtonDelta*2); 346 } 347 else { 348 rectl.xRight=swp.cx-1; 349 } 350 rclDrawn=rectl; 351 WinDrawBorder(hps,&rectl, 2, 2, 0, 0, DB_STANDARD|DB_PATINVERT); 352 bDrawn=TRUE; 353 354 DrgReleasePS(hps); 355 } 356 mResult = MRFROM2SHORT( DOR_DROP, DO_LINK); 357 break; 358 default: 359 break; 360 } 361 362 /* Free the draginfo */ 363 DrgFreeDraginfo(pDragInfo); 364 365 return mResult; 357 return MRFROM2SHORT(usIndicator,usOp); 366 358 } 367 359 … … 375 367 /* Remove target emphasis here */ 376 368 hps=DrgGetPS(hwnd); 377 WinDrawBorder(hps,&rclDrawn, 2, 2, 0, 0, DB_STANDARD|DB_PATINVERT); 369 WinDrawBorder(hps,&rclDrawn, 2, 2, 0, 0, DB_STANDARD|DB_PATINVERT); 378 370 DrgReleasePS(hps); 379 bDrawn=FALSE; 371 bDrawn=FALSE; 380 372 return (MRESULT) FALSE; 381 373 } 382 374 383 375 384 static MRESULT EXPENTRY launchPadWindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 376 static MRESULT EXPENTRY launchPadWindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 385 377 { 386 378 WPFolder* thisPtr; 387 379 launchPad * lp; 388 380 LPObject *lpo; 389 static USHORT id=0;//Initialisation new in V1.00a 381 static USHORT id=0;//Initialisation new in V1.00a 390 382 391 383 switch(msg) 392 384 { 393 #if 0394 case DM_ENDCONVERSATION:395 case DM_DRAGFILECOMPLETE:396 case DM_DROPNOTIFY:397 case DM_FILERENDERED:398 case DM_RENDERCOMPLETE:399 DosBeep(500,500);400 break;401 return (MRESULT)FALSE;402 case WM_ENDDRAG:403 DosBeep(500,500);404 break;405 return (MRESULT)TRUE;406 #endif407 385 case WM_PAINT: 408 386 { … … 426 404 case DM_DROP: 427 405 { 428 ULONG ulCount; 429 ULONG ulNumberOfObjects; 430 PDRAGITEM pDragItem; 431 SOMClass *folderClass; 432 WPObject * wpObject; 433 PDRAGINFO pDragInfo; 434 435 TRY_LOUD(LP_FRAMEDROP) { 406 TRY_LOUD(LP_FRAMEDROP) { 436 407 /* A new object dropped on the launchpad */ 437 pDragInfo=(PDRAGINFO)mp1;408 PDRAGINFO pDragInfo=(PDRAGINFO)mp1; 438 409 if(DrgAccessDraginfo(pDragInfo)) { 439 /* Get number of items */440 ulNumberOfObjects = DrgQueryDragitemCount( pDragInfo);441 if(ulNumberOfObjects>1){442 /* Free the draginfo */443 DrgDeleteDraginfoStrHandles(pDragInfo);444 DrgFreeDraginfo(pDragInfo);445 }446 else {447 ulCount=0;448 449 pDragItem=DrgQueryDragitemPtr( pDragInfo, ulCount);450 wpObject=(WPObject*)OBJECT_FROM_PREC(DrgQueryDragitemPtr( pDragInfo, ulCount)->ulItemID);451 410 lp=(launchPad*)WinQueryWindowULong(hwnd,QWL_USER); 452 411 if(lp) { 453 if(somIsObj(wpObject)) {454 412 PDRAGITEM pDragItem=DrgQueryDragitemPtr( pDragInfo, 0); 413 WPObject *wpObject=(WPObject*)OBJECT_FROM_PREC(pDragItem->ulItemID); 455 414 POINTL ptl; 456 415 int numB; 457 416 SWP swp; 458 417 459 418 WinQueryWindowPos(hwnd,&swp); 460 419 ptl.x=pDragInfo->xDrop; … … 467 426 /* Do a link */ 468 427 lp->lpAddButton(wpObject, numB); 469 handleDragLeave(hwnd, mp1, mp2);470 }471 428 } 472 DrgDeleteDraginfoStrHandles(pDragInfo);429 myDrgDeleteDraginfoStrHandles(pDragInfo); 473 430 DrgFreeDraginfo(pDragInfo); 474 }475 431 } 476 432 handleDragLeave(hwnd, mp1, mp2); … … 479 435 { 480 436 } END_CATCH; 481 482 break; 437 return MRFROMLONG(0); 483 438 } 484 439 case DM_DRAGLEAVE: … … 496 451 return (MRESULT)FALSE; 497 452 /***********************************************/ 498 /* Stuff for fly over help */ 453 /* Stuff for fly over help */ 499 454 case WM_MOUSEMOVE: 500 455 launchPad * lp; … … 506 461 } 507 462 } 508 509 #if 0 510 tempID=WinQueryWindowUShort(hwnd,QWS_ID);/* get the id of the window under the pointer */ 511 if(id!=tempID) { // New Button? 512 WinStartTimer(WinQueryAnchorBlock(hwnd),hwnd,tempID,(ULONG)iTBFlyOverDelay); // New timer for delay 513 id=tempID; // Save ID 514 } 515 else { 516 if(!hwndBubbleWindow) 517 WinStartTimer(WinQueryAnchorBlock(hwnd),hwnd,tempID,(ULONG)iTBFlyOverDelay); // New timer for delay 518 } 519 #endif 463 520 464 if(!hwndBubbleWindow) 521 465 WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, 2,(ULONG)iTBFlyOverDelay); // New timer for delay … … 541 485 HPS hps; 542 486 RECTL rcl; 543 487 544 488 /* we have to build a new information window */ 545 if(hwndBubbleWindow){// if(){...} new in V1.00a 489 if(hwndBubbleWindow){// if(){...} new in V1.00a 546 490 WinDestroyWindow(hwndBubbleWindow);/* close the bubblewindow */ 547 491 hwndBubbleWindow=NULL; … … 551 495 WinMapWindowPoints(HWND_DESKTOP,hwnd,&ptl,1); 552 496 WinQueryWindowRect(hwnd,&rclWork); 553 if(!hwndBubbleWindow 497 if(!hwndBubbleWindow 554 498 && WinPtInRect(WinQueryAnchorBlock(hwnd),&rclWork,&ptl) 555 499 && bTBFlyOverEnabled) { 556 500 557 501 static HWND hwndBubbleClient; 558 502 ULONG style=FCF_BORDER|FCF_NOBYTEALIGN; 559 503 char winText[255] = {0}; 560 504 561 505 /* Get window text for size calculating */ 562 506 lp=(launchPad*)WinQueryWindowULong(hwnd,QWL_USER); … … 567 511 568 512 ulWinTextLen=(LONG)strlen(winText); // Query text length 569 513 570 514 /* Delete 'Returns' in object title */ 571 515 char *pBuchst; … … 579 523 pRest=pBuchst; 580 524 } 581 525 582 526 /* Create help window */ 583 527 hwndBubbleWindow=WinCreateStdWindow(HWND_DESKTOP, … … 612 556 GpiQueryTextBox(hps,ulWinTextLen,winText,TXTBOX_COUNT,aptlPoints); 613 557 WinEndPaint(hps); 614 558 615 559 /* Set colors */ 616 560 WinSetPresParam(hwndBubbleClient, … … 620 564 PP_FOREGROUNDCOLOR,sizeof(rgbTBFlyForeground) , 621 565 &rgbTBFlyForeground ); 622 566 623 567 /* Calculate bubble positon and show bubble */ 624 568 WinQueryPointerPos(HWND_DESKTOP,&ptl);//Query pointer position in the desktop window 625 569 WinQueryWindowRect(HWND_DESKTOP,&rcl);//Query desktop size 626 aptlPoints[TXTBOX_BOTTOMRIGHT].x-aptlPoints[TXTBOX_BOTTOMLEFT].x+7+xVal+ptl.x 627 > rcl.xRight 628 ? deltaX=-aptlPoints[TXTBOX_BOTTOMRIGHT].x-aptlPoints[TXTBOX_BOTTOMLEFT].x-xVal-xVal-7 570 aptlPoints[TXTBOX_BOTTOMRIGHT].x-aptlPoints[TXTBOX_BOTTOMLEFT].x+7+xVal+ptl.x 571 > rcl.xRight 572 ? deltaX=-aptlPoints[TXTBOX_BOTTOMRIGHT].x-aptlPoints[TXTBOX_BOTTOMLEFT].x-xVal-xVal-7 629 573 : deltaX=0 ; 630 631 aptlPoints[TXTBOX_TOPLEFT].y-aptlPoints[TXTBOX_BOTTOMLEFT].y+2+yVal+ptl.y 632 > rcl.yTop 574 575 aptlPoints[TXTBOX_TOPLEFT].y-aptlPoints[TXTBOX_BOTTOMLEFT].y+2+yVal+ptl.y 576 > rcl.yTop 633 577 ? deltaY=-aptlPoints[TXTBOX_TOPLEFT].y-aptlPoints[TXTBOX_BOTTOMLEFT].y-2*yVal-7 634 578 : deltaY=0 ; 635 579 WinSetWindowPos(hwndBubbleWindow, 636 580 HWND_TOP, 637 ptl.x+xVal+deltaX,ptl.y+yVal+deltaY, 581 ptl.x+xVal+deltaX,ptl.y+yVal+deltaY, 638 582 aptlPoints[TXTBOX_BOTTOMRIGHT].x-aptlPoints[TXTBOX_BOTTOMLEFT].x+8, 639 583 aptlPoints[TXTBOX_TOPLEFT].y-aptlPoints[TXTBOX_BOTTOMLEFT].y+2, … … 643 587 hwndBubbleWindow, 644 588 ptl.x+xVal+deltaX+5 645 ,ptl.y+yVal+deltaY-5, 589 ,ptl.y+yVal+deltaY-5, 646 590 aptlPoints[TXTBOX_BOTTOMRIGHT].x-aptlPoints[TXTBOX_BOTTOMLEFT].x+8, 647 591 aptlPoints[TXTBOX_TOPLEFT].y-aptlPoints[TXTBOX_BOTTOMLEFT].y+2, 648 592 SWP_ZORDER|SWP_SIZE|SWP_MOVE|SWP_SHOW); 649 593 650 594 /* Set bubble text */ 651 595 WinSetWindowText(hwndBubbleClient,winText); 652 WinStartTimer(WinQueryAnchorBlock(hwnd),hwnd,1,35); 596 WinStartTimer(WinQueryAnchorBlock(hwnd),hwnd,1,35); 653 597 } // end if(!hwndBubbleWindow) 654 598 break; … … 666 610 WinQueryWindowRect(hwnd, &rclWork); 667 611 if(!WinPtInRect(WinQueryAnchorBlock(hwnd),&rclWork,&ptl)) 668 { // Window has changed 612 { // Window has changed 669 613 WinStopTimer(WinQueryAnchorBlock(hwnd), hwnd, 1); // stop the running timer 670 if(hwndBubbleWindow) 614 if(hwndBubbleWindow) 671 615 WinDestroyWindow(hwndBubbleWindow);/* close the bubblewindow */ 672 616 hwndBubbleWindow=0; … … 694 638 break; 695 639 default: 696 break; 640 break; 697 641 } 698 642 return pfnwpOldLPProc(hwnd, msg, mp1, mp2); … … 701 645 void LPList::lplRefreshAllPads() 702 646 { 703 647 704 648 } 705 649 … … 711 655 LPObject::~LPObject(void) 712 656 { 713 #if 0714 if(hPtr) {715 if(!WinDestroyPointer(hPtr))716 DosBeep(100,200);717 }718 #endif719 657 } 720 658 … … 766 704 if(hwndLaunchPad) 767 705 WinDestroyWindow(hwndLaunchPad); 768 706 769 707 /* Remove this pad from the list of pads */ 770 708 lplTemp=lplAllLPads; … … 844 782 } 845 783 } 846 784 847 785 lpBuildObjectList(chrConfigID); 848 786 … … 859 797 /* Refresh all launchpads */ 860 798 LPList *lplTemp; 861 799 862 800 //lplTemp=lplAllLPads; 863 801 lplTemp=*lpList; … … 902 840 } 903 841 } 904 905 lpSaveObjectList(); 842 843 lpSaveObjectList(); 906 844 lpRefreshLaunchPad(); 907 845 … … 967 905 if((lpoTempNew=new LPObject(wpTempObject->wpQueryIcon()))!=NULL) { 968 906 ULONG ulRC; 969 907 970 908 lpoTempNew->wpObject=wpTempObject; 971 909 lpoTempNew->wpObject->wpLockObject(); … … 1017 955 if(!SysCheckFileExists(chrConfigTarget)) 1018 956 return FALSE; /* No install dir defined */ 1019 957 1020 958 sprintf(chrPath,"OBJECTID=%s",chrConfigID); 1021 959 if((hObject2=WinCreateObject("WPFolder", chrConfigID, chrPath,chrConfigTarget,CO_FAILIFEXISTS))==NULLHANDLE) 1022 960 return FALSE; /* Can't create new toolbar folder */ 1023 961 } 1024 962 1025 963 /* Get toolbar folder */ 1026 964 if(somIsObj(wpParentFolder)) { … … 1038 976 wpFolder->wpQueryRealName(chrPath, &ulBufferSize, TRUE); 1039 977 strcat(chrPath,"\\objects.ini");/* Ini-File containing the hobjects */ 1040 1041 // WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, chrPath, "~launchPad", 123, MB_OK| MB_MOVEABLE); 978 979 // WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, chrPath, "~launchPad", 123, MB_OK| MB_MOVEABLE); 1042 980 do{ 1043 981 /* Open the ini-file */ 1044 982 if((hIni=PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP),chrPath))==NULLHANDLE) 1045 break; 983 break; 1046 984 1047 985 if((memPtr=(char*)malloc(ulNumObjects*sizeof(HOBJECT)))==NULL) 1048 986 break; 1049 987 1050 988 1051 989 hObject=(HOBJECT*)memPtr; … … 1064 1002 1065 1003 free(hObject); 1066 1004 1067 1005 PrfCloseProfile(hIni); 1068 1006 return TRUE; … … 1083 1021 WPObject* wpObject; 1084 1022 1085 char chrText[200]; 1023 char chrText[200]; 1086 1024 ULONG ul; 1087 1025 … … 1113 1051 wpFolder->wpQueryRealName(chrPath, &ulBufferSize, TRUE); 1114 1052 strcat(chrPath,"\\objects.ini");/* Ini-File containing the hobjects */ 1115 1053 1116 1054 do{ 1117 1055 /* Open the ini-file */ 1118 1056 if((hIni=PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP),chrPath))==NULLHANDLE) 1119 break; 1120 1057 break; 1058 1121 1059 if(!PrfQueryProfileSize(hIni,"objects","handles", &ulBufferSize)) 1122 1060 break; … … 1127 1065 if((memPtr=(char*)malloc(ulBufferSize))==NULL) 1128 1066 break; 1129 1130 ulNumObjects=ulBufferSize/sizeof(HOBJECT); 1067 1068 ulNumObjects=ulBufferSize/sizeof(HOBJECT); 1131 1069 1132 1070 if(!PrfQueryProfileData(hIni,"objects","handles", memPtr, &ulBufferSize)){ … … 1149 1087 strncpy(lpoTemp->chrName, wpTempObject->wpQueryTitle(),sizeof(lpoTemp->chrName)); 1150 1088 lpoTemp->lpParent=this; 1151 1089 1152 1090 lpoTemp->lpoNext=lpoObjectList; 1153 1091 lpoObjectList=lpoTemp; … … 1158 1096 } 1159 1097 }/* for */ 1160 1098 1161 1099 free(hObjectArray); 1162 1100 1163 1101 PrfCloseProfile(hIni); 1164 1102 return TRUE; … … 1249 1187 for(a=ulNumObjects;a>0 && lpoTemp; a--) 1250 1188 { 1251 /* Create Buttons */ 1189 /* Create Buttons */ 1252 1190 if((hwndTemp=WinCreateWindow(hwndLaunchPad, WC_BUTTON, lpoTemp->chrName, WS_VISIBLE, xButtonOffset+(a-1)*(swp.cy+xButtonDelta), 1, swp.cy-2, swp.cy-2, 1253 1191 hwndLaunchPad, HWND_TOP, a*100, … … 1276 1214 lpoTemp=lpoTemp->lpoNext; 1277 1215 } 1278 return TRUE; 1279 } 1280 1281 1282 1216 return TRUE; 1217 } 1218
Note:
See TracChangeset
for help on using the changeset viewer.