void Viewer::ZoomToggleFullSizeDefaultZoom() { if (m_viewPort.ZoomMode() != m_cfg.View.DefaultZoomMode) { ZoomMode(m_cfg.View.DefaultZoomMode); } else { ZoomMode(ZoomFullSize); } }
void Cu2::SecondaryAttack() { if(firemode==FIREMODE_SCOPE) ZoomMode(); if(firemode==FIREMODE_GLAUNCHER) GrenadeLauncher(); }
void Viewer::ActiveImage(Img::Image::Ptr pImage) { if (m_viewPort.Image() == pImage) { return; } m_viewPort.Image(pImage); if (m_cfg.View.ResetZoom) { ZoomMode(m_cfg.View.DefaultZoomMode); UpdateImageInformation(); } else { ImageChanged(); } }
void Viewer::ZoomDefault() { ZoomMode(m_cfg.View.DefaultZoomMode); }
bool Viewer::Init(const std::string params) { m_dropTarget = new DropTarget(this); m_normalRect = wxToRect(GetRect()); Bind(wxEVT_CLOSE_WINDOW, [&](wxCloseEvent& evt) { PerformOnClose(); evt.Skip(); }); ViewportBuilder b; b.BuildViewport(m_viewPort, this, m_cfg); m_adjust = std::make_shared<Adjust>(this); m_adjust->OnChange.connect([this](int a, int b, int c) { AdjustChange(a, b, c); }); m_mouseMap.AddAction(MouseFullscreen, [this](Win::MouseEvent) { ToggleFullscreenMode(); }); m_mouseMap.AddAction(MouseToggleFullSizeDefaultZoom, [&](Win::MouseEvent) { ZoomToggleFullSizeDefaultZoom(); }); m_mouseMap.AddAction(MouseNextImage, [this](Win::MouseEvent) { ImageNext(1); }); m_mouseMap.AddAction(MousePrevImage, [this](Win::MouseEvent) { ImagePrev(1); }); m_mouseMap.AddAction(MouseZoomIn, [this](Win::MouseEvent) { ZoomIn(); }); m_mouseMap.AddAction(MouseZoomOut, [this](Win::MouseEvent) { ZoomOut(); }); m_mouseMap.AddAction(MouseContext, [this](Win::MouseEvent e) { ShowContextMenu(e); }); m_mouseMap.AddAction(MouseRotateLeft, [this](Win::MouseEvent) { RotateLeft(); }); m_mouseMap.AddAction(MouseRotateRight, [this](Win::MouseEvent) { RotateRight(); }); m_contextMenu.Construct(this); m_keys.Construct(this); m_keys.SetBindings(m_cfg.Keyboard); m_lang = Intl::OnLanguageChanged.connect([&]() { UpdateImageInformation(); }); m_cacher.SetCodecFactoryStore(m_codecs); UpdateViewportConfig(); // Apply some settings that can't be set automatically UpdateMemoryLimits(); m_cacher.MessageTarget(this); // TODO: FIXME: This is very wrong, should be set to something that isn't hardcoded. m_cacher.SetMaximumResolutionHint(Geom::SizeInt(25600, 25600)); m_folderMonitor.OnEvent.connect([this](IO::FileEvent e) { AddNotification(e); }); m_cacher.WrapAround(m_cfg.View.BrowseWrapAround); AlwaysOnTop(m_cfg.View.AlwaysOnTop); ZoomMode(m_cfg.View.DefaultZoomMode); if (m_cfg.View.Maximized) { m_doMaximize = true; } m_viewPort.Init(); m_statusBar = CreateStatusBar(7); int widths[] = { StatFieldZoomWidth, -1, StatFieldImageDimWidth, StatFieldPosWidth, StatFieldTimeWidth, StatFieldFileSizeWidth, StatFieldLastModified }; m_statusBar->SetStatusWidths(7, widths); m_statusBar->Show(m_cfg.View.ShowStatusBar); SetImageLocation(params); SetDropTarget(m_dropTarget); return true; }