1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00

GLideNUI-wtl: Make sure clearing of selected font on load

This commit is contained in:
zilmar 2020-04-27 13:13:02 +09:30 committed by Sergey Lipskiy
parent 1934062d65
commit bea0403d2c
2 changed files with 6 additions and 4 deletions

Binary file not shown.

View File

@ -106,14 +106,16 @@ void COsdTab::SelCurrentFont(void)
tv.item.cchTextMax = sizeof(Item) / sizeof(Item[0]);
tv.item.hItem = m_Fonts.GetChildItem(TVI_ROOT);
HTREEITEM hCurrentItem = NULL;
while (hCurrentItem == NULL && tv.item.hItem) {
while (tv.item.hItem) {
m_Fonts.GetItem(&tv.item);
HTREEITEM hChild = m_Fonts.GetChildItem(tv.item.hItem);
m_Fonts.SetItemState(tv.item.hItem, 0, TVIF_STATE | TVIS_SELECTED);
HTREEITEM hChild = m_Fonts.GetChildItem(tv.item.hItem);
HTREEITEM NextItem = m_Fonts.GetNextSiblingItem(tv.item.hItem);
if (hCurrentItem == NULL && hChild != NULL) {
if (hChild != NULL) {
tv.item.hItem = hChild;
while (hCurrentItem == NULL && tv.item.hItem) {
while (tv.item.hItem) {
m_Fonts.GetItem(&tv.item);
m_Fonts.SetItemState(tv.item.hItem, 0, TVIF_STATE | TVIS_SELECTED);
if (Item == CurrentFile)
hCurrentItem = tv.item.hItem;
tv.item.hItem = m_Fonts.GetNextSiblingItem(tv.item.hItem);