void Core::Widgets::WorkingAreaManagerWidget::OnRename( wxCommandEvent &event )
{
	if ( !GetActiveWorkingArea() )
	{
		return;
	}

	std::string name = AskName( GetActiveWorkingArea()->GetName().c_str() );
	if ( name.empty() )
	{
		return;
	}

	BaseWorkingAreaStorage::Pointer workingAreaStorage;
	workingAreaStorage = Core::Runtime::Kernel::GetGraphicalInterface()->GetWorkingAreaStorage( );
	workingAreaStorage->Delete( dynamic_cast<BaseWindow*> ( GetActiveWorkingArea() ) );

	GetActiveWorkingArea()->SetName( name );

	workingAreaStorage->Save( dynamic_cast<BaseWindow*> ( GetActiveWorkingArea() ) );

	UpdateWidget();

	GetPluginTab()->GetWindowsMapHolder()->NotifyObservers();
}
void Core::Widgets::WorkingAreaManagerWidget::OnNew( wxCommandEvent &event )
{
	std::string name = AskName( "New Working Area" );
	if ( name.empty() )
	{
		return;
	}

	BaseWindowFactories::Pointer baseWindowFactory;
	baseWindowFactory = Core::Runtime::Kernel::GetGraphicalInterface()->GetBaseWindowFactory( );

	BaseWorkingAreaStorage::Pointer workingAreaStorage;
	workingAreaStorage = Core::Runtime::Kernel::GetGraphicalInterface()->GetWorkingAreaStorage( );

	std::string factoryName = workingAreaStorage->GetDefaultWorkingAreaFactoryName( );
	BaseWindow *baseWindow = baseWindowFactory->CreateWindow( factoryName, GetPluginTab() );
	wxWindow* window = dynamic_cast<wxWindow*> (baseWindow);
	window->SetName( name );
	window->SetId( wxNewId() );

	Core::WindowConfig config;
	baseWindowFactory->GetWindowConfig( factoryName, config );
	GetPluginTab()->AddWindow( baseWindow, config );
	GetPluginTab()->ShowWindow( name );
}
Ejemplo n.º 3
0
extern  void    DumpOperand( name *operand ) {
/********************************************/

    char        buffer[20];
    hw_reg_set  reg;
    name        *base;

    if( operand->n.class == N_INDEXED ) {
        if( operand->i.base != NULL ) {
            if( !( operand->i.index_flags & X_FAKE_BASE ) ) {
                if( operand->i.index_flags & X_LOW_ADDR_BASE ) {
                    DumpLiteral( "l^" );
                }
                DumpOperand( operand->i.base );
                if( operand->i.constant > 0 ) {
                    DumpChar( '+' );
                }
            }
        }
        if( operand->i.constant != 0 ) {
            DumpLong( operand->i.constant );
        }
        DumpChar( '[' );
        if( operand->i.index_flags & X_BASE ) {
            reg = operand->i.index->r.reg;
#if _TARGET & ( _TARG_IAPX86 | _TARG_80386 )
            if( HW_COvlap( reg, HW_SEGS ) ) {

                hw_reg_set tmp;

                tmp = reg;
                HW_COnlyOn( tmp, HW_SEGS );
                DumpRegName( tmp );
                DumpChar( ':' );
                HW_CTurnOff( reg, HW_SEGS );
            }
#endif
            if( operand->i.index_flags & X_HIGH_BASE ) {
                DumpRegName( HighReg( reg ) );
                DumpChar( '+' );
                DumpRegName( LowReg( reg ) );
            } else {
                DumpRegName( LowReg( reg ) );
                DumpChar( '+' );
                DumpRegName( HighReg( reg ) );
            }
        } else {
            DumpOperand( operand->i.index );
        }
        if( operand->i.scale != 0 ) {
            DumpChar( '*' );
            DumpInt( 1 << operand->i.scale );
        }
        if( operand->i.index_flags & ( X_ALIGNED_1 | X_ALIGNED_2 | X_ALIGNED_4 | X_ALIGNED_8 ) ) {
            DumpChar( '$' );
            DumpInt( FlagsToAlignment( operand->i.index_flags ) );
        }
        DumpChar( ']' );
        base = operand->i.base;
        if( base != NULL ) {
            if( operand->i.index_flags & X_FAKE_BASE ) {
                DumpChar( '{' );
                if( base->n.class == N_MEMORY ) {
                    DumpXString( AskName(base->v.symbol, base->m.memory_type) );
                } else if( base->n.class == N_TEMP ) {
                    if( _FrontEndTmp( base ) ) {
                        DumpXString( FEName( base->v.symbol ) );
                    } else {
                        DumpOperand( base );
                    }
                }
                DumpChar( '}' );
            }
        }