示例#1
0
void __fastcall TnewItem::BitBtn1Click(TObject *Sender)
{
    if (leItem->Text!="")
    {
        ModalResult=mrOk;
        CloseModal();
    }else
    {
        MessageBoxW(Handle,L"Название не может быть пустым",L"Внимание",MB_ICONWARNING|MB_OK);
    }
}
示例#2
0
void __fastcall TUserData::BitBtn1Click(TObject *Sender)
{
    if (leLogin->Text.Trim()!=""&&cbGroup->ItemIndex!=-1)
    {
        ModalResult=mrOk;
        CloseModal();
    }else
    {
        MessageBox(Handle,_T("”кажите логин и группу пользовател¤"),_T("¬нимание!"),MB_ICONWARNING|MB_OK);
    }
}
void CDialog_RendertargetSettings::OnCommand( const char *cmd )
{
	if ( !Q_stricmp( cmd, "Ok" ) )
	{
		if ( m_pText_RTName->GetTextLength() < 1 )
		{
			PromptSimple *prompt = new PromptSimple( this, "Error" );
			prompt->MoveToCenterOfScreen();
			prompt->SetText( "You must specify a name for the RT!" );
			prompt->AddButton( "Ok" );
			return;
		}

		if ( m_pRTTarget != NULL )
		{
			RTDef tmpRT = *m_pRTTarget;
			WriteToRT( &tmpRT );

			RTDef *pFound = GetRTManager()->FindRTByName( tmpRT.GetName(), true );
			if ( pFound != NULL && pFound != m_pRTTarget )
			{
				ShowErrorDiag( tmpRT.GetName() );
				return;
			}

			m_pRTTarget->Modify( tmpRT );
		}
		else
		{
			RTDef newRT;
			WriteToRT( &newRT );

			int oldIndex = GetRTManager()->FindRTIndexByName(newRT.GetName());

			if ( oldIndex >= 0 && GetRTManager()->GetRT( oldIndex )->IsFlaggedForDeletion() )
			{
				GetRTManager()->RemoveRT( oldIndex );
				GetRTManager()->AddRT( newRT );
			}
			else if ( DoesRTExist( newRT.GetName() ) )
			{
				ShowErrorDiag( newRT.GetName() );
				return;
			}
			else
				GetRTManager()->AddRT( newRT );
		}

		CloseModal();
	}
	else if ( !Q_stricmp( cmd, "Close" ) )
	{
		CloseModal();
	}
	else if ( !Q_stricmp( cmd, "onerror_override" ) )
	{
		RTDef newRT;
		WriteToRT( &newRT );

		for ( int i = 0; i < GetRTManager()->GetNumRTs(); i++ )
		{
			RTDef *pold = GetRTManager()->GetRT( i );
			if ( Q_stricmp( pold->GetName(), newRT.GetName() ) )
				continue;
			pold->FlagForDeletion();
		}

		if ( m_pRTTarget != NULL )
			m_pRTTarget->Modify( newRT );
		else
			GetRTManager()->AddRT( newRT );

		CloseModal();
	}
	else if ( !Q_stricmp( cmd, "onerror_cancel" ) )
	{
	}
}
void CDialog_NewCanvas::OnDataLoaded( int mode )
{
	pEditorRoot->OpenShaderFlowgraph( mode, m_pRadBut_Sm2->IsSelected() );
	CloseModal();
}