LabelSet.h 570 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #pragma once
  2. //字母标签集合
  3. class LabelSet
  4. {
  5. public:
  6. LabelSet(LPCTSTR* _pTable,int _n);
  7. LPCTSTR getLabel(int _id) const;
  8. ~LabelSet();
  9. protected:
  10. LabelSet(){}
  11. private:
  12. LPCTSTR* pTable;
  13. int n;
  14. };
  15. //相当于单刀双掷开关组
  16. class LabelSetEx
  17. {
  18. protected:
  19. struct Switch
  20. {
  21. LabelSet* s[2];
  22. int at;
  23. };
  24. public:
  25. LabelSetEx(int _n);
  26. bool addSets(int id,LPCTSTR* s1,LPCTSTR* s2,int n,int at = 0);
  27. LPCTSTR getLable(int id,int off) const;
  28. void turn(int id);
  29. ~LabelSetEx();
  30. private:
  31. int n; //开关组总个数
  32. Switch* pGroup; //开关组
  33. };