Changeset 83 for trunk/dll/newview.c
- Timestamp:
- May 21, 2004, 5:10:42 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/newview.c
r2 r83 1 2 /*********************************************************************** 3 4 $Id$ 5 6 New internal viewer 7 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2001, 2003 Steven H.Levine 10 11 Revisions 01 Dec 03 SHL - Comments 12 02 Dec 03 SHL - Correct WM_VSCROLL math 13 14 ***********************************************************************/ 15 1 16 #define INCL_DOS 2 17 #define INCL_WIN … … 98 113 99 114 100 MRESULT EXPENTRY UrlDlgProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) {101 115 MRESULT EXPENTRY UrlDlgProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) 116 { 102 117 URLDATA *urld; 103 118 … … 231 246 232 247 233 static ULONG NumLines (RECTL *rcl,VIEWDATA *ad) {234 248 static ULONG NumLines (RECTL *rcl,VIEWDATA *ad) 249 { 235 250 ULONG numlines; 236 251 … … 244 259 245 260 246 static CHAR **BuildAList (HWND hwnd) {247 261 static CHAR **BuildAList (HWND hwnd) 262 { 248 263 VIEWDATA *ad = WinQueryWindowPtr(hwnd,0); 249 264 register ULONG x,y,z = 0; … … 325 340 326 341 327 static CHAR **BuildAList2 (HWND hwnd) {328 342 static CHAR **BuildAList2 (HWND hwnd) 343 { 329 344 VIEWDATA *ad = WinQueryWindowPtr(hwnd,0); 330 345 CHAR **list = NULL,s[SEARCHSTRINGLEN]; … … 351 366 352 367 353 MRESULT EXPENTRY ViewStatusProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) {354 368 MRESULT EXPENTRY ViewStatusProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) 369 { 355 370 switch(msg) { 356 371 case WM_CREATE: … … 531 546 532 547 533 static VOID FreeViewerMem (HWND hwnd) {534 548 static VOID FreeViewerMem (HWND hwnd) 549 { 535 550 VIEWDATA *ad = WinQueryWindowPtr(hwnd,0); 536 551 … … 551 566 552 567 553 static HPS InitWindow (HWND hwnd) {554 568 static HPS InitWindow (HWND hwnd) 569 { 555 570 VIEWDATA *ad = WinQueryWindowPtr(hwnd,0); 556 571 HPS hps = (HPS)0; … … 609 624 610 625 static VOID PaintLine (HWND hwnd,HPS hps,ULONG whichline,ULONG topline, 611 RECTL *Rectl) {612 626 RECTL *Rectl) 627 { 613 628 VIEWDATA *ad = WinQueryWindowPtr(hwnd,0); 614 629 POINTL ptl; … … 799 814 800 815 801 static VOID Search (VOID *args) {802 816 static VOID Search (VOID *args) 817 { 803 818 HWND hwnd = (HWND)args; 804 819 HAB hab2; … … 952 967 953 968 954 static VOID Clipboard (VOID *args) {955 969 static VOID Clipboard (VOID *args) 970 { 956 971 HWND hwnd = (HWND)args; 957 972 HAB hab2; … … 1050 1065 1051 1066 1052 static VOID ReLine (VOID *args) {1053 1067 static VOID ReLine (VOID *args) 1068 { 1054 1069 HWND hwnd = (HWND)args; 1055 1070 HAB hab2; … … 1225 1240 1226 1241 1227 static VOID LoadFile (VOID *args) {1228 1242 static VOID LoadFile (VOID *args) 1243 { 1229 1244 HWND hwnd = (HWND)args; 1230 1245 HAB hab2; … … 1335 1350 1336 1351 1337 MRESULT EXPENTRY ViewFrameWndProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) {1338 1352 MRESULT EXPENTRY ViewFrameWndProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) 1353 { 1339 1354 PFNWP oldproc = (PFNWP)WinQueryWindowPtr(hwnd,0); 1340 1355 … … 1498 1513 1499 1514 1500 MRESULT EXPENTRY FindStrDlgProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) {1501 1515 MRESULT EXPENTRY FindStrDlgProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) 1516 { 1502 1517 VIEWDATA *ad; 1503 1518 … … 1601 1616 1602 1617 1603 MRESULT EXPENTRY ViewWndProc (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) {1604 1618 MRESULT EXPENTRY ViewWndProc (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 1619 { 1605 1620 VIEWDATA *ad = WinQueryWindowPtr(hwnd,0); 1606 1621 … … 2760 2775 ad->topline -= numlines; 2761 2776 if(ad->topline > ad->numlines || 2762 ad->topline > (ad->numlines + 1) - numlines)2777 ad->topline + numlines > (ad->numlines + 1)) 2763 2778 ad->topline = 1; 2764 2779 if(ad->cursored > ad->topline + numlines) … … 2770 2785 break; 2771 2786 case SB_PAGEDOWN: 2772 if(ad->topline <= ad->numlines -numlines) {2787 if(ad->topline + numlines <= ad->numlines) { 2773 2788 ad->topline += numlines; 2774 if (ad->topline > (ad->numlines + 1) - numlines)2789 if (ad->topline + numlines > ad->numlines + 1) 2775 2790 ad->topline = (ad->numlines + 1) - numlines; 2776 2791 if(ad->cursored < ad->topline) 2777 2792 ad->cursored = ad->topline; 2778 if (ad->cursored > (ad->topline + numlines) - 1)2793 if (ad->cursored + 1 > ad->topline + numlines) 2779 2794 ad->cursored = (ad->topline + numlines) - 1; 2780 2795 if(ad->cursored > ad->numlines) … … 2784 2799 break; 2785 2800 case SB_LINEDOWN: 2786 if (ad->topline <= ad->numlines -numlines) {2801 if (ad->topline + numlines <= ad->numlines) { 2787 2802 2788 2803 RECTL Rectl,iRectl; … … 2791 2806 if(ad->cursored < ad->topline) 2792 2807 ad->cursored = ad->topline; 2793 else if (ad->cursored > (ad->topline + numlines) - 1)2808 else if (ad->cursored + 1 > ad->topline + numlines) 2794 2809 ad->cursored = (ad->topline + numlines) - 1; 2795 2810 if(ad->cursored > ad->numlines) … … 2829 2844 if(ad->cursored < ad->topline) 2830 2845 ad->cursored = ad->topline; 2831 else if (ad->cursored > (ad->topline + numlines) - 1)2846 else if (ad->cursored + 1 > ad->topline + numlines) 2832 2847 ad->cursored = (ad->topline + numlines) - 1; 2833 2848 if(ad->cursored > ad->numlines) … … 2867 2882 (SHORT1FROMMP(mp2)) <= ad->numlines) { 2868 2883 ad->topline = (ULONG)SHORT1FROMMP(mp2) * ad->multiplier; 2869 if (ad->topline > (ad->numlines + 1) - numlines)2884 if (ad->topline + numlines > ad->numlines + 1) 2870 2885 ad->topline = (ad->numlines + 1) - numlines; 2871 2886 if(!ad->topline) … … 3881 3896 3882 3897 HWND StartViewer (HWND hwndParent,USHORT flags,CHAR *filename, 3883 HWND hwndRestore) {3884 3898 HWND hwndRestore) 3899 { 3885 3900 HWND hwndFrame = (HWND)0,hwndClient; 3886 3901 VIEWDATA *ad; … … 4037 4052 return hwndFrame; 4038 4053 } 4039
Note:
See TracChangeset
for help on using the changeset viewer.