wxListbook

From WxWiki
Jump to: navigation, search
Official Classes SmallBlocks.png Archive Containers Controls Data Structures Database Date & Time Debug Device Contexts Dialogs Document & Views Drag & Drop Events Filesystem Frames Graphics Grid Cell Help HTML Logging Miscellaneous Networking Printing Sizers Streams Threading Windows

wxListbook is a class similar to wxNotebook but which uses a wxListCtrl to show the labels instead of the tabs.

The underlying wxListCtrl displays page labels in a one-column report view by default. Calling wxBookCtrl::SetImageList will implicitly switch the control to use an icon view.

For usage documentation of this class, please refer to the base abstract class wxBookCtrl. You can also use the Notebook Sample to see wxListbook in action.

Deleting some selected rows correctly

"Rows" in a listctrl are called 'items' and are indexed starting from zero. You often want to delete some items that the user has selected. This is obviously done is get the index of the selected items, and then loop through, deleting the selected items. However, what will happen is that you will delete the first one, and the index numbers have now renumbered.

To get around this, you just need to loop through in reverse order: delete the bottommost selected item first, and work your way up.

See Also