GUIで起動時にcrop_size_list.txtから読みだした分割サイズをリストに表示するようにした

This commit is contained in:
lltcggie 2015-12-16 23:31:47 +09:00
parent 74eb842790
commit 927726889a

View File

@ -909,6 +909,31 @@ public:
}
}
{
HWND hcrop = GetDlgItem(dh, IDC_COMBO_CROP_SIZE);
SendMessage(hcrop, CB_ADDSTRING, 0, (LPARAM)TEXT("-----------------------"));
// CropSizeListÌlðljÁµÄ¢­
int mindiff = INT_MAX;
int defaultListIndex = -1;
for (const auto n : CropSizeList)
{
tstring str(to_tstring(n));
const int index = SendMessage(hcrop, CB_ADDSTRING, 0, (LPARAM)str.c_str());
const int diff = abs(DefaultCommonDivisor - n);
if (DefaultCommonDivisorRange.first <= n && n <= DefaultCommonDivisorRange.second && diff < mindiff)
{
mindiff = diff;
defaultListIndex = index;
}
}
if (GetWindowTextLength(hcrop) == 0)
SendMessage(hcrop, CB_SETCURSEL, defaultListIndex, 0);
}
const boost::filesystem::path SettingFilePath(exeDir / SettingFileName);
tstring tScale;