[ENHANCEMENT] Enhance doc map.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@878 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2012-03-12 02:25:39 +00:00
parent 9206fd252e
commit e6dbc657d6
2 changed files with 41 additions and 2 deletions

View File

@ -4853,6 +4853,7 @@ Quote quotes[nbQuote] = {
{"Gavin Russell Baker", "C++ : Where friends have access to your private members."}, {"Gavin Russell Baker", "C++ : Where friends have access to your private members."},
{"Alanna", "Saying that Java is nice because it works on all OSes is like saying that anal sex is nice because it works on all genders."}, {"Alanna", "Saying that Java is nice because it works on all OSes is like saying that anal sex is nice because it works on all genders."},
{"Linus Torvalds", "Software is like sex: It's better when it's free."}, {"Linus Torvalds", "Software is like sex: It's better when it's free."},
//{"Thomer M. Gil", "Don't get me wrong: Emacs is a great operating system --- it lacks a good editor, though."},
{"Steve Jobs", "The only problem with Microsoft is they just have no taste. They have absolutely no taste. And I don't mean that in a small way, I mean that in a big way, in the sense that they don't think of original ideas, and they don't bring much culture into their products."}, {"Steve Jobs", "The only problem with Microsoft is they just have no taste. They have absolutely no taste. And I don't mean that in a small way, I mean that in a big way, in the sense that they don't think of original ideas, and they don't bring much culture into their products."},
{"brotips #1001", "Do everything for greatness, not money. Money follows greatness."}, {"brotips #1001", "Do everything for greatness, not money. Money follows greatness."},
{"brotips #1212", "Cheating is like eating fast food: you do it, you enjoy it, and then you feel like shit."}, {"brotips #1212", "Cheating is like eating fast food: you do it, you enjoy it, and then you feel like shit."},

View File

@ -126,7 +126,7 @@ void DocumentMap::wrapMap()
pLine = i; pLine = i;
} }
} }
else else // line wrapped, let's found the nb char in the first wrapped line
{ {
nbWrappedDocLine++; nbWrappedDocLine++;
} }
@ -155,7 +155,45 @@ void DocumentMap::wrapMap()
// resize map width W2 according W1, Xlength1 and Xlength2 // resize map width W2 according W1, Xlength1 and Xlength2
int w2 = (w1 * Xlength2)/Xlength1; int w2 = (w1 * Xlength2)/Xlength1;
/*
double ddd = (double)Xlength1/(double)Xlength2;
char dchar[256];
sprintf(dchar, "%f", ddd);
::MessageBoxA(NULL, dchar, "", MB_OK);
// -10 => 1
// -9 => 1
// -8 => 1
// -7 => 1
// -6 => 1.5
// -5 => 2
// -4 => 2.5
// -3 => 2.5
// -2 => 3.5
// -1 => 3.5
// 0: -10 => 4
// 1: -10 => 4.5
// 2 => 5
// 3 => 5
// 4 => 5.5
// 5 => 6
// 6 => 6.5
// 7 => 7
// 8 => 7
// 9 => 7.5
// 10 => 8
// 11 => 8.5
// 12 => 8.5
// 13 => 9.5
// 14 => 9.5
// 15 => 10
// 16 => 10.5
// 17 => 11
// 18 => 11
// 19 => 11.5
// 20 => 12
*/
::MoveWindow(_pScintillaEditView->getHSelf(), 0, 0, w2, rect.bottom-rect.top, TRUE); ::MoveWindow(_pScintillaEditView->getHSelf(), 0, 0, w2, rect.bottom-rect.top, TRUE);
_pScintillaEditView->wrap(true); _pScintillaEditView->wrap(true);
@ -225,7 +263,7 @@ void DocumentMap::doMove()
RECT rc; RECT rc;
POINT pt = {0,0}; POINT pt = {0,0};
::ClientToScreen(_pScintillaEditView->getHSelf(), &pt); ::ClientToScreen(_pScintillaEditView->getHSelf(), &pt);
_pScintillaEditView->getClientRect(rc); getClientRect(rc);
::MoveWindow(_vzDlg.getHSelf(), pt.x, pt.y, (rc.right - rc.left), (rc.bottom - rc.top), TRUE); ::MoveWindow(_vzDlg.getHSelf(), pt.x, pt.y, (rc.right - rc.left), (rc.bottom - rc.top), TRUE);
} }