コード例 #1
0
	/// Loads modal document from the URL.
	/// FIXME: move to window.
	void modal( const ASURL &location, int defaultCode = -1 )
	{
		WSWUI::NavigationStack *stack = UI_Main::Get()->getNavigator();

		// default return value when modal window is not closed via window.close()
		modalValue = defaultCode;
		if( stack == NULL || stack->isTopModal() ) {
			modalValue = defaultCode;
			return;
		}

		// suspend active context, we're going to resume it when 
		// the modal dialog is closed
		suspendActiveContext();

		if( suspendedContext ) {
			// attach itself as a listener of hide event so the context
			// can be resumed after the modal document is hidden
			WSWUI::Document *doc = stack->pushDocument( location.GetURL()->buffer, true, true );
			if( doc ) {
				attachedModalDocument = doc->getRocketDocument();
				attachedModalDocument->AddEventListener( "hide", this );
			}
		}
	}
コード例 #2
0
	/// Loads document from the passed URL.
	void open( const ASURL &location )
	{
		WSWUI::NavigationStack *stack = UI_Main::Get()->getNavigator();
		if( stack == NULL ) {
			return;
		}

		stack->pushDocument( location.GetURL()->buffer );
	}