bool.cpp 701 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef _XBOX
  2. #include "bool.h"
  3. #include "..\..\system\datasource\databool.h"
  4. BoolEditor::BoolEditor ()
  5. {
  6. cbValue = NULL;
  7. EditedBool = NULL;
  8. }
  9. BoolEditor::~BoolEditor ()
  10. {
  11. }
  12. void BoolEditor::Release ()
  13. {
  14. delete this;
  15. }
  16. void BoolEditor::BeginEdit (GUIControl* form, DataBool* EditedBool)
  17. {
  18. this->EditedBool = EditedBool;
  19. cbValue = NEW GUICheckBox (form, 10, 10, 100, 20);
  20. cbValue->ImageChecked->Load ("checked");
  21. cbValue->ImageNormal->Load ("normal");
  22. cbValue->Caption = EditedBool->GetName();
  23. cbValue->Checked = EditedBool->GetValue();
  24. }
  25. void BoolEditor::EndEdit ()
  26. {
  27. delete cbValue;
  28. cbValue = NULL;
  29. }
  30. void BoolEditor::Apply ()
  31. {
  32. EditedBool->SetValue(cbValue->Checked);
  33. }
  34. #endif