Ignore:
Timestamp:
Aug 14, 1999, 6:13:16 PM (26 years ago)
Author:
cbratschi
Message:

wine-990731 update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comctl32/pager.c

    r94 r496  
    1 /* $Id: pager.c,v 1.3 1999-06-10 16:22:01 achimha Exp $ */
     1/* $Id: pager.c,v 1.4 1999-08-14 16:13:12 cbratschi Exp $ */
    22/*
    33 * Pager control
     
    9393
    9494    if (infoPtr->hwndChild) {
    95         ZeroMemory (&nmpgcs, sizeof (NMPGCALCSIZE));
    96         nmpgcs.hdr.hwndFrom = hwnd;
    97         nmpgcs.hdr.idFrom   = GetWindowLongA (hwnd, GWL_ID);
    98         nmpgcs.hdr.code = PGN_CALCSIZE;
    99         nmpgcs.dwFlag = (dwStyle & PGS_HORZ) ? PGF_CALCWIDTH : PGF_CALCHEIGHT;
    100         SendMessageA (GetParent (hwnd), WM_NOTIFY,
    101                         (WPARAM)nmpgcs.hdr.idFrom, (LPARAM)&nmpgcs);
    102 
    103         infoPtr->nChildSize = (dwStyle & PGS_HORZ) ? nmpgcs.iWidth : nmpgcs.iHeight;
     95        ZeroMemory (&nmpgcs, sizeof (NMPGCALCSIZE));
     96        nmpgcs.hdr.hwndFrom = hwnd;
     97        nmpgcs.hdr.idFrom   = GetWindowLongA (hwnd, GWL_ID);
     98        nmpgcs.hdr.code = PGN_CALCSIZE;
     99        nmpgcs.dwFlag = (dwStyle & PGS_HORZ) ? PGF_CALCWIDTH : PGF_CALCHEIGHT;
     100        SendMessageA (GetParent (hwnd), WM_NOTIFY,
     101                        (WPARAM)nmpgcs.hdr.idFrom, (LPARAM)&nmpgcs);
     102
     103        infoPtr->nChildSize = (dwStyle & PGS_HORZ) ? nmpgcs.iWidth : nmpgcs.iHeight;
    104104
    105105
     
    168168    /* FIXME: redraw */
    169169    if (infoPtr->hwndChild) {
    170         SetParent (infoPtr->hwndChild, hwnd);
    171         SetWindowPos (infoPtr->hwndChild, HWND_TOP,
    172                         0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE);
     170        RECT rect;
     171
     172        GetClientRect(hwnd,&rect);
     173        SetParent (infoPtr->hwndChild, hwnd);
     174        SetWindowPos (infoPtr->hwndChild, HWND_TOP,
     175                        0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE);
     176
     177        MoveWindow (infoPtr->hwndChild, 0, 0, rect.right, rect.bottom, TRUE);
    173178    }
    174179
     
    188193    /* FIXME: redraw */
    189194    SetWindowPos (infoPtr->hwndChild, HWND_TOP,
    190                     0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE);
     195                    0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE);
    191196
    192197    return 0;
     
    268273    GetClientRect (hwnd, &rect);
    269274    if (infoPtr->hwndChild) {
    270         SetWindowPos (infoPtr->hwndChild, HWND_TOP, rect.left, rect.top,
    271                         rect.right - rect.left, rect.bottom - rect.top,
    272                         SWP_SHOWWINDOW);
    273 /*      MoveWindow32 (infoPtr->hwndChild, 1, 1, rect.right - 2, rect.bottom-2, TRUE); */
    274 /*      UpdateWindow32 (infoPtr->hwndChild); */
     275        SetWindowPos (infoPtr->hwndChild, HWND_TOP, rect.left, rect.top,
     276                        rect.right - rect.left, rect.bottom - rect.top,
     277                        SWP_SHOWWINDOW);
     278/*      MoveWindow (infoPtr->hwndChild, 1, 1, rect.right - 2, rect.bottom-2, TRUE); */
     279/*      UpdateWindow (infoPtr->hwndChild); */
    275280
    276281    }
    277 /*    FillRect32 ((HDC32)wParam, &rect, hBrush); */
    278 /*    DeleteObject32 (hBrush); */
     282/*    FillRect ((HDC)wParam, &rect, hBrush); */
     283/*    DeleteObject (hBrush); */
    279284    return TRUE;
    280285}
     
    282287
    283288
    284 LRESULT WINAPI
     289static LRESULT WINAPI
    285290PAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
    286291{
    287292    switch (uMsg)
    288293    {
    289         case PGM_FORWARDMOUSE:
    290             return PAGER_ForwardMouse (hwnd, wParam);
    291 
    292         case PGM_GETBKCOLOR:
    293             return PAGER_GetBkColor (hwnd, wParam, lParam);
    294 
    295         case PGM_GETBORDER:
    296             return PAGER_GetBorder (hwnd, wParam, lParam);
    297 
    298         case PGM_GETBUTTONSIZE:
    299             return PAGER_GetButtonSize (hwnd, wParam, lParam);
    300 
    301         case PGM_GETBUTTONSTATE:
    302             return PAGER_GetButtonState (hwnd, wParam, lParam);
    303 
    304 /*      case PGM_GETDROPTARGET: */
    305 
    306         case PGM_GETPOS:
    307             return PAGER_SetPos (hwnd, wParam, lParam);
    308 
    309         case PGM_RECALCSIZE:
    310             return PAGER_RecalcSize (hwnd, wParam, lParam);
    311 
    312         case PGM_SETBKCOLOR:
    313             return PAGER_SetBkColor (hwnd, wParam, lParam);
    314 
    315         case PGM_SETBORDER:
    316             return PAGER_SetBorder (hwnd, wParam, lParam);
    317 
    318         case PGM_SETBUTTONSIZE:
    319             return PAGER_SetButtonSize (hwnd, wParam, lParam);
    320 
    321         case PGM_SETCHILD:
    322             return PAGER_SetChild (hwnd, wParam, lParam);
    323 
    324         case PGM_SETPOS:
    325             return PAGER_SetPos (hwnd, wParam, lParam);
    326 
    327         case WM_CREATE:
    328             return PAGER_Create (hwnd, wParam, lParam);
    329 
    330         case WM_DESTROY:
    331             return PAGER_Destroy (hwnd, wParam, lParam);
    332 
    333         case WM_ERASEBKGND:
    334             return PAGER_EraseBackground (hwnd, wParam, lParam);
    335 
    336         case WM_MOUSEMOVE:
    337             return PAGER_MouseMove (hwnd, wParam, lParam);
    338 
    339         case WM_NOTIFY:
    340         case WM_COMMAND:
    341             return SendMessageA (GetParent (hwnd), uMsg, wParam, lParam);
    342 
    343 /*      case WM_PAINT: */
    344 /*          return PAGER_Paint (hwnd, wParam); */
    345 
    346         case WM_SIZE:
    347             return PAGER_Size (hwnd, wParam, lParam);
    348 
    349         default:
    350 //          if (uMsg >= WM_USER)
    351 //              ERR (pager, "unknown msg %04x wp=%08x lp=%08lx\n",
    352 //                   uMsg, wParam, lParam);
    353             return DefWindowProcA (hwnd, uMsg, wParam, lParam);
     294        case PGM_FORWARDMOUSE:
     295            return PAGER_ForwardMouse (hwnd, wParam);
     296
     297        case PGM_GETBKCOLOR:
     298            return PAGER_GetBkColor (hwnd, wParam, lParam);
     299
     300        case PGM_GETBORDER:
     301            return PAGER_GetBorder (hwnd, wParam, lParam);
     302
     303        case PGM_GETBUTTONSIZE:
     304            return PAGER_GetButtonSize (hwnd, wParam, lParam);
     305
     306        case PGM_GETBUTTONSTATE:
     307            return PAGER_GetButtonState (hwnd, wParam, lParam);
     308
     309/*      case PGM_GETDROPTARGET: */
     310
     311        case PGM_GETPOS:
     312            return PAGER_SetPos (hwnd, wParam, lParam);
     313
     314        case PGM_RECALCSIZE:
     315            return PAGER_RecalcSize (hwnd, wParam, lParam);
     316
     317        case PGM_SETBKCOLOR:
     318            return PAGER_SetBkColor (hwnd, wParam, lParam);
     319
     320        case PGM_SETBORDER:
     321            return PAGER_SetBorder (hwnd, wParam, lParam);
     322
     323        case PGM_SETBUTTONSIZE:
     324            return PAGER_SetButtonSize (hwnd, wParam, lParam);
     325
     326        case PGM_SETCHILD:
     327            return PAGER_SetChild (hwnd, wParam, lParam);
     328
     329        case PGM_SETPOS:
     330            return PAGER_SetPos (hwnd, wParam, lParam);
     331
     332        case WM_CREATE:
     333            return PAGER_Create (hwnd, wParam, lParam);
     334
     335        case WM_DESTROY:
     336            return PAGER_Destroy (hwnd, wParam, lParam);
     337
     338        case WM_ERASEBKGND:
     339            return PAGER_EraseBackground (hwnd, wParam, lParam);
     340
     341        case WM_MOUSEMOVE:
     342            return PAGER_MouseMove (hwnd, wParam, lParam);
     343
     344        case WM_NOTIFY:
     345        case WM_COMMAND:
     346            return SendMessageA (GetParent (hwnd), uMsg, wParam, lParam);
     347
     348/*      case WM_PAINT: */
     349/*          return PAGER_Paint (hwnd, wParam); */
     350
     351        case WM_SIZE:
     352            return PAGER_Size (hwnd, wParam, lParam);
     353
     354        default:
     355//          if (uMsg >= WM_USER)
     356//              ERR (pager, "unknown msg %04x wp=%08x lp=%08lx\n",
     357//                   uMsg, wParam, lParam);
     358            return DefWindowProcA (hwnd, uMsg, wParam, lParam);
    354359    }
    355360    return 0;
     
    372377    wndClass.hbrBackground = 0;
    373378    wndClass.lpszClassName = WC_PAGESCROLLERA;
    374  
     379
    375380    RegisterClassA (&wndClass);
    376381}
     
    381386{
    382387    if (GlobalFindAtomA (WC_PAGESCROLLERA))
    383         UnregisterClassA (WC_PAGESCROLLERA, (HINSTANCE)NULL);
    384 }
    385 
     388        UnregisterClassA (WC_PAGESCROLLERA, (HINSTANCE)NULL);
     389}
     390
Note: See TracChangeset for help on using the changeset viewer.