string.cpp 745 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef _XBOX
  2. #include "string.h"
  3. #include "..\..\system\datasource\datastring.h"
  4. StringEditor::StringEditor ()
  5. {
  6. EditedString = NULL;
  7. pLabel = NULL;
  8. pEdit = NULL;
  9. }
  10. StringEditor::~StringEditor ()
  11. {
  12. }
  13. void StringEditor::Release ()
  14. {
  15. delete this;
  16. }
  17. void StringEditor::BeginEdit (GUIControl* form, DataString* EditedString)
  18. {
  19. this->EditedString = EditedString;
  20. pLabel = NEW GUILabel (form, 10, 10, 300, 20);
  21. pLabel->Caption = EditedString->GetName ();
  22. pEdit = NEW GUIEdit (form, 10, 30, 300, 20);
  23. pEdit->Text = EditedString->GetValue();
  24. }
  25. void StringEditor::EndEdit ()
  26. {
  27. delete pLabel;
  28. pLabel = NULL;
  29. delete pEdit;
  30. pEdit = NULL;
  31. }
  32. void StringEditor::Apply ()
  33. {
  34. EditedString->SetValue(pEdit->Text.GetBuffer());
  35. }
  36. #endif