afx_msg void Main_Frame::OnLogin(void) { CMLogin cdlg(MAKEINTRESOURCE(IDD_MLOGIN),this); cdlg.DoModal(); IsLogin=cdlg.IL; //return afx_msg void(); }
afx_msg void Main_Frame::OnMenuEdit(void) { if(IsLogin == true){ CMenuEdit cdlg(MAKEINTRESOURCE(IDD_MENUEDIT),this); cdlg.DoModal(); } else{ MessageBox(_T("Please Login First !!"),_T("Error"));} //return afx_msg void(); }
afx_msg void Main_Frame::OnStaffView(void) { if(IsLogin == true){ CEmpView cdlg(MAKEINTRESOURCE(IDD_EMPVIEW),this); cdlg.DoModal(); } else{ MessageBox(_T("Please Login First !!"),_T("Error"));} //return afx_msg void(); }
void CPMPTensorDatView::OnButtonBackground256() { // TODO: Add your command handler code here double m_dColorRed = 0.9 ; double m_dColorGreen = 0.9; double m_dColorBlue = 0.9; COLORREF color = RGB(m_dColorRed*255, m_dColorGreen*255, m_dColorBlue*255); CColorDialog cdlg(color, CC_FULLOPEN | CC_RGBINIT); // 设置默认颜色 if(cdlg.DoModal() == IDOK) color = cdlg.GetColor(); m_dColorRed = GetRValue(color)/255.0; m_dColorGreen = GetGValue(color)/255.0; m_dColorBlue = GetBValue(color)/255.0; m_pvtkRenderer->SetBackground(m_dColorRed,m_dColorGreen,m_dColorBlue); CRect rc; GetClientRect(rc); m_pvtkMFCWindow->RedrawWindow(rc); }
BOOL CChatClientApp::InitInstance() { AfxInitRichEdit(); //TODO: call AfxInitRichEdit2() to initialize richedit2 library. // 응용 프로그램 매니페스트가 ComCtl32.dll 버전 6 이상을 사용하여 비주얼 스타일을 // 사용하도록 지정하는 경우, Windows XP 상에서 반드시 InitCommonControlsEx()가 필요합니다. // InitCommonControlsEx()를 사용하지 않으면 창을 만들 수 없습니다. INITCOMMONCONTROLSEX InitCtrls; InitCtrls.dwSize = sizeof(InitCtrls); // 응용 프로그램에서 사용할 모든 공용 컨트롤 클래스를 포함하도록 // 이 항목을 설정하십시오. InitCtrls.dwICC = ICC_WIN95_CLASSES; InitCommonControlsEx(&InitCtrls); CWinApp::InitInstance(); if (!AfxSocketInit()) { AfxMessageBox(IDP_SOCKETS_INIT_FAILED); return FALSE; } GdiplusStartupInput gidplusStartInput; GdiplusStartup(&m_gidplusToken, &gidplusStartInput, NULL); AfxEnableControlContainer(); // 대화 상자에 셸 트리 뷰 또는 // 셸 목록 뷰 컨트롤이 포함되어 있는 경우 셸 관리자를 만듭니다. CShellManager *pShellManager = new CShellManager; // 표준 초기화 // 이들 기능을 사용하지 않고 최종 실행 파일의 크기를 줄이려면 // 아래에서 필요 없는 특정 초기화 // 루틴을 제거해야 합니다. // 해당 설정이 저장된 레지스트리 키를 변경하십시오. // TODO: 이 문자열을 회사 또는 조직의 이름과 같은 // 적절한 내용으로 수정해야 합니다. SetRegistryKey(_T("로컬 응용 프로그램 마법사에서 생성된 응용 프로그램")); CClientSocket *p_client_socket = new CClientSocket(); CImageSocket *p_image_socket = new CImageSocket(); TCHAR id[20] = {0}; CChatConnector cdlg(p_client_socket, p_image_socket, id); if(IDOK == cdlg.DoModal()){ CChatClientDlg dlg(p_client_socket, p_image_socket, id); m_pMainWnd = &dlg; INT_PTR nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: 여기에 [확인]을 클릭하여 대화 상자가 없어질 때 처리할 // 코드를 배치합니다. } else if (nResponse == IDCANCEL) { // TODO: 여기에 [취소]를 클릭하여 대화 상자가 없어질 때 처리할 // 코드를 배치합니다. } } // 위에서 만든 셸 관리자를 삭제합니다. if (pShellManager != NULL) { delete pShellManager; } // 대화 상자가 닫혔으므로 응용 프로그램의 메시지 펌프를 시작하지 않고 응용 프로그램을 끝낼 수 있도록 FALSE를 // 반환합니다. return FALSE; }
afx_msg void Main_Frame::OnAboutUs(void) { CAboutUs cdlg(MAKEINTRESOURCE(IDD_ABOUTUS),this); cdlg.DoModal(); }
afx_msg void Main_Frame::OnOrder(void) { COrder cdlg(MAKEINTRESOURCE(IDD_ORDER),this); cdlg.DoModal(); //return afx_msg void(); }
void CMainFrame::OnColor(wxCommandEvent& event) { ColorDialog cdlg(m_toolbar, -1, wxT("Couleur")); cdlg.ShowModal(); }
void MainFrame::OnOpenYUVFile(const wxString& sFile, const wxString& sName, bool bWrongOpened) { int w, h; bool bit; bool bShowConfigDlg = true; if(GetYUVConfigData(sFile, w, h, bit)) bShowConfigDlg = false; if(bWrongOpened) bShowConfigDlg = true; if(bShowConfigDlg) { YUVConfigDlg cdlg(this, bWrongOpened); wxString width,height; if(g_parseResolutionFromFilename(sName, width, height)) { cdlg.SetWidth(width); cdlg.SetHeight(height); } int ret = sName.find(_T("_10bit_")); if(ret != wxNOT_FOUND) cdlg.SetBitFlag(true); if(cdlg.ShowModal() == wxID_CANCEL) return; m_iSourceWidth = cdlg.GetWidth(); m_iSourceHeight = cdlg.GetHeight(); m_iYUVBit = (cdlg.Is10bitYUV() ? 10 : 8); if(wxFile::Exists((const wxChar*)sFile)) m_FileLength = wxFile((const wxChar*)sFile).Length(); else { wxMessageBox(_T("No such file in the disk")); return; } int t = (cdlg.Is10bitYUV() ? 2 : 1); if(!(m_FileLength/(m_iSourceWidth*m_iSourceHeight*3/2*t) > 0)) { wxMessageBox(_T("Not enough data for one frame, open YUV file failed")); return; } StoreYUVConfigData(sFile, m_iSourceWidth, m_iSourceHeight, (m_iYUVBit > 8)); } else { m_iSourceWidth = w; m_iSourceHeight = h; m_iYUVBit = (bit ? 10 : 8); if(wxFile::Exists((const wxChar*)sFile)) m_FileLength = wxFile((const wxChar*)sFile).Length(); else { wxMessageBox(_T("No such file in the disk")); return; } int t = (bit ? 2 : 1); if(!(m_FileLength/(m_iSourceWidth*m_iSourceHeight*3/2*t) > 0)) { wxMessageBox(_T("Not enough data for one frame, open YUV file failed")); return; } } // multi-thread wxString lastFile = sFile; wxString lastName = sName; wxCommandEvent event; OnCloseFile(event); m_sCurOpenedFilePath = lastFile; m_sCurOpenedFileName = lastName; m_bOPened = true; m_bPlaying = false; m_FileLength = wxFile((const wxChar*)lastFile).Length(); SetTotalFrameNumber(); m_pCenterPageManager->GetPicViewCtrl(0)->SetScale(1.0); m_pCenterPageManager->GetPicViewCtrl(0)->SetFitMode(true); #if defined(__WXMSW__) m_cYUVIO.open(lastFile.mb_str(wxCSConv(wxFONTENCODING_SYSTEM)).data(), false, m_iYUVBit, m_iYUVBit, m_iYUVBit, m_iYUVBit); #else m_cYUVIO.open(lastFile.mb_str(wxConvUTF8).data(), false, m_iYUVBit, m_iYUVBit, m_iYUVBit, m_iYUVBit); #endif m_pcPicYuvOrg = new TComPicYuv; m_pcPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, 64, 64, 4 ); double scaleRate = 165.0/m_iSourceWidth; InitThumbnailListView(); g_LogMessage(_T("Initialize thumbnail finished")); m_pImageList = new wxImageList((int)m_iSourceWidth*scaleRate, (int)m_iSourceHeight*scaleRate); m_pThumbThread = new ThumbnailThread(this, m_pImageList, m_iSourceWidth, m_iSourceHeight, m_iYUVBit, lastFile); if(m_pThumbThread->Create() != wxTHREAD_NO_ERROR) { g_LogError(_T("Can't create the thread!")); delete m_pThumbThread; m_pThumbThread = NULL; } else { if(m_pThumbThread->Run() != wxTHREAD_NO_ERROR) { g_LogError(_T("Can't create the thread!")); delete m_pThumbThread; m_pThumbThread = NULL; } } }