Changeset 117 for branches/v2.9_Lars


Ignore:
Timestamp:
Oct 6, 2023, 2:27:09 AM (22 months ago)
Author:
erdmann
Message:

attempt to fix Netlabs ticket #19

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/v2.9_Lars/mediafolder/c/helper/launchpad.cpp

    r57 r117  
    1818 */
    1919
    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
    2523
    2624#include "mediafolder.hh"
    2725#include "launchpad.hh"
     26#include "cwcdtrack.hh"
    2827
    2928#include <os2.h>
     
    5756MRESULT EXPENTRY shadowProc(HWND hwnd, ULONG msg,MPARAM mp1,MPARAM mp2 );
    5857
     58
     59BOOL 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
    5981/******************************************************************************/
    6082/*  New button procedure which handles the context menu stuff for the objects */
     
    7597  switch (msg)
    7698    {
    77 #if 0
    78     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 0
    86             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 #endif
    93             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 #endif
    13099    case WM_PAINT:
    131100      lpo=(LPObject*)WinQueryWindowULong(hwnd,QWL_USER);
     
    166135      {
    167136        BOOL bReturn=FALSE;
    168        
     137
    169138        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           }
    202171        }
    203172        CATCH(LP_DRAGOVER)
    204           {
    205           } END_CATCH;
    206           if(bReturn)
    207             return wpObject->wpDragOver(hwndMenu,(PDRAGINFO) mp1);
    208           break;
     173        {
     174        } END_CATCH;
     175        if(bReturn)
     176         return wpObject->wpDragOver(hwndMenu,(PDRAGINFO) mp1);
     177        break;
    209178      }
    210179    case DM_DRAGLEAVE:
     
    213182        SWP swp;
    214183        HPS hps;
    215        
     184
    216185        /* Remove target emphasis here */
    217186        hps=DrgGetPS(hwnd);
     
    221190        rectl.xRight=swp.cx-1;
    222191        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);
    224193        bDrawn=FALSE;
    225194        DrgReleasePS(hps);
     
    238207          if(lpo) {
    239208            wpObject=lpo->wpObject;
    240             if(somIsObj(wpObject)) { 
     209            if(somIsObj(wpObject)) {
    241210              pDragInfo=(PDRAGINFO) mp1;
    242211              pDragItem=DrgQueryDragitemPtr(pDragInfo, 0);
     
    264233        if(somIsObj(wpObject)) {
    265234          if((SHORT)0x6d==SHORT1FROMMP(mp1)) {
    266             /* Delete menu item */       
     235            /* Delete menu item */
    267236            if(wpObject->wpDelete(CONFIRM_DELETE|CONFIRM_DELETEFOLDER ) == OK_DELETE)
    268237              lpo->lpParent->lpRemoveButton(lpo);
     
    272241        }/* end of if(somIsObj(wpObject)) */
    273242      }
    274       } 
     243      }
    275244      CATCH(LP_COMMAND)
    276245        {
     
    288257static MRESULT handleDragOver(HWND hwnd, MPARAM mp1, MPARAM mp2)
    289258{
    290   MRESULT mResult;
    291259  ULONG ulNumberOfObjects;
    292260  PDRAGINFO pDragInfo;
     
    294262  RECTL rectl;
    295263  SWP swp;
    296 
    297   mResult = MRFROM2SHORT( DOR_NODROPOP, DO_LINK);
    298  
     264  USHORT usIndicator=DOR_NEVERDROP,usOp=0;
     265  WPObject *wpObject = NULL;
     266
    299267  /* Get access to the dragInfo */
    300268  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       }
     353quit:
     354     /* Free the draginfo */
     355     DrgFreeDraginfo(pDragInfo);
    309356  }
    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);
    366358}
    367359
     
    375367  /* Remove target emphasis here */
    376368  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);
    378370  DrgReleasePS(hps);
    379   bDrawn=FALSE; 
     371  bDrawn=FALSE;
    380372  return (MRESULT) FALSE;
    381373}
    382374
    383375
    384 static MRESULT EXPENTRY launchPadWindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 
     376static MRESULT EXPENTRY launchPadWindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    385377{
    386378  WPFolder* thisPtr;
    387379  launchPad * lp;
    388380  LPObject *lpo;
    389   static USHORT id=0;//Initialisation new in V1.00a 
     381  static USHORT id=0;//Initialisation new in V1.00a
    390382
    391383  switch(msg)
    392384    {
    393 #if 0
    394     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 #endif
    407385    case WM_PAINT:
    408386      {
     
    426404    case DM_DROP:
    427405      {
    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) {
    436407          /* A new object dropped on the launchpad */
    437           pDragInfo=(PDRAGINFO)mp1;
     408          PDRAGINFO pDragInfo=(PDRAGINFO)mp1;
    438409          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);
    451410              lp=(launchPad*)WinQueryWindowULong(hwnd,QWL_USER);
    452411              if(lp) {
    453                 if(somIsObj(wpObject)) {
    454  
     412                  PDRAGITEM pDragItem=DrgQueryDragitemPtr( pDragInfo, 0);
     413                  WPObject *wpObject=(WPObject*)OBJECT_FROM_PREC(pDragItem->ulItemID);
    455414                  POINTL ptl;
    456415                  int numB;
    457416                  SWP swp;
    458                  
     417
    459418                  WinQueryWindowPos(hwnd,&swp);
    460419                  ptl.x=pDragInfo->xDrop;
     
    467426                  /* Do a link */
    468427                  lp->lpAddButton(wpObject, numB);
    469                   handleDragLeave(hwnd, mp1, mp2);
    470                 }
    471428              }
    472               DrgDeleteDraginfoStrHandles(pDragInfo);
     429              myDrgDeleteDraginfoStrHandles(pDragInfo);
    473430              DrgFreeDraginfo(pDragInfo);
    474             }
    475431          }
    476432          handleDragLeave(hwnd, mp1, mp2);
     
    479435          {
    480436          } END_CATCH;
    481          
    482           break;
     437          return MRFROMLONG(0);
    483438      }
    484439    case DM_DRAGLEAVE:
     
    496451      return (MRESULT)FALSE;
    497452      /***********************************************/
    498       /* Stuff for fly over help                     */ 
     453      /* Stuff for fly over help                     */
    499454    case WM_MOUSEMOVE:
    500455      launchPad * lp;
     
    506461        }
    507462      }
    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
    520464      if(!hwndBubbleWindow)
    521465        WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, 2,(ULONG)iTBFlyOverDelay); // New timer for delay       
     
    541485      HPS  hps;
    542486      RECTL   rcl;
    543  
     487
    544488      /*  we have to build a new information window  */
    545       if(hwndBubbleWindow){// if(){...} new in V1.00a 
     489      if(hwndBubbleWindow){// if(){...} new in V1.00a
    546490        WinDestroyWindow(hwndBubbleWindow);/*  close the bubblewindow  */
    547491        hwndBubbleWindow=NULL;
     
    551495      WinMapWindowPoints(HWND_DESKTOP,hwnd,&ptl,1);
    552496      WinQueryWindowRect(hwnd,&rclWork);                               
    553       if(!hwndBubbleWindow 
     497      if(!hwndBubbleWindow
    554498         && WinPtInRect(WinQueryAnchorBlock(hwnd),&rclWork,&ptl)
    555499         && bTBFlyOverEnabled) {
    556        
     500
    557501        static HWND hwndBubbleClient;
    558502        ULONG style=FCF_BORDER|FCF_NOBYTEALIGN;
    559503        char winText[255] = {0};
    560        
     504
    561505        /* Get window text for size calculating */
    562506            lp=(launchPad*)WinQueryWindowULong(hwnd,QWL_USER);
     
    567511
    568512        ulWinTextLen=(LONG)strlen(winText); // Query text length
    569        
     513
    570514        /* Delete 'Returns' in object title */
    571515        char *pBuchst;
     
    579523          pRest=pBuchst;
    580524        }
    581        
     525
    582526        /* Create help window */
    583527        hwndBubbleWindow=WinCreateStdWindow(HWND_DESKTOP,
     
    612556        GpiQueryTextBox(hps,ulWinTextLen,winText,TXTBOX_COUNT,aptlPoints);
    613557        WinEndPaint(hps);
    614        
     558
    615559        /* Set colors */
    616560        WinSetPresParam(hwndBubbleClient,
     
    620564                        PP_FOREGROUNDCOLOR,sizeof(rgbTBFlyForeground) ,
    621565                        &rgbTBFlyForeground );
    622        
     566
    623567        /* Calculate bubble positon and show bubble */
    624568        WinQueryPointerPos(HWND_DESKTOP,&ptl);//Query pointer position in the desktop window
    625569        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
    629573              : 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
    633577          ? deltaY=-aptlPoints[TXTBOX_TOPLEFT].y-aptlPoints[TXTBOX_BOTTOMLEFT].y-2*yVal-7
    634578              : deltaY=0 ;             
    635579        WinSetWindowPos(hwndBubbleWindow,
    636580                        HWND_TOP,
    637                         ptl.x+xVal+deltaX,ptl.y+yVal+deltaY, 
     581                        ptl.x+xVal+deltaX,ptl.y+yVal+deltaY,
    638582                        aptlPoints[TXTBOX_BOTTOMRIGHT].x-aptlPoints[TXTBOX_BOTTOMLEFT].x+8,
    639583                        aptlPoints[TXTBOX_TOPLEFT].y-aptlPoints[TXTBOX_BOTTOMLEFT].y+2,
     
    643587                        hwndBubbleWindow,
    644588                        ptl.x+xVal+deltaX+5
    645                         ,ptl.y+yVal+deltaY-5, 
     589                        ,ptl.y+yVal+deltaY-5,
    646590                        aptlPoints[TXTBOX_BOTTOMRIGHT].x-aptlPoints[TXTBOX_BOTTOMLEFT].x+8,
    647591                        aptlPoints[TXTBOX_TOPLEFT].y-aptlPoints[TXTBOX_BOTTOMLEFT].y+2,
    648592                        SWP_ZORDER|SWP_SIZE|SWP_MOVE|SWP_SHOW);
    649        
     593
    650594        /* Set bubble text */
    651595        WinSetWindowText(hwndBubbleClient,winText);
    652         WinStartTimer(WinQueryAnchorBlock(hwnd),hwnd,1,35); 
     596        WinStartTimer(WinQueryAnchorBlock(hwnd),hwnd,1,35);
    653597      } // end if(!hwndBubbleWindow)
    654598      break;
     
    666610            WinQueryWindowRect(hwnd, &rclWork);
    667611            if(!WinPtInRect(WinQueryAnchorBlock(hwnd),&rclWork,&ptl))
    668               { // Window has changed                            
     612              { // Window has changed                           
    669613                WinStopTimer(WinQueryAnchorBlock(hwnd), hwnd, 1);  // stop the running timer
    670                 if(hwndBubbleWindow) 
     614                if(hwndBubbleWindow)
    671615                  WinDestroyWindow(hwndBubbleWindow);/*  close the bubblewindow  */
    672616                hwndBubbleWindow=0;
     
    694638      break;
    695639    default:
    696       break;   
     640      break;
    697641    }
    698642  return pfnwpOldLPProc(hwnd, msg, mp1, mp2);
     
    701645void LPList::lplRefreshAllPads()
    702646{
    703  
     647
    704648}
    705649
     
    711655LPObject::~LPObject(void)
    712656{
    713 #if 0
    714   if(hPtr) {
    715     if(!WinDestroyPointer(hPtr))
    716       DosBeep(100,200);
    717   }
    718 #endif
    719657}
    720658
     
    766704  if(hwndLaunchPad)
    767705    WinDestroyWindow(hwndLaunchPad);
    768    
     706
    769707  /* Remove this pad from the list of pads */
    770708  lplTemp=lplAllLPads;
     
    844782      }
    845783    }
    846  
     784
    847785  lpBuildObjectList(chrConfigID);
    848786
     
    859797  /* Refresh all launchpads */
    860798  LPList *lplTemp;
    861  
     799
    862800  //lplTemp=lplAllLPads;
    863801  lplTemp=*lpList;
     
    902840      }
    903841  }
    904  
    905   lpSaveObjectList();   
     842
     843  lpSaveObjectList();
    906844  lpRefreshLaunchPad();
    907845
     
    967905        if((lpoTempNew=new LPObject(wpTempObject->wpQueryIcon()))!=NULL) {
    968906          ULONG ulRC;
    969          
     907
    970908          lpoTempNew->wpObject=wpTempObject;
    971909          lpoTempNew->wpObject->wpLockObject();
     
    1017955      if(!SysCheckFileExists(chrConfigTarget))
    1018956        return FALSE; /* No install dir defined */
    1019      
     957
    1020958      sprintf(chrPath,"OBJECTID=%s",chrConfigID);
    1021959      if((hObject2=WinCreateObject("WPFolder", chrConfigID, chrPath,chrConfigTarget,CO_FAILIFEXISTS))==NULLHANDLE)
    1022960        return FALSE; /* Can't create new toolbar folder */
    1023961    }
    1024  
     962
    1025963  /* Get toolbar folder */
    1026964  if(somIsObj(wpParentFolder)) {
     
    1038976  wpFolder->wpQueryRealName(chrPath, &ulBufferSize, TRUE);
    1039977  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);
    1042980  do{
    1043981    /* Open the ini-file */
    1044982    if((hIni=PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP),chrPath))==NULLHANDLE)
    1045       break; 
     983      break;
    1046984
    1047985    if((memPtr=(char*)malloc(ulNumObjects*sizeof(HOBJECT)))==NULL)
    1048986      break;
    1049    
     987
    1050988
    1051989    hObject=(HOBJECT*)memPtr;
     
    10641002
    10651003    free(hObject);
    1066    
     1004
    10671005    PrfCloseProfile(hIni);
    10681006    return TRUE;
     
    10831021  WPObject* wpObject;
    10841022
    1085   char chrText[200]; 
     1023  char chrText[200];
    10861024  ULONG ul;
    10871025
     
    11131051  wpFolder->wpQueryRealName(chrPath, &ulBufferSize, TRUE);
    11141052  strcat(chrPath,"\\objects.ini");/* Ini-File containing the hobjects */
    1115  
     1053
    11161054  do{
    11171055    /* Open the ini-file */
    11181056    if((hIni=PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP),chrPath))==NULLHANDLE)
    1119       break; 
    1120  
     1057      break;
     1058
    11211059    if(!PrfQueryProfileSize(hIni,"objects","handles", &ulBufferSize))
    11221060      break;
     
    11271065    if((memPtr=(char*)malloc(ulBufferSize))==NULL)
    11281066      break;
    1129    
    1130     ulNumObjects=ulBufferSize/sizeof(HOBJECT);   
     1067
     1068    ulNumObjects=ulBufferSize/sizeof(HOBJECT);
    11311069
    11321070    if(!PrfQueryProfileData(hIni,"objects","handles", memPtr, &ulBufferSize)){
     
    11491087            strncpy(lpoTemp->chrName, wpTempObject->wpQueryTitle(),sizeof(lpoTemp->chrName));
    11501088            lpoTemp->lpParent=this;
    1151            
     1089
    11521090            lpoTemp->lpoNext=lpoObjectList;
    11531091            lpoObjectList=lpoTemp;
     
    11581096        }
    11591097      }/* for */
    1160    
     1098
    11611099    free(hObjectArray);
    1162    
     1100
    11631101    PrfCloseProfile(hIni);
    11641102    return TRUE;
     
    12491187  for(a=ulNumObjects;a>0 && lpoTemp; a--)
    12501188    {
    1251       /* Create Buttons */ 
     1189      /* Create Buttons */
    12521190      if((hwndTemp=WinCreateWindow(hwndLaunchPad, WC_BUTTON, lpoTemp->chrName, WS_VISIBLE, xButtonOffset+(a-1)*(swp.cy+xButtonDelta), 1, swp.cy-2, swp.cy-2,
    12531191                                   hwndLaunchPad, HWND_TOP, a*100,
     
    12761214      lpoTemp=lpoTemp->lpoNext;
    12771215    }
    1278   return TRUE; 
    1279 }
    1280 
    1281 
    1282 
     1216  return TRUE;
     1217}
     1218
Note: See TracChangeset for help on using the changeset viewer.