nakedobject.cpp 682 B

12345678910111213141516171819202122232425262728293031323334
  1. #include <precomp.h>
  2. #include "nakedobject.h"
  3. NakedObject::NakedObject() {
  4. reentry_onresize = 0;
  5. reentry_onsetvisible = 0;
  6. }
  7. int NakedObject::getPreferences(int what) {
  8. return 0;
  9. }
  10. int NakedObject::onResize() {
  11. int rt = NAKEDOBJECT_PARENT::onResize();
  12. RECT r;
  13. getClientRect(&r);
  14. if (!reentry_onresize && r.left != r.right || r.top != r.bottom) {
  15. reentry_onresize = 1;
  16. resize(r.left, r.top, 0, 0);
  17. reentry_onresize = 0;
  18. }
  19. return rt;
  20. }
  21. void NakedObject::onSetVisible(int i) {
  22. NAKEDOBJECT_PARENT::onSetVisible(i);
  23. if (!i) return;
  24. if (!reentry_onsetvisible) {
  25. reentry_onsetvisible = 1;
  26. setVisible(0);
  27. reentry_onsetvisible = 0;
  28. }
  29. }