When modifying the contents of a C_List control on
Microsoft Windows systems, sometimes the list control
is not redrawn, and area where the control is becomes
the color of the dialog box frame.
The solution for this is to turn off Windows' redrawing
of the control before the changes are made, like this:
::SendDlgItemMessage(_parentWin->getParent(),
_cmdId, WM_SETREDRAW, FALSE, 0);
This fix applies to V 1.27, 1,90, and 1.90a.
Replace the same if-block with the one below in the
file srcwin\vlistc.cpp, vListCmd::SetCmdVal:
//---- start
if (st == ChangeList || st == ChangeListPtr)
{
if (st == ChangeListPtr)
_itemList = dlgCmd->itemList;
// delay redraw
::SendDlgItemMessage(_parentWin->getParent(),
_cmdId, WM_SETREDRAW, FALSE, 0);
// Change list is used both for initial display,
// and when user changes the list.
::SendDlgItemMessage(_parentWin->getParent(),
_cmdId, LB_RESETCONTENT, 0, 0); //
Clear current
int oldMax = _maxWidth; // track
current max width
SetupList(); // resetup the list
if (oldMax > _maxWidth)
_maxWidth = oldMax; // don't let it
get narrower
for (int ixx = 0 ; ixx < _numItems ; ++ixx)
{
// Add each item to the list
::SendDlgItemMessage(_parentWin->getParent(), _cmdId,
LB_INSERTSTRING, ixx,
(LPARAM)_fullList[ixx]);
}
// Need to set to insensitive if it is set
insensitive
if (!_Sensitive)
{
::EnableWindow(myHwnd, 0);
}
if (dlgCmd->attrs & CA_Hidden)
{
::ShowWindow(myHwnd, SW_HIDE);
}
_curSelection = val;
::SendDlgItemMessage(_parentWin->getParent(),
_cmdId, LB_SETCURSEL, _curSelection, 0);
// force redraw
::SendDlgItemMessage(_parentWin->getParent(),
_cmdId, WM_SETREDRAW, TRUE, 0);
return;
}
//---- end
Contains the fixed if-block w/formatting preserved.