Changeset 352 for branches


Ignore:
Timestamp:
Apr 3, 2010, 8:53:49 PM (12 years ago)
Author:
dmik
Message:

branches/kmk: Fixed r349 regression: Don't cancel field editor if clicked inside it.

Location:
branches/kmk/Lucide/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/kmk/Lucide/gui/docViewer.cpp

    r351 r352  
    14411441}
    14421442
    1443 void DocumentViewer::hideTextField( bool apply )
     1443void DocumentViewer::hideTextField( bool apply, PPOINTL ptl )
    14441444{
    14451445    if ( textField != NULL ) {
    14461446        HWND hwnd = textField->isMultiLine( ev ) ? hWndMLE : hWndEntry;
     1447        SWP swp;
     1448        WinQueryWindowPos( hwnd, &swp );
     1449        RECTL r = { swp.x, swp.y, swp.x + swp.cx, swp.y + swp.cy };
     1450        if ( ptl && WinPtInRect( hab, &r, ptl ) ) {
     1451            // don't hide if the point is inside the field
     1452            return;
     1453        }
    14471454        if ( apply ) {
    14481455            LONG len = WinQueryWindowTextLength( hwnd );
     
    14581465        }
    14591466        textField = NULL;
    1460         SWP swp;
    1461         WinQueryWindowPos( hwnd, &swp );
    14621467        WinShowWindow( hwnd, FALSE );
    14631468        // repaint little bit more (rounding errors)
    1464         RECTL r = { swp.x - 1, swp.y - 1, swp.x + swp.cx + 2, swp.y + swp.cy + 2 };
     1469        r.xLeft -= 1; r.yBottom -= 1;
     1470        r.xRight += 1; r.yTop += 1;
    14651471        WinInvalidateRect( hWndDoc, &r, TRUE );
    14661472    }
     
    23712377    }
    23722378
    2373     hideTextField();
     2379    POINTL ptl = { xpos, ypos };
     2380    hideTextField( true, &ptl );
    23742381
    23752382    WinSetCapture( HWND_DESKTOP, hwnd );
  • branches/kmk/Lucide/gui/docViewer.h

    r351 r352  
    149149        void showTextField( long page, long index, PRECTL r = NULL );
    150150        void positionTextField( PRECTL r = NULL );
    151         void hideTextField( bool apply = true );
     151        void hideTextField( bool apply = true, PPOINTL ptl = NULL );
    152152
    153153        static MRESULT EXPENTRY docViewProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
Note: See TracChangeset for help on using the changeset viewer.