Changeset 266
- Timestamp:
- Feb 24, 2009, 3:34:50 PM (12 years ago)
- Location:
- trunk/Lucide/SOURCE/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Lucide/SOURCE/gui/docViewer.cpp
r241 r266 99 99 drawareaIndex = 0; 100 100 closed = true; 101 layout = SinglePage; 101 102 // continuous view 102 continuous = false;103 103 pagesizes = NULL; 104 104 realVscrollMax = 0; … … 297 297 298 298 // sets the page layout 299 void DocumentViewer::setPageLayout( PgLayout layout )300 { 301 continuous = ( layout == Continuous );299 void DocumentViewer::setPageLayout( PgLayout _layout ) 300 { 301 layout = _layout; 302 302 if ( doc != NULL ) { 303 303 long pg = currentpage; 304 304 drawPage(); 305 if ( continuous) {305 if ( isContinuous() ) { 306 306 goToPage( pg ); 307 307 } … … 346 346 } 347 347 348 if ( continuous&& ( doc != NULL ) )348 if ( isContinuous() && ( doc != NULL ) ) 349 349 { 350 350 bool needRedraw = ( page == currentpage ); … … 450 450 void DocumentViewer::copyToClipbrd() 451 451 { 452 if ( continuous)452 if ( isContinuous() ) 453 453 { 454 454 std::string txt = ""; … … 469 469 void DocumentViewer::selectAll() 470 470 { 471 if ( continuous)471 if ( isContinuous() ) 472 472 { 473 473 for ( long i = 0; i < totalpages; i++ ) … … 594 594 595 595 if ( zoom == -1 ) { // fit width 596 realzoom = (double)cxClient / ( continuous? fullwidth : width );596 realzoom = (double)cxClient / ( isContinuous() ? fullwidth : width ); 597 597 } 598 598 else if ( zoom == -2 ) { // fit page … … 613 613 void DocumentViewer::drawPage() 614 614 { 615 if ( ! continuous)615 if ( !isContinuous() ) 616 616 { 617 617 LuDocument::freeRectangles( ev, selrects[ currentpage ] ); … … 754 754 else 755 755 { 756 sHscrollMax = (SHORT)__max( 0, ( continuous? fullwidth : width ) - cxClient );756 sHscrollMax = (SHORT)__max( 0, ( isContinuous() ? fullwidth : width ) - cxClient ); 757 757 sHscrollPos = __min( sHscrollPos, sHscrollMax ); 758 758 … … 764 764 765 765 VScrollStep = 1; 766 if ( continuous)766 if ( isContinuous() ) 767 767 { 768 768 realVscrollMax = __max( 0, fullheight - cyClient ); … … 785 785 WinSendMsg( hWndVscroll, SBM_SETSCROLLBAR, 786 786 MPFROMSHORT(sVscrollPos), MPFROM2SHORT(0, sVscrollMax) ); 787 if ( continuous) {787 if ( isContinuous() ) { 788 788 WinSendMsg( hWndVscroll, SBM_SETTHUMBSIZE, 789 789 MPFROM2SHORT( cyClient/VScrollStep, fullheight/VScrollStep ), MPVOID ); … … 1448 1448 void DocumentViewer::docPosToWinPos( long pagenum, LuRectangle *r, PRECTL rcl ) 1449 1449 { 1450 double yplus = continuous? pagenumToPos( pagenum ) : 0;1450 double yplus = isContinuous() ? pagenumToPos( pagenum ) : 0; 1451 1451 double w = pagesizes[ pagenum ].x; 1452 1452 double h = pagesizes[ pagenum ].y; … … 1490 1490 rcl->xRight += xPos; 1491 1491 } 1492 if ( ! continuous)1492 if ( !isContinuous() ) 1493 1493 { 1494 1494 LONG ph = h * realzoom; … … 1626 1626 selectionEnd.y = ypos; 1627 1627 1628 if ( continuous)1628 if ( isContinuous() ) 1629 1629 { 1630 1630 scrollToPos( hwnd, NULLHANDLE, xpos, ypos, true ); … … 1705 1705 { 1706 1706 long pg = currentpage; 1707 if ( continuous) {1707 if ( isContinuous() ) { 1708 1708 double tmp; 1709 1709 pg = posToPagenum( ypos, &tmp ); … … 1765 1765 1766 1766 long pg = currentpage; 1767 if ( continuous) {1767 if ( isContinuous() ) { 1768 1768 double tmp; 1769 1769 pg = posToPagenum( ypos, &tmp ); … … 1849 1849 else 1850 1850 { 1851 bool dojump = ( ! continuous&& ( sVscrollPos == 0 )1851 bool dojump = ( !isContinuous() && ( sVscrollPos == 0 ) 1852 1852 && ( currentpage > 0 ) ); 1853 1853 … … 1874 1874 else 1875 1875 { 1876 bool dojump = ( ! continuous&& ( sVscrollPos == sVscrollMax ) );1876 bool dojump = ( !isContinuous() && ( sVscrollPos == sVscrollMax ) ); 1877 1877 1878 1878 if ( fullscreen || dojump ) { … … 1941 1941 void DocumentViewer::wmButton1Down( HWND hwnd, SHORT xpos, SHORT ypos ) 1942 1942 { 1943 if ( continuous&& ( doc != NULL ) )1943 if ( isContinuous() && ( doc != NULL ) ) 1944 1944 { 1945 1945 // clear selection … … 2104 2104 case WM_PAINT: 2105 2105 if ( _this->enableAsynchDraw ) { 2106 if ( _this-> continuous) {2106 if ( _this->isContinuous() ) { 2107 2107 _this->wmPaintContAsynch( hwnd ); 2108 2108 } else { … … 2110 2110 } 2111 2111 } else { 2112 if ( _this-> continuous) {2112 if ( _this->isContinuous() ) { 2113 2113 _this->wmPaintCont( hwnd ); 2114 2114 } else { -
trunk/Lucide/SOURCE/gui/docViewer.h
r241 r266 61 61 62 62 void setPageLayout( PgLayout layout ); 63 PgLayout getPageLayout() { return ( continuous ? Continuous : SinglePage ); }63 PgLayout getPageLayout() { return layout; } 64 64 65 65 HWND getFrameHWND() { return hWndDocFrame; } … … 123 123 double pagenumToPos( long pagenum ); 124 124 bool isRotated() { return ( (rotation==90) || (rotation==270) ); } 125 bool isContinuous() { return ( layout == Continuous ); }; 125 126 126 127 static MRESULT EXPENTRY docViewProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ); … … 163 164 bool closed; 164 165 bool drawPS; 166 PgLayout layout; 165 167 166 168 // fullscreen … … 174 176 175 177 // continuous view 176 bool continuous;177 178 LuSize *pagesizes; 178 179 SHORT VScrollStep; -
trunk/Lucide/SOURCE/gui/lucide.h
r234 r266 42 42 class ProgressDlg; 43 43 44 enum PgLayout { SinglePage = 0, Continuous = 1 };44 enum PgLayout { SinglePage = 0, Continuous = 1, TwoPages = 2 }; 45 45 enum ActiveWindow { AwIndex, AwView }; 46 46 enum FileList { ListFirst, ListPrevious, ListNext, ListLast };
Note: See TracChangeset
for help on using the changeset viewer.