Changeset 178 for trunk/dll/mainwnd.c


Ignore:
Timestamp:
May 28, 2005, 7:42:39 PM (20 years ago)
Author:
root
Message:

Comments and localize code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/mainwnd.c

    r162 r178  
    44  $Id$
    55
    6   Main window
     6  fm/2 main window
    77
    88  Copyright (c) 1993-98 M. Kimes
     
    1515  23 May 05 SHL Use datamin.h
    1616  25 May 05 SHL Use ULONGLONG and CommaFmtULL
     17  26 May 05 SHL Comments and localize code
    1718
    1819***********************************************************************/
     
    5960#pragma alloc_text(MAINOBJ,MainObjectWndProc,MakeMainObjWin)
    6061
    61 extern TOOL *toolhead;
    62 
    63 USHORT firsttool = 0;
    64 
    65 MRESULT EXPENTRY MainObjectWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
     62static USHORT firsttool = 0;
     63
     64static BOOL CloseDirCnrChildren (HWND hwndClient);
     65static BOOL RestoreDirCnrState (HWND hwndClient,CHAR *name,BOOL noview);
     66
     67static MRESULT EXPENTRY MainObjectWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    6668{
    67 
    6869  switch (msg)
    6970  {
     
    211212VOID MakeMainObjWin(VOID * args)
    212213{
    213 
    214214  HAB hab2;
    215215  HMQ hmq2;
     
    255255}
    256256
    257 MRESULT EXPENTRY IdealButtonProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
     257static MRESULT EXPENTRY IdealButtonProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    258258{
    259 
    260259  switch (msg)
    261260  {
     
    273272HWND TopWindow(HWND hwndParent, HWND exclude)
    274273{
    275 
    276274  HENUM henum;
    277275  HWND hwndC = (HWND) 0;
     
    297295HWND TopWindowName(HWND hwndParent, HWND exclude, CHAR * ret)
    298296{
    299 
    300297  HENUM henum;
    301298  HWND hwndC = (HWND) 0, hwndDir, hwndClient;
     
    377374ULONG CountDirCnrs(HWND hwndParent)
    378375{
    379 
    380376  HENUM henum;
    381377  HWND hwndF = (HWND) 0, hwndC, hwndDir;
     
    399395HWND FindDirCnrByName(CHAR * directory, BOOL restore)
    400396{
    401 
    402397  HENUM henum;
    403398  HWND hwndF = (HWND) 0, hwndC, hwndDir;
     
    442437}
    443438
    444 VOID SetToggleChecks(HWND hwndMenu)
     439static VOID SetToggleChecks(HWND hwndMenu)
    445440{
    446 
    447441  WinCheckMenuItem(hwndMenu,
    448442                   IDM_TEXTTOOLS,
     
    480474}
    481475
    482 VOID ResizeTools(HWND hwnd)
     476static VOID ResizeTools(HWND hwnd)
    483477{
    484 
    485478  register ULONG butx = 18L;
    486479  INT attrib = SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_ZORDER | SWP_NOREDRAW,
     
    601594}
    602595
    603 MRESULT EXPENTRY DropDownListProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
     596static MRESULT EXPENTRY DropDownListProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    604597{
    605 
    606598  PFNWP oldproc = (PFNWP) INSTDATA(hwnd);
    607599  static HWND hwndMenu = (HWND) 0;
     
    813805void BubbleHelp(HWND hwnd, BOOL other, BOOL drive, BOOL above, char *help)
    814806{
    815 
    816807  if (help && *help &&
    817808      ((drive && fDrivebarHelp) ||
     
    830821VOID MakeBubble(HWND hwnd, BOOL above, CHAR * help)
    831822{
    832 
    833823  if (!hwnd || !help || !*help)
    834824    return;
     
    952942MRESULT EXPENTRY BubbleProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    953943{
    954 
    955944  switch (msg)
    956945  {
     
    10961085MRESULT EXPENTRY LEDProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    10971086{
    1098 
    10991087  switch (msg)
    11001088  {
     
    12251213MRESULT EXPENTRY ChildButtonProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    12261214{
    1227 
    12281215  USHORT id;
    12291216  register TOOL *tool;
     
    14041391      {
    14051392        DrgFreeDraginfo(pDInfo);
    1406         return (MRFROM2SHORT(DOR_NEVERDROP, 0));        /* Drop not valid  */
     1393        return (MRFROM2SHORT(DOR_NEVERDROP, 0));        /* Drop not valid */
    14071394      }
    14081395      if (!(tool -> flags & T_DROPABLE))
    14091396      {
    14101397        DrgFreeDraginfo(pDInfo);
    1411         return (MRFROM2SHORT(DOR_NEVERDROP, 0));        /* Drop not valid  */
     1398        return (MRFROM2SHORT(DOR_NEVERDROP, 0));        /* Drop not valid */
    14121399      }
    14131400      {
     
    14171404                                     0);        /* Index to DRAGITEM */
    14181405        if (DrgVerifyRMF(pDItem,        /* Check valid rendering */
    1419                          DRM_OS2FILE,   /* mechanisms and data   */
     1406                         DRM_OS2FILE,   /* mechanisms and data */
    14201407                         NULL))
    14211408        {                               /* formats */
     
    14321419      }
    14331420    }
    1434     return (MRFROM2SHORT(DOR_NEVERDROP, 0));    /* Drop not valid                              */
     1421    return (MRFROM2SHORT(DOR_NEVERDROP, 0));    /* Drop not valid */
    14351422
    14361423  case DM_DROPHELP:
     
    15081495VOID BuildTools(HWND hwndT, BOOL resize)
    15091496{
    1510 
    15111497  register TOOL *tool;
    15121498  register ULONG ctrlxpos = 18L;
     
    16651651}
    16661652
    1667 MRESULT EXPENTRY CommandLineProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
     1653static MRESULT EXPENTRY CommandLineProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    16681654{
    1669 
    16701655  PFNWP oldproc = (PFNWP) WinQueryWindowPtr(hwnd, QWL_USER);
    16711656  static BOOL lbup = FALSE;
     
    18381823MRESULT EXPENTRY DriveBackProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    18391824{
    1840 
    18411825  switch (msg)
    18421826  {
     
    19381922MRESULT EXPENTRY DriveProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    19391923{
    1940 
    19411924  USHORT id;
    19421925  static CHAR dv[4];
     
    23612344VOID BuildDrives(HWND hwndT)
    23622345{
    2363 
    23642346  register ULONG x, y = 0;
    23652347  ULONG ulDriveNum, ulDriveMap, iconid;
     
    24632445VOID ResizeDrives(HWND hwndT, long xwidth)
    24642446{
    2465 
    24662447  register ULONG ctrlxpos = 2, ctrlypos = 0, ctrlxsize;
    24672448  HENUM henum;
     
    25112492MRESULT EXPENTRY StatusProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    25122493{
    2513 
    25142494  static HWND hwndE = (HWND) 0, hwndB = (HWND) 0;
    25152495  static CHAR lastcmd[1024] = "";
     
    28642844MRESULT EXPENTRY ToolBackProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    28652845{
    2866 
    28672846  switch (msg)
    28682847  {
     
    29742953}
    29752954
    2976 VOID AdjustSizeOfClient(PSWP pswp, PRECTL prectl)
     2955static VOID AdjustSizeOfClient(PSWP pswp, PRECTL prectl)
    29772956{
    2978 
    29792957  SWP swp;
    29802958  RECTL rectl;
     
    30052983VOID FillClient(HWND hwndClient, PSWP pswp, PRECTL prectl, BOOL avoidtree)
    30062984{
    3007 
    30082985  ULONG adjust;
    30092986
     
    30293006}
    30303007
    3031 VOID MoveChildrenAwayFromTree(HWND hwndClient)
     3008static VOID MoveChildrenAwayFromTree(HWND hwndClient)
    30323009{
    3033 
    30343010  SWP swpC, swpT, swp;
    30353011  USHORT id;
     
    30663042}
    30673043
    3068 VOID ArrangeIcons(HWND hwndClient)
     3044static VOID ArrangeIcons(HWND hwndClient)
    30693045{
    3070 
    30713046  HENUM henum;
    30723047  HWND hwndChild;
     
    30883063}
    30893064
    3090 VOID NextChild(HWND hwndClient, BOOL previous)
     3065static VOID NextChild(HWND hwndClient, BOOL previous)
    30913066{
    3092 
    30933067  HENUM henum;
    30943068  HWND hwndActive, hwndNext, hwndPrev = (HWND) 0;
     
    31473121BOOL CloseChildren(HWND hwndClient)
    31483122{
    3149 
    31503123  HENUM henum;
    31513124  HWND hwndChild;
     
    31793152BOOL CloseDirCnrChildren(HWND hwndClient)
    31803153{
    3181 
    31823154  /* returns TRUE if a directory container window was told to close */
    31833155
     
    32143186BOOL SaveDirCnrState(HWND hwndClient, CHAR * name)
    32153187{
    3216 
    32173188  /* returns TRUE if any directory container windows existed */
    32183189
     
    33083279}
    33093280
    3310 VOID TransformSwp(PSWP pswp, double xtrans, double ytrans)
     3281static VOID TransformSwp(PSWP pswp, double xtrans, double ytrans)
    33113282{
    3312 
    33133283  SWP swp;
    33143284  HWND hwnd;
     
    33483318}
    33493319
    3350 BOOL RestoreDirCnrState(HWND hwndClient, CHAR * name, BOOL noview)
     3320static BOOL RestoreDirCnrState(HWND hwndClient, CHAR * name, BOOL noview)
    33513321{
    3352 
    33533322  /* returns TRUE if a directory container was opened */
    33543323
     
    36663635}
    36673636
    3668 ULONG CountChildren(HWND hwndClient, ULONG * ulNumMinChildren)
     3637static ULONG CountChildren(HWND hwndClient, ULONG * ulNumMinChildren)
    36693638{
    3670 
    36713639  HENUM henum;
    36723640  HWND hwndChild;
     
    36983666                      ULONG * ulNumMinChildrenR)
    36993667{
    3700 
    37013668  register ULONG ulCnt;
    37023669  ULONG ulNumMinChildren;
     
    37443711}
    37453712
    3746 VOID CascadeChildren(HWND hwndClient)
     3713static VOID CascadeChildren(HWND hwndClient)
    37473714{
    3748 
    37493715  ULONG ulCnt = 0L, ulNumMinChildren;
    37503716  HWND hwndChild;
     
    37993765VOID TileChildren(HWND hwndClient, BOOL absolute)
    38003766{
    3801 
    38023767  register ULONG ulChildCnt, ulSquare, ulNumRows, ulNumCols, ulExtraCols,
    38033768      ulWidth, ulHeight;
     
    39693934}
    39703935
    3971 VOID ResizeChildren(HWND hwndClient, SHORT oldcx, SHORT oldcy, SHORT newcx,
     3936static VOID ResizeChildren(HWND hwndClient, SHORT oldcx, SHORT oldcy, SHORT newcx,
    39723937                    SHORT newcy)
    39733938{
     
    40794044}
    40804045
    4081 VOID MinResChildren(HWND hwndClient, ULONG cmd)
     4046static VOID MinResChildren(HWND hwndClient, ULONG cmd)
    40824047{
    4083 
    40844048  HENUM henum;
    40854049  HWND hwndChild;
     
    41014065}
    41024066
    4103 MRESULT EXPENTRY ChildFrameButtonProc(HWND hwnd, ULONG msg, MPARAM mp1,
    4104                                       MPARAM mp2)
     4067//=== ChildFrameButtonProc: subclass handler for WALKBUTTON and QUICKBUTTON windows ===
     4068
     4069static MRESULT EXPENTRY ChildFrameButtonProc(HWND hwnd,
     4070                                             ULONG msg,
     4071                                             MPARAM mp1,
     4072                                             MPARAM mp2)
    41054073{
    4106 
    41074074  USHORT id;
    41084075  static BOOL emphasized = FALSE;
     
    42064173        }
    42074174        break;
    4208       }
     4175      } // switch id
    42094176      if (cmd)
    42104177        PostMsg(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), FID_CLIENT),
     
    42774244}
    42784245
    4279 MRESULT EXPENTRY MainFrameWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
     4246static MRESULT EXPENTRY MainFrameWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    42804247{
    4281 
    42824248  PFNWP oldproc = (PFNWP) WinQueryWindowPtr(hwnd, QWL_USER);
    42834249  static ULONG aheight = 0L;
     
    43534319      /*
    43544320       * Calculate the position of the client rectangle.
    4355        * Otherwise,  we'll see a lot of redraw when we move the
     4321       * Otherwise, we'll see a lot of redraw when we move the
    43564322       * client during WM_FORMATFRAME.
    43574323       */
     
    58635829}
    58645830
    5865 MRESULT EXPENTRY MainWMOnce(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
     5831static MRESULT EXPENTRY MainWMOnce(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    58665832{
    5867 
    58685833  switch (msg)
    58695834  {
     
    64606425MRESULT EXPENTRY MainWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    64616426{
    6462 
    64636427  switch (msg)
    64646428  {
Note: See TracChangeset for help on using the changeset viewer.