#1 Notes not being restored

closed-fixed
nobody
None
5
2003-08-29
2003-08-21
Leonardo Zide
No

If you don't use the shrink on minimize feature, the
notes are not restored correctly next time you restart
the program.

To fix it I changed the following functions:

void CNote::OnMinimize ()
{
// Minimize the note or restore it
if (theApp.m_bMinimizeShrink) {
if (m_bVisible) {
CRect rc;
SystemParametersInfo
(SPI_GETWORKAREA , 0, &rc, 0);
if (m_bDockedBottom) {
m_rPosition.top =
rc.bottom - 23;
// Move the cursor to the
minimize-button
CRect rect;
GetWindowRect
(&rect);
SetCursorPos
(m_rPosition.left + rect.Width () - 32, m_rPosition.top
+ 10);
}
m_iOldHeight =
m_rPosition.bottom;
MoveWindow
(m_rPosition.left, m_rPosition.top, m_rPosition.right,
23);
if
(theApp.m_bThinNoteBorder)

m_pMinimize.SetBitmaps
(IDB_NOTEMINIMIZE2, RGB (100,100,100),
IDB_NOTEMINIMIZE2, RGB (100,100,100));
else

m_pMinimize.SetBitmaps
(IDB_NOTEMINIMIZE3, RGB (100,100,100),
IDB_NOTEMINIMIZE3, RGB (100,100,100));
m_bVisible = FALSE;
}
else
RestoreNote ();
}
else {
if (m_bVisible) {
m_bVisible = FALSE;
MoveWindow
(m_rPosition.left, m_rPosition.top, m_rPosition.right,
m_rPosition.bottom);
ShowWindow (SW_HIDE);
}
else
RestoreNote ();
}

}

void CNote::RestoreNote()
{
// Show it again
if (theApp.m_bMinimizeShrink) {
m_bVisible = TRUE;
CRect rc;
SystemParametersInfo
(SPI_GETWORKAREA , 0, &rc, 0);

if (rc.bottom < (m_rPosition.top +
m_iOldHeight)) {
m_rPosition.top =
rc.bottom - m_iOldHeight;
m_bDockedBottom = TRUE;
}
MoveWindow (m_rPosition.left,
m_rPosition.top, m_rPosition.right, m_iOldHeight);

// Move the cursor to the minimize-button
CRect rect;
GetWindowRect (&rect);
SetCursorPos (m_rPosition.left +
rect.Width () - 32, m_rPosition.top + 10);
}
else {
m_bVisible = TRUE;
ShowWindow (SW_SHOW);
}

if (theApp.m_bThinNoteBorder)
m_pMinimize.SetBitmaps
(IDB_NOTEMINIMIZE1, RGB (100,100,100),
IDB_NOTEMINIMIZE1, RGB (100,100,100));
else
m_pMinimize.SetBitmaps
(IDB_NOTEMINIMIZE, RGB (100,100,100),
IDB_NOTEMINIMIZE, RGB (100,100,100));
}

Discussion

    • status: open --> closed-fixed