Changeset 2228 for trunk/src


Ignore:
Timestamp:
Dec 28, 1999, 6:04:24 PM (26 years ago)
Author:
cbratschi
Message:

* empty log message *

Location:
trunk/src/user32
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/button.cpp

    r2221 r2228  
    1 /* $Id: button.cpp,v 1.26 1999-12-27 22:53:51 cbratschi Exp $ */
     1/* $Id: button.cpp,v 1.27 1999-12-28 17:04:22 cbratschi Exp $ */
    22/* File: button.cpp -- Button type widgets
    33 *
     
    125125  DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
    126126
    127   if (dwStyle & BS_NOTIFY && !wParam) BUTTON_SendNotify(hwnd,BN_DISABLE);
     127  if ((dwStyle & BS_NOTIFY) && !wParam) BUTTON_SendNotify(hwnd,BN_DISABLE);
    128128
    129129  //PAINT_BUTTON(hwnd,dwStyle & 0x0f,ODA_DRAWENTIRE);
     
    151151    } else checkBoxWidth = checkBoxHeight = 0;
    152152  }
    153   if (style < 0L || style >= MAX_BTN_TYPE) return -1; /* abort */
     153  if ((style < 0L) || (style >= MAX_BTN_TYPE)) return -1; /* abort */
    154154
    155155  infoPtr = (BUTTONINFO*)malloc(sizeof(BUTTONINFO));
     
    409409  if (dwStyle & BS_NOTIFY) BUTTON_SendNotify(hwnd,BN_SETFOCUS);
    410410
    411   if ((style == BS_AUTORADIOBUTTON || style == BS_RADIOBUTTON) &&
     411  if (((style == BS_AUTORADIOBUTTON) || (style == BS_RADIOBUTTON)) &&
    412412      (GetCapture() != hwnd) && !(SendMessageA(hwnd,BM_GETCHECK,0,0) & BST_CHECKED))
    413413  {
     
    484484  HANDLE oldHbitmap = infoPtr->hImage;
    485485
    486   if (dwStyle & BS_BITMAP || dwStyle & BS_ICON) infoPtr->hImage = (HANDLE)lParam;
     486  if ((dwStyle & BS_BITMAP) || (dwStyle & BS_ICON)) infoPtr->hImage = (HANDLE)lParam;
    487487
    488488  return oldHbitmap;
     
    529529        dwStyle &= ~WS_TABSTOP;
    530530
    531       //if (oldStyle != dwStyle) SetWindowLongA(hwnd,GWL_STYLE,dwStyle);
     531      if (oldStyle != dwStyle) SetWindowLongA(hwnd,GWL_STYLE,dwStyle);
    532532    }
    533533    infoPtr->state = (infoPtr->state & ~3) | wParam;
     
    775775     */
    776776    textLen = GetWindowTextLengthA(hwnd);
    777     if (textLen > 0 && (!(dwStyle & (BS_ICON|BS_BITMAP))))
     777    if ((textLen > 0) && (!(dwStyle & (BS_ICON|BS_BITMAP))))
    778778    {
    779779        INT format = BUTTON_GetTextFormat(dwStyle,DT_CENTER,DT_VCENTER);
     
    885885    SelectObject( hDC, hOldBrush );
    886886
    887     if (infoPtr->state & BUTTON_HASFOCUS && IsWindowEnabled(hwnd))
     887    if ((infoPtr->state & BUTTON_HASFOCUS) && IsWindowEnabled(hwnd))
    888888    {
    889889        InflateRect( &focus_rect, -1, -1 );
     
    980980      GetWindowTextA(hwnd,text,textLen);
    981981    }
    982     if (action == ODA_DRAWENTIRE || action == ODA_SELECT)
     982    if ((action == ODA_DRAWENTIRE) || (action == ODA_SELECT))
    983983    {
    984984        UINT state;
  • trunk/src/user32/edit.cpp

    r2221 r2228  
    1 /* $Id: edit.cpp,v 1.27 1999-12-27 22:53:52 cbratschi Exp $ */
     1/* $Id: edit.cpp,v 1.28 1999-12-28 17:04:22 cbratschi Exp $ */
    22/*
    33 *      Edit control
     
    2020    new in Win98, Win2k: for single line too
    2121  - WinNT/Win2k: higher size limits (single: 0x7FFFFFFE, multi: none)
     22  - too many GetDC/ReleaseDC calls -> GetDC is very slow!
     23    EM_REPLACESEL: calls more than 10 times GetDC/ReleaseDC!
     24    add HDC parameter
    2225*/
    2326
     
    182185static INT      EDIT_WordBreakProc(LPSTR s, INT index, INT count, INT action);
    183186static VOID     EDIT_Draw(HWND hwnd,EDITSTATE *es,HDC hdc);
    184 static VOID     EDIT_Refresh(HWND hwnd,EDITSTATE *es);
     187static VOID     EDIT_Refresh(HWND hwnd,EDITSTATE *es,BOOL useCache);
    185188
    186189/*
     
    623626                //DPRINTF_EDIT_MSG32("WM_ENABLE");
    624627                es->bEnableState = (BOOL)wParam;
    625                 EDIT_Refresh(hwnd,es);
     628                EDIT_Refresh(hwnd,es,FALSE);
    626629                break;
    627630
     
    767770static void EDIT_BuildLineDefs_ML(HWND hwnd, EDITSTATE *es)
    768771{
    769         HDC dc;
     772        HDC dc = 0;
    770773        HFONT old_font = 0;
    771774        LPSTR start, cp;
     
    782785        es->line_count = 0;
    783786        es->text_width = 0;
    784 
    785         dc = GetDC(hwnd);
    786         if (es->font)
    787                 old_font = SelectObject(dc, es->font);
    788787
    789788        fw = es->format_rect.right - es->format_rect.left;
     
    809808                        current_def->net_length = cp - start;
    810809                }
     810
     811                if (!dc)
     812                {
     813                  dc = GetDC(hwnd);
     814                  if (es->font)
     815                    old_font = SelectObject(dc, es->font);
     816                }
     817
    811818                current_def->width = (INT)LOWORD(GetTabbedTextExtentA(dc,
    812819                                        start, current_def->net_length,
     
    857864                es->line_count++;
    858865        } while (current_def->ending != END_0);
    859         if (es->font)
    860                 SelectObject(dc, old_font);
    861         ReleaseDC(hwnd, dc);
     866        if (dc)
     867        {
     868          if (es->font)
     869                  SelectObject(dc, old_font);
     870          ReleaseDC(hwnd, dc);
     871        }
    862872        EDIT_UpdateScrollBars(hwnd,es,TRUE,TRUE);
    863873}
     
    905915{
    906916        INT index;
    907         HDC dc;
     917        HDC dc = 0;
    908918        HFONT old_font = 0;
    909919
     
    929939                        return line_index;
    930940                }
    931                 dc = GetDC(hwnd);
    932                 if (es->font)
    933                         old_font = SelectObject(dc, es->font);
    934                     low = line_index + 1;
    935                     high = line_index + line_def->net_length + 1;
    936                     while (low < high - 1)
    937                     {
    938                         INT mid = (low + high) / 2;
    939                         if (LOWORD(GetTabbedTextExtentA(dc, es->text + line_index,mid - line_index, es->tabs_count, es->tabs)) > x) high = mid;
    940                         else low = mid;
    941                     }
    942                     index = low;
     941                low = line_index + 1;
     942                high = line_index + line_def->net_length + 1;
     943                if (low < high-1)
     944                {
     945                  if (!dc)
     946                  {
     947                    dc = GetDC(hwnd);
     948                    if (es->font)
     949                      old_font = SelectObject(dc, es->font);
     950                  }
     951
     952                  while (low < high-1)
     953                  {
     954                    INT mid = (low + high) / 2;
     955                    if (LOWORD(GetTabbedTextExtentA(dc, es->text + line_index,mid - line_index, es->tabs_count, es->tabs)) > x) high = mid;
     956                    else low = mid;
     957                  }
     958                }
     959                index = low;
    943960
    944961                if (after_wrap)
     
    954971                        return es->x_offset;
    955972                text = EDIT_GetPasswordPointer_SL(hwnd, es);
    956                 dc = GetDC(hwnd);
    957                 if (es->font)
    958                         old_font = SelectObject(dc, es->font);
    959973                if (x < 0)
    960974                {
    961                     INT low = 0;
    962                     INT high = es->x_offset;
    963                     while (low < high - 1)
     975                  INT low = 0;
     976                  INT high = es->x_offset;
     977
     978                  if (low < high-1)
     979                  {
     980                    if (!dc)
    964981                    {
    965                         INT mid = (low + high) / 2;
    966                         GetTextExtentPoint32A( dc, text + mid,
    967                                                es->x_offset - mid, &size );
    968                         if (size.cx > -x) low = mid;
    969                         else high = mid;
     982                      dc = GetDC(hwnd);
     983                      if (es->font)
     984                        old_font = SelectObject(dc, es->font);
    970985                    }
    971                     index = low;
    972                 }
    973                 else
     986
     987                    while (low < high-1)
     988                    {
     989                      INT mid = (low + high) / 2;
     990
     991                      GetTextExtentPoint32A( dc, text + mid,
     992                                             es->x_offset - mid, &size );
     993                      if (size.cx > -x) low = mid;
     994                      else high = mid;
     995                    }
     996                  }
     997                  index = low;
     998                } else
    974999                {
    975                     INT low = es->x_offset;
    976                     INT high = lstrlenA(es->text) + 1;
    977                     while (low < high - 1)
     1000                  INT low = es->x_offset;
     1001                  INT high = lstrlenA(es->text) + 1;
     1002
     1003                  if (low < high-1)
     1004                  {
     1005                    if (!dc)
    9781006                    {
    979                         INT mid = (low + high) / 2;
    980                         GetTextExtentPoint32A( dc, text + es->x_offset,
    981                                                mid - es->x_offset, &size );
    982                         if (size.cx > x) high = mid;
    983                         else low = mid;
     1007                      dc = GetDC(hwnd);
     1008                      if (es->font)
     1009                        old_font = SelectObject(dc, es->font);
    9841010                    }
    985                     index = low;
     1011
     1012                    while (low < high-1)
     1013                    {
     1014                      INT mid = (low + high) / 2;
     1015
     1016                      GetTextExtentPoint32A( dc, text + es->x_offset,
     1017                                             mid - es->x_offset, &size );
     1018                      if (size.cx > x) high = mid;
     1019                      else low = mid;
     1020                    }
     1021                  }
     1022                  index = low;
    9861023                }
    9871024                if (es->style & ES_PASSWORD)
    9881025                        HeapFree(es->heap, 0 ,text);
    9891026        }
    990         if (es->font)
    991                 SelectObject(dc, old_font);
    992         ReleaseDC(hwnd, dc);
     1027        if (dc)
     1028        {
     1029          if (es->font)
     1030            SelectObject(dc, old_font);
     1031          ReleaseDC(hwnd, dc);
     1032        }
    9931033        return index;
    9941034}
     
    10991139        {
    11001140          HideCaret(hwnd);
    1101           InvalidateRect(hwnd, &rc, FALSE);
     1141          InvalidateRect(hwnd, &rc, TRUE);
    11021142          ShowCaret(hwnd);
    11031143        }
     
    22092249        INT x;
    22102250        INT y = 0;
    2211         HDC dc;
     2251        HDC dc = 0;
    22122252        HFONT old_font = 0;
    22132253        SIZE size;
    22142254
    22152255        index = MIN(index, len);
    2216         dc = GetDC(hwnd);
    2217         if (es->font)
    2218                 old_font = SelectObject(dc, es->font);
     2256        if (!dc)
     2257        {
     2258          dc = GetDC(hwnd);
     2259          if (es->font)
     2260            old_font = SelectObject(dc, es->font);
     2261        }
    22192262        if (es->style & ES_MULTILINE) {
    22202263                l = EDIT_EM_LineFromChar(hwnd, es, index);
     
    23842427
    23852428        EDIT_EM_SetSel(hwnd, es, s, s, FALSE);
     2429
    23862430        es->flags |= EF_MODIFIED;
    23872431        es->flags |= EF_UPDATE;
    23882432        EDIT_EM_ScrollCaret(hwnd, es);
    2389 
    23902433        EDIT_NOTIFY_PARENT(hwnd,EN_UPDATE);
    23912434        /* FIXME: really inefficient */
    2392         EDIT_Refresh(hwnd,es);
     2435        EDIT_Refresh(hwnd,es,TRUE);
    23932436}
    23942437
     
    24862529                        } while ((x < goal) && es->x_offset);
    24872530                        /* FIXME: use ScrollWindow() somehow to improve performance */
    2488                         EDIT_Refresh(hwnd,es);
     2531                        EDIT_Refresh(hwnd,es,TRUE);
    24892532                        EDIT_UpdateScrollBars(hwnd,es,TRUE,FALSE);
    24902533                } else if (x > es->format_rect.right)
     
    24992542                        } while ((x > goal) && (x_last > es->format_rect.right));
    25002543                        /* FIXME: use ScrollWindow() somehow to improve performance */
    2501                         EDIT_Refresh(hwnd,es);
     2544                        EDIT_Refresh(hwnd,es,TRUE);
    25022545                        EDIT_UpdateScrollBars(hwnd,es,TRUE,FALSE);
    25032546                }
     
    25642607        es->flags &= ~EF_UPDATE;
    25652608        EDIT_BuildLineDefs_ML(hwnd, es);
    2566         EDIT_Refresh(hwnd,es);
     2609        EDIT_Refresh(hwnd,es,FALSE);
    25672610        EDIT_EM_ScrollCaret(hwnd, es);
    25682611        EDIT_UpdateScrollBars(hwnd,es,TRUE,TRUE);
     
    26302673                  EDIT_BuildLineDefs_ML(hwnd, es);
    26312674
    2632           EDIT_Refresh(hwnd,es);
     2675          EDIT_Refresh(hwnd,es,FALSE);
    26332676          if (es->flags & EF_FOCUSED) {
    26342677                  DestroyCaret();
     
    26702713                es->style &= ~ES_PASSWORD;
    26712714        }
    2672         EDIT_Refresh(hwnd,es);
     2715        EDIT_Refresh(hwnd,es,FALSE);
    26732716}
    26742717
     
    26932736  {
    26942737    EDIT_SetRectNP(hwnd,es,lprc);
    2695     EDIT_Refresh(hwnd,es);
     2738    EDIT_Refresh(hwnd,es,FALSE);
    26962739  }
    26972740}
     
    27982841        if ((es->style & ES_MULTILINE) && !(es->style & ES_AUTOHSCROLL)) {
    27992842                EDIT_BuildLineDefs_ML(hwnd, es);
    2800                 EDIT_Refresh(hwnd,es);
     2843                EDIT_Refresh(hwnd,es,FALSE);
    28012844        }
    28022845}
     
    37193762}
    37203763
    3721 static VOID EDIT_Refresh(HWND hwnd,EDITSTATE *es)
     3764static VOID EDIT_Refresh(HWND hwnd,EDITSTATE *es,BOOL useCache)
    37223765{
    37233766  HDC hdc,hdcCompatible;
     
    37263769
    37273770  if (!IsWindowVisible(hwnd)) return;
     3771
     3772  if (!useCache)
     3773  {
     3774    InvalidateRect(hwnd,NULL,TRUE);
     3775    return;
     3776  }
    37283777
    37293778  //CB: original controls redraws many times, cache drawing
     
    38443893
    38453894        if (redraw)
    3846                 EDIT_Refresh(hwnd,es);
     3895                EDIT_Refresh(hwnd,es,FALSE);
    38473896        if (es->flags & EF_FOCUSED) {
    38483897                DestroyCaret();
     
    39023951                SetRect(&rc, 0, 0, width, height);
    39033952                EDIT_SetRectNP(hwnd, es, &rc);
    3904                 EDIT_Refresh(hwnd,es);
     3953                EDIT_Refresh(hwnd,es,FALSE);
    39053954        }
    39063955}
  • trunk/src/user32/oslibgdi.cpp

    r2221 r2228  
    1 /* $Id: oslibgdi.cpp,v 1.5 1999-12-27 22:53:52 cbratschi Exp $ */
     1/* $Id: oslibgdi.cpp,v 1.6 1999-12-28 17:04:23 cbratschi Exp $ */
    22/*
    33 * Window GDI wrapper functions for OS/2
     
    1919#include <oslibgdi.h>
    2020#include <oslibwin.h>
     21#include "win32wbase.h"
    2122
    2223//CB: new mapping infrastructure to avoid transformation bugs -> available soon
    2324
    2425/*
    25 All functions can be used to transform from Win32 to OS/2 and vice versa
     26All mapScreen/Window can be used to transform from Win32 to OS/2 and vice versa
    2627First letter is lower case to avoid conflicts with Win32 API names
    2728
    2829Single y mapping:
    2930 mapScreenY()
    30  mapWindowY()
     31 mapClientY()
     32 mapChildY()
    3133
    3234Single point mapping:
    3335 mapScreenPoint()
    34  mapWindowPoint()
     36 mapClientPoint()
     37 mapChildPoint()
    3538
    3639Single rect mapping:
    3740 mapScreenRect()
    38  mapWindowRect()
     41 mapClientRect()
    3942
    4043Rect transformation:
     
    4346*/
    4447
    45 INT mapScreenY(INT y)
    46 {
    47   return WinQuerySysValue(HWND_DESKTOP,SV_CYSCREEN)-1-y;
    48 }
    49 //******************************************************************************
    50 //******************************************************************************
    51 INT mapScreenY(INT screenH,INT y)
    52 {
    53   return screenH-1-y;
    54 }
    55 
     48INT mapScreenY(INT screenPosY)
     49{
     50  return WinQuerySysValue(HWND_DESKTOP,SV_CYSCREEN)-1-screenPosY;
     51}
     52//******************************************************************************
     53//******************************************************************************
     54INT mapScreenY(INT screenH,INT screenPosY)
     55{
     56  return screenH-1-screenPosY;
     57}
     58//******************************************************************************
     59//******************************************************************************
     60INT mapClientY(INT clientH,INT clientPosY)
     61{
     62  return clientH-1-clientPosY;
     63}
     64//******************************************************************************
     65//******************************************************************************
     66INT mapClientY(HWND os2Client,INT clientPosY)
     67{
     68  RECTL rect;
     69
     70  if (os2Client == OSLIB_HWND_DESKTOP) os2Client = HWND_DESKTOP; //client shouldn't be desktop
     71  if (!WinQueryWindowRect(os2Client,&rect)) return 0;
     72  return rect.yTop-1-clientPosY;
     73}
     74//******************************************************************************
     75//******************************************************************************
     76INT mapClientY(Win32BaseWindow *win32wnd,INT clientPosY)
     77{
     78  return win32wnd->getWindowHeight()-1-clientPosY;
     79}
     80//******************************************************************************
     81//******************************************************************************
     82INT mapChildY(INT parentH,INT childY,INT childPosY)
     83{
     84  return parentH-1-childY-childPosY;
     85}
     86//******************************************************************************
     87//******************************************************************************
     88INT mapChildY(HWND os2Parent,INT childY,INT childPosY)
     89{
     90  RECTL rect;
     91
     92  if (os2Parent == OSLIB_HWND_DESKTOP) os2Parent = HWND_DESKTOP;
     93  if (!WinQueryWindowRect(os2Parent,&rect)) return 0;
     94  return rect.yTop-1-childY-childPosY;
     95}
     96//******************************************************************************
     97//******************************************************************************
     98INT mapChildY(HWND os2Parent,HWND os2Child,INT childPosY)
     99{
     100  RECTL rect;
     101  SWP swp;
     102
     103  if (os2Parent == OSLIB_HWND_DESKTOP) os2Parent = HWND_DESKTOP;
     104  if (!WinQueryWindowRect(os2Parent,&rect)) return 0;
     105  if (!WinQueryWindowPos(os2Child,&swp)) return 0;
     106  return rect.yTop-1-swp.y-childPosY;
     107}
     108//******************************************************************************
     109//******************************************************************************
     110BOOL mapScreenPoint(OSLIBPOINT *screenPt)
     111{
     112  if(!screenPt) return FALSE;
     113  screenPt->y = WinQuerySysValue(HWND_DESKTOP,SV_CYSCREEN)-1-screenPt->y;
     114  return TRUE;
     115}
     116//******************************************************************************
     117//******************************************************************************
     118INT mapScreenY(INT screenH,OSLIBPOINT *screenPt)
     119{
     120  if (!screenPt) return FALSE;
     121  screenPt->y = screenH-1-screenPt->y;
     122  return TRUE;
     123}
     124
     125//old mapping functions
    56126
    57127//******************************************************************************
  • trunk/src/user32/scroll.cpp

    r2204 r2228  
    1 /* $Id: scroll.cpp,v 1.29 1999-12-26 17:30:17 cbratschi Exp $ */
     1/* $Id: scroll.cpp,v 1.30 1999-12-28 17:04:23 cbratschi Exp $ */
    22/*
    33 * Scrollbar control
     
    666666  CREATESTRUCTA *lpCreat = (CREATESTRUCTA *)lParam;
    667667
    668   if (!(lpCreat->style & (SBS_SIZEBOX | SBS_SIZEGRIP)) && lpCreat->style & (SBS_LEFTALIGN | SBS_RIGHTALIGN))
     668  if (!(lpCreat->style & (SBS_SIZEBOX | SBS_SIZEGRIP)) && (lpCreat->style & (SBS_LEFTALIGN | SBS_RIGHTALIGN)))
    669669  {
    670670    if (lpCreat->style & SBS_VERT)
     
    793793        SCROLL_Scrolling = TRUE;
    794794        timerRunning = FALSE;
    795         if (SCROLL_FocusWin == hwnd && SCROLL_Highlighted)
     795        if ((SCROLL_FocusWin == hwnd) && SCROLL_Highlighted)
    796796        {
    797797          hdc = GetDC(hwnd);
     
    892892
    893893      case SCROLL_TOP_ARROW:
    894         if (msg == WM_LBUTTONUP || msg == WM_CAPTURECHANGED)
     894        if ((msg == WM_LBUTTONUP) || (msg == WM_CAPTURECHANGED))
    895895          KillSystemTimer(hwnd,SCROLL_TIMER);
    896         else if (msg == WM_LBUTTONDOWN || (!timerRunning && msg == WM_SYSTIMER))
     896        else if ((msg == WM_LBUTTONDOWN) || (!timerRunning && msg == WM_SYSTIMER))
    897897        {
    898898          SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
     
    902902        }
    903903
    904         if (msg == WM_LBUTTONDOWN || SCROLL_lastHitTest != hittest)
     904        if ((msg == WM_LBUTTONDOWN) || (SCROLL_lastHitTest != hittest))
    905905        {
    906906          SCROLL_DrawTopArrow(hdc,infoPtr,&rect,arrowSize,vertical,(hittest == SCROLL_trackHitTest));
    907907          SCROLL_lastHitTest = hittest;
    908908        }
    909         if (hittest == SCROLL_trackHitTest && (msg == WM_LBUTTONDOWN || msg == WM_SYSTIMER))
     909        if ((hittest == SCROLL_trackHitTest) && ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER)))
    910910          SendMessageA(hwndOwner,vertical ? WM_VSCROLL:WM_HSCROLL,SB_LINEUP,hwndCtl);
    911911
     
    913913
    914914      case SCROLL_TOP_RECT:
    915         if (msg == WM_LBUTTONUP || msg == WM_CAPTURECHANGED)
     915        if ((msg == WM_LBUTTONUP) || (msg == WM_CAPTURECHANGED))
    916916          KillSystemTimer(hwnd,SCROLL_TIMER);
    917         else if (msg == WM_LBUTTONDOWN || (!timerRunning && msg == WM_SYSTIMER))
     917        else if ((msg == WM_LBUTTONDOWN) || (!timerRunning && (msg == WM_SYSTIMER)))
    918918        {
    919919          SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
     
    923923        }
    924924
    925         if (msg == WM_LBUTTONDOWN || SCROLL_lastHitTest != hittest)
     925        if ((msg == WM_LBUTTONDOWN) || (SCROLL_lastHitTest != hittest))
    926926        {
    927927          SCROLL_DrawInterior( hwnd, hdc, nBar, &rect, arrowSize, thumbSize,
     
    931931        }
    932932
    933         if (hittest == SCROLL_trackHitTest && (msg == WM_LBUTTONDOWN || msg == WM_SYSTIMER))
     933        if ((hittest == SCROLL_trackHitTest) && ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER)))
    934934          SendMessageA(hwndOwner,vertical ? WM_VSCROLL:WM_HSCROLL,SB_PAGEUP,hwndCtl);
    935935
     
    946946            thumbTrackSent = FALSE;
    947947            SCROLL_DrawMovingThumb(hdc, &rect, vertical, arrowSize, thumbSize);
    948         } else if (msg == WM_LBUTTONUP || msg == WM_CAPTURECHANGED)
     948        } else if ((msg == WM_LBUTTONUP) || (msg == WM_CAPTURECHANGED))
    949949        {
    950950          UINT val;
     
    957957                                    trackThumbPos + lastMousePos - lastClickPos );
    958958
    959           if (val != infoPtr->CurVal || thumbTrackSent)
     959          if ((val != infoPtr->CurVal) || thumbTrackSent)
    960960            SendMessageA( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
    961961                          MAKEWPARAM( SB_THUMBPOSITION, val ), hwndCtl );
     
    10001000
    10011001      case SCROLL_BOTTOM_RECT:
    1002         if (msg == WM_LBUTTONUP || msg == WM_CAPTURECHANGED)
     1002        if ((msg == WM_LBUTTONUP) || (msg == WM_CAPTURECHANGED))
    10031003          KillSystemTimer(hwnd,SCROLL_TIMER);
    1004         else if (msg == WM_LBUTTONDOWN || (!timerRunning && msg == WM_SYSTIMER))
     1004        else if ((msg == WM_LBUTTONDOWN) || (!timerRunning && (msg == WM_SYSTIMER)))
    10051005        {
    10061006          SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
     
    10101010        }
    10111011
    1012         if (msg == WM_LBUTTONDOWN || SCROLL_lastHitTest != hittest)
     1012        if ((msg == WM_LBUTTONDOWN) || (SCROLL_lastHitTest != hittest))
    10131013        {
    10141014          SCROLL_DrawInterior( hwnd, hdc, nBar, &rect, arrowSize, thumbSize,
     
    10181018        }
    10191019
    1020         if (hittest == SCROLL_trackHitTest && (msg == WM_LBUTTONDOWN || msg == WM_SYSTIMER))
     1020        if ((hittest == SCROLL_trackHitTest) && ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER)))
    10211021          SendMessageA(hwndOwner,vertical ? WM_VSCROLL:WM_HSCROLL,SB_PAGEDOWN,hwndCtl);
    10221022
     
    10241024
    10251025      case SCROLL_BOTTOM_ARROW:
    1026         if (msg == WM_LBUTTONUP || msg == WM_CAPTURECHANGED)
     1026        if ((msg == WM_LBUTTONUP) || (msg == WM_CAPTURECHANGED))
    10271027          KillSystemTimer(hwnd,SCROLL_TIMER);
    1028         else if (msg == WM_LBUTTONDOWN || (!timerRunning && msg == WM_SYSTIMER))
     1028        else if ((msg == WM_LBUTTONDOWN) || (!timerRunning && (msg == WM_SYSTIMER)))
    10291029        {
    10301030          SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
     
    10341034        }
    10351035
    1036         if (msg == WM_LBUTTONDOWN || SCROLL_lastHitTest != hittest)
     1036        if ((msg == WM_LBUTTONDOWN) || (SCROLL_lastHitTest != hittest))
    10371037        {
    10381038          SCROLL_DrawBottomArrow(hdc,infoPtr,&rect,arrowSize,vertical,(hittest == SCROLL_trackHitTest));
    10391039          SCROLL_lastHitTest = hittest;
    10401040        }
    1041         if (hittest == SCROLL_trackHitTest && (msg == WM_LBUTTONDOWN || msg == WM_SYSTIMER))
     1041        if ((hittest == SCROLL_trackHitTest) && ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER)))
    10421042          SendMessageA(hwndOwner,vertical ? WM_VSCROLL:WM_HSCROLL,SB_LINEDOWN,hwndCtl);
    10431043
     
    10451045    }
    10461046
    1047     if (msg == WM_LBUTTONUP || msg == WM_CAPTURECHANGED)
     1047    if ((msg == WM_LBUTTONUP) || (msg == WM_CAPTURECHANGED))
    10481048    {
    10491049      SCROLL_trackHitTest = SCROLL_NOWHERE;  /* Terminate tracking */
     
    16691669      BOOL rc = FALSE;
    16701670
    1671       if ((nBar == SB_VERT || nBar == SB_BOTH) && window->getStyle() & WS_VSCROLL)
     1671      if (((nBar == SB_VERT) || (nBar == SB_BOTH)) && (window->getStyle() & WS_VSCROLL))
    16721672      {
    16731673        HWND hwndScroll =  Win32BaseWindow::OS2ToWin32Handle(window->getVertScrollHandle());
     
    16851685        }
    16861686      }
    1687       if ((nBar == SB_HORZ || (rc && nBar == SB_BOTH)) && window->getStyle() & WS_HSCROLL)
     1687      if (((nBar == SB_HORZ) || (rc && (nBar == SB_BOTH))) && (window->getStyle() & WS_HSCROLL))
    16881688      {
    16891689        HWND hwndScroll =  Win32BaseWindow::OS2ToWin32Handle(window->getHorzScrollHandle());
     
    17131713BOOL WINAPI GetScrollBarInfo(HWND hwnd,LONG idObject,PSCROLLBARINFO psbi)
    17141714{
    1715   if (!psbi || psbi->cbSize != sizeof(SCROLLBARINFO))
     1715  if (!psbi || (psbi->cbSize != sizeof(SCROLLBARINFO)))
    17161716  {
    17171717    SetLastError(ERROR_INVALID_PARAMETER);
  • trunk/src/user32/static.cpp

    r2160 r2228  
    1 /* $Id: static.cpp,v 1.13 1999-12-20 16:45:16 cbratschi Exp $ */
     1/* $Id: static.cpp,v 1.14 1999-12-28 17:04:24 cbratschi Exp $ */
    22/*
    33 * Static control
     
    123123    if ((dwStyle & SS_TYPEMASK) != SS_BITMAP) return 0;
    124124
    125     if (hBitmap && GetObjectType(hBitmap) != OBJ_BITMAP) {
     125    if (hBitmap && (GetObjectType(hBitmap) != OBJ_BITMAP)) {
    126126        //ERR("huh? hBitmap!=0, but not bitmap\n");
    127127        return 0;
     
    249249  DWORD style = GetWindowLongA(hwnd,GWL_STYLE) & SS_TYPEMASK;
    250250
    251   if (style < 0L || style > SS_TYPEMASK)
     251  if ((style < 0L) || (style > SS_TYPEMASK))
    252252  {
    253253    //Unknown style
     
    268268  DWORD style = GetWindowLongA(hwnd,GWL_STYLE) & SS_TYPEMASK;
    269269
    270   if (style == SS_ICON && infoPtr->hIcon)
     270  if ((style == SS_ICON) && infoPtr->hIcon)
    271271  {
    272272    DestroyIcon(infoPtr->hIcon);
    273   } else if (style == SS_BITMAP && infoPtr->hIcon)
     273  } else if ((style == SS_BITMAP) && infoPtr->hIcon)
    274274  {
    275275    DeleteObject(infoPtr->hIcon);
    276   } else if (style == SS_ENHMETAFILE && infoPtr->hIcon)
     276  } else if ((style == SS_ENHMETAFILE) && infoPtr->hIcon)
    277277  {
    278278    DeleteEnhMetaFile((HENHMETAFILE)infoPtr->hIcon);
     
    345345    STATICINFO* infoPtr = (STATICINFO*)GetInfoPtr(hwnd);
    346346
    347     if (wParam < 4 || !lParam) return 0;
     347    if ((wParam < 4) || !lParam) return 0;
    348348    memcpy((VOID*)lParam,&infoPtr->hIcon,4);
    349349
  • trunk/src/user32/text.cpp

    r2101 r2228  
    1 /* $Id: text.cpp,v 1.2 1999-12-17 17:49:53 cbratschi Exp $ */
     1/* $Id: text.cpp,v 1.3 1999-12-28 17:04:24 cbratschi Exp $ */
    22
    33/*
     
    4848INT WIN32API DrawTextA(HDC hDC,LPCSTR lpString,INT nCount,PRECT lpRect,UINT nFormat)
    4949{
    50   dprintf2(("USER32: DrawTextA %x",hDC));
     50  dprintf(("USER32: DrawTextA %x",hDC));
    5151
    5252  return InternalDrawTextExA(hDC,lpString,nCount,lpRect,nFormat,NULL,FALSE);
     
    5656INT WIN32API DrawTextW(HDC hDC,LPCWSTR lpString,INT nCount,PRECT lpRect,UINT nFormat)
    5757{
    58   dprintf2(("USER32: DrawTextW %x",hDC));
     58  dprintf(("USER32: DrawTextW %x",hDC));
    5959
    6060  return InternalDrawTextExW(hDC,lpString,nCount,lpRect,nFormat,NULL,FALSE);
     
    6464INT WIN32API DrawTextExA(HDC hdc,LPCSTR lpchText,INT cchText,LPRECT lprc,UINT dwDTFormat,LPDRAWTEXTPARAMS lpDTParams)
    6565{
    66   dprintf2(("USER32:DrawTextExA %x\n",hdc));
     66  dprintf(("USER32:DrawTextExA %x\n",hdc));
    6767
    6868  return InternalDrawTextExA(hdc,lpchText,cchText,lprc,dwDTFormat,lpDTParams,TRUE);
     
    7272int WIN32API DrawTextExW(HDC hdc,LPWSTR lpchText,INT cchText,LPRECT lprc,UINT dwDTFormat,LPDRAWTEXTPARAMS lpDTParams)
    7373{
    74   dprintf2(("USER32: DrawTextExW %x",hDC));
     74  dprintf(("USER32: DrawTextExW %x",hdc));
    7575
    7676  return InternalDrawTextExW(hdc,lpchText,cchText,lprc,dwDTFormat,lpDTParams,TRUE);
     
    8080DWORD WIN32API GetTabbedTextExtentA( HDC hDC, LPCSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions)
    8181{
    82   dprintf2(("USER32: GetTabbedTextExtentA %x",hDC));
     82  dprintf(("USER32: GetTabbedTextExtentA %x",hDC));
    8383
    8484  return InternalGetTabbedTextExtentA(hDC,lpString,nCount,nTabPositions,lpnTabStopPositions);
     
    8888DWORD WIN32API GetTabbedTextExtentW(HDC hDC,LPCWSTR lpString,INT nCount,INT nTabPositions,LPINT lpnTabStopPositions)
    8989{
    90   dprintf2(("USER32: GetTabbedTextExtentW %x",hDC));
     90  dprintf(("USER32: GetTabbedTextExtentW %x",hDC));
    9191
    9292  return InternalGetTabbedTextExtentW(hDC,lpString,nCount,nTabPositions,lpnTabStopPositions);
     
    9696LONG WIN32API TabbedTextOutA(HDC hdc,INT x,INT y,LPCSTR lpString,INT nCount,INT nTabPositions, LPINT lpnTabStopPositions,INT nTabOrigin)
    9797{
    98   dprintf2(("USER32: TabbedTextOutA %x",hDC));
     98  dprintf(("USER32: TabbedTextOutA %x",hdc));
    9999
    100100  return InternalTabbedTextOutA(hdc,x,y,lpString,nCount,nTabPositions,lpnTabStopPositions,nTabOrigin);
     
    104104LONG WIN32API TabbedTextOutW( HDC hdc, int x, int y, LPCWSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions, int  nTabOrigin)
    105105{
    106   dprintf2(("USER32: TabbedTextOutW %x",hDC));
     106  dprintf(("USER32: TabbedTextOutW %x",hdc));
    107107
    108108  return InternalTabbedTextOutW(hdc,x,y,lpString,nCount,nTabPositions,lpnTabStopPositions,nTabOrigin);
     
    190190BOOL WIN32API GrayStringA(HDC hdc,HBRUSH hBrush,GRAYSTRINGPROC lpOutputFunc,LPARAM lpData,int nCount,int X,int Y,int nWidth,int nHeight)
    191191{
    192   dprintf2(("USER32: GrayStringA %x",hDC));
     192  dprintf(("USER32: GrayStringA %x",hdc));
    193193
    194194  return InternalGrayString(hdc,hBrush,lpOutputFunc,lpData,nCount,X,Y,nWidth,nHeight,FALSE);
     
    198198BOOL WIN32API GrayStringW(HDC hdc,HBRUSH hBrush,GRAYSTRINGPROC lpOutputFunc,LPARAM lpData,int nCount,int X,int Y,int nWidth,int nHeight)
    199199{
    200   dprintf2(("USER32: GrayStringW %x",hDC));
     200  dprintf(("USER32: GrayStringW %x",hdc));
    201201
    202202  return InternalGrayString(hdc,hBrush,lpOutputFunc,lpData,nCount,X,Y,nWidth,nHeight,TRUE);
Note: See TracChangeset for help on using the changeset viewer.