File: WrapPanel.h

package info (click to toggle)
mygui 3.2.2%2Bdfsg-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 36,228 kB
  • sloc: cpp: 118,031; ansic: 30,202; xml: 15,544; cs: 12,602; tcl: 776; python: 417; makefile: 34
file content (57 lines) | stat: -rw-r--r-- 1,092 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*!
	@file
	@author		Albert Semenov
	@date		02/2011
*/
#ifndef WRAP_PANEL_H_
#define WRAP_PANEL_H_

#include "MyGUI_Prerequest.h"
#include "Panel.h"

namespace MyGUI
{

	class WrapPanel :
		public Panel
	{
		MYGUI_RTTI_DERIVED( WrapPanel )

	public:
		WrapPanel();

		Align getContentAlign() const;
		void setContentAlign(Align _value);

		const IntSize& getSpacer() const;
		void setSpacer(const IntSize& _value);

		bool getContentFloat() const;
		void setContentFloat(bool _value);

		Align getSnapFloat() const;
		void setSnapFloat(Align _value);

	protected:
		virtual IntSize overrideMeasure(const IntSize& _sizeAvailable);
		virtual void overrideArrange();

	private:
		void alignChildLine(size_t _startIndex, size_t _stopIndex, const IntCoord& _coordAvailable, int _lineWidth);

		IntSize simpleMeasure(const IntSize& _sizeAvailable);
		void simpleArrange();

		IntSize floatMeasure(const IntSize& _sizeAvailable);
		void floatArrange();

	private:
		Align mContentAlign;
		Align mSnapFloat;
		bool mContentFloat;
		IntSize mSpacer;
	};

} // namespace MyGUI

#endif // WRAP_PANEL_H_