<commit_before>#include "stdafx.h"
#include "SettingsUI.h"
#include "Display.h"
#include "afxdialogex.h"

#include "Monitor.h"
#include "Settings.h"

#define MIN_MS USER_TIMER_MINIMUM
#define MAX_MS 60000

IMPLEMENT_DYNAMIC(Display, CPropertyPage)

Display::Display() :
CPropertyPage(Display::IDD) {
}

Display::~Display() {

}

void Display::DoDataExchange(CDataExchange* pDX) {
    CPropertyPage::DoDataExchange(pDX);
    DDX_Control(pDX, CHK_ONTOP, _onTop);
    DDX_Control(pDX, SP_DELAY, _spinDelay);
    DDX_Control(pDX, SP_SPEED, _spinSpeed);
    DDX_Control(pDX, CHK_FULLSCREEN, _fullscreen);
    DDX_Control(pDX, CMB_POSITION, _position);
    DDX_Control(pDX, LBL_CUSTOMX, _lbX);
    DDX_Control(pDX, LBL_CUSTOMY, _lbY);
    DDX_Control(pDX, ED_CUSTOMX, _customX);
    DDX_Control(pDX, ED_CUSTOMY, _customY);
    DDX_Control(pDX, ED_DELAY, _delay);
    DDX_Control(pDX, ED_SPEED, _speed);
    DDX_Control(pDX, CMB_ANIMATION, _animation);
    DDX_Control(pDX, CMB_MONITOR, _monitor);
}

BOOL Display::OnApply() {
    return CPropertyPage::OnApply();
}

BOOL Display::OnCommand(WPARAM wParam, LPARAM lParam) {
    SetModified();
    return CPropertyPage::OnCommand(wParam, lParam);
}

BOOL Display::OnInitDialog() {
    CPropertyPage::OnInitDialog();

    Settings *settings = Settings::Instance();

    _onTop.SetCheck(settings->AlwaysOnTop());
    _fullscreen.SetCheck(settings->HideFullscreen());

    _position.AddString(L"Top");
    _position.AddString(L"Left");
    _position.AddString(L"Right");
    _position.AddString(L"Bottom");
    _position.AddString(L"Center");
    _position.AddString(L"Custom");
    Settings::OSDPos position = settings->OSDPosition();
    _position.SetCurSel((int) position);

    _customX.SetWindowText(std::to_wstring(settings->OSDX()).c_str());
    _customY.SetWindowText(std::to_wstring(settings->OSDY()).c_str());

    _monitor.AddString(L"Default");
    std::list<DISPLAY_DEVICE> devices = Monitor::ListAll();
    for (DISPLAY_DEVICE dev : devices) {
        MessageBox(dev.DeviceString);
    }

    _animation.AddString(L"None");
    _animation.AddString(L"Fade");
<commit_msg>Use new list of position names to populate combo box<commit_after>#include "stdafx.h"
#include "SettingsUI.h"
#include "Display.h"
#include "afxdialogex.h"

#include "Monitor.h"
#include "Settings.h"

#define MIN_MS USER_TIMER_MINIMUM
#define MAX_MS 60000

IMPLEMENT_DYNAMIC(Display, CPropertyPage)

Display::Display() :
CPropertyPage(Display::IDD) {
}

Display::~Display() {

}

void Display::DoDataExchange(CDataExchange* pDX) {
    CPropertyPage::DoDataExchange(pDX);
    DDX_Control(pDX, CHK_ONTOP, _onTop);
    DDX_Control(pDX, SP_DELAY, _spinDelay);
    DDX_Control(pDX, SP_SPEED, _spinSpeed);
    DDX_Control(pDX, CHK_FULLSCREEN, _fullscreen);
    DDX_Control(pDX, CMB_POSITION, _position);
    DDX_Control(pDX, LBL_CUSTOMX, _lbX);
    DDX_Control(pDX, LBL_CUSTOMY, _lbY);
    DDX_Control(pDX, ED_CUSTOMX, _customX);
    DDX_Control(pDX, ED_CUSTOMY, _customY);
    DDX_Control(pDX, ED_DELAY, _delay);
    DDX_Control(pDX, ED_SPEED, _speed);
    DDX_Control(pDX, CMB_ANIMATION, _animation);
    DDX_Control(pDX, CMB_MONITOR, _monitor);
}

BOOL Display::OnApply() {
    return CPropertyPage::OnApply();
}

BOOL Display::OnCommand(WPARAM wParam, LPARAM lParam) {
    SetModified();
    return CPropertyPage::OnCommand(wParam, lParam);
}

BOOL Display::OnInitDialog() {
    CPropertyPage::OnInitDialog();

    Settings *settings = Settings::Instance();

    /* Visibility Settings */
    _onTop.SetCheck(settings->AlwaysOnTop());
    _fullscreen.SetCheck(settings->HideFullscreen());

    /* Position on Screen*/
    for (std::wstring pos : settings->OSDPosNames) {
        CString positionName = UIUtils::Capitalize(pos);
        _position.AddString(positionName);
    }
    Settings::OSDPos position = settings->OSDPosition();
    _position.SetCurSel((int) position);
    OnCbnSelchangePosition();
    _customX.SetWindowText(std::to_wstring(settings->OSDX()).c_str());
    _customY.SetWindowText(std::to_wstring(settings->OSDY()).c_str());

    _monitor.AddString(L"Default");
    std::list<DISPLAY_DEVICE> devices = Monitor::ListAll();
    for (DISPLAY_DEVICE dev : devices) {
        MessageBox(dev.DeviceString);
    }

    _animation.AddString(L"None");
    _animation.AddString(L"Fade");

{'fraction_non_alphanumeric': 0.13931960194399445, 'fraction_numerical': 0.0023142791020597086, 'mean_word_length': 5.227665706051873, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4402181', 'n_tokens_mistral': 1663, 'n_tokens_neox': 1568, 'n_words': 239}