Changeset 285


Ignore:
Timestamp:
Jan 6, 2010, 5:47:40 PM (11 years ago)
Author:
rbri
Message:

Zoom out by right mouse button
initial impl for vert scrolling via mouse drag

Location:
trunk/Lucide/SOURCE/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Lucide/SOURCE/gui/docViewer.cpp

    r268 r285  
    671671    }
    672672
    673     if ( SHORT2FROMMP( mp2 ) != SB_PAGEDRAG ) { 
     673    if ( SHORT2FROMMP( mp2 ) != SB_PAGEDRAG ) {
    674674        sVscrollInc = __max( -sVscrollPos * VScrollStep, __min( sVscrollInc,
    675675                              ( sVscrollMax - sVscrollPos ) * VScrollStep ) );
     
    714714        case SB_SLIDERPOSITION:
    715715            sHscrollInc = SHORT1FROMMP( mp2 ) - sHscrollPos;
     716            break;
     717        case SB_PAGEDRAG:
     718            sHscrollInc = (SHORT)SHORT1FROMMP( mp2 );
    716719            break;
    717720    }
     
    17171720            docDraggingEnd.x = xpos;
    17181721            docDraggingEnd.y = ypos;
     1722 
     1723            SHORT hMove = docDraggingEnd.x - docDraggingStart.x;
     1724            if ( abs( hMove ) > 5 )
     1725            {
     1726                horizScroll( hwnd, MPFROM2SHORT( hMove, SB_PAGEDRAG ) );
     1727                docDraggingStart.x = xpos;
     1728            }
    17191729
    17201730            SHORT vMove = docDraggingEnd.y - docDraggingStart.y;
    1721             if ( abs( vMove ) > 5 ) 
    1722             {           
     1731            if ( abs( vMove ) > 5 )
     1732            {
    17231733                vertScroll( hwnd, MPFROM2SHORT( vMove, SB_PAGEDRAG ) );
    1724                 docDraggingStart.x = xpos;
    17251734                docDraggingStart.y = ypos;
    17261735            }
     
    18441853}
    18451854
     1855// handles WM_BUTTON2CLICK
     1856BOOL DocumentViewer::wmRightClick( HWND hwnd, SHORT xpos, SHORT ypos )
     1857{
     1858    if ( zoomMode )
     1859    {
     1860        zoomInOut( false );
     1861        return TRUE;
     1862    }
     1863    return FALSE;
     1864}
     1865
    18461866BOOL DocumentViewer::wmChar( HWND hwnd, MPARAM mp1, MPARAM mp2 )
    18471867{
     
    21782198            _this->wmButton2Down( hwnd, SHORT1FROMMP( mp1 ), SHORT2FROMMP( mp1 ) );
    21792199            break;
    2180            
     2200
    21812201        case WM_BUTTON2UP:
    21822202            _this->wmButton2Up();
    21832203            break;
    2184            
     2204
    21852205        case WM_MOUSEMOVE:
    21862206            if ( _this->wmMouseMove( hwnd, SHORT1FROMMP( mp1 ), SHORT2FROMMP( mp1 ) ) ) {
     
    21912211        case WM_BUTTON1CLICK:
    21922212            if ( _this->wmClick( hwnd, SHORT1FROMMP( mp1 ), SHORT2FROMMP( mp1 ) ) ) {
     2213                return (MRESULT)TRUE;
     2214            }
     2215            break;
     2216
     2217        case WM_BUTTON2CLICK:
     2218            if ( _this->wmRightClick( hwnd, SHORT1FROMMP( mp1 ), SHORT2FROMMP( mp1 ) ) ) {
    21932219                return (MRESULT)TRUE;
    21942220            }
  • trunk/Lucide/SOURCE/gui/docViewer.h

    r268 r285  
    2222 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    2323 * in which case the provisions of the LGPL are applicable instead of those
    24  * above. If you wish to allow use of your version of this file only under the 
     24 * above. If you wish to allow use of your version of this file only under the
    2525 * terms of the LGPL, and not to allow others to use your version of this file
    2626 * under the terms of the CDDL, indicate your decision by deleting the
    2727 * provisions above and replace them with the notice and other provisions
    2828 * required by the LGPL. If you do not delete the provisions above, a recipient
    29  * may use your version of this file under the terms of any one of the CDDL 
     29 * may use your version of this file under the terms of any one of the CDDL
    3030 * or the LGPL.
    3131 *
     
    9191        void drawPage();
    9292        void adjustSize();
    93                 void countPagesizes();
     93        void countPagesizes();
    9494
    9595        MRESULT vertScroll( HWND hwnd, MPARAM mp2 );
    9696        MRESULT horizScroll( HWND hwnd, MPARAM mp2 );
    9797        MRESULT wmDragOver( PDRAGINFO dragInfo );
    98                 void wmDrop( PDRAGINFO dragInfo );
    99                 void wmSize( HWND hwnd, MPARAM mp2 );
     98        void wmDrop( PDRAGINFO dragInfo );
     99        void wmSize( HWND hwnd, MPARAM mp2 );
    100100        void wmPaint( HWND hwnd );
    101101        void wmPaintCont( HWND hwnd );
     
    108108        BOOL wmMouseMove( HWND hwnd, SHORT xpos, SHORT ypos );
    109109        BOOL wmClick( HWND hwnd, SHORT xpos, SHORT ypos );
     110        BOOL wmRightClick( HWND hwnd, SHORT xpos, SHORT ypos );
    110111        BOOL wmChar( HWND hwnd, MPARAM mp1, MPARAM mp2 );
    111                 void wmTimer( USHORT idTimer );
     112        void wmTimer( USHORT idTimer );
    112113        void winPosToDocPos( PPOINTL startpoint, PPOINTL endpoint, LuRectangle *r );
    113114        void winPosToDocPos( PageDrawArea *pda, LuRectangle *r );
     
    172173        POINTL docDraggingStart;
    173174        POINTL docDraggingEnd;
    174        
     175
    175176        // fullscreen
    176177        bool fullscreen;
     
    212213        bool continueSearch;
    213214        bool abortSearch;
    214        
     215
    215216        // pointers
    216217        HPOINTER handPtr;
Note: See TracChangeset for help on using the changeset viewer.