Changeset 126 for branches


Ignore:
Timestamp:
Jul 1, 2008, 4:56:49 PM (17 years ago)
Author:
lpino
Message:

Changed the comment styles

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/watcom_ant17_java141/src/plugins/org.eclipse.swt/Eclipse SWT PI/pm/library/editcol.c

    r14 r126  
    1 //=========================================================================\
     1/*=========================================================================\
    22// editcol.c : color wheel dlg procedure                                   |
    33// version 1.1                                                             |
    4 //=========================================================================/
     4//=========================================================================*/
    55
    66#pragma strings(readonly)
     
    1414
    1515
    16 //=========================================================================\
     16/*=========================================================================\
    1717// WinEditColorDlg():                                                      |
    1818// parameters: ----------------------------------------------------------- |
     
    2323// returned value: ------------------------------------------------------- |
    2424// LONG lColor      : RGB color (success), CLR_ERROR (failure)             |
    25 //=========================================================================/
     25//=========================================================================*/
    2626
    2727
     
    3333   ULONG i;
    3434
    35    // allocate storage for application data
     35   /* allocate storage for application data */
    3636   if (DosAllocMem((PPVOID)&pad, sizeof(APPDATA),
    3737       PAG_READ | PAG_WRITE | PAG_COMMIT))
    3838      return CLR_ERROR;
    39    // initialize APPDATA structure (size)
     39   /* initialize APPDATA structure (size) */
    4040   pad->cbSize = sizeof(APPDATA);
    41    // anchor block
     41   /* anchor block */
    4242   pad->hab = WinQueryAnchorBlock(hwndOwner);
    43    // window handles
     43   /* window handles */
    4444   pad->hwndParent = hwndParent;
    4545   pad->hwndOwner = hwndOwner;
    46    // query the OS version
     46   /* query the OS version */
    4747   DosQuerySysInfo(QSV_VERSION_MINOR, QSV_VERSION_MINOR,
    4848                   &pad->ulVer, sizeof(ULONG));
    49    // sets msg value according to OS version
    50    if (pad->ulVer > 30) {                  // warp 4
     49   /* sets msg value according to OS version */
     50   if (pad->ulVer > 30) {                  /* warp 4 */
    5151      pad->cwChangedMsg = WM_COLORWHEELCHANGED;
    5252      pad->cwSetMsg = CWM_COLORWHEELSETVAL;
    53    } else {                                // warp 3 (warp 2?)
     53   } else {                                /* warp 3 (warp 2?) */
    5454      pad->cwChangedMsg = WM_COLORWHEELCHANGED3;
    5555      pad->cwSetMsg = CWM_COLORWHEELSETVAL3;
    5656   } /* endif */
    57    // register the color wheel control
     57   /* register the color wheel control */
    5858   if (NULLHANDLE == (pad->hlib = WinLoadLibrary(pad->hab, "WPCONFIG.DLL")))
    5959      return CLR_ERROR;
    60    // get the module handle to load the dialog from the DLL
     60   /* get the module handle to load the dialog from the DLL */
    6161   if (DosQueryModuleHandle(SZ_MODULE, &pad->hDlgMod))
    6262      return CLR_ERROR;
    63    // copy the start color
     63   /* copy the start color */
    6464   pad->clrCurr.lClr = pad->clrUndo.lClr = color;
    65    // gets the dialog title, if pszTitle is NULL set the default
     65   /* gets the dialog title, if pszTitle is NULL set the default */
    6666   if (!pszTitle) pszTitle = SZ_DEFTITLE;
    67    // code equivalent to strncpy to make DLL smaller
     67   /* code equivalent to strncpy to make DLL smaller */
    6868   for (i = 0;
    6969        pad->achDlgTitle[i++] = *pszTitle++;
     
    7878
    7979
    80 //=========================================================================\
     80/*=========================================================================\
    8181// EditColorDlgProc(): color wheel dlg procedure                           |
    8282// processed messages: - WM_INITDLG                                        |
     
    8686//                     - WM_CLOSE                                          |
    8787//                     - WM_DESTROY                                        |
    88 //=========================================================================/
     88//=========================================================================*/
    8989
    9090MRESULT EXPENTRY EditColorDlgProc(HWND hwnd,
     
    9393                                  MPARAM mp2) {
    9494   switch (msg) {
    95    // init -----------------------------------------------------------------
     95   /* init ----------------------------------------------------------------- */
    9696      case WM_INITDLG: {
    9797         PAPPDATA pad = (PAPPDATA)mp2;
    9898         WinSetWindowPtr(hwnd, 0L, (PVOID)mp2);
    9999         WinSetWindowText(hwnd, pad->achDlgTitle);
    100          SetSpins(hwnd, pad->clrUndo); // initialize spinbutton
    101          // initialize the color wheel control
     100         SetSpins(hwnd, pad->clrUndo); /* initialize spinbutton */
     101         /* initialize the color wheel control */
    102102         WinSendDlgItemMsg(hwnd, CWHEEL, pad->cwSetMsg,
    103103                           (MPARAM)pad->clrUndo.lClr, MPVOID);
    104          pad->flUpd = TRUE;            // sets the update flag
    105          // show the dialog in the middle of the parent window
     104         pad->flUpd = TRUE;            /* sets the update flag */
     105         /* show the dialog in the middle of the parent window */
    106106         WinQueryWindowRect(pad->hwndParent, &pad->rclPar);
    107107         WinQueryWindowRect(hwnd, &pad->rcl);
     
    111111                         0, 0, SWP_MOVE | SWP_SHOW);
    112112         break;
    113       } // end case WM_INITDLG
    114    // a new color has been set through the color wheel ---------------------
     113      } /* end case WM_INITDLG */
     114   /* a new color has been set through the color wheel --------------------- */
    115115      case WM_COLORWHEELCHANGED3:
    116116      case WM_COLORWHEELCHANGED: {
    117117         PAPPDATA pad = WinQueryWindowPtr(hwnd, 0L);
    118118         pad->clrCurr.lClr = (LONG)mp1;
    119          pad->flUpd = FALSE;           // reset update flag
     119         pad->flUpd = FALSE;           /* reset update flag */
    120120         SetSpins(hwnd, pad->clrCurr);
    121          pad->flUpd = TRUE;            // set update flag
    122          // notify new color to owner
     121         pad->flUpd = TRUE;            /* set update flag */
     122         /* notify new color to owner */
    123123         WinSendMsg(pad->hwndOwner, msg, mp1, mp2);
    124124         break;
    125       } // end case WM_COLORWHEELCHANGED
    126    // spinbutton value has changed -----------------------------------------
     125      } /* end case WM_COLORWHEELCHANGED */
     126   /* spinbutton value has changed ----------------------------------------- */
    127127      case WM_CONTROL:
    128          if ((SHORT1FROMMP(mp1) == SPN_RED ||      // if a spin button
    129               SHORT1FROMMP(mp1) == SPN_GREEN ||    // originated SPBN_CHANGE
    130               SHORT1FROMMP(mp1) == SPN_BLUE) &&    // or SPBN_ENDSPIN
     128         if ((SHORT1FROMMP(mp1) == SPN_RED ||      /* if a spin button */
     129              SHORT1FROMMP(mp1) == SPN_GREEN ||    /* originated SPBN_CHANGE */
     130              SHORT1FROMMP(mp1) == SPN_BLUE) &&    /* or SPBN_ENDSPIN */
    131131             (SHORT2FROMMP(mp1) == SPBN_CHANGE ||
    132132              SHORT2FROMMP(mp1) == SPBN_ENDSPIN)) {
    133133            PAPPDATA pad = WinQueryWindowPtr(hwnd, 0L);
    134134            ULONG ulVal;
    135             if (!pad->flUpd) break; // value changed on init or by colorwheel
    136             // query new spinbutton value
     135            if (!pad->flUpd) break; /* value changed on init or by colorwheel */
     136            /* query new spinbutton value */
    137137            WinSendMsg(HWNDFROMMP(mp2), SPBM_QUERYVALUE,
    138138                       (MPARAM)&ulVal, MPFROM2SHORT(0, SPBQ_ALWAYSUPDATE));
     
    146146            WinSendMsg(pad->hwndOwner, pad->cwChangedMsg, // notify owner
    147147                          (MPARAM)pad->clrCurr.lClr, MPVOID);
    148          } // end if
    149          break;
    150    // user clicked on a PUSHBUTTON -----------------------------------------
     148         } /* end if */
     149         break;
     150   /* user clicked on a PUSHBUTTON ----------------------------------------- */
    151151      case WM_COMMAND: {
    152152         PAPPDATA pad = WinQueryWindowPtr(hwnd, 0L);
    153153         switch ((USHORT)mp1) {
    154             case BTN_OK:            // OK: return current color
     154            case BTN_OK:            /* OK: return current color */
    155155               WinDismissDlg(hwnd, pad->clrCurr.lClr);
    156156               break;
    157             case BTN_UNDO:          // UNDO: restore start color
     157            case BTN_UNDO:          /* UNDO: restore start color */
    158158               SetSpins(hwnd, pad->clrUndo);
    159159               WinSendDlgItemMsg(hwnd, CWHEEL, pad->cwSetMsg,
    160160                                 (MPARAM)pad->clrUndo.lClr, MPVOID);
    161161               break;
    162             default:                // CANCEL: return start color
     162            default:                /* CANCEL: return start color */
    163163               WinDismissDlg(hwnd, pad->clrUndo.lClr);
    164164              break;
    165165         } /* endswitch */
    166166         break;
    167       } // end case WM_COMMAND
    168    // user closed the "edit color" dialog window ---------------------------
    169       case WM_CLOSE: {              // return start color
     167      } /* end case WM_COMMAND */
     168   /* user closed the "edit color" dialog window --------------------------- */
     169      case WM_CLOSE: {              /* return start color */
    170170         PAPPDATA pad = WinQueryWindowPtr(hwnd, 0L);
    171171         WinDismissDlg(hwnd, pad->clrUndo.lClr);
    172172         break;
    173       } // end case WM_CLOSE
     173      } /* end case WM_CLOSE */
    174174      case WM_DESTROY: {
    175175         PAPPDATA pad = WinQueryWindowPtr(hwnd, 0L);
     
    177177         DosFreeMem(pad);
    178178         break;
    179       } // end case WM_DESTROY
     179      } /* end case WM_DESTROY */
    180180      default:
    181181         return WinDefDlgProc(hwnd, msg, mp1, mp2);
     
    185185
    186186
    187 //=========================================================================\
     187/*=========================================================================\
    188188// SetSpins() : sets the spinbutton values on initialization and when a    |
    189189//              new color is set through the Color Wheel control           |
     
    193193// returned value: ------------------------------------------------------- |
    194194// VOID                                                                    |
    195 //=========================================================================/
     195//=========================================================================*/
    196196
    197197
Note: See TracChangeset for help on using the changeset viewer.