本文整理汇总了C++中IsModal函数的典型用法代码示例。如果您正苦于以下问题:C++ IsModal函数的具体用法?C++ IsModal怎么用?C++ IsModal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsModal函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetLeftButtonRect
void IngameWindow::MouseLeftUp(const MouseCoords& mc)
{
// Bewegung stoppen
isMoving = false;
// beiden Buttons oben links und rechts prfen
const Rect rec[2] =
{
GetLeftButtonRect(),
GetRightButtonRect()
};
for(unsigned i = 0; i < 2; ++i)
{
button_state[i] = BUTTON_UP;
if(Coll(mc.x, mc.y, rec[i]))
{
if(i == 0 && (!IsModal() || closeOnRightClick_))
Close();
else if(i==1 && !IsModal())
{
SetMinimized(!IsMinimized());
LOADER.GetSoundN("sound", 113)->Play(255, false);
}
}
}
}
示例2: OnCancel
void dlgSearchObject::OnCancel(wxCommandEvent &ev)
{
if (IsModal())
EndModal(wxID_CANCEL);
else
Destroy();
}
示例3: OnCancel
void pgDialog::OnCancel(wxCommandEvent &ev)
{
if (IsModal())
EndModal(wxID_CANCEL);
else
Destroy();
}
示例4: OnClose
void pgDialog::OnClose(wxCloseEvent &event)
{
if (IsModal())
EndModal(wxID_CANCEL);
else
Destroy();
}
示例5: OnOkClick
void DlgSaveLayout::OnOkClick( wxCommandEvent& event )
{
if(!m_ComboLayout->GetValue().IsEmpty())
{
if(bSave)
{
wxMainFrame::Get()->AddLayout(m_ComboLayout->GetValue());
}
else
{
wxMainFrame::Get()->RemoveLayout(m_ComboLayout->GetValue());
}
if ( IsModal() )
EndModal(wxID_OK); // If modal
else
{
SetReturnCode(wxID_OK);
this->Show(false); // If modeless
}
}
else
{
wxMessageBox(wxT("You must enter a layout name"), wxT("Error"));
}
}
示例6: VECTOR2D
void DIALOG_DRC_CONTROL::OnLeftDClickClearance( wxMouseEvent& event )
{
event.Skip();
// I am assuming that the double click actually changed the selected item.
// please verify this.
int selection = m_ClearanceListBox->GetSelection();
if( selection != wxNOT_FOUND )
{
// Find the selected MARKER in the PCB, position cursor there.
// Then close the dialog.
const DRC_ITEM* item = m_ClearanceListBox->GetItem( selection );
if( item )
{
m_brdEditor->CursorGoto( item->GetPointA() );
m_brdEditor->GetGalCanvas()->GetView()->SetCenter( VECTOR2D( item->GetPointA() ) );
if( !IsModal() )
{
// turn control over to m_brdEditor, hide this DIALOG_DRC_CONTROL window,
// no destruction so we can preserve listbox cursor
Show( false );
// We do not want the clarification popup window.
// when releasing the left button in the main window
m_brdEditor->SkipNextLeftButtonReleaseEvent();
}
}
}
}
示例7: ShowModal
int wxDialog::ShowModal()
{
if ( IsModal() )
{
wxFAIL_MSG( wxT("wxDialog:ShowModal called twice") );
return GetReturnCode();
}
// use the apps top level window as parent if none given unless explicitly
// forbidden
wxWindow * const parent = GetParentForModalDialog();
if ( parent && parent != this )
{
m_parent = parent;
}
Show(true);
m_isShowingModal = true;
wxASSERT_MSG( !m_windowDisabler, wxT("disabling windows twice?") );
#if defined(__WXGTK__) || defined(__WXMGL__)
wxBusyCursorSuspender suspender;
// FIXME (FIXME_MGL) - make sure busy cursor disappears under MSW too
#endif
m_windowDisabler = new wxWindowDisabler(this);
if ( !m_eventLoop )
m_eventLoop = new wxEventLoop;
m_eventLoop->Run();
return GetReturnCode();
}
示例8: OnCancel
void frmExport::OnCancel(wxCommandEvent &ev)
{
if (IsModal())
EndModal(wxID_CANCEL);
else
Destroy();
}
示例9: InitDialog
bool wxDialog::Show(bool show)
{
if ( !wxDialogBase::Show(show) )
{
// nothing to do
return FALSE;
}
if ( show )
{
// usually will result in TransferDataToWindow() being called
InitDialog();
}
if ( IsModal() )
{
if ( show )
{
DoShowModal();
}
else // end of modal dialog
{
// this will cause IsModalShowing() return FALSE and our local
// message loop will terminate
wxModalDialogs.DeleteObject(this);
}
}
return TRUE;
}
示例10: EndDialog
void wxDialogBase::EndDialog(int rc)
{
if ( IsModal() )
EndModal(rc);
else
Hide();
}
示例11: OnLeftDClickItem
void DIALOG_CLEANUP_TRACKS_AND_VIAS::OnLeftDClickItem( wxMouseEvent& event )
{
event.Skip();
int selection = m_ItemsListBox->GetSelection();
if( selection != wxNOT_FOUND )
{
// Find the selected DRC_ITEM in the listbox, position cursor there.
// Then hide the dialog.
const DRC_ITEM* item = m_ItemsListBox->GetItem( selection );
if( item )
{
m_parentFrame->FocusOnLocation( item->GetPointA(), true, true );
if( !IsModal() )
{
Show( false );
// We do not want the clarify selection popup when releasing the
// left button in the main window
m_parentFrame->SkipNextLeftButtonReleaseEvent();
}
}
}
}
示例12: DoStartModal
void tmwxOptimizerDialog::DoStartModal() {
/* CAF - essentially lifted from wxGTK 2.5.1's wxDialog::ShowModal, up to
grabbing the focus. */
if (IsModal()) {
wxFAIL_MSG( wxT("wxDialog:ShowModal called twice") );
mStatus = GetReturnCode();
return;
}
// use the apps top level window as parent if none given unless explicitly
// forbidden
if (! GetParent() && !(GetWindowStyleFlag() & wxDIALOG_NO_PARENT)) {
wxWindow *parent = wxTheApp->GetTopWindow();
if (parent && parent != this &&
parent -> IsBeingDeleted() &&
! (parent->GetExtraStyle() & wxWS_EX_TRANSIENT)) {
m_parent = parent;
gtk_window_set_transient_for (GTK_WINDOW(m_widget),
GTK_WINDOW(parent->m_widget) );
}
}
wxBeginBusyCursor ();
Show (true);
SetFocus();
m_modalShowing = true;
g_openDialogs++;
gtk_grab_add (m_widget);
}
示例13: WX_TESTING_SHOW_MODAL_HOOK
int wxDialog::ShowModal()
{
WX_TESTING_SHOW_MODAL_HOOK();
wxASSERT_MSG( !IsModal(), "ShowModal() can't be called twice" );
// release the mouse if it's currently captured as the window having it
// will be disabled when this dialog is shown -- but will still keep the
// capture making it impossible to do anything in the modal dialog itself
wxWindow * const win = wxWindow::GetCapture();
if ( win )
win->GTKReleaseMouseAndNotify();
wxWindow * const parent = GetParentForModalDialog();
if ( parent )
{
gtk_window_set_transient_for( GTK_WINDOW(m_widget),
GTK_WINDOW(parent->m_widget) );
}
wxBusyCursorSuspender cs; // temporarily suppress the busy cursor
#if GTK_CHECK_VERSION(2,10,0)
unsigned sigId = 0;
gulong hookId = 0;
#ifndef __WXGTK3__
// Ubuntu overlay scrollbar uses at least GTK 2.24
if (gtk_check_version(2,24,0) == NULL)
#endif
{
sigId = g_signal_lookup("realize", GTK_TYPE_WIDGET);
hookId = g_signal_add_emission_hook(sigId, 0, realize_hook, NULL, NULL);
}
#endif
Show( true );
m_modalShowing = true;
wxOpenModalDialogLocker modalLock;
// NOTE: gtk_window_set_modal internally calls gtk_grab_add() !
gtk_window_set_modal(GTK_WINDOW(m_widget), TRUE);
// Run modal dialog event loop.
{
wxGUIEventLoopTiedPtr modal(&m_modalLoop, new wxGUIEventLoop());
m_modalLoop->Run();
}
#if GTK_CHECK_VERSION(2,10,0)
if (sigId)
g_signal_remove_emission_hook(sigId, hookId);
#endif
gtk_window_set_modal(GTK_WINDOW(m_widget), FALSE);
return GetReturnCode();
}
示例14: Close
void ParamEdit::Close() {
if (IsModal())
EndModal(wxID_OK);
else {
SetReturnCode(wxID_OK);
Show(false);
}
}
示例15: OnCloseWindow
void wxGenericAboutDialog::OnCloseWindow(wxCloseEvent& event)
{
// safeguards in case the window is still shown using ShowModal
if ( !IsModal() )
Destroy();
event.Skip();
}