Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef TNZ_STYLECONTROL_INCLUDED
Toshihiro Shimizu 890ddd
#define TNZ_STYLECONTROL_INCLUDED
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tw/action.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#undef DVAPI
Toshihiro Shimizu 890ddd
#undef DVVAR
Toshihiro Shimizu 890ddd
#ifdef TWIN_EXPORTS
Toshihiro Shimizu 890ddd
#define DVAPI DV_EXPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_EXPORT_VAR
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
#define DVAPI DV_IMPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_IMPORT_VAR
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TColorStyle;
Toshihiro Shimizu 890ddd
class TPalette;
Toshihiro Shimizu 890ddd
class TLevel;
Toshihiro Shimizu 890ddd
class TFilePath;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class DVAPI TStyleControl : public TWidget, public TCommandSource
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	class Data;
Toshihiro Shimizu 890ddd
	Data *m_data;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	enum {
Toshihiro Shimizu 890ddd
		COLOR_PAGE = 0x01,
Toshihiro Shimizu 890ddd
		TEXTURE_PAGE = 0x02,
Toshihiro Shimizu 890ddd
		SPECIAL_PAGE = 0x04,
Toshihiro Shimizu 890ddd
		CUSTOM_PAGE = 0x08,
Toshihiro Shimizu 890ddd
		SETTINGS_PAGE = 0x10,
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
		NO_PAGES = 0x00,
Toshihiro Shimizu 890ddd
		ALL_PAGES = 0x1F
Toshihiro Shimizu 890ddd
	};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	enum {
Toshihiro Shimizu 890ddd
		ALL_STYLES = 0x01,
Toshihiro Shimizu 890ddd
		VECTOR_SYLES_ONLY = 0x02
Toshihiro Shimizu 890ddd
	};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TStyleControl(
Toshihiro Shimizu 890ddd
		TWidget *parent,
Toshihiro Shimizu 890ddd
		const TFilePath &rootDir,
Toshihiro Shimizu 890ddd
		int styleFilter = ALL_STYLES);
Toshihiro Shimizu 890ddd
	~TStyleControl();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void setActivePages(unsigned long pageMask);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void configureNotify(const TDimension &);
Toshihiro Shimizu 890ddd
	void draw();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void setStyle(TPalette *palette, int styleIndex);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	const TColorStyle *getCurrentStyle() const;
Toshihiro Shimizu 890ddd
	int getCurrentStyleIndex() const;
Toshihiro Shimizu 890ddd
	TPalette *getPalette() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	virtual void onChangeStyleParam(bool dragging) {}
Toshihiro Shimizu 890ddd
	virtual void onChangeStyleNumericParam(int paramIndex, bool dragging)
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		onChangeStyleParam(dragging);
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void refreshCurrentPage();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void setAutoApply(bool on);
Toshihiro Shimizu 890ddd
	bool getAutoApply() const;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif