GSdx-GUI: Add wchar_t variant of ComboBoxAppend

This commit is contained in:
sonicfind 2020-09-18 19:56:27 -05:00 committed by refractionpcsx2
parent 1ff67c6c1b
commit 7662e22665
3 changed files with 17 additions and 5 deletions

View File

@ -143,9 +143,7 @@ void GSCaptureDlg::OnInit()
m_codecs.push_back(c);
std::string s{c.FriendlyName.begin(), c.FriendlyName.end()};
ComboBoxAppend(IDC_CODECS, s.c_str(), (LPARAM)&m_codecs.back(), c.DisplayName == selected);
ComboBoxAppend(IDC_CODECS, c.FriendlyName.c_str(), (LPARAM)&m_codecs.back(), c.DisplayName == selected);
}
EndEnumSysDev
UpdateConfigureButton();

View File

@ -200,12 +200,22 @@ void GSDialog::ComboBoxInit(UINT id, const std::vector<GSSetting>& settings, int
int GSDialog::ComboBoxAppend(UINT id, const char* str, LPARAM data, bool select)
{
HWND hWnd = GetDlgItem(m_hWnd, id);
int item = (int)SendMessageA(hWnd, CB_ADDSTRING, 0, (LPARAM)str);
return BoxAppend(hWnd, item, data, select);
}
int item = (int)SendMessage(hWnd, CB_ADDSTRING, 0, (LPARAM)str);
int GSDialog::ComboBoxAppend(UINT id, const wchar_t* str, LPARAM data, bool select)
{
HWND hWnd = GetDlgItem(m_hWnd, id);
int item = (int)SendMessageW(hWnd, CB_ADDSTRING, 0, (LPARAM)str);
return BoxAppend(hWnd, item, data, select);
}
int GSDialog::BoxAppend(HWND& hWnd, int item, LPARAM data, bool select)
{
SendMessage(hWnd, CB_SETITEMDATA, item, (LPARAM)data);
if(select)
if (select)
{
SendMessage(hWnd, CB_SETCURSEL, item, 0);
}

View File

@ -53,6 +53,7 @@ public:
void ComboBoxInit(UINT id, const std::vector<GSSetting>& settings, int32_t selectionValue, int32_t maxValue = INT32_MAX);
int ComboBoxAppend(UINT id, const char* str, LPARAM data = 0, bool select = false);
int ComboBoxAppend(UINT id, const wchar_t* str, LPARAM data = 0, bool select = false);
bool ComboBoxGetSelData(UINT id, INT_PTR& data);
void ComboBoxFixDroppedWidth(UINT id);
@ -61,4 +62,7 @@ public:
void AddTooltip(UINT id);
static void InitCommonControls();
private:
int BoxAppend(HWND& hWnd, int item, LPARAM data = 0, bool select = false);
};