void CMediaWin::OnClick(const TNotifyUI& msg) { if(msg.pSender->IsName(UIMediaWin::kClose)) SendMessage(WM_SYSCOMMAND,SC_CLOSE, 0); else if(msg.pSender->IsName(UIMediaWin::kMin)) SendMessage(WM_SYSCOMMAND, SC_MINIMIZE, 0); else if(msg.pSender->IsName(UIMediaWin::kMax)) SendMessage(WM_SYSCOMMAND, SC_MAXIMIZE, 0); else if(msg.pSender->IsName(UIMediaWin::kRestore)) SendMessage(WM_SYSCOMMAND, SC_RESTORE, 0); else if(msg.pSender->IsName(UIMediaWin::kPlayBtn)) Play(); else if(msg.pSender->IsName(UIMediaWin::kPauseBtn)) Pause(); else if(msg.pSender->IsName(UIMediaWin::kStopBtn)) Stop(); else if(msg.pSender->IsName(UIMediaWin::kVolOffBtn)) SwitchVol(false); else if(msg.pSender->IsName(UIMediaWin::kVolOnBtn)) SwitchVol(true); else if(msg.pSender->IsName(UIMediaWin::kFullScreenBtn)) FullScreen(true); else if(msg.pSender->IsName(UIMediaWin::kNormalBtn)) FullScreen(false); }
//Перевод приложения в/из полноэкранный режим void AnimeList::FullSizeWindow() { if(size) { size = false; FullScreen(size); } else { size = true; FullScreen(size); } }
void topMenu::onClick_fullScreen() { bool b = fullScreen->isAlternate; if(b) { fullScreen->setAlternate(false); emit FullScreen(false); } else { fullScreen->setAlternate(true); emit FullScreen(true); } }
void AfterStartup() { #if TESTBENCH StartupStore(TEXT(". CloseProgressDialog%s"),NEWLINE); #endif CloseProgressDialog(); // NOTE: Must show errors AFTER all windows ready int olddelay = StatusMessageData[0].delay_ms; StatusMessageData[0].delay_ms = 20000; // 20 seconds if (SIMMODE) { StartupStore(TEXT(". GCE_STARTUP_SIMULATOR%s"),NEWLINE); InputEvents::processGlideComputer(GCE_STARTUP_SIMULATOR); } else { StartupStore(TEXT(". GCE_STARTUP_REAL%s"),NEWLINE); InputEvents::processGlideComputer(GCE_STARTUP_REAL); } StatusMessageData[0].delay_ms = olddelay; // Create default task if none exists #if TESTBENCH StartupStore(TEXT(". Create default task%s"),NEWLINE); #endif DefaultTask(); // Trigger first redraw MapWindow::MapDirty = true; MapWindow::zoom.Reset(); FullScreen(); drawTriggerEvent.set(); }
void moPreviewFrame::OnToolClick( wxCommandEvent &event) { if ( event.GetId() == TOOLPLAY) { ShowMessage( moText("Play") ); //ToolBar1->Hide(); //SetClientSize(wxSize(1024,768)); } else if (event.GetId() == TOOLPAUSE) { ShowMessage( moText("Pause") ); //ToolBar1->Hide(); } else if (event.GetId() == TOOLFULLSCREEN) { ShowMessage( moText("Fullscreen") ); FullScreen(); } //wxDisplay thisDisplay(0); //wxDisplay theOtherDisplay(1); //thisDisplay.GetFromWindow(this); //wxRect client = thisDisplay.GetClientArea(); //wxRect client2 = theOtherDisplay.GetClientArea(); //wxString clientareastr; //wxString clientareastr2; //clientareastr.Printf(" area: %d,%d,%d,%d", client.GetLeft(), client.GetTop(), client.GetWidth(), client.GetHeight() ); //clientareastr2.Printf(" area: %d,%d,%d,%d", client2.GetLeft(), client2.GetTop(), client2.GetWidth(), client2.GetHeight() ); ///wxMessageBox(thisDisplay.GetName() + clientareastr); //wxMessageBox(theOtherDisplay.GetName() + clientareastr2 ); }
Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) { ui->setupUi(this); openbutton->setObjectName("OpenButton"); openbutton->setText(tr("打开图片")); openbutton->setGeometry(50,10,60,20);//设置button位置和大小 lastbutton->setObjectName("LastButton"); lastbutton->setText(tr("上一张")); lastbutton->setGeometry(130,10,60,20); nextbutton->setObjectName("NextButton"); nextbutton->setText(tr("下一张")); nextbutton->setGeometry(210,10,60,20); amplifybutton->setObjectName("AmplifyButton"); amplifybutton->setText(tr("放 大")); amplifybutton->setGeometry(290,10,60,20); shrinkbutton->setObjectName("ShrinkButton"); shrinkbutton->setText(tr("缩 小")); shrinkbutton->setGeometry(370,10,60,20); fullscreenbutton->setObjectName("FullScreenButton"); fullscreenbutton->setText(tr("全 屏")); fullscreenbutton->setGeometry(450,10,60,20); connect(openbutton,SIGNAL(clicked()),this,SLOT(OpenPhoto())); connect(amplifybutton,SIGNAL(clicked()),this,SLOT(AmplifyPhoto())); connect(shrinkbutton,SIGNAL(clicked()),this,SLOT(ShrinkPhoto())); connect(fullscreenbutton,SIGNAL(clicked()),this,SLOT(FullScreen())); }
void CMainFrame::OnShowWindow(BOOL bShow, UINT nStatus) { CFrameWnd::OnShowWindow(bShow, nStatus); // TODO: 在此处添加消息处理程序代码 if(!m_bFullScreen) ShowWindow(SW_MAXIMIZE); FullScreen(); //移动工具栏到中间 CRect ToolBarRect; m_wndToolBar.GetWindowRect(&ToolBarRect); m_wndToolBarRect = ToolBarRect; // CRect windowRect; // GetWindowRect(&windowRect); CRect destRect; destRect.left = m_windowRect.Width()/2 - ToolBarRect.Width()/2; destRect.right = m_windowRect.Width()/2 + ToolBarRect.Width()/2; destRect.top = ToolBarRect.top;//ToolBarRect.top; destRect.bottom = ToolBarRect.bottom;//ToolBarRect.bottom; m_wndToolBar.MoveWindow(destRect); /////////////////////////////////////// theApp.m_pView->GetBackDC(); }
void CMediaWin::Notify(TNotifyUI& msg) { YTrace_(_T("class:%s,id:%s,msg:%s"),msg.pSender->GetClass(),msg.pSender->GetName().GetData(),msg.sType.GetData()); if(0 == msg.sType.Compare(kClick)) return OnClick(msg); else if( 0 == msg.sType.Compare(kDBClick)) FullScreen(! m_bFullScreenMode); }
void *RunFullScreen(void *arg) { /************************************************* *************************************************/ void **v=NULL; void *pt=NULL; /* pointer to send any extra information */ FullScreen(NULL,v,pt ); return NULL; }
LRESULT CDuiFrameWnd::ResponseDefaultKeyEvent(WPARAM wParam) { if (wParam == VK_ESCAPE) { if (m_bFullScreenMode) { FullScreen(false); } } return __super::ResponseDefaultKeyEvent(wParam); }
LRESULT CMediaWin::ResponseDefaultKeyEvent(WPARAM wParam) { if (wParam == VK_RETURN) { return FALSE; } else if (wParam == VK_ESCAPE) { FullScreen(false); return TRUE; } return FALSE; }
void DisplayManager::Init(bool Fullscreen, bool UsingOpenGL) { FullScreen(Fullscreen); useOpengGL(UsingOpenGL); setVideo(); if(!openGL) { renderer = SDL_CreateRenderer(mainWindow, -1, 0); } else { gl_context = SDL_GL_CreateContext(mainWindow); SDL_GL_MakeCurrent(mainWindow, gl_context); } assert(mainWindow); }
void CMoviePlayerDlg::Hide(bool Enable) { if (Enable == m_Hidden) return; // nothing to do CSize sz = Enable ? CSize(0, 0) : m_InitRect.Size(); // topmost window of zero size is invisible but retains input focus SetWindowPos(Enable ? &CWnd::wndTopMost : &CWnd::wndNoTopMost, 0, 0, sz.cx, sz.cy, SWP_NOMOVE); if (Enable) SetCapture(); else { ReleaseCapture(); FullScreen(FALSE); } m_Hidden = Enable; }
void BasePlatformInterface::SetFullscreen(bool aFullscreen) { if (aFullscreen && !mFullscreen) { mFullscreen = true; FullScreen(); } else if (!aFullscreen && mFullscreen) { mFullscreen = false; UnFullScreen(); // Make sure we're in the right place and the right size ResizeToWindow(); ResizeVideo(); } // Otherwise, we're already in the right mode, so don't do anything. }
BOOL vncServer::SetShareMonitorFromPoint(POINT pt) { HINSTANCE hInstUser32 = LoadLibrary("User32.DLL"); if (!hInstUser32) return FALSE; pMonitorFromPoint pMFP = (pMonitorFromPoint)GetProcAddress(hInstUser32, "MonitorFromPoint"); pGetMonitorInfo pGMI = (pGetMonitorInfo)GetProcAddress(hInstUser32, "GetMonitorInfoA"); if (!pMFP || !pGMI) { vnclog.Print( LL_INTERR, VNCLOG("Can not import '%s' and '%s' from '%s'.\n"), "MonitorFromPoint", "GetMonitorInfoA", "User32.DLL"); FreeLibrary(hInstUser32); return FALSE; } HMONITOR hm = pMFP(pt, MONITOR_DEFAULTTONEAREST); if (!hm) { FreeLibrary(hInstUser32); return FALSE; } MONITORINFO moninfo; moninfo.cbSize = sizeof(moninfo); if (!pGMI(hm, &moninfo)) { FreeLibrary(hInstUser32); return FALSE; } FullScreen(FALSE); WindowShared(FALSE); ScreenAreaShared(TRUE); PrimaryDisplayOnlyShared(FALSE); SetMatchSizeFields( moninfo.rcMonitor.left, moninfo.rcMonitor.top, moninfo.rcMonitor.right, moninfo.rcMonitor.bottom); FreeLibrary(hInstUser32); return TRUE; }
LRESULT CFlashPlayerDlg::OnDropFiles(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { int iFileNumber; CString filename; TCHAR szFileName[MAX_PATH*2]; iFileNumber = DragQueryFile((HDROP)wParam, 0xFFFFFFFF, NULL, 0); m_playlist.RemoveAll(); for (int i = 0; i < iFileNumber; i++) { DragQueryFile((HDROP)wParam, i, szFileName, MAX_PATH*2); m_playlist.Add(szFileName); } m_current = 0; PlayFile(); if(m_fs_init) FullScreen(); return 0; }
LRESULT MainMenu(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { // int wmId = LOWORD(wParam); // int wmEvent = HIWORD(wParam); HWND wmControl = (HWND)lParam; if(wmControl != NULL) { if (ProgramStarted==psNormalOp) { FullScreen(); Message::CheckTouch(wmControl); if (ButtonLabel::CheckButtonPress(wmControl)) { return TRUE; // don't continue processing.. } } } return DefWindowProc(hWnd, message, wParam, lParam); }
LRESULT CFlashPlayerDlg::OnFlashOpen(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { TCHAR szFilePath[MAX_PATH + 1]; ::GetCurrentDirectory(MAX_PATH,szFilePath); TCHAR strBuffer[MAX_PATH * 2] = {0}; CFileDialog dlg(TRUE, 0, 0, OFN_HIDEREADONLY, _T("Flash (*.swf)\0*.swf\0All File(*.*)\0*.*\0")); dlg.m_ofn.lpstrFile = strBuffer; dlg.m_ofn.nMaxFile = MAX_PATH * 2; if(dlg.DoModal()==IDOK) { m_playlist.RemoveAll(); m_playlist.Add(dlg.m_ofn.lpstrFile); m_current = 0; PlayFile(); if(m_fs_init) FullScreen(); } ::SetCurrentDirectory(szFilePath); DoDataExchange(FALSE); return 0; }
void CDuiFrameWnd::OnClick( TNotifyUI& msg ) { if( msg.pSender->GetName() == _T("btnPlaylistShow") ) { ShowPlaylist(true); } else if( msg.pSender->GetName() == _T("btnPlaylistHide") ) { ShowPlaylist(false); } else if( msg.pSender->GetName() == _T("btnFastBackward") ) { m_cAVPlayer.SeekBackward(); ::PostMessage(*this, WM_USER_POS_CHANGED, 0, m_cAVPlayer.GetPos()); } else if( msg.pSender->GetName() == _T("btnFastForward") ) { m_cAVPlayer.SeekForward(); ::PostMessage(*this, WM_USER_POS_CHANGED, 0, m_cAVPlayer.GetPos()); } else if( msg.pSender->GetName() == _T("btnPrevious") ) { Play(GetNextPath(false)); } else if( msg.pSender->GetName() == _T("btnNext") ) { Play(GetNextPath(true)); } else if( msg.pSender->GetName() == _T("btnPlay") ) { Play(true); } else if( msg.pSender->GetName() == _T("btnPause") ) { Play(false); } else if( msg.pSender->GetName() == _T("btnStop") ) { Stop(); } else if( msg.pSender->GetName() == _T("btnOpen") || msg.pSender->GetName() == _T("btnOpenMini") ) { OpenFileDialog(); } else if( msg.pSender->GetName() == _T("btnRefresh") ) { CEditUI* pUI = static_cast<CEditUI*>(m_PaintManager.FindControl(_T("editURL"))); Play(pUI->GetText()); } else if( msg.pSender->GetName() == _T("btnScreenFull") ) { FullScreen(true); } else if( msg.pSender->GetName() == _T("btnScreenNormal") ) { FullScreen(false); } else if( msg.pSender->GetName() == _T("btnVolume") ) { m_cAVPlayer.Volume(0); m_PaintManager.FindControl(_T("btnVolumeZero"))->SetVisible(true); msg.pSender->SetVisible(false); } else if( msg.pSender->GetName() == _T("btnVolumeZero") ) { CSliderUI* pUI = static_cast<CSliderUI*>(m_PaintManager.FindControl(_T("sliderVol"))); m_cAVPlayer.Volume(pUI->GetValue()); m_PaintManager.FindControl(_T("btnVolume"))->SetVisible(true); msg.pSender->SetVisible(false); } else if( msg.pSender->GetName() == _T("btnPlayMode") ) { CMenuWnd *pMenu = new CMenuWnd(_T("menu.xml")); POINT pt = {msg.ptMouse.x, msg.ptMouse.y}; CDuiRect rc = msg.pSender->GetPos(); pt.x = rc.left; pt.y = rc.bottom; pMenu->Init(&m_PaintManager, pt); pMenu->ShowWindow(TRUE); } else if (msg.pSender->GetName() == _T("btnAdd")) { OpenFileDialog(); } else if (msg.pSender->GetName() == _T("btnDelete")) { DeleteFileItem(); } else if (msg.pSender->GetTag() == U_TAG_PLAYLIST) { CDuiString strPath = msg.pSender->GetName(); Play(strPath.GetData()); } __super::OnClick(msg); }
void getkey(unsigned char key,int x,int y) { static int drawMode = 0; switch(key) { case 27: exit(0); break; case '0': ResetNx(); break; case '1': CreateCube(NxVec3(0,40,0),3); break; case '2': CreateCubeFromEye(2); break; case '3': CreateStack(10); break; case 'p': case 'P': gPauseSimulation = !gPauseSimulation; break; case 'h': case 'H': g_DisplayHelp = !g_DisplayHelp; break; case 'f': case 'F': FullScreen(); break; case 't': case 'T': drawMode = ++drawMode % 3; if(drawMode == 0) // fill mode { glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glEnable(GL_DEPTH_TEST); glEnable(GL_CULL_FACE); } else if(drawMode == 1) // wireframe mode { glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glDisable(GL_DEPTH_TEST); glDisable(GL_CULL_FACE); } else // point mode { glPolygonMode(GL_FRONT_AND_BACK, GL_POINT); glDisable(GL_DEPTH_TEST); glDisable(GL_CULL_FACE); } break; case ' ': g_CameraPos = NxVec3(0.0f, 20.0f, 80.0f); g_CameraForward = NxVec3(0.0f,0.0f,-1.0f); g_fovy =90.0f; break; default: break; } glutPostRedisplay(); glCheckError("getkey"); }
void PreloadInitialisation(bool ask) { LKLanguageReady=false; LKReadLanguageFile(szLanguageFile); FillDataOptions(); // Load infobox list if (ask) { // Load default profile and status file: we are at an early stage LKProfileResetDefault(); LKProfileLoad(startAircraftFile); LKProfileLoad(startPilotFile); LKProfileLoad(startDeviceFile); // if DEFAULT PROFILE does not exist, initialize ResetDefaults! // This is because LKProfileLoad will do this at its end, normally. // Notice: aircraft and pilot files will not be overridden by defaults if (!LKProfileLoad(startProfileFile)) { LKProfileInitRuntime(); } StatusFileInit(); } else { // We are in the dialog startup phase FullScreen(); short retstartup; do { retstartup=dlgStartupShowModal(); } while (retstartup>0); if (retstartup<0) return; if (_tcscmp(startProfileFile,_T("PROFILE_RESET"))==0) { StartupStore(_T(". USER ASKED FOR PROFILE FULL RESET!%s"),NEWLINE); DoStatusMessage(gettext(_T("_@M1757_"))); // LK8000 PROFILES RESET LKProfileResetDefault(); LKProfileInitRuntime(); // Notice: this is also resetting the default Aircraft and Pilot profiles to demo settings } else { if (!LKProfileLoad(startPilotFile)) { #if TESTBENCH StartupStore(_T(". PilotFile RESET to defaults%s"),NEWLINE); #endif } if (!LKProfileLoad(startDeviceFile)) { #if TESTBENCH StartupStore(_T(". DeviceFile RESET to defaults%s"),NEWLINE); #endif } if (!LKProfileLoad(startAircraftFile)) { #if TESTBENCH StartupStore(_T(". AircraftFile RESET to defaults%s"),NEWLINE); #endif } LKProfileLoad(startProfileFile); // this is calling adjust and InitRuntime itself } // LKTOKEN _@M1206_ "Initialising..." CreateProgressDialog(gettext(TEXT("_@M1206_"))); } // Interface (before interface) if (!ask) { LKReadLanguageFile(szLanguageFile); InputEvents::readFile(); } InitCustomHardware(); }
void TopWindow::SerializePlacement(Stream& s, bool reminimize) { GuiLock __; #ifndef PLATFORM_WINCE int version = 1; s / version; Rect rect = GetRect(); s % overlapped % rect; bool mn = state == MINIMIZED; bool mx = state == MAXIMIZED; bool fs = fullscreen; // 12-05-23 Tom added fullscreen serialization if(version >= 1) s.Pack(mn, mx, fs); // 12-05-23 Tom changed from: s.Pack(mn, mx); else s.Pack(mn, mx); LLOG("TopWindow::SerializePlacement / " << (s.IsStoring() ? "write" : "read")); LLOG("minimized = " << mn << ", maximized = " << mx << ", fullscreen = " << fs); // 12-05-23 Tom extended with fullscreen LLOG("rect = " << rect << ", overlapped = " << overlapped); if(s.IsLoading()) { rect = overlapped; Rect limit = GetVirtualWorkArea(); Rect outer = rect; ::AdjustWindowRect(outer, WS_OVERLAPPEDWINDOW, FALSE); limit.left += rect.left - outer.left; limit.top += rect.top - outer.top; limit.right += rect.right - outer.right; limit.bottom += rect.bottom - outer.bottom; Size sz = min(rect.Size(), limit.Size()); rect = RectC( minmax(rect.left, limit.left, limit.right - sz.cx), minmax(rect.top, limit.top, limit.bottom - sz.cy), sz.cx, sz.cy); Overlap(); SetRect(rect); if(mn && reminimize){ state = MINIMIZED; //Minimize(); // 12-05-23 Tom removed } if(mx){ state = MAXIMIZED; //Maximize(); // 12-05-23 Tom removed } if(IsOpen()) { switch(state) { case MINIMIZED: Minimize(); break; case MAXIMIZED: Maximize(); break; } /* WINDOWPLACEMENT wp; memset(&wp,0,sizeof(WINDOWPLACEMENT)); wp.length=sizeof(WINDOWPLACEMENT); wp.showCmd = state==MINIMIZED ? SW_MINIMIZE : state==MAXIMIZED ? SW_MAXIMIZE : SW_RESTORE; wp.rcNormalPosition.left=rect.left; wp.rcNormalPosition.top=rect.top; wp.rcNormalPosition.right=rect.right; wp.rcNormalPosition.bottom=rect.bottom; ::SetWindowPlacement(GetHWND(),&wp); */ if(fs) { Overlap(); // Needed to restore normal position before fullscreen mode FullScreen(fs); // 12-05-23 Tom added for fullscreen serialization } } else // 12-05-23 Tom added for fullscreen serialization fullscreen=fs; // 12-05-23 Tom added for fullscreen serialization } #endif }
LRESULT CALLBACK AnalysisProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { TCHAR Temp[2048]; static HDC hdcScreen; static int page = 0; PAINTSTRUCT ps; HDC hdc; RECT rc; static RECT rcgfx; HFONT hfOld; HBRUSH background; switch (message) { case WM_INITDIALOG: hdcScreen = GetDC(hDlg); GetClientRect(hDlg, &rc); SendDlgItemMessage(hDlg, IDC_ANALYSISLABEL, WM_SETFONT, (WPARAM)StatisticsFont,MAKELPARAM(TRUE,0)); SendDlgItemMessage(hDlg, IDC_ANALYSISTEXT, WM_SETFONT, (WPARAM)StatisticsFont,MAKELPARAM(TRUE,0)); if (!InfoBoxLayout::landscape) { rcgfx = rc; rcgfx.left += 10; rcgfx.right -= 10; rcgfx.top = (rc.bottom-rc.top)*2/10+rc.top; rcgfx.bottom = (rc.bottom-rc.top)*2/3+rc.top; } else { rcgfx = rc; rcgfx.left = long(double(rc.right-rc.left)*0.36)+rc.left; rcgfx.right = rc.right-10; rcgfx.top = (rc.bottom-rc.top)*2/10+rc.top; rcgfx.bottom = rc.bottom; } return TRUE; case WM_COMMAND: if (LOWORD(wParam) == IDOK) { ::ReleaseDC(hDlg, hdcScreen); EndDialog(hDlg, LOWORD(wParam)); MapWindow::RequestFastRefresh(); ClearAirspaceWarnings(false); // airspace warning gets refreshed FullScreen(); return TRUE; } if (LOWORD(wParam) == IDC_ANALYSISNEXT) { page++; // cycle around to start page if (page==5) { page=0; } } case WM_PAINT: // make background white GetClientRect(hDlg, &rc); hdc = BeginPaint(hDlg, &ps); background = CreateSolidBrush(RGB(0xf0,0xf0,0xb0)); HGDIOBJ gTemp; gTemp = SelectObject(hdcScreen, background); SelectObject(hdcScreen, GetStockObject(WHITE_PEN)); Rectangle(hdcScreen,rcgfx.left,rcgfx.top,rcgfx.right,rcgfx.bottom); DeleteObject(background); hfOld = (HFONT)SelectObject(hdcScreen, StatisticsFont); if (page==0) { // LKTOKEN _@M127_ = "Barograph" SetDlgItemText(hDlg,IDC_ANALYSISLABEL, gettext(TEXT("_@M127_"))); _stprintf(Temp, TEXT("%s: %5.0f-%5.0f %s\r\n%s: %5.0f %s/hr"), // LKTOKEN _@M823_ = "Working band" gettext(TEXT("_@M823_")), flightstats.Altitude_Base.y_ave*ALTITUDEMODIFY, flightstats.Altitude_Ceiling.y_ave*ALTITUDEMODIFY, Units::GetAltitudeName(), // LKTOKEN _@M165_ = "Ceiling trend" gettext(TEXT("_@M165_")), flightstats.Altitude_Ceiling.m*ALTITUDEMODIFY, Units::GetAltitudeName()); SetDlgItemText(hDlg,IDC_ANALYSISTEXT, Temp); Statistics::RenderBarograph(hdcScreen, rcgfx); } if (page==1) { // LKTOKEN _@M182_ = "Climb" SetDlgItemText(hDlg,IDC_ANALYSISLABEL, gettext(TEXT("_@M182_"))); _stprintf(Temp, TEXT("%s: %3.1f %s\r\n%s: %3.2f %s"), // LKTOKEN _@M117_ = "Average climb rate" gettext(TEXT("_@M117_")), flightstats.ThermalAverage.y_ave*LIFTMODIFY, Units::GetVerticalSpeedName(), // LKTOKEN _@M181_ = "Climb trend" gettext(TEXT("_@M181_")), flightstats.ThermalAverage.m*LIFTMODIFY, Units::GetVerticalSpeedName() ); SetDlgItemText(hDlg,IDC_ANALYSISTEXT, Temp); Statistics::RenderClimb(hdcScreen, rcgfx); } if (page==2) { // LKTOKEN _@M820_ = "Wind at Altitude" SetDlgItemText(hDlg,IDC_ANALYSISLABEL, gettext(TEXT("_@M820_"))); _stprintf(Temp, TEXT(" ")); SetDlgItemText(hDlg,IDC_ANALYSISTEXT, Temp); Statistics::RenderWind(hdcScreen, rcgfx); } if (page==3) { // LKTOKEN _@M325_ = "Glide Polar" SetDlgItemText(hDlg,IDC_ANALYSISLABEL, gettext(TEXT("_@M325_"))); _stprintf(Temp, TEXT("%s: %3.1f %s %3.0f %s\r\n%s: %3.2f %s %s %3.0f %s"), // LKTOKEN _@M140_ = "Best LD" gettext(TEXT("_@M140_")), GlidePolar::bestld, gettext(TEXT("at")), GlidePolar::Vbestld*SPEEDMODIFY, Units::GetHorizontalSpeedName(), // LKTOKEN _@M437_ = "Min sink" gettext(TEXT("_@M437_")), GlidePolar::minsink*LIFTMODIFY, Units::GetVerticalSpeedName(), gettext(TEXT("at")), GlidePolar::Vminsink*SPEEDMODIFY, Units::GetHorizontalSpeedName()); SetDlgItemText(hDlg,IDC_ANALYSISTEXT, Temp); Statistics::RenderGlidePolar(hdcScreen, rcgfx); } if (page==4) { // LKTOKEN _@M701_ = "Temp trace" SetDlgItemText(hDlg,IDC_ANALYSISLABEL, gettext(TEXT("_@M701_"))); _stprintf(Temp, TEXT("%s: %5.0f\r\n%s: %5.0f\r\n"), // LKTOKEN _@M714_ = "Thermal height" gettext(TEXT("_@M714_")), CuSonde::thermalHeight*ALTITUDEMODIFY, // LKTOKEN _@M187_ = "Cloud base" gettext(TEXT("_@M187_")), CuSonde::cloudBase*ALTITUDEMODIFY); SetDlgItemText(hDlg,IDC_ANALYSISTEXT, Temp); Statistics::RenderTemperature(hdcScreen, rcgfx); } SelectObject(hdcScreen, hfOld); EndPaint(hDlg, &ps); return FALSE; case WM_CLOSE: MapWindow::RequestFastRefresh(); ClearAirspaceWarnings(false); // airspace warning gets refreshed FullScreen(); } return FALSE; }
void CDuiFrameWnd::Notify( TNotifyUI& msg ) { if (msg.sType == DUI_MSGTYPE_SELECTCHANGED) { CTreeViewUI* pTree = static_cast<CTreeViewUI*>(m_PaintManager.FindControl(_T("treePlaylist"))); if(pTree && -1 != pTree->GetItemIndex(msg.pSender) && U_TAG_PLAYLIST == msg.pSender->GetTag()) { m_iPlaylistIndex = pTree->GetItemIndex(msg.pSender); Play(m_cPlayList.GetPlaylist(GetPlaylistIndex(m_iPlaylistIndex)).szFileName); //(static_cast<CTreeNodeUI*> (msg.pSender))->GetItemText(); } } else if(msg.sType == DUI_MSGTYPE_SELECTCHANGED) { CDuiString strName = msg.pSender->GetName(); CTabLayoutUI* pTab = static_cast<CTabLayoutUI*>(m_PaintManager.FindControl(_T("tabCaption"))); std::vector<CDuiString> vctString; vctString.push_back(_T("tabPlay")); vctString.push_back(_T("tabLib")); vctString.push_back(_T("tabFind")); vctString.push_back(_T("tabMine")); vctString.push_back(_T("tabCloud")); std::vector<CDuiString>::iterator it = std::find(vctString.begin(), vctString.end(), strName); if (vctString.end() != it) { int iIndex = it - vctString.begin(); pTab->SelectItem(iIndex); // 加载网页 // 由于加载网页会耗很多内存,所以这里选择动态加载 if (iIndex > 0) { std::vector<CDuiString> vctName, vctURL; CActiveXUI* pActiveXUI; vctName.push_back(_T("ActiveXLib")); vctName.push_back(_T("ActiveXFind")); vctName.push_back(_T("ActiveXMine")); vctName.push_back(_T("ActiveXCloud")); vctURL.push_back(_T("http://pianku.xmp.kankan.com/moviestore_index.html")); vctURL.push_back(_T("http://search.xmp.kankan.com/index4xmp.shtml")); vctURL.push_back(_T("http://pianku.xmp.kankan.com/xmpguess/host.html")); vctURL.push_back(_T("http://vod.xunlei.com/page/xmp/home/home.html?init=1")); iIndex--; pActiveXUI = static_cast<CActiveXUI*>(m_PaintManager.FindControl(vctName[iIndex])); if(pActiveXUI) { IWebBrowser2* pWebBrowser = NULL; pActiveXUI->GetControl(IID_IWebBrowser2, (void**)&pWebBrowser); if(pWebBrowser) { _bstr_t bstrTmp; BSTR bstr; pWebBrowser->get_LocationURL(&bstr); bstrTmp.Attach(bstr); if (! bstrTmp.length()) { pWebBrowser->Navigate(_bstr_t(vctURL[iIndex]), NULL,NULL,NULL,NULL); pWebBrowser->Release(); } } } } } } else if(msg.sType == DUI_MSGTYPE_ITEMCLICK) { CDuiString strName = msg.pSender->GetName(); if (strName == _T("menuSequence")) { m_emPlayMode = EM_PLAY_MODE_SEQUENCE; } else if (strName == _T("menuRandom")) { m_emPlayMode = EM_PLAY_MODE_RANDOM; } else if (strName == _T("menuSingleCircle")) { m_emPlayMode = EM_PLAY_MODE_SINGLE_CIRCLE; } } else if( msg.sType == DUI_MSGTYPE_DBCLICK ) { if (IsInStaticControl(msg.pSender)) { // 这里会传进来很多次双击消息,所以只获取祖先控件的消息 if (! msg.pSender->GetParent()) { FullScreen(! m_bFullScreenMode); } } } __super::Notify(msg); }
BOOL CFlashPlayerDlg::PreTranslateMessage(MSG* pMsg) { int const wmId = LOWORD(pMsg->wParam); if (pMsg->message == s_uTBBC) { if (!g_pTaskbarList) { HRESULT hr = CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&g_pTaskbarList)); if (SUCCEEDED(hr)) { hr = g_pTaskbarList->HrInit(); if (FAILED(hr)) { g_pTaskbarList->Release(); g_pTaskbarList = NULL; } if(g_pTaskbarList) { hImglist = ImageList_LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_BITMAP_96), 16, 0, RGB(255,0,255), IMAGE_BITMAP, LR_CREATEDIBSECTION); if (hImglist) { hr = g_pTaskbarList->ThumbBarSetImageList(this->m_hWnd, hImglist); if (SUCCEEDED(hr)) { THUMBBUTTON buttons[2] = {}; buttons[0].dwMask = THB_BITMAP | THB_FLAGS; buttons[0].dwFlags = THBF_ENABLED; buttons[0].iId = IDTB_PLAY_PAUSE; if(IsFlashPlaying()) buttons[0].iBitmap = 1; else buttons[0].iBitmap = 0; g_pTaskbarList->ThumbBarAddButtons(this->m_hWnd, 1, buttons); } g_pTaskbarList->SetProgressState(this->m_hWnd, TBPF_NORMAL); ImageList_Destroy(hImglist); } } } } } else if(pMsg->message == WM_COMMAND && (wmId == IDTB_PLAY_PAUSE)) { if(IsFlashPlaying()) pFlashPtr->Stop(); else pFlashPtr->Play(); UpdateThumbnailToolbar(m_hWnd); } else { switch(pMsg->message) { case WM_NCRBUTTONDOWN: { if(pMsg->wParam == HTMAXBUTTON || pMsg->wParam == HTMINBUTTON || pMsg->wParam == HTCLOSE) break; m_popmenu.GetSubMenu(0).TrackPopupMenu(TPM_LEFTALIGN, LOWORD(pMsg->lParam), HIWORD(pMsg->lParam), m_hWnd); return TRUE; } case WM_SYSCHAR: if (pMsg->wParam == 13) FullScreen(); break; case WM_KEYDOWN: SendMessage(CMD_KEYDOWN, CMD_KEY, pMsg->wParam ); if(pMsg->wParam == 13) return TRUE; break; case WM_LBUTTONDOWN: POINT point; GetCursorPos(&point); if(m_fs && m_showctrl) { if(point.y < m_scr_height - 16) break; if(point.x < 5 || point.x > m_scr_width - 5) break; m_changing = true; double pos = (double)(point.x - 5) / (double) (m_scr_width - 10); pFlashPtr->GotoFrame((long)(m_fnumber * pos)); pFlashPtr->Play(); m_changing = false; return TRUE; } break; case WM_RBUTTONDOWN: if(!m_rmenu) { SendMessage(CMD_KEYDOWN, CMD_KEY, WM_RBUTTONDOWN ); return TRUE; } break; case WM_MOUSEMOVE: { if(!m_fs) break; ShowCursor(TRUE); SetTimer(TIMER_HIDE_CURSOR, 2000, NULL); POINT point; GetCursorPos(&point); if(!m_showctrl && point.y >= m_scr_height - 20) { m_control.MoveWindow(0,m_scr_height - 16,m_scr_width,20); m_showctrl = true; } else if(m_showctrl && point.y < m_scr_height - 20) { m_control.MoveWindow(0,m_scr_height,m_scr_width,20); m_showctrl = false; } break; } } } return CWindow::IsDialogMessage(pMsg); }
LRESULT CFlashPlayerDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { // center the dialog on the screen CenterWindow(); // set icons HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR); SetIcon(hIcon, TRUE); HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR); SetIcon(hIconSmall, FALSE); // register object for message filtering and idle updates CMessageLoop* pLoop = _Module.GetMessageLoop(); ATLASSERT(pLoop != NULL); pLoop->AddMessageFilter(this); pLoop->AddIdleHandler(this); UIAddChildWindowContainer(m_hWnd); if(m_applang == 2) m_popmenu.LoadMenu(IDR_MENU_FLASH_EN); else if(m_applang == 3 || m_applang == 4) m_popmenu.LoadMenu(IDR_MENU_FLASH_TC); else m_popmenu.LoadMenu(IDR_MENU_FLASH); s_uTBBC = RegisterWindowMessage(L"TaskbarButtonCreated"); HINSTANCE user32 = GetModuleHandle(L"user32.dll"); if(user32) ChangeWindowMessageFilterDLL = (ChangeWindowMessageFilterFunction)GetProcAddress(user32, "ChangeWindowMessageFilter"); if(ChangeWindowMessageFilterDLL) { ChangeWindowMessageFilterDLL(s_uTBBC, MSGFLT_ADD); ChangeWindowMessageFilterDLL(WM_COMMAND, MSGFLT_ADD); } m_wndFlashPlayer.Attach(GetDlgItem(IDC_SHOCKWAVEFLASH)); m_control.Attach(GetDlgItem(IDC_SLIDER_CONTROL)); m_wndFlashPlayer.QueryControl(&pFlashPtr); m_control.SetRange(0, 100); m_inited = true; if(m_ontop) ::SetWindowPos(this->m_hWnd,HWND_TOPMOST,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE); SetTimer(0, 300, 0); DoDataExchange(); LoadConfig(); pFlashPtr->put_Loop(FALSE); if(m_playlist.GetSize() > 0) { m_current = 0; PlayFile(); if(m_fs_init) FullScreen(true); } return TRUE; }
// @brief : コンストラクタ // @param : 幅 // : 高さ // : フルスクリーンにするのか // : ウィンドウクラス //-------------------------------------------------------------------- DirectX9::DirectX9( float _width, float _height, bool _is_full, HWND _window ) : IRenderer(_width,_height,new _2d::FactoryDx9, new _3d::FactoryDx9, new effect::FactoryDx9), Device(direct3d_device), window(_window) { // Direct3Dオブジェクトの生成 if( !CreateDirect3D() ) return ; // クライアント領域作成 D3DPRESENT_PARAMETERS d3dpp = ( _is_full ) ? FullScreen() : Window(); // 描画,頂点計算をGPUで行う if( !DeviceHALSoftware( _window, d3dpp ) ) { // 描画をGPU,頂点計算をCPUで行う if( !DeviceHALSoftware( _window, d3dpp ) ) { // 描画,頂点計算をCPUで行う if( !DeviceREFSoftware( _window, d3dpp ) ) { // Graphic 9がありません MessageBox( _window, "このPCはDirectX 9に対応していません", "エラー", MB_OK ); return ; } } } // レンダーステートの設定 direct3d_device->SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW ); direct3d_device->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE ); direct3d_device->SetRenderState( D3DRS_BLENDOP, D3DBLENDOP_ADD ); direct3d_device->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA ); direct3d_device->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA ); // サンプラーステートの設定 direct3d_device->SetSamplerState( 0, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP ); direct3d_device->SetSamplerState( 0, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP ); direct3d_device->SetSamplerState( 0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR ); direct3d_device->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR ); // テクスチャステートメントの設定 direct3d_device->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE ); direct3d_device->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE ); direct3d_device->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_CURRENT ); // Node解放順序の制御 TextureManagerDx9::Instance(); XFileManagerDx9::Instance(); PMDNoBoneManagerDx9::Instance(); // 行列スタックの初期化 { D3DXMATRIX mtx; D3DXMatrixIdentity(&mtx); m_Matrix.push(mtx); } #if _DEBUG // デバック表示の準備 const HRESULT hr = D3DXCreateFont( direct3d_device, 18, 0, 0, 0, FALSE, SHIFTJIS_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, "Terminal", &m_DebugFont ); _ASSERT( SUCCEEDED( hr ) ); #endif }
void CClientMain::OnBtnFullScreen() { //ShowWindow(SW_HIDE); FullScreen(); }
void PreloadInitialisation(bool ask) { LKReadLanguageFile(szLanguageFile); if (ask) { // Load default profile and status file: we are at an early stage LKProfileResetDefault(); LKProfileLoad(startAircraftFile); LKProfileLoad(startPilotFile); LKProfileLoad(startDeviceFile); LKProfileLoad(startProfileFile); LKProfileInitRuntime(); } else { // We are in the dialog startup phase FullScreen(); short retstartup; do { retstartup=dlgStartupShowModal(); } while (retstartup>0); if (retstartup<0) return; if (_tcscmp(startProfileFile,_T("PROFILE_RESET"))==0) { StartupStore(_T(". USER ASKED FOR PROFILE FULL RESET!%s"),NEWLINE); DoStatusMessage(MsgToken(1757)); // LK8000 PROFILES RESET LKProfileResetDefault(); // Notice: this is also resetting the default Aircraft and Pilot profiles to demo settings } else { if (!LKProfileLoad(startPilotFile)) { #if TESTBENCH StartupStore(_T(". PilotFile RESET to defaults%s"),NEWLINE); #endif } if (!LKProfileLoad(startDeviceFile)) { #if TESTBENCH StartupStore(_T(". DeviceFile RESET to defaults%s"),NEWLINE); #endif } if (!LKProfileLoad(startAircraftFile)) { #if TESTBENCH StartupStore(_T(". AircraftFile RESET to defaults%s"),NEWLINE); #endif } if(!LKProfileLoad(startProfileFile)) { #if TESTBENCH StartupStore(_T(". SystemFile RESET to defaults%s"),NEWLINE); #endif } } LKProfileInitRuntime(); InitLKFonts(); // We are sure that buttons have been created already ButtonLabel::SetFont(MapWindowBoldFont); // font change, we need to reset "Messge Message::InitFont(); // LKTOKEN _@M1206_ "Initialising..." CreateProgressDialog(MsgToken(1206)); } // Interface (before interface) if (!ask) { LKReadLanguageFile(szLanguageFile); InputEvents::readFile(); } InitCustomHardware(); }
LRESULT CFlashPlayerDlg::OnCmdKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { if(wParam != CMD_KEY) return FALSE; if(m_keydowning) return FALSE; m_keydowning = true; CString cmd, value; if(GetKeyCommand(lParam, cmd, value)) { if( cmd == _T("quit")) { pFlashPtr->Stop(); CloseDialog(0); } else if( cmd == _T("pause")) { if(IsFlashPlaying()) pFlashPtr->Stop(); else pFlashPtr->Play(); } else if( cmd == _T("vo_fullscreen")) { FullScreen(); } else if( cmd == _T("vo_ontop")) { if(! m_ontop) { ::SetWindowPos(this->m_hWnd,HWND_TOPMOST,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE); m_ontop = true; } else { ::SetWindowPos(this->m_hWnd,HWND_NOTOPMOST,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE); m_ontop = false; } } else if( cmd == _T("keep_aspect")) { int type; pFlashPtr->get_ScaleMode(&type); if(type == 0) pFlashPtr->put_ScaleMode(1); else if(type == 1) pFlashPtr->put_ScaleMode(2); else if(type == 2) pFlashPtr->put_ScaleMode(3); else if(type == 3) pFlashPtr->put_ScaleMode(4); else pFlashPtr->put_ScaleMode(0); } else if( cmd == _T("seek")) { int val = _ttoi(value); long m_fnow = 0; pFlashPtr->CurrentFrame(&m_fnow); long seek = m_fnow + (val * 5); if(seek > 0 && seek < m_fnumber) { pFlashPtr->GotoFrame(seek); pFlashPtr->Play(); } else if (seek <= 0) { pFlashPtr->GotoFrame(0); pFlashPtr->Play(); } else if (seek >= m_fnumber) { pFlashPtr->GotoFrame(m_fnumber); pFlashPtr->Play(); } } else if( cmd == _T("pt_step")) { int val = _ttoi(value); if(val > 0) OnNext(); else if(val < 0) OnPre(); } } m_keydowning = false; return TRUE; }