diff options
author | Neil <nyamatongwe@gmail.com> | 2021-03-18 17:38:38 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-03-18 17:38:38 +1100 |
commit | bac6aef730e569c6b4bcda7026bf1c1db3e827b6 (patch) | |
tree | 898ef25cd1964752c397cb752866b9527c1f9c30 | |
parent | 30e8720a235014e96125f9142e5c0a7e628526ce (diff) | |
download | scintilla-mirror-bac6aef730e569c6b4bcda7026bf1c1db3e827b6.tar.gz |
ListBox options API. ListOptions is currently empty but may contain list item
colours in the future.
-rw-r--r-- | cocoa/PlatCocoa.mm | 4 | ||||
-rwxr-xr-x | gtk/PlatGTK.cxx | 4 | ||||
-rw-r--r-- | qt/ScintillaEditBase/PlatQt.cpp | 4 | ||||
-rw-r--r-- | src/Platform.h | 4 | ||||
-rw-r--r-- | win32/PlatWin.cxx | 6 |
5 files changed, 22 insertions, 0 deletions
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index 8e4323dca..d01c73da6 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -1680,6 +1680,7 @@ public: delegate = lbDelegate; } void SetList(const char *list, char separator, char typesep) override; + void SetOptions(ListOptions options_) override; // To clean up when closed void ReleaseViews(); @@ -1866,6 +1867,9 @@ void ListBoxImpl::SetList(const char *list, char separator, char typesep) { [table reloadData]; } +void ListBoxImpl::SetOptions(ListOptions) { +} + int ListBoxImpl::Length() { return ld.Length(); } diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 2f37cf62d..45564df78 100755 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -1232,6 +1232,7 @@ public: void ClearRegisteredImages() override; void SetDelegate(IListBoxDelegate *lbDelegate) override; void SetList(const char *listText, char separator, char typesep) override; + void SetOptions(ListOptions options_) override; }; std::unique_ptr<ListBox> ListBox::Allocate() { @@ -1878,6 +1879,9 @@ void ListBoxX::SetList(const char *listText, char separator, char typesep) { } } +void ListBoxX::SetOptions(ListOptions) { +} + Menu::Menu() noexcept : mid(nullptr) {} void Menu::CreatePopUp() { diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp index 7451a3077..d49d22f0f 100644 --- a/qt/ScintillaEditBase/PlatQt.cpp +++ b/qt/ScintillaEditBase/PlatQt.cpp @@ -792,6 +792,7 @@ public: void ClearRegisteredImages() override; void SetDelegate(IListBoxDelegate *lbDelegate) override; void SetList(const char *list, char separator, char typesep) override; + void SetOptions(ListOptions options_) override; ListWidget *GetWidget() const noexcept; private: @@ -1034,6 +1035,9 @@ void ListBoxImpl::SetList(const char *list, char separator, char typesep) Append(startword, numword?atoi(numword + 1):-1); } } +void ListBoxImpl::SetOptions(ListOptions) +{ +} ListWidget *ListBoxImpl::GetWidget() const noexcept { return static_cast<ListWidget *>(wid); diff --git a/src/Platform.h b/src/Platform.h index 3b5b991b0..33116999c 100644 --- a/src/Platform.h +++ b/src/Platform.h @@ -269,6 +269,9 @@ public: virtual void ListNotify(ListBoxEvent *plbe)=0; }; +struct ListOptions { +}; + class ListBox : public Window { public: ListBox() noexcept; @@ -294,6 +297,7 @@ public: virtual void ClearRegisteredImages()=0; virtual void SetDelegate(IListBoxDelegate *lbDelegate)=0; virtual void SetList(const char* list, char separator, char typesep)=0; + virtual void SetOptions(ListOptions options_)=0; }; /** diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 7b5ece752..f94bf058c 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -2512,6 +2512,7 @@ class ListBoxX : public ListBox { Point dragOffset; Point location; // Caret location at which the list is opened int wheelDelta; // mouse wheel residue + ListOptions options; HWND GetHWND() const noexcept; void AppendListItem(const char *text, const char *numword); @@ -2568,6 +2569,7 @@ public: void ClearRegisteredImages() override; void SetDelegate(IListBoxDelegate *lbDelegate) override; void SetList(const char *list, char separator, char typesep) override; + void SetOptions(ListOptions options_) override; void Draw(DRAWITEMSTRUCT *pDrawItem); LRESULT WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam); static LRESULT PASCAL StaticWndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam); @@ -2874,6 +2876,10 @@ void ListBoxX::SetList(const char *list, char separator, char typesep) { SetRedraw(true); } +void ListBoxX::SetOptions(ListOptions options_) { + options = options_; +} + void ListBoxX::AdjustWindowRect(PRectangle *rc, UINT dpi) noexcept { RECT rcw = RectFromPRectangle(*rc); if (fnAdjustWindowRectExForDpi) { |