今度は、ウィンドウリストアイテムの削除を実装する。
WindowListItemsPanel.hに、
Removeを追加。
WindowListItemsPanel.cppで、
Removeは、基本的にはInsertと逆の動きをすればいい。
WindowListControl.hも、
Removeを追加。
WindowListControl.cppは、
m_pWindowListItemsPanel->Remove(iIndex)を呼ぶだけ。
UserControl.hで、
OnDestroyを追加。
UserControl.cppでは、
OnDestroyは何もしない。
CustomControl.hも、
OnDestroyを追加。
CustomControl.cppで、
OnDestroyは何もしない。
MainWindow.cppでは、
5つInsertした後に、0番目、3番目、1番目という順でRemoveしている。
さて、どうなるか。
このように、"2"と"0"が残る。