Implement wxSTCListBox using wxVListBox

Previously wxSTCListBox was a class derived from wxListView and required
several extra steps to make the control look correct when it lacked
focus. This commit changes wxSTCListBox so that it is a wxVListBox and
is built to always draw itself looking as though it has focus.

In addition this splits the work previously done by ListBoxImpl class
among wxSTCListBox and a newly defined wxSTCListBoxVisualData class.
wxSTCListBox manages the work done by a specific list and
wxSTCListBoxVisualData manages the data common to all lists. All
ListBoxImpl methods now simply forward to a method of one of those 2
classes.
This commit is contained in:
New Pagodi
2019-03-18 22:35:43 -05:00
parent 59190ffc06
commit de0992ea3d
2 changed files with 633 additions and 341 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,8 @@
#include "Platform.h"
class wxStyledTextCtrl;
class wxSTCListBox;
class wxSTCListBoxVisualData;
@@ -19,14 +20,8 @@ wxColour wxColourFromCD(const ColourDesired& ca);
class ListBoxImpl : public ListBox {
private:
int lineHeight;
bool unicodeMode;
int desiredVisibleRows;
int aveCharWidth;
size_t maxStrWidth;
Point location; // Caret location at which the list is opened
wxImageList* imgList;
wxArrayInt* imgTypeMap;
wxSTCListBox* m_listBox;
wxSTCListBoxVisualData* m_visualData;
public:
ListBoxImpl();