#ifndef		__MAIN_DLG_H__
#define		__MAIN_DLG_H__

#include "defines.h"
#include "gui_defines.h"
#include "wcolwidget.h"
#include "wcolimage.h"


class AttractorItem : public ListBoxEx::Item {
	protected:
		void DrawItem(Bitmap &canvas, int i, int state, const Rect &dstRect);

	protected:
		WColImage::Attractor att;

	public:
		AttractorItem(WColImage::Attractor att);
};



class MainDialog : public Dialog {
	private:
		Panel desktop;

		WColImage image;
		WColWidget imgWidget;

		Label lblAttractors;
		ListBoxEx lstAttractors;
		Button btnAddAttractor, btnRemoveAttractor, btnColourAttractor;
		Button btnMoveUp, btnMoveDown, btnDuplicate;
		Label lblAttractorType;
		ComboBox lstAttractorType;
		Label lblAttractorMode;
		ComboBox lstAttractorMode;
		Label lblAttractorPos;
		EditBox txtAttractorPosX, txtAttractorPosY;
		Label lblAttractorRange;
		EditBox txtAttractorRange;
		Label lblAttractorLinearity;
		Slider sldAttractorLinearity;
		EditBox txtAttractorLinearity;
		Label lblAttractorMultiplier;
		Slider sldAttractorMultiplier;
		EditBox txtAttractorMultiplier;
		Label lblAuthor, lblTitle;
		EditBox txtAuthor, txtTitle;

		Button btnNew, btnLoad, btnSave, btnExport, btnRandom;
		char path[1024];

		Label lblCredits;
		Button btnExit;

		void OnAddAttractor();
		void OnRemoveAttractor();
		void OnColourAttractor();
		void OnAttractorType(int i);
		void OnAttractorMode(int i);
		void OnAttractorUpdate();
		void OnAttractorLinearity();
		void OnLinearityScroll(int l);
		void OnAttractorMultiplier();
		void OnMultiplierScroll(int l);
		void OnNew();
		void OnSave();
		void OnLoad();
		void OnExport();
		void OnRandom();
		void OnUpdateGUI();
		void OnSelectAttractor(int i);
		void OnMoveUp();
		void OnMoveDown();
		void OnDuplicate();
		void OnUpdateTexts();
		void OnPlaceAttractor(int x, int y);
		void OnSetAttractorRange(int x, int y);

	public:
		MainDialog();
		void HandleEvent(Widget &obj, int msg, int arg1=0, int arg2=0);
};


#endif		//__MAIN_DLG_H__
