Esempio n. 1
0
void
DataFieldBoolean::SetAsInteger(int Value)
{
  if (GetAsInteger() != Value) {
    SetAsBoolean(!(Value == 0));
  }
}
Esempio n. 2
0
    bool FundamentalValue::Equals(const Value* other) const
    {
        if(other->GetType() != GetType())
        {
            return false;
        }

        switch(GetType())
        {
        case TYPE_BOOLEAN:
            {
                bool lhs, rhs;
                return GetAsBoolean(&lhs) && other->GetAsBoolean(&rhs) && lhs==rhs;
            }
        case TYPE_INTEGER:
            {
                int lhs, rhs;
                return GetAsInteger(&lhs) && other->GetAsInteger(&rhs) && lhs==rhs;
            }
        case TYPE_DOUBLE:
            {
                double lhs, rhs;
                return GetAsDouble(&lhs) && other->GetAsDouble(&rhs) && lhs==rhs;
            }
        default:
            NOTREACHED();
            return false;
        }
    }
Esempio n. 3
0
ComboList
DataFieldBoolean::CreateComboList(const TCHAR *reference) const
{
  ComboList combo_list;
  combo_list.Append(false, false_text);
  combo_list.Append(true, true_text);

  combo_list.current_index = GetAsInteger();
  return combo_list;
}
Esempio n. 4
0
ComboList *
DataFieldBoolean::CreateComboList() const
{
  ComboList *combo_list = new ComboList();
  combo_list->Append(0, 0, mTextFalse, mTextFalse);
  combo_list->Append(1, 1, mTextTrue, mTextTrue);

  combo_list->ComboPopupItemSavedIndex = GetAsInteger();
  return combo_list;
}
Esempio n. 5
0
ComboList *
DataFieldBoolean::CreateComboList() const
{
  ComboList *combo_list = new ComboList();
  combo_list->Append(false, false_text);
  combo_list->Append(true, true_text);

  combo_list->ComboPopupItemSavedIndex = GetAsInteger();
  return combo_list;
}
Esempio n. 6
0
int DataFieldFloat::SetAsInteger(int Value){
  int res = GetAsInteger();
  SetAsFloat(Value);
  return(res);
}