/*******************************************************************************/

#ifndef __PKR3EDITORFRM_H__
#define __PKR3EDITORFRM_H__

#ifdef __BORLANDC__
	#pragma hdrstop
#endif

#ifndef WX_PRECOMP
	#include <wx/wx.h>
	#include <wx/frame.h>
#else
	#include <wx/wxprec.h>
#endif

/*******************************************************************************/

////Header Include Start
#include <wx/textdlg.h>
#include <wx/msgdlg.h>
#include <wx/filedlg.h>
#include <wx/html/htmlwin.h>
#include <wx/checkbox.h>
#include <wx/button.h>
#include <wx/listbox.h>
#include <wx/textctrl.h>
////Header Include End

/*******************************************************************************/

////Dialog Style Start
#undef PKR3EditorFrm_STYLE
#define PKR3EditorFrm_STYLE wxCAPTION | wxSYSTEM_MENU | wxMINIMIZE_BOX | wxCLOSE_BOX
////Dialog Style End

/*******************************************************************************/

#include "PKR3Structs.h"
#include <wx/file.h>

/*******************************************************************************/

class PKR3EditorFrm : public wxFrame
{	
	public:
		PKR3EditorFrm(wxWindow *parent, wxWindowID id = 1, const wxString &title = wxT("PKR3Editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = PKR3EditorFrm_STYLE);
		virtual ~PKR3EditorFrm();
		void BTNExportClick(wxCommandEvent& event);
		void BTNImportClick(wxCommandEvent& event);
		void BTNPreviewClick(wxCommandEvent& event);
		void BTNAddClick(wxCommandEvent& event);
		void BTNDeleteClick(wxCommandEvent& event);
		void BTNOpenDataClick(wxCommandEvent& event);
		void BTNSaveFileClick(wxCommandEvent& event);
		void LSTDirsSelected(wxCommandEvent& event);
		void LSTFilesSelected(wxCommandEvent& event);
		void LSTFilesDoubleClicked(wxCommandEvent& event);
		void Print(const wxChar*);
		void Print(unsigned int);
		void PreviewCBMP();
		void MakeFileList(unsigned short);
		void LSTFilesAction();
		void writezip(const wxChar*,unsigned short,unsigned short,const wxChar*);
		unsigned short GetExtension(char*);
	private:
		DECLARE_EVENT_TABLE();
		////GUI Control Declaration Start
		wxMessageDialog *DLGAddBad;
		wxTextEntryDialog *DLGAddName;
		wxFileDialog *DLGSaveFile;
		wxFileDialog *DLGImport;
		wxFileDialog *DLGExport;
		wxMessageDialog *DLGCaution;
		wxFileDialog *DLGOpenDataPkr;
		wxTextCtrl *EDTTxt;
		wxHtmlWindow *HTMLBmp;
		wxCheckBox *CHKPreview;
		wxButton *BTNOpenData;
		wxButton *BTNSaveFile;
		wxButton *BTNDelete;
		wxButton *BTNAdd;
		wxButton *BTNExport;
		wxButton *BTNImport;
		wxButton *BTNPreview;
		wxListBox *LSTFiles;
		wxListBox *LSTDirs;
		wxTextCtrl *EDTConsole;
		////GUI Control Declaration End
		enum
		{
			////GUI Enum Control ID Start
			ID_EDTTXT = 1013,
			ID_HTMLBMP = 1012,
			ID_CHKPREVIEW = 1011,
			ID_BTNOPENDATA = 1010,
			ID_BTNSAVEFILE = 1009,
			ID_BTNDELETE = 1008,
			ID_BTNADD = 1007,
			ID_BTNEXPORT = 1006,
			ID_BTNIMPORT = 1005,
			ID_BTNPREVIEW = 1004,
			ID_LSTFILES = 1003,
			ID_LSTDIRS = 1002,
			ID_EDTCONSOLE = 1001,
			////GUI Enum Control ID End
		};
        unsigned int aux;
        unsigned short saux;
        unsigned int dirs_n;
        unsigned int files_n; 
        wxFile FHandler;
        wxFile AuxHandler;
        wxString Str;
        pkr3dir* dir;
        pkr3file* file;
        pkr3file* exfile;
		void OnClose(wxCloseEvent& event);
		void CreateGUIControls();
};

#endif

/*******************************************************************************/
