Boolean SaveFlightDialogHandleEvent(EventPtr event) { Boolean handled = false; Boolean savedOk = false; char *inputName; switch (PFEventGetType(event)) { case frmOpenEvent: InitDialog(); GUIFormDraw(); handled = true; break; case ctlSelectEvent: switch (PFEventGetControlSelectID(event)) { case SaveFlightOKButton: inputName = GUIFieldGetText(SaveFlightFileNameField); if (inputName && StrLen(inputName)) { savedOk = FlightDBSaveFlight(GUIFieldGetText(SaveFlightFileNameField), FlightPlan, FpStackPeek(FlightPlanStackB, 0), false); if (!savedOk && GUIAlertShow(FlightExistsAlert) == 0) { savedOk = FlightDBSaveFlight(GUIFieldGetText(SaveFlightFileNameField), FlightPlan, FpStackPeek(FlightPlanStackB,0), true); if (!savedOk) ErrThrow(1966); } } if (savedOk) { StrNCopy(Preferences.FlightPlanName, inputName, sizeof(Preferences.FlightPlanName)); GUIFormReturn(); } handled = true; break; case SaveFlightCancelButton: handled = true; GUIFormReturn(); break; } break; default: break; } return handled; }
nuiDialogSelectDirectory::nuiDialogSelectDirectory(nuiMainWindow* pParent, const nglString& rTitle, const nglPath& rPath, const nglPath& rRootPath, nuiSize Left, nuiSize Top, nuiSize Width, nuiSize Height) : nuiDialog(pParent), mpParent(pParent), mPath(rPath), mEventSink(this) { mpContainer = new nuiSimpleContainer(); nuiSize userWidth = (Width == 0.f) ? mpParent->GetWidth() * .8 : Width; nuiSize userHeight = (Height == 0.f) ? mpParent->GetHeight() * .8 : Height; mpContainer->SetUserSize(userWidth, userHeight); mpSelector = new nuiFileSelector(mPath, rRootPath); mpContainer->AddChild(mpSelector); mEventSink.Connect(mpSelector->OK, &nuiDialogSelectDirectory::OnSelectorOK); nuiLabel* pTitle = new nuiLabel(rTitle); pTitle->SetObjectName(_T("nuiDialog::Title")); InitDialog(pTitle, NULL, nuiDialog::eDialogButtonOk + nuiDialog::eDialogButtonCancel); nuiButton* pButton = new nuiButton(_T("New Folder")); pButton->SetObjectName(_T("nuiDialog::Button")); AddButton(pButton, nuiDialog::eDialogButtonCustom); mEventSink.Connect(pButton->Activated, &nuiDialogSelectDirectory::OnCreateNewFolder); SetContents(mpContainer); if ((Top == 0.f) && (Left == 0.f) && (Width == 0.f) && (Height == 0.f)) SetDefaultPos(); else SetUserPos(Left, Top); mEventSink.Connect(DialogDone, &nuiDialogSelectDirectory::OnDialogDone); mpSelector->UpdateLayout(); }
BOOL CSnapperOptions::OnInitDialog() { CDialog::OnInitDialog(); InitToolTips(); InitDialog(); return TRUE; }
LRESULT CAboutDlg::DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); switch (uMsg) { case WM_INITDIALOG: { InitDialog(hwndDlg, IDI_COMMITMONITOR); // initialize the controls m_link.ConvertStaticToHyperlink(hwndDlg, IDC_WEBLINK, _T("http://stefanstools.sourceforge.net")); TCHAR verbuf[1024] = {0}; #ifdef _WIN64 _stprintf_s(verbuf, _countof(verbuf), _T("CommitMonitor version %d.%d.%d.%d (64-bit)"), CM_VERMAJOR, CM_VERMINOR, CM_VERMICRO, CM_VERBUILD); #else _stprintf_s(verbuf, _countof(verbuf), _T("CommitMonitor version %d.%d.%d.%d"), CM_VERMAJOR, CM_VERMINOR, CM_VERMICRO, CM_VERBUILD); #endif SetDlgItemText(hwndDlg, IDC_VERSIONLABEL, verbuf); } return TRUE; case WM_COMMAND: return DoCommand(LOWORD(wParam)); default: return FALSE; } }
int main(int argc, char *argv[]) { tmsg Msg; tevent_gadget EventG; uldat err; if (!ParseArgs(argc, argv)) return 255; if (InitDialog()) while ((Msg=TwReadMsg(TRUE))) { if (Msg->Type==TW_MSG_WIDGET_GADGET) { EventG=&Msg->Event.EventGadget; if (EventG->W == Dialog_Win) switch (EventG->Code) { case 0: return 1; default: return EventG->Code - 1; } } } if ((err = TwErrno)) fprintf(stderr, "%s: libTw error: %s%s\n", argv[0], TwStrError(err), TwStrErrorDetail(err, TwErrnoDetail)); if (!TwInPanic()) TwClose(); return 255; }
LRESULT CAboutDlg::DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); switch (uMsg) { case WM_INITDIALOG: { InitDialog(hwndDlg, IDI_TORTOISEIDIFF); // initialize the controls m_link.ConvertStaticToHyperlink(hwndDlg, IDC_WEBLINK, L"http://tortoisesvn.net"); TCHAR verbuf[1024] = {0}; TCHAR maskbuf[1024] = {0}; if (!::LoadString (hResource, IDS_VERSION, maskbuf, _countof(maskbuf))) { SecureZeroMemory(maskbuf, sizeof(maskbuf)); } swprintf_s(verbuf, maskbuf, TSVN_VERMAJOR, TSVN_VERMINOR, TSVN_VERMICRO, TSVN_VERBUILD); SetDlgItemText(hwndDlg, IDC_ABOUTVERSION, verbuf); } return TRUE; case WM_COMMAND: return DoCommand(LOWORD(wParam)); default: return FALSE; } }
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; }
GUITextEntryDialog::GUITextEntryDialog(const char* prompt, const char* windowCaption, const char* buttonCaption) { windowCaption_ = windowCaption; buttonCaption_ = buttonCaption; std::string promptStr = prompt; std::vector<std::string> lines = Tokenize(promptStr, "\n"); unsigned int lineCount = lines.size(); if (lineCount < 4) { for (unsigned int index = 0; index < lineCount; index++) { prompts_.push_back(lines.at(index).c_str()); } while(prompts_.size() < 4) { prompts_.push_back(""); } } else { lineCount = (lineCount > 4) ? 4 : lineCount; for (unsigned int index = 0; index < lineCount; index++) { prompts_.push_back(lines.at(index).c_str()); } } InitDialog(); }
BOOL CALLBACK SetupDlgFunc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_INITDIALOG: return InitDialog(hWnd); case WM_NOTIFY: OnNotify(hWnd, wParam, lParam); break; case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: OnSetupOK(hWnd); EndDialog(hWnd, IDOK); break; case IDCANCEL: EndDialog(hWnd, IDCANCEL); break; case IDC_PROPERTY: // プロパティ OnProperty(hWnd); break; } } return false; }
bool ArmDialog::Initialize(dxKeyboard *_keyBoard, ArmGuiData* _armGuiData, ArmConnector* _armConnector,ArmConfig* _armConfig,Calibrate* _calibrate, Surf *_surf,CameraManager *_cameraMan,Stereo *_stereo,Cube* _cube,Mesh *_mesh) { keyboard = _keyBoard; armDlgData = _armGuiData; armConnector = _armConnector; armConfig = _armConfig; stereo = _stereo; calibrate = _calibrate; cube = _cube; mesh = _mesh; targetX=0;targetY=0;targetZ=0; surf = _surf; cameraMan = _cameraMan; InitDialog(); if(FAILED(keyboard->OnCreateDevice( m_hDlg ))) { MessageBox( NULL, _T("Failed To Initialize keyboard."), _T("ERROR"), MB_OK | MB_ICONEXCLAMATION ); return false; } glApp.m_hWnd = GetDlgItem( m_hDlg, IDC_Render_Pic ); if ( !glApp.CreateGLWindow( GetModuleHandle(NULL), 0, 0, 0, 0 ) ) { MessageBox( NULL, _T("Failed To Create GL Windows."), _T("ERROR"), MB_OK | MB_ICONEXCLAMATION ); return FALSE; // Quit If Window Was Not Created } camera.SetUpAxis(ModelViewerCamera::UPAXIS_Z); camera.m_fAngleY = G_PI; camera.m_fAngleX = G_PI/8; camera.CalPosition(); // originCamera = camera; ResetDialog(); armDlgData->isScanning = false; armDlgData->hasObj = false; armDlgData->noObj = false; armDlgData->unknownObj = false; positionPath = fopen("img/savepos/path.txt","w"); walkPath = fopen("img/savepos/path2.txt","r"); numsave = 0; return true; }
void COptionsSubtitlesTime::OnButtonDefault() { bSubtitlesLoaded = defConfig.bSubtitlesLoaded; bSubtitlesOffsetTime = defConfig.bSubtitlesOffsetTime; valSubtitlesOffsetTime = defConfig.valSubtitlesOffsetTime; InitDialog(); m_BApply.EnableWindow(); }
ConfigurationManagerDlg::ConfigurationManagerDlg( wxWindow* parent ) : ConfigManagerBaseDlg( parent ) , m_dirty(false) { PopulateConfigurations(); InitDialog(); WindowAttrManager::Load(this, wxT("ConfigurationManagerDlg"), NULL); }
BOOL COptionsSubtitlesTime::OnInitDialog() { CDialog::OnInitDialog(); InitLanguage(); InitDialog(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
PHPLintDlg::PHPLintDlg(wxWindow* parent) : PHPLintBaseDlg(parent) { // center the dialog Centre(); InitDialog(); SetName("PHPLintDlg"); WindowAttrManager::Load(this); }
void CSearchResultView::GetTextSearch(const TDesC& aText) { if(aText.Length()>0) { StartInSearch(aText); } else { InitDialog(iMainEngine.GetDesById(ETurkeyTextRes_InputNull),ESRDialogShowInfo); } }
/*-----------------------*/ int main(int argc, char* argv[]) { IupSOpen(&argc, &argv); /* opens the IUP lib */ gc.dialog = InitDialog(); /* local function to create a dialog with buttons and canvas */ IupShowXY(gc.dialog, IUP_CENTER, IUP_CENTER); /* shows dialog in the center of screen */ IupMainLoop(); /* handle the program control to the IUP lib until a return IUP_CLOSE */ IupClose(); /* closes the IUP lib */ }
DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR( SCH_EDIT_FRAME* aParent, SCH_TEXT* aTextItem ) : DIALOG_LABEL_EDITOR_BASE( aParent ) { m_Parent = aParent; m_CurrentText = aTextItem; InitDialog(); FixOSXCancelButtonIssue(); // Now all widgets have the size fixed, call FinishDialogSettings FinishDialogSettings(); }
BOOL COptionsSubtitlesTime::OnCommand(WPARAM wParam, LPARAM lParam) { switch ( wParam ) { case IDM_CALLBACK_TRIEDLOADSUBTITLES: bSubtitlesLoaded = pOptions->bSubtitlesLoaded; InitDialog(); break; } return CDialog::OnCommand(wParam, lParam); }
BOOL CWndVendor::Initialize( CWndBase* pWndParent, DWORD dwWndId ) { if( g_eLocal.GetState( EVE_SCHOOL ) ) return FALSE; if( g_WndMng.GetWndBase( APP_TRADE ) || g_WndMng.GetWndBase( APP_SHOP_ ) || g_WndMng.GetWndBase( APP_BANK ) || g_WndMng.GetWndBase( APP_GUILD_BANK ) ) { return FALSE; } #if __VER >= 8 // 8차 듀얼 061226 ma if( g_pPlayer->m_nDuel ) { return FALSE; } #endif // __VER >= 8 // 8차 듀얼 061226 ma #if __VER >= 8 // __S8_VENDOR_REVISION return InitDialog( g_Neuz.GetSafeHwnd(), APP_VENDOR_REVISION, 0, 0, pWndParent ); #else // __VER >= 8 // __S8_VENDOR_REVISION return InitDialog( g_Neuz.GetSafeHwnd(), APP_VENDOREX, 0, 0, pWndParent ); #endif // __VER >= 8 // __S8_VENDOR_REVISION }
BOOL ToolbarDlg::Create() { if (DialogOp::Create()) { // Set the initial control values InitDialog(); return TRUE; } else { return FALSE; } }
DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR( SCH_EDIT_FRAME* aParent, SCH_TEXT* aTextItem ) : DIALOG_LABEL_EDITOR_BASE( aParent ) { m_Parent = aParent; m_CurrentText = aTextItem; InitDialog(); GetSizer()->SetSizeHints( this ); Layout(); Fit(); SetMinSize( GetBestSize() ); Centre(); }
bool wxDialog::Show( bool bShow ) { if ( bShow == IsShown() ) return false; if (!bShow && m_modalData ) { // we need to do this before calling wxDialogBase version because if we // had disabled other app windows, they must be reenabled right now as // if they stay disabled Windows will activate another window (one // which is enabled, anyhow) when we're hidden in the base class Show() // and we will lose activation m_modalData->ExitLoop(); #if 0 if (m_pWindowDisabler) { delete m_pWindowDisabler; m_pWindowDisabler = NULL; } #endif } if (bShow) { // this usually will result in TransferDataToWindow() being called // which will change the controls values so do it before showing as // otherwise we could have some flicker InitDialog(); } wxDialogBase::Show(bShow); if (GetTitle().c_str()) ::WinSetWindowText((HWND)GetHwnd(), (PSZ)GetTitle().c_str()); if ( bShow ) { // dialogs don't get WM_SIZE message after creation unlike most (all?) // other windows and so could start their life non laid out correctly // if we didn't call Layout() from here // // NB: normally we should call it just the first time but doing it // every time is simpler than keeping a flag Layout(); } return true; } // end of wxDialog::Show
LRESULT CMultiLineEditDlg::DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); switch (uMsg) { case WM_INITDIALOG: { InitDialog(hwndDlg, IDI_GREPWIN); CLanguage::Instance().TranslateWindow(*this); // initialize the controls SetDlgItemText(hwndDlg, IDC_TEXTCONTENT, m_RegexText.c_str()); SetFocus(GetDlgItem(hwndDlg, IDC_TEXTCONTENT)); m_resizer.Init(hwndDlg); m_resizer.AddControl(hwndDlg, IDC_TEXTCONTENT, RESIZER_TOPLEFTBOTTOMRIGHT); m_resizer.AddControl(hwndDlg, IDOK, RESIZER_BOTTOMRIGHT); m_resizer.AddControl(hwndDlg, IDCANCEL, RESIZER_BOTTOMRIGHT); SendMessage(GetDlgItem(*this, IDC_TEXTCONTENT), EM_SETEVENTMASK, 0, ENM_CHANGE); SendMessage(GetDlgItem(*this, IDC_TEXTCONTENT), EM_EXLIMITTEXT, 0, 200*1024); ExtendFrameIntoClientArea(IDC_TEXTCONTENT, IDC_TEXTCONTENT, IDC_TEXTCONTENT, IDC_TEXTCONTENT); m_aerocontrols.SubclassControl(GetDlgItem(*this, IDOK)); m_aerocontrols.SubclassControl(GetDlgItem(*this, IDCANCEL)); if (m_Dwm.IsDwmCompositionEnabled()) m_resizer.ShowSizeGrip(false); } return FALSE; case WM_COMMAND: return DoCommand(LOWORD(wParam), HIWORD(wParam)); case WM_SIZE: { m_resizer.DoResize(LOWORD(lParam), HIWORD(lParam)); } break; case WM_GETMINMAXINFO: { MINMAXINFO * mmi = (MINMAXINFO*)lParam; mmi->ptMinTrackSize.x = m_resizer.GetDlgRect()->right; mmi->ptMinTrackSize.y = m_resizer.GetDlgRect()->bottom; return 0; } break; default: return FALSE; } return FALSE; }
bool wxDialog::Show( bool show ) { if( !wxWindowBase::Show( show ) ) return false; if ( !show && IsModal() ) EndModal(wxID_CANCEL); m_isShown = show; if (show) { if (CanDoLayoutAdaptation()) DoLayoutAdaptation(); // this usually will result in TransferDataToWindow() being called // which will change the controls values so do it before showing as // otherwise we could have some flicker InitDialog(); } if (show) { #if !wxUSE_INVISIBLE_RESIZE XtMapWidget(XtParent((Widget) m_mainWidget)); #else XtManageChild((Widget)m_mainWidget) ; #endif XRaiseWindow( XtDisplay( (Widget)m_mainWidget ), XtWindow( (Widget)m_mainWidget) ); } else { #if !wxUSE_INVISIBLE_RESIZE XtUnmapWidget(XtParent((Widget) m_mainWidget)); #else XtUnmanageChild((Widget)m_mainWidget) ; #endif XFlush(XtDisplay((Widget)m_mainWidget)); XSync(XtDisplay((Widget)m_mainWidget), False); } return true; }
bool wxDialog::Show( bool show ) { if (!show && IsModal()) { EndModal( wxID_CANCEL ); } if (show && CanDoLayoutAdaptation()) DoLayoutAdaptation(); bool ret = wxDialogBase::Show(show); if (show) InitDialog(); return ret; }
LRESULT CCleanVerifyDlg::DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); switch (uMsg) { case WM_INITDIALOG: { InitDialog(hwndDlg, IDI_FILETOOL); SetDlgItemText(*this, IDC_PATH, m_path.c_str()); } return TRUE; case WM_COMMAND: return DoCommand(LOWORD(wParam)); default: return FALSE; } }
LRESULT CALLBACK DialogProc(const HWND hWnd, const UINT Msg, const WPARAM wParam, const LPARAM lParam) { LRESULT res = 0; switch (Msg) { case WM_CREATE: g_hWndMain = hWnd; if (FALSE == InitDialog()){ DestroyWindow(g_hWndMain); } break; case WM_CLOSE: DestroyWindow(g_hWndMain); break; case WM_DESTROY: if (g_hWndMenuBar) DestroyWindow(g_hWndMenuBar); g_hWndMenuBar = NULL; g_hWndMain = NULL; PostQuitMessage(0); break; case WM_HOTKEY: /* Exit app when back is pressed. */ if (VK_TBACK == HIWORD(lParam) && (0 != (MOD_KEYUP & LOWORD(lParam)))) { DestroyWindow(g_hWndMain); } else { return DefWindowProc(hWnd, Msg, wParam, lParam); } break; case WM_COMMAND: res = handle_menu(LOWORD(wParam)); break; default: return DefWindowProc(hWnd, Msg, wParam, lParam); } return res; }
void CSnapperOptions::OnBnClickedUpdate() { UpdateData(TRUE); m_bUpdateHotlists = TRUE; UpdateData(FALSE); // if we've enabled shortcuts then warn the user it may take a while... if (m_bIncludeShares) MessageBox(_T("This may take a minute if any shortcuts point to inaccessible folders/sections."), _T("Starting Update")); // update the folder/section lists, following network paths. UpdateConfig(TRUE); // just in case we've loaded a new config file... InitDialog(); UpdateData(FALSE); MessageBox(_T("Folder/section lists updated to match Notebook."), _T("Updated!")); }
INT_PTR ServerPingSettings::ProcMessage(UINT message, WPARAM wParam, LPARAM lParam) { switch(message) { case WM_INITDIALOG: { InitDialog(); return TRUE; } case WM_DESTROY: { DestroyDialog(); return TRUE; } case WM_COMMAND: { if(LOWORD(wParam) == IDC_CLEAR) { HandleClear(); return TRUE; } } case WM_NOTIFY: { switch (((LPNMHDR) lParam)->code) { case LVN_GETDISPINFO: { HandleLVNGetDispInfo((NMLVDISPINFO*)lParam); return TRUE; } case LVN_ITEMCHANGED: { HandleLVNItemChanged((LPNMLISTVIEW)lParam); return TRUE; } case NM_CUSTOMDRAW: { SetWindowLong(hwnd, 0, (LONG)HandleCustomDraw(lParam)); return TRUE; } } break; } } return FALSE; }
LRESULT CWindowTreeDlg::DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); switch (uMsg) { case WM_INITDIALOG: { InitDialog(hwndDlg, IDI_SENDMESSAGE); m_resizer.Init(hwndDlg); m_resizer.AddControl(hwndDlg, IDC_WINDOWTREE, RESIZER_TOPLEFTBOTTOMRIGHT); m_resizer.AddControl(hwndDlg, IDC_REFRESH, RESIZER_BOTTOMRIGHT); m_resizer.AddControl(hwndDlg, IDOK, RESIZER_BOTTOMRIGHT); m_resizer.AddControl(hwndDlg, IDCANCEL, RESIZER_BOTTOMRIGHT); ExtendFrameIntoClientArea(IDC_WINDOWTREE, IDC_WINDOWTREE, IDC_WINDOWTREE, IDC_WINDOWTREE); m_aerocontrols.SubclassControl(GetDlgItem(*this, IDC_REFRESH)); m_aerocontrols.SubclassControl(GetDlgItem(*this, IDOK)); m_aerocontrols.SubclassControl(GetDlgItem(*this, IDCANCEL)); if (m_Dwm.IsDwmCompositionEnabled()) m_resizer.ShowSizeGrip(false); RefreshTree(); } return FALSE; case WM_COMMAND: return DoCommand(LOWORD(wParam), HIWORD(wParam)); case WM_SIZE: { m_resizer.DoResize(LOWORD(lParam), HIWORD(lParam)); } break; case WM_GETMINMAXINFO: { MINMAXINFO * mmi = (MINMAXINFO*)lParam; mmi->ptMinTrackSize.x = m_resizer.GetDlgRect()->right; mmi->ptMinTrackSize.y = m_resizer.GetDlgRect()->bottom; return 0; } break; default: return FALSE; } return FALSE; }