Пример #1
0
int AppOpenModalDialog( wxString panel_name, wxWindow* parent=NULL )
{
	if( wxWindow* window = wxFindWindowByName( L"Dialog:" + DialogType::GetNameStatic() ) )
	{
		window->SetFocus();
		if( wxDialog* dialog = wxDynamicCast( window, wxDialog ) )
		{
			// Switch to the requested panel.
			wxCommandEvent evt(pxEvt_SetSettingsPage);
			evt.SetString(panel_name);
			dialog->GetEventHandler()->ProcessEvent(evt);

			// It's legal to call ShowModal on a non-modal dialog, therefore making
			// it modal in nature for the needs of whatever other thread of action wants
			// to block against it:
			if( !dialog->IsModal() )
			{
				int result = dialog->ShowModal();
				dialog->Destroy();
				return result;
			}
		}
		pxFailDev( "Can only show wxDialog class windows as modal!" );
		return wxID_CANCEL;
	}
	else
		return DialogType( parent ).ShowModal();
}
Пример #2
0
int AppOpenModalDialog( wxWindow* parent=NULL )
{
	if( wxWindow* window = wxFindWindowByName( L"Dialog:" + DialogType::GetNameStatic() ) )
	{
		window->SetFocus();
		if( wxDialog* dialog = wxDynamicCast( window, wxDialog ) )
		{
			// It's legal to call ShowModal on a non-modal dialog, therefore making
			// it modal in nature for the needs of whatever other thread of action wants
			// to block against it:

			if( !dialog->IsModal() )
			{
				int result = dialog->ShowModal();
				dialog->Destroy();
				return result;
			}
		}
		pxFailDev( "Can only show wxDialog class windows as modal!" );
		return wxID_CANCEL;
	}
	else
		return DialogType( parent ).ShowModal();
}
Пример #3
0
EWXWEXPORT(void*,ELJApp_FindWindowByName)(wxString* _lbl,wxWindow* _prt)
{
        return (void*)wxFindWindowByName(*_lbl, _prt);
}