Changeset 133 for trunk/mediafolder/c/helper/launchpad.cpp
- Timestamp:
- Nov 29, 2023, 5:59:34 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mediafolder/c/helper/launchpad.cpp
r57 r133 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> … … 32 31 33 32 #include "sys_funcs.h" 33 SOMClass* somhlpGetSomClass(char* chrClassName); 34 34 35 35 extern HWND hwndShadow;// The handle of the help window … … 57 57 MRESULT EXPENTRY shadowProc(HWND hwnd, ULONG msg,MPARAM mp1,MPARAM mp2 ); 58 58 59 60 BOOL APIENTRY myDrgDeleteDraginfoStrHandles(PDRAGINFO pDragInfo) 61 { 62 /* a replacement for DrgDeleteDraginfoStrHandles */ 63 /* because that routine will fail if any one hstr is invalid */ 64 65 ULONG i,ulItems; 66 PDRAGITEM pDragItem; 67 68 ulItems = DrgQueryDragitemCount(pDragInfo); 69 for (i=0;i<ulItems;i++) 70 { 71 pDragItem = DrgQueryDragitemPtr(pDragInfo,i); 72 DrgDeleteStrHandle(pDragItem->hstrType); 73 DrgDeleteStrHandle(pDragItem->hstrRMF); 74 DrgDeleteStrHandle(pDragItem->hstrContainerName); 75 DrgDeleteStrHandle(pDragItem->hstrSourceName); 76 DrgDeleteStrHandle(pDragItem->hstrTargetName); 77 } 78 return TRUE; 79 } 80 81 59 82 /******************************************************************************/ 60 83 /* New button procedure which handles the context menu stuff for the objects */ … … 75 98 switch (msg) 76 99 { 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 100 case WM_PAINT: 131 101 lpo=(LPObject*)WinQueryWindowULong(hwnd,QWL_USER); … … 166 136 { 167 137 BOOL bReturn=FALSE; 168 138 169 139 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 }140 lpo=(LPObject*)WinQueryWindowULong(hwnd,QWL_USER); 141 if(lpo) { 142 wpObject=lpo->wpObject; 143 if(somIsObj(wpObject)) { 144 char chrClassName[10]; 145 LONG lLength; 146 147 pDragInfo=(PDRAGINFO) mp1; 148 hwndMenu=pDragInfo->hwndSource; 149 lLength=sizeof(chrClassName); 150 WinQueryClassName(hwndMenu, lLength, chrClassName); 151 if(strcmp(chrClassName,"#37")) 152 hwndMenu=NULL;/* Source isn't a container */ 153 if(!bDrawn) { 154 HPS hps; 155 RECTL rectl; 156 SWP swp; 157 158 /* Draw the rect */ 159 hps=DrgGetPS(hwnd); 160 WinQueryWindowPos(hwnd,&swp); 161 rectl.xLeft=1; 162 rectl.yBottom=1; 163 rectl.xRight=swp.cx-1; 164 rectl.yTop=swp.cy-1; 165 //WinDrawBorder(hps,&rectl, 3, 3, 0, 0, DB_STANDARD|DB_PATINVERT); 166 DrgReleasePS(hps); 167 //bDrawn=TRUE; 168 } 169 bReturn=TRUE; 170 } 171 } 202 172 } 203 173 CATCH(LP_DRAGOVER) 204 205 206 207 208 174 { 175 } END_CATCH; 176 if(bReturn) 177 return wpObject->wpDragOver(hwndMenu,(PDRAGINFO) mp1); 178 break; 209 179 } 210 180 case DM_DRAGLEAVE: … … 213 183 SWP swp; 214 184 HPS hps; 215 185 216 186 /* Remove target emphasis here */ 217 187 hps=DrgGetPS(hwnd); … … 221 191 rectl.xRight=swp.cx-1; 222 192 rectl.yTop=swp.cy-1; 223 // WinDrawBorder(hps,&rectl,3, 3, 0, 0, DB_STANDARD|DB_PATINVERT); 193 // WinDrawBorder(hps,&rectl,3, 3, 0, 0, DB_STANDARD|DB_PATINVERT); 224 194 bDrawn=FALSE; 225 195 DrgReleasePS(hps); … … 238 208 if(lpo) { 239 209 wpObject=lpo->wpObject; 240 if(somIsObj(wpObject)) { 210 if(somIsObj(wpObject)) { 241 211 pDragInfo=(PDRAGINFO) mp1; 242 212 pDragItem=DrgQueryDragitemPtr(pDragInfo, 0); … … 264 234 if(somIsObj(wpObject)) { 265 235 if((SHORT)0x6d==SHORT1FROMMP(mp1)) { 266 /* Delete menu item */ 236 /* Delete menu item */ 267 237 if(wpObject->wpDelete(CONFIRM_DELETE|CONFIRM_DELETEFOLDER ) == OK_DELETE) 268 238 lpo->lpParent->lpRemoveButton(lpo); … … 272 242 }/* end of if(somIsObj(wpObject)) */ 273 243 } 274 } 244 } 275 245 CATCH(LP_COMMAND) 276 246 { … … 288 258 static MRESULT handleDragOver(HWND hwnd, MPARAM mp1, MPARAM mp2) 289 259 { 290 MRESULT mResult;291 260 ULONG ulNumberOfObjects; 292 261 PDRAGINFO pDragInfo; … … 294 263 RECTL rectl; 295 264 SWP swp; 296 297 mResult = MRFROM2SHORT( DOR_NODROPOP, DO_LINK);298 265 USHORT usIndicator=DOR_NEVERDROP,usOp=0; 266 WPObject *wpObject = NULL; 267 299 268 /* Get access to the dragInfo */ 300 269 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); 270 if (DrgAccessDraginfo(pDragInfo)) { 271 PDRAGITEM pDragItem = NULL; 272 SOMClass *cdTrackClass = NULL; 273 274 /* Get number of items */ 275 ulNumberOfObjects = DrgQueryDragitemCount( pDragInfo); 276 277 if(ulNumberOfObjects>1) { 278 usIndicator = DOR_NODROP; 279 usOp = 0; 280 goto quit; 281 } 282 283 /* check if a WPS object was dropped, we do not accept anything else */ 284 pDragItem = DrgQueryDragitemPtr(pDragInfo,0); 285 if (!DrgVerifyRMF(pDragItem,"DRM_OBJECT","DRF_OBJECT")) { 286 usIndicator = DOR_NEVERDROP; 287 usOp = 0; 288 goto quit; 289 } /* endif */ 290 291 /* 292 refuse drop if WPS object pointer is not valid or if the object is 293 a descendant of MMCDTrack class (see Netlabs ticket #19) 294 */ 295 wpObject = (WPObject *)OBJECT_FROM_PREC(pDragItem->ulItemID); 296 cdTrackClass = somhlpGetSomClass("MMCDTrack"); 297 if (!somIsObj(wpObject) || wpObject->somIsA(cdTrackClass)) { 298 usIndicator = DOR_NEVERDROP; 299 usOp = 0; 300 goto quit; 301 } /* endif */ 302 303 switch(pDragInfo->usOperation) 304 { 305 case DO_DEFAULT: 306 case DO_LINK: 307 if(!bDrawn) { 308 POINTL ptl; 309 launchPad * lp; 310 311 ptl.x=SHORT1FROMMP(mp2); 312 ptl.y=SHORT2FROMMP(mp2); 313 /* Pos in window coords */ 314 WinMapWindowPoints(HWND_DESKTOP, hwnd, &ptl, 1); 315 316 hps=DrgGetPS(hwnd); 317 WinQueryWindowPos(hwnd,&swp); 318 319 rectl.xLeft=swp.cx;//-swp.cy; 320 321 lp=(launchPad*)WinQueryWindowULong(hwnd,QWL_USER); 322 if(lp) { 323 if(lp->lpQueryNumObjects()==0) { 324 rectl.xLeft=0; 325 } 326 } 327 328 rectl.yTop=swp.cy-1; 329 rectl.yBottom=1; 330 if(ptl.x<rectl.xLeft) { 331 int numB; 332 333 numB=(ptl.x-xButtonOffset)/(swp.cy+xButtonDelta); 334 rectl.xLeft=((ptl.x-numB*swp.cy) > swp.cy/2 ? numB+1: numB); 335 rectl.xLeft*=(swp.cy+xButtonDelta); 336 rectl.xLeft-=(xButtonDelta)-xButtonOffset+xButtonDelta; 337 rectl.xRight=rectl.xLeft+(xButtonDelta*2); 338 } 339 else { 340 rectl.xRight=swp.cx-1; 341 } 342 rclDrawn=rectl; 343 WinDrawBorder(hps,&rectl, 2, 2, 0, 0, DB_STANDARD|DB_PATINVERT); 344 bDrawn=TRUE; 345 346 DrgReleasePS(hps); 347 } 348 usIndicator = DOR_DROP; 349 usOp = DO_LINK; 350 break; 351 default: 352 usIndicator = DOR_NODROPOP; 353 usOp = DO_LINK; 354 break; 355 } 356 quit: 357 /* Free the draginfo */ 358 DrgFreeDraginfo(pDragInfo); 309 359 } 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; 360 return MRFROM2SHORT(usIndicator,usOp); 366 361 } 367 362 … … 375 370 /* Remove target emphasis here */ 376 371 hps=DrgGetPS(hwnd); 377 WinDrawBorder(hps,&rclDrawn, 2, 2, 0, 0, DB_STANDARD|DB_PATINVERT); 372 WinDrawBorder(hps,&rclDrawn, 2, 2, 0, 0, DB_STANDARD|DB_PATINVERT); 378 373 DrgReleasePS(hps); 379 bDrawn=FALSE; 374 bDrawn=FALSE; 380 375 return (MRESULT) FALSE; 381 376 } 382 377 383 378 384 static MRESULT EXPENTRY launchPadWindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 379 static MRESULT EXPENTRY launchPadWindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 385 380 { 386 381 WPFolder* thisPtr; 387 382 launchPad * lp; 388 383 LPObject *lpo; 389 static USHORT id=0;//Initialisation new in V1.00a 384 static USHORT id=0;//Initialisation new in V1.00a 390 385 391 386 switch(msg) 392 387 { 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 388 case WM_PAINT: 408 389 { … … 426 407 case DM_DROP: 427 408 { 428 ULONG ulCount; 429 ULONG ulNumberOfObjects; 430 PDRAGITEM pDragItem; 431 SOMClass *folderClass; 432 WPObject * wpObject; 433 PDRAGINFO pDragInfo; 434 435 TRY_LOUD(LP_FRAMEDROP) { 409 TRY_LOUD(LP_FRAMEDROP) { 436 410 /* A new object dropped on the launchpad */ 437 pDragInfo=(PDRAGINFO)mp1;411 PDRAGINFO pDragInfo=(PDRAGINFO)mp1; 438 412 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 413 lp=(launchPad*)WinQueryWindowULong(hwnd,QWL_USER); 452 414 if(lp) { 453 if(somIsObj(wpObject)) {454 415 PDRAGITEM pDragItem=DrgQueryDragitemPtr( pDragInfo, 0); 416 WPObject *wpObject=(WPObject*)OBJECT_FROM_PREC(pDragItem->ulItemID); 455 417 POINTL ptl; 456 418 int numB; 457 419 SWP swp; 458 420 459 421 WinQueryWindowPos(hwnd,&swp); 460 422 ptl.x=pDragInfo->xDrop; … … 467 429 /* Do a link */ 468 430 lp->lpAddButton(wpObject, numB); 469 handleDragLeave(hwnd, mp1, mp2);470 }471 431 } 472 DrgDeleteDraginfoStrHandles(pDragInfo);432 myDrgDeleteDraginfoStrHandles(pDragInfo); 473 433 DrgFreeDraginfo(pDragInfo); 474 }475 434 } 476 435 handleDragLeave(hwnd, mp1, mp2); … … 479 438 { 480 439 } END_CATCH; 481 482 break; 440 return MRFROMLONG(0); 483 441 } 484 442 case DM_DRAGLEAVE: … … 496 454 return (MRESULT)FALSE; 497 455 /***********************************************/ 498 /* Stuff for fly over help */ 456 /* Stuff for fly over help */ 499 457 case WM_MOUSEMOVE: 500 458 launchPad * lp; … … 506 464 } 507 465 } 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 466 520 467 if(!hwndBubbleWindow) 521 468 WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, 2,(ULONG)iTBFlyOverDelay); // New timer for delay … … 541 488 HPS hps; 542 489 RECTL rcl; 543 490 544 491 /* we have to build a new information window */ 545 if(hwndBubbleWindow){// if(){...} new in V1.00a 492 if(hwndBubbleWindow){// if(){...} new in V1.00a 546 493 WinDestroyWindow(hwndBubbleWindow);/* close the bubblewindow */ 547 494 hwndBubbleWindow=NULL; … … 551 498 WinMapWindowPoints(HWND_DESKTOP,hwnd,&ptl,1); 552 499 WinQueryWindowRect(hwnd,&rclWork); 553 if(!hwndBubbleWindow 500 if(!hwndBubbleWindow 554 501 && WinPtInRect(WinQueryAnchorBlock(hwnd),&rclWork,&ptl) 555 502 && bTBFlyOverEnabled) { 556 503 557 504 static HWND hwndBubbleClient; 558 505 ULONG style=FCF_BORDER|FCF_NOBYTEALIGN; 559 506 char winText[255] = {0}; 560 507 561 508 /* Get window text for size calculating */ 562 509 lp=(launchPad*)WinQueryWindowULong(hwnd,QWL_USER); … … 567 514 568 515 ulWinTextLen=(LONG)strlen(winText); // Query text length 569 516 570 517 /* Delete 'Returns' in object title */ 571 518 char *pBuchst; … … 579 526 pRest=pBuchst; 580 527 } 581 528 582 529 /* Create help window */ 583 530 hwndBubbleWindow=WinCreateStdWindow(HWND_DESKTOP, … … 612 559 GpiQueryTextBox(hps,ulWinTextLen,winText,TXTBOX_COUNT,aptlPoints); 613 560 WinEndPaint(hps); 614 561 615 562 /* Set colors */ 616 563 WinSetPresParam(hwndBubbleClient, … … 620 567 PP_FOREGROUNDCOLOR,sizeof(rgbTBFlyForeground) , 621 568 &rgbTBFlyForeground ); 622 569 623 570 /* Calculate bubble positon and show bubble */ 624 571 WinQueryPointerPos(HWND_DESKTOP,&ptl);//Query pointer position in the desktop window 625 572 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 573 aptlPoints[TXTBOX_BOTTOMRIGHT].x-aptlPoints[TXTBOX_BOTTOMLEFT].x+7+xVal+ptl.x 574 > rcl.xRight 575 ? deltaX=-aptlPoints[TXTBOX_BOTTOMRIGHT].x-aptlPoints[TXTBOX_BOTTOMLEFT].x-xVal-xVal-7 629 576 : deltaX=0 ; 630 631 aptlPoints[TXTBOX_TOPLEFT].y-aptlPoints[TXTBOX_BOTTOMLEFT].y+2+yVal+ptl.y 632 > rcl.yTop 577 578 aptlPoints[TXTBOX_TOPLEFT].y-aptlPoints[TXTBOX_BOTTOMLEFT].y+2+yVal+ptl.y 579 > rcl.yTop 633 580 ? deltaY=-aptlPoints[TXTBOX_TOPLEFT].y-aptlPoints[TXTBOX_BOTTOMLEFT].y-2*yVal-7 634 581 : deltaY=0 ; 635 582 WinSetWindowPos(hwndBubbleWindow, 636 583 HWND_TOP, 637 ptl.x+xVal+deltaX,ptl.y+yVal+deltaY, 584 ptl.x+xVal+deltaX,ptl.y+yVal+deltaY, 638 585 aptlPoints[TXTBOX_BOTTOMRIGHT].x-aptlPoints[TXTBOX_BOTTOMLEFT].x+8, 639 586 aptlPoints[TXTBOX_TOPLEFT].y-aptlPoints[TXTBOX_BOTTOMLEFT].y+2, … … 643 590 hwndBubbleWindow, 644 591 ptl.x+xVal+deltaX+5 645 ,ptl.y+yVal+deltaY-5, 592 ,ptl.y+yVal+deltaY-5, 646 593 aptlPoints[TXTBOX_BOTTOMRIGHT].x-aptlPoints[TXTBOX_BOTTOMLEFT].x+8, 647 594 aptlPoints[TXTBOX_TOPLEFT].y-aptlPoints[TXTBOX_BOTTOMLEFT].y+2, 648 595 SWP_ZORDER|SWP_SIZE|SWP_MOVE|SWP_SHOW); 649 596 650 597 /* Set bubble text */ 651 598 WinSetWindowText(hwndBubbleClient,winText); 652 WinStartTimer(WinQueryAnchorBlock(hwnd),hwnd,1,35); 599 WinStartTimer(WinQueryAnchorBlock(hwnd),hwnd,1,35); 653 600 } // end if(!hwndBubbleWindow) 654 601 break; … … 666 613 WinQueryWindowRect(hwnd, &rclWork); 667 614 if(!WinPtInRect(WinQueryAnchorBlock(hwnd),&rclWork,&ptl)) 668 { // Window has changed 615 { // Window has changed 669 616 WinStopTimer(WinQueryAnchorBlock(hwnd), hwnd, 1); // stop the running timer 670 if(hwndBubbleWindow) 617 if(hwndBubbleWindow) 671 618 WinDestroyWindow(hwndBubbleWindow);/* close the bubblewindow */ 672 619 hwndBubbleWindow=0; … … 694 641 break; 695 642 default: 696 break; 643 break; 697 644 } 698 645 return pfnwpOldLPProc(hwnd, msg, mp1, mp2); … … 701 648 void LPList::lplRefreshAllPads() 702 649 { 703 650 704 651 } 705 652 … … 711 658 LPObject::~LPObject(void) 712 659 { 713 #if 0714 if(hPtr) {715 if(!WinDestroyPointer(hPtr))716 DosBeep(100,200);717 }718 #endif719 660 } 720 661 … … 766 707 if(hwndLaunchPad) 767 708 WinDestroyWindow(hwndLaunchPad); 768 709 769 710 /* Remove this pad from the list of pads */ 770 711 lplTemp=lplAllLPads; … … 844 785 } 845 786 } 846 787 847 788 lpBuildObjectList(chrConfigID); 848 789 … … 859 800 /* Refresh all launchpads */ 860 801 LPList *lplTemp; 861 802 862 803 //lplTemp=lplAllLPads; 863 804 lplTemp=*lpList; … … 902 843 } 903 844 } 904 905 lpSaveObjectList(); 845 846 lpSaveObjectList(); 906 847 lpRefreshLaunchPad(); 907 848 … … 967 908 if((lpoTempNew=new LPObject(wpTempObject->wpQueryIcon()))!=NULL) { 968 909 ULONG ulRC; 969 910 970 911 lpoTempNew->wpObject=wpTempObject; 971 912 lpoTempNew->wpObject->wpLockObject(); … … 1017 958 if(!SysCheckFileExists(chrConfigTarget)) 1018 959 return FALSE; /* No install dir defined */ 1019 960 1020 961 sprintf(chrPath,"OBJECTID=%s",chrConfigID); 1021 962 if((hObject2=WinCreateObject("WPFolder", chrConfigID, chrPath,chrConfigTarget,CO_FAILIFEXISTS))==NULLHANDLE) 1022 963 return FALSE; /* Can't create new toolbar folder */ 1023 964 } 1024 965 1025 966 /* Get toolbar folder */ 1026 967 if(somIsObj(wpParentFolder)) { … … 1038 979 wpFolder->wpQueryRealName(chrPath, &ulBufferSize, TRUE); 1039 980 strcat(chrPath,"\\objects.ini");/* Ini-File containing the hobjects */ 1040 1041 // WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, chrPath, "~launchPad", 123, MB_OK| MB_MOVEABLE); 981 982 // WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, chrPath, "~launchPad", 123, MB_OK| MB_MOVEABLE); 1042 983 do{ 1043 984 /* Open the ini-file */ 1044 985 if((hIni=PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP),chrPath))==NULLHANDLE) 1045 break; 986 break; 1046 987 1047 988 if((memPtr=(char*)malloc(ulNumObjects*sizeof(HOBJECT)))==NULL) 1048 989 break; 1049 990 1050 991 1051 992 hObject=(HOBJECT*)memPtr; … … 1064 1005 1065 1006 free(hObject); 1066 1007 1067 1008 PrfCloseProfile(hIni); 1068 1009 return TRUE; … … 1083 1024 WPObject* wpObject; 1084 1025 1085 char chrText[200]; 1026 char chrText[200]; 1086 1027 ULONG ul; 1087 1028 … … 1113 1054 wpFolder->wpQueryRealName(chrPath, &ulBufferSize, TRUE); 1114 1055 strcat(chrPath,"\\objects.ini");/* Ini-File containing the hobjects */ 1115 1056 1116 1057 do{ 1117 1058 /* Open the ini-file */ 1118 1059 if((hIni=PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP),chrPath))==NULLHANDLE) 1119 break; 1120 1060 break; 1061 1121 1062 if(!PrfQueryProfileSize(hIni,"objects","handles", &ulBufferSize)) 1122 1063 break; … … 1127 1068 if((memPtr=(char*)malloc(ulBufferSize))==NULL) 1128 1069 break; 1129 1130 ulNumObjects=ulBufferSize/sizeof(HOBJECT); 1070 1071 ulNumObjects=ulBufferSize/sizeof(HOBJECT); 1131 1072 1132 1073 if(!PrfQueryProfileData(hIni,"objects","handles", memPtr, &ulBufferSize)){ … … 1149 1090 strncpy(lpoTemp->chrName, wpTempObject->wpQueryTitle(),sizeof(lpoTemp->chrName)); 1150 1091 lpoTemp->lpParent=this; 1151 1092 1152 1093 lpoTemp->lpoNext=lpoObjectList; 1153 1094 lpoObjectList=lpoTemp; … … 1158 1099 } 1159 1100 }/* for */ 1160 1101 1161 1102 free(hObjectArray); 1162 1103 1163 1104 PrfCloseProfile(hIni); 1164 1105 return TRUE; … … 1249 1190 for(a=ulNumObjects;a>0 && lpoTemp; a--) 1250 1191 { 1251 /* Create Buttons */ 1192 /* Create Buttons */ 1252 1193 if((hwndTemp=WinCreateWindow(hwndLaunchPad, WC_BUTTON, lpoTemp->chrName, WS_VISIBLE, xButtonOffset+(a-1)*(swp.cy+xButtonDelta), 1, swp.cy-2, swp.cy-2, 1253 1194 hwndLaunchPad, HWND_TOP, a*100, … … 1276 1217 lpoTemp=lpoTemp->lpoNext; 1277 1218 } 1278 return TRUE; 1279 } 1280 1281 1282 1219 return TRUE; 1220 } 1221
Note:
See TracChangeset
for help on using the changeset viewer.