Gui Custom.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /******************************************************************************/
  2. #include "stdafx.h"
  3. namespace EE{
  4. /******************************************************************************/
  5. void GuiCustom::zero()
  6. {
  7. _focusable=false;
  8. }
  9. GuiCustom::GuiCustom() {zero();}
  10. GuiCustom& GuiCustom::del()
  11. {
  12. super::del(); zero(); return T;
  13. }
  14. GuiCustom& GuiCustom::create(Ptr user)
  15. {
  16. del();
  17. T._type =GO_CUSTOM;
  18. T._visible=true;
  19. T. user =user;
  20. return T;
  21. }
  22. GuiCustom& GuiCustom::create(C GuiCustom &src)
  23. {
  24. if(this!=&src)
  25. {
  26. if(!src.is())del();else
  27. {
  28. copyParams(src);
  29. _type =GO_CUSTOM;
  30. _focusable=src._focusable;
  31. }
  32. }
  33. return T;
  34. }
  35. /******************************************************************************/
  36. GuiCustom& GuiCustom::focusable(Bool on) {if(_focusable!=on){_focusable=on; if(!on)kbClear();} return T;}
  37. /******************************************************************************/
  38. Bool GuiCustom::save(File &f, CChar *path)C
  39. {
  40. if(super::save(f, path))
  41. {
  42. f.cmpUIntV(0); // version
  43. f<<_focusable;
  44. return f.ok();
  45. }
  46. return false;
  47. }
  48. Bool GuiCustom::load(File &f, CChar *path)
  49. {
  50. del(); if(super::load(f, path))switch(f.decUIntV()) // version
  51. {
  52. case 0:
  53. {
  54. _type=GO_CUSTOM;
  55. f>>_focusable;
  56. if(f.ok())return true;
  57. }break;
  58. }
  59. del(); return false;
  60. }
  61. /******************************************************************************/
  62. }
  63. /******************************************************************************/