Ignore:
Timestamp:
Nov 29, 2023, 5:59:34 PM (21 months ago)
Author:
gyoung
Message:

Merge Lar's 2.9 branch into the trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mediafolder/c/helper/launchpad.cpp

    r57 r133  
    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>
     
    3231
    3332#include "sys_funcs.h"
     33SOMClass* somhlpGetSomClass(char* chrClassName);
    3434
    3535extern HWND hwndShadow;// The handle of the help window
     
    5757MRESULT EXPENTRY shadowProc(HWND hwnd, ULONG msg,MPARAM mp1,MPARAM mp2 );
    5858
     59
     60BOOL 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
    5982/******************************************************************************/
    6083/*  New button procedure which handles the context menu stuff for the objects */
     
    7598  switch (msg)
    7699    {
    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
    130100    case WM_PAINT:
    131101      lpo=(LPObject*)WinQueryWindowULong(hwnd,QWL_USER);
     
    166136      {
    167137        BOOL bReturn=FALSE;
    168        
     138
    169139        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           }
    202172        }
    203173        CATCH(LP_DRAGOVER)
    204           {
    205           } END_CATCH;
    206           if(bReturn)
    207             return wpObject->wpDragOver(hwndMenu,(PDRAGINFO) mp1);
    208           break;
     174        {
     175        } END_CATCH;
     176        if(bReturn)
     177         return wpObject->wpDragOver(hwndMenu,(PDRAGINFO) mp1);
     178        break;
    209179      }
    210180    case DM_DRAGLEAVE:
     
    213183        SWP swp;
    214184        HPS hps;
    215        
     185
    216186        /* Remove target emphasis here */
    217187        hps=DrgGetPS(hwnd);
     
    221191        rectl.xRight=swp.cx-1;
    222192        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);
    224194        bDrawn=FALSE;
    225195        DrgReleasePS(hps);
     
    238208          if(lpo) {
    239209            wpObject=lpo->wpObject;
    240             if(somIsObj(wpObject)) { 
     210            if(somIsObj(wpObject)) {
    241211              pDragInfo=(PDRAGINFO) mp1;
    242212              pDragItem=DrgQueryDragitemPtr(pDragInfo, 0);
     
    264234        if(somIsObj(wpObject)) {
    265235          if((SHORT)0x6d==SHORT1FROMMP(mp1)) {
    266             /* Delete menu item */       
     236            /* Delete menu item */
    267237            if(wpObject->wpDelete(CONFIRM_DELETE|CONFIRM_DELETEFOLDER ) == OK_DELETE)
    268238              lpo->lpParent->lpRemoveButton(lpo);
     
    272242        }/* end of if(somIsObj(wpObject)) */
    273243      }
    274       } 
     244      }
    275245      CATCH(LP_COMMAND)
    276246        {
     
    288258static MRESULT handleDragOver(HWND hwnd, MPARAM mp1, MPARAM mp2)
    289259{
    290   MRESULT mResult;
    291260  ULONG ulNumberOfObjects;
    292261  PDRAGINFO pDragInfo;
     
    294263  RECTL rectl;
    295264  SWP swp;
    296 
    297   mResult = MRFROM2SHORT( DOR_NODROPOP, DO_LINK);
    298  
     265  USHORT usIndicator=DOR_NEVERDROP,usOp=0;
     266  WPObject *wpObject = NULL;
     267
    299268  /* Get access to the dragInfo */
    300269  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       }
     356quit:
     357     /* Free the draginfo */
     358     DrgFreeDraginfo(pDragInfo);
    309359  }
    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);
    366361}
    367362
     
    375370  /* Remove target emphasis here */
    376371  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);
    378373  DrgReleasePS(hps);
    379   bDrawn=FALSE; 
     374  bDrawn=FALSE;
    380375  return (MRESULT) FALSE;
    381376}
    382377
    383378
    384 static MRESULT EXPENTRY launchPadWindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 
     379static MRESULT EXPENTRY launchPadWindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    385380{
    386381  WPFolder* thisPtr;
    387382  launchPad * lp;
    388383  LPObject *lpo;
    389   static USHORT id=0;//Initialisation new in V1.00a 
     384  static USHORT id=0;//Initialisation new in V1.00a
    390385
    391386  switch(msg)
    392387    {
    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
    407388    case WM_PAINT:
    408389      {
     
    426407    case DM_DROP:
    427408      {
    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) {
    436410          /* A new object dropped on the launchpad */
    437           pDragInfo=(PDRAGINFO)mp1;
     411          PDRAGINFO pDragInfo=(PDRAGINFO)mp1;
    438412          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);
    451413              lp=(launchPad*)WinQueryWindowULong(hwnd,QWL_USER);
    452414              if(lp) {
    453                 if(somIsObj(wpObject)) {
    454  
     415                  PDRAGITEM pDragItem=DrgQueryDragitemPtr( pDragInfo, 0);
     416                  WPObject *wpObject=(WPObject*)OBJECT_FROM_PREC(pDragItem->ulItemID);
    455417                  POINTL ptl;
    456418                  int numB;
    457419                  SWP swp;
    458                  
     420
    459421                  WinQueryWindowPos(hwnd,&swp);
    460422                  ptl.x=pDragInfo->xDrop;
     
    467429                  /* Do a link */
    468430                  lp->lpAddButton(wpObject, numB);
    469                   handleDragLeave(hwnd, mp1, mp2);
    470                 }
    471431              }
    472               DrgDeleteDraginfoStrHandles(pDragInfo);
     432              myDrgDeleteDraginfoStrHandles(pDragInfo);
    473433              DrgFreeDraginfo(pDragInfo);
    474             }
    475434          }
    476435          handleDragLeave(hwnd, mp1, mp2);
     
    479438          {
    480439          } END_CATCH;
    481          
    482           break;
     440          return MRFROMLONG(0);
    483441      }
    484442    case DM_DRAGLEAVE:
     
    496454      return (MRESULT)FALSE;
    497455      /***********************************************/
    498       /* Stuff for fly over help                     */ 
     456      /* Stuff for fly over help                     */
    499457    case WM_MOUSEMOVE:
    500458      launchPad * lp;
     
    506464        }
    507465      }
    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
    520467      if(!hwndBubbleWindow)
    521468        WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, 2,(ULONG)iTBFlyOverDelay); // New timer for delay       
     
    541488      HPS  hps;
    542489      RECTL   rcl;
    543  
     490
    544491      /*  we have to build a new information window  */
    545       if(hwndBubbleWindow){// if(){...} new in V1.00a 
     492      if(hwndBubbleWindow){// if(){...} new in V1.00a
    546493        WinDestroyWindow(hwndBubbleWindow);/*  close the bubblewindow  */
    547494        hwndBubbleWindow=NULL;
     
    551498      WinMapWindowPoints(HWND_DESKTOP,hwnd,&ptl,1);
    552499      WinQueryWindowRect(hwnd,&rclWork);                               
    553       if(!hwndBubbleWindow 
     500      if(!hwndBubbleWindow
    554501         && WinPtInRect(WinQueryAnchorBlock(hwnd),&rclWork,&ptl)
    555502         && bTBFlyOverEnabled) {
    556        
     503
    557504        static HWND hwndBubbleClient;
    558505        ULONG style=FCF_BORDER|FCF_NOBYTEALIGN;
    559506        char winText[255] = {0};
    560        
     507
    561508        /* Get window text for size calculating */
    562509            lp=(launchPad*)WinQueryWindowULong(hwnd,QWL_USER);
     
    567514
    568515        ulWinTextLen=(LONG)strlen(winText); // Query text length
    569        
     516
    570517        /* Delete 'Returns' in object title */
    571518        char *pBuchst;
     
    579526          pRest=pBuchst;
    580527        }
    581        
     528
    582529        /* Create help window */
    583530        hwndBubbleWindow=WinCreateStdWindow(HWND_DESKTOP,
     
    612559        GpiQueryTextBox(hps,ulWinTextLen,winText,TXTBOX_COUNT,aptlPoints);
    613560        WinEndPaint(hps);
    614        
     561
    615562        /* Set colors */
    616563        WinSetPresParam(hwndBubbleClient,
     
    620567                        PP_FOREGROUNDCOLOR,sizeof(rgbTBFlyForeground) ,
    621568                        &rgbTBFlyForeground );
    622        
     569
    623570        /* Calculate bubble positon and show bubble */
    624571        WinQueryPointerPos(HWND_DESKTOP,&ptl);//Query pointer position in the desktop window
    625572        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
    629576              : 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
    633580          ? deltaY=-aptlPoints[TXTBOX_TOPLEFT].y-aptlPoints[TXTBOX_BOTTOMLEFT].y-2*yVal-7
    634581              : deltaY=0 ;             
    635582        WinSetWindowPos(hwndBubbleWindow,
    636583                        HWND_TOP,
    637                         ptl.x+xVal+deltaX,ptl.y+yVal+deltaY, 
     584                        ptl.x+xVal+deltaX,ptl.y+yVal+deltaY,
    638585                        aptlPoints[TXTBOX_BOTTOMRIGHT].x-aptlPoints[TXTBOX_BOTTOMLEFT].x+8,
    639586                        aptlPoints[TXTBOX_TOPLEFT].y-aptlPoints[TXTBOX_BOTTOMLEFT].y+2,
     
    643590                        hwndBubbleWindow,
    644591                        ptl.x+xVal+deltaX+5
    645                         ,ptl.y+yVal+deltaY-5, 
     592                        ,ptl.y+yVal+deltaY-5,
    646593                        aptlPoints[TXTBOX_BOTTOMRIGHT].x-aptlPoints[TXTBOX_BOTTOMLEFT].x+8,
    647594                        aptlPoints[TXTBOX_TOPLEFT].y-aptlPoints[TXTBOX_BOTTOMLEFT].y+2,
    648595                        SWP_ZORDER|SWP_SIZE|SWP_MOVE|SWP_SHOW);
    649        
     596
    650597        /* Set bubble text */
    651598        WinSetWindowText(hwndBubbleClient,winText);
    652         WinStartTimer(WinQueryAnchorBlock(hwnd),hwnd,1,35); 
     599        WinStartTimer(WinQueryAnchorBlock(hwnd),hwnd,1,35);
    653600      } // end if(!hwndBubbleWindow)
    654601      break;
     
    666613            WinQueryWindowRect(hwnd, &rclWork);
    667614            if(!WinPtInRect(WinQueryAnchorBlock(hwnd),&rclWork,&ptl))
    668               { // Window has changed                            
     615              { // Window has changed                           
    669616                WinStopTimer(WinQueryAnchorBlock(hwnd), hwnd, 1);  // stop the running timer
    670                 if(hwndBubbleWindow) 
     617                if(hwndBubbleWindow)
    671618                  WinDestroyWindow(hwndBubbleWindow);/*  close the bubblewindow  */
    672619                hwndBubbleWindow=0;
     
    694641      break;
    695642    default:
    696       break;   
     643      break;
    697644    }
    698645  return pfnwpOldLPProc(hwnd, msg, mp1, mp2);
     
    701648void LPList::lplRefreshAllPads()
    702649{
    703  
     650
    704651}
    705652
     
    711658LPObject::~LPObject(void)
    712659{
    713 #if 0
    714   if(hPtr) {
    715     if(!WinDestroyPointer(hPtr))
    716       DosBeep(100,200);
    717   }
    718 #endif
    719660}
    720661
     
    766707  if(hwndLaunchPad)
    767708    WinDestroyWindow(hwndLaunchPad);
    768    
     709
    769710  /* Remove this pad from the list of pads */
    770711  lplTemp=lplAllLPads;
     
    844785      }
    845786    }
    846  
     787
    847788  lpBuildObjectList(chrConfigID);
    848789
     
    859800  /* Refresh all launchpads */
    860801  LPList *lplTemp;
    861  
     802
    862803  //lplTemp=lplAllLPads;
    863804  lplTemp=*lpList;
     
    902843      }
    903844  }
    904  
    905   lpSaveObjectList();   
     845
     846  lpSaveObjectList();
    906847  lpRefreshLaunchPad();
    907848
     
    967908        if((lpoTempNew=new LPObject(wpTempObject->wpQueryIcon()))!=NULL) {
    968909          ULONG ulRC;
    969          
     910
    970911          lpoTempNew->wpObject=wpTempObject;
    971912          lpoTempNew->wpObject->wpLockObject();
     
    1017958      if(!SysCheckFileExists(chrConfigTarget))
    1018959        return FALSE; /* No install dir defined */
    1019      
     960
    1020961      sprintf(chrPath,"OBJECTID=%s",chrConfigID);
    1021962      if((hObject2=WinCreateObject("WPFolder", chrConfigID, chrPath,chrConfigTarget,CO_FAILIFEXISTS))==NULLHANDLE)
    1022963        return FALSE; /* Can't create new toolbar folder */
    1023964    }
    1024  
     965
    1025966  /* Get toolbar folder */
    1026967  if(somIsObj(wpParentFolder)) {
     
    1038979  wpFolder->wpQueryRealName(chrPath, &ulBufferSize, TRUE);
    1039980  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);
    1042983  do{
    1043984    /* Open the ini-file */
    1044985    if((hIni=PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP),chrPath))==NULLHANDLE)
    1045       break; 
     986      break;
    1046987
    1047988    if((memPtr=(char*)malloc(ulNumObjects*sizeof(HOBJECT)))==NULL)
    1048989      break;
    1049    
     990
    1050991
    1051992    hObject=(HOBJECT*)memPtr;
     
    10641005
    10651006    free(hObject);
    1066    
     1007
    10671008    PrfCloseProfile(hIni);
    10681009    return TRUE;
     
    10831024  WPObject* wpObject;
    10841025
    1085   char chrText[200]; 
     1026  char chrText[200];
    10861027  ULONG ul;
    10871028
     
    11131054  wpFolder->wpQueryRealName(chrPath, &ulBufferSize, TRUE);
    11141055  strcat(chrPath,"\\objects.ini");/* Ini-File containing the hobjects */
    1115  
     1056
    11161057  do{
    11171058    /* Open the ini-file */
    11181059    if((hIni=PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP),chrPath))==NULLHANDLE)
    1119       break; 
    1120  
     1060      break;
     1061
    11211062    if(!PrfQueryProfileSize(hIni,"objects","handles", &ulBufferSize))
    11221063      break;
     
    11271068    if((memPtr=(char*)malloc(ulBufferSize))==NULL)
    11281069      break;
    1129    
    1130     ulNumObjects=ulBufferSize/sizeof(HOBJECT);   
     1070
     1071    ulNumObjects=ulBufferSize/sizeof(HOBJECT);
    11311072
    11321073    if(!PrfQueryProfileData(hIni,"objects","handles", memPtr, &ulBufferSize)){
     
    11491090            strncpy(lpoTemp->chrName, wpTempObject->wpQueryTitle(),sizeof(lpoTemp->chrName));
    11501091            lpoTemp->lpParent=this;
    1151            
     1092
    11521093            lpoTemp->lpoNext=lpoObjectList;
    11531094            lpoObjectList=lpoTemp;
     
    11581099        }
    11591100      }/* for */
    1160    
     1101
    11611102    free(hObjectArray);
    1162    
     1103
    11631104    PrfCloseProfile(hIni);
    11641105    return TRUE;
     
    12491190  for(a=ulNumObjects;a>0 && lpoTemp; a--)
    12501191    {
    1251       /* Create Buttons */ 
     1192      /* Create Buttons */
    12521193      if((hwndTemp=WinCreateWindow(hwndLaunchPad, WC_BUTTON, lpoTemp->chrName, WS_VISIBLE, xButtonOffset+(a-1)*(swp.cy+xButtonDelta), 1, swp.cy-2, swp.cy-2,
    12531194                                   hwndLaunchPad, HWND_TOP, a*100,
     
    12761217      lpoTemp=lpoTemp->lpoNext;
    12771218    }
    1278   return TRUE; 
    1279 }
    1280 
    1281 
    1282 
     1219  return TRUE;
     1220}
     1221
Note: See TracChangeset for help on using the changeset viewer.