DialogItemEx *DialogBuilder::AddCheckbox(const wchar_t* Caption, BoolOption& Value) { const auto Item = AddDialogItem(DI_CHECKBOX, Caption); SetNextY(Item); Item->X2 = Item->X1 + ItemWidth(*Item); Item->Selected = Value; SetLastItemBinding(CreateCheckBoxBinding(Value)); return Item; }
DialogItemEx *DialogBuilder::AddCheckbox(lng TextMessageId, Bool3Option& Value) { const auto Item = AddDialogItem(DI_CHECKBOX, GetLangString(TextMessageId)); Item->Flags |= DIF_3STATE; SetNextY(Item); Item->X2 = Item->X1 + ItemWidth(*Item); Item->Selected = Value; SetLastItemBinding(CreateCheckBoxBinding(Value)); return Item; }
// Добавляет чекбокс. T *AddCheckbox(int TextMessageId, int *Value, int Mask=0, bool ThreeState=false) { T *Item = AddDialogItem(DI_CHECKBOX, GetLangString(TextMessageId)); if (ThreeState && !Mask) Item->Flags |= DIF_3STATE; SetNextY(Item); Item->X2 = Item->X1 + ItemWidth(*Item); if (!Mask) Item->Selected = *Value; else Item->Selected = (*Value & Mask) != 0; SetLastItemBinding(CreateCheckBoxBinding(Value, Mask)); return Item; }
DialogItemEx *DialogBuilder::AddCheckbox(lng TextMessageId, IntOption& Value, int Mask, bool ThreeState) { const auto Item = AddDialogItem(DI_CHECKBOX, GetLangString(TextMessageId)); if (ThreeState && !Mask) Item->Flags |= DIF_3STATE; SetNextY(Item); Item->X2 = Item->X1 + ItemWidth(*Item); if (!Mask) Item->Selected = Value; else Item->Selected = (Value & Mask) != 0; SetLastItemBinding(CreateCheckBoxBinding(Value, Mask)); return Item; }