position.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: position.h
  3. // Purpose: interface of wxPosition
  4. // Author: wxWidgets team
  5. // Licence: wxWindows licence
  6. /////////////////////////////////////////////////////////////////////////////
  7. /**
  8. @class wxPosition
  9. This class represents the position of an item in any kind of grid of rows and
  10. columns such as wxGridBagSizer, or wxHVScrolledWindow.
  11. @library{wxbase}
  12. @category{data}
  13. @see wxPoint, wxSize
  14. */
  15. class wxPosition
  16. {
  17. public:
  18. /**
  19. Construct a new wxPosition, setting the row and column to the
  20. default value of (0, 0).
  21. */
  22. wxPosition();
  23. /**
  24. Construct a new wxPosition, setting the row and column to the
  25. value of (@a row, @a col).
  26. */
  27. wxPosition(int row, int col);
  28. /**
  29. A synonym for GetColumn().
  30. */
  31. int GetCol() const;
  32. /**
  33. Get the current row value.
  34. */
  35. int GetColumn() const;
  36. /**
  37. Get the current row value.
  38. */
  39. int GetRow() const;
  40. /**
  41. A synonym for SetColumn().
  42. */
  43. void SetCol(int column);
  44. /**
  45. Set a new column value.
  46. */
  47. void SetColumn(int column);
  48. /**
  49. Set a new row value.
  50. */
  51. void SetRow(int row);
  52. /**
  53. @name Miscellaneous operators
  54. @{
  55. */
  56. bool operator ==(const wxPosition& pos) const;
  57. bool operator !=(const wxPosition& pos) const;
  58. wxPosition& operator +=(const wxPosition& pos);
  59. wxPosition& operator -=(const wxPosition& pos);
  60. wxPosition& operator +=(const wxSize& size);
  61. wxPosition& operator -=(const wxSize& size);
  62. wxPosition operator +(const wxPosition& pos) const;
  63. wxPosition operator -(const wxPosition& pos) const;
  64. wxPosition operator +(const wxSize& size) const;
  65. wxPosition operator -(const wxSize& size) const;
  66. //@}
  67. };