intptr_t DialogBuilder::DoShowDialog() { const auto Dlg = Dialog::create(span(m_DialogItems, m_DialogItemsCount), m_handler, nullptr); Dlg->SetHelp(m_HelpTopic); Dlg->SetPosition({ -1, -1, static_cast<int>(m_DialogItems[0].X2 + 4), static_cast<int>(m_DialogItems[0].Y2 + 2) }); if (m_Mode) Dlg->SetDialogMode(m_Mode); if (m_IdExist) Dlg->SetId(m_Id); Dlg->Process(); return Dlg->GetExitCode(); }
intptr_t DialogBuilder::DoShowDialog() { const auto Dlg = Dialog::create(make_range(m_DialogItems, m_DialogItems + m_DialogItemsCount), m_handler, nullptr); Dlg->SetHelp(m_HelpTopic); Dlg->SetPosition(-1, -1, m_DialogItems [0].X2+4, m_DialogItems [0].Y2+2); if (m_Mode) Dlg->SetDialogMode(m_Mode); if (m_IdExist) Dlg->SetId(m_Id); Dlg->Process(); return Dlg->GetExitCode(); }
static reply ExcDialog(const string& ModuleName, LPCWSTR Exception, LPVOID Adress) { // TODO: Far Dialog is not the best choice for exception reporting // replace with something trivial string strAddr = str_printf(L"0x%p",Adress); FarDialogItem EditDlgData[]= { {DI_DOUBLEBOX,3,1,72,8,0,nullptr,nullptr,0,MSG(MExcTrappedException)}, {DI_TEXT, 5,2, 17,2,0,nullptr,nullptr,0,MSG(MExcException)}, {DI_TEXT, 18,2, 70,2,0,nullptr,nullptr,0,Exception}, {DI_TEXT, 5,3, 17,3,0,nullptr,nullptr,0,MSG(MExcAddress)}, {DI_TEXT, 18,3, 70,3,0,nullptr,nullptr,0,strAddr.data()}, {DI_TEXT, 5,4, 17,4,0,nullptr,nullptr,0,MSG(MExcFunction)}, {DI_TEXT, 18,4, 70,4,0,nullptr,nullptr,0,From}, {DI_TEXT, 5,5, 17,5,0,nullptr,nullptr,0,MSG(MExcModule)}, {DI_EDIT, 18,5, 70,5,0,nullptr,nullptr,DIF_READONLY|DIF_SELECTONENTRY,ModuleName.data()}, {DI_TEXT, -1,6, 0,6,0,nullptr,nullptr,DIF_SEPARATOR,L""}, {DI_BUTTON, 0,7, 0,7,0,nullptr,nullptr,DIF_DEFAULTBUTTON|DIF_FOCUS|DIF_CENTERGROUP, MSG(PluginModule? MExcUnload : MExcTerminate)}, {DI_BUTTON, 0,7, 0,7,0,nullptr,nullptr,DIF_CENTERGROUP,MSG(MExcDebugger)}, {DI_BUTTON, 0,7, 0,7,0,nullptr,nullptr,DIF_CENTERGROUP,MSG(MIgnore)}, }; auto EditDlg = MakeDialogItemsEx(EditDlgData); auto Dlg = Dialog::create(EditDlg, ExcDlgProc); Dlg->SetDialogMode(DMODE_WARNINGSTYLE|DMODE_NOPLUGINS); Dlg->SetPosition(-1,-1,76,10); Dlg->Process(); switch (Dlg->GetExitCode()) { case 10: return reply_handle; case 11: return reply_debug; case 12: default: return reply_ignore; } }