void nsDeckFrame::IndexChanged() { //did the index change? int32_t index = GetSelectedIndex(); if (index == mIndex) return; // redraw InvalidateFrame(); // hide the currently showing box nsIFrame* currentBox = GetSelectedBox(); if (currentBox) // only hide if it exists HideBox(currentBox); mIndex = index; #ifdef ACCESSIBILITY nsAccessibilityService* accService = GetAccService(); if (accService) { accService->DeckPanelSwitched(PresContext()->GetPresShell(), mContent, currentBox, GetSelectedBox()); } #endif }
static void OnButtonInstall() { CrashAlwaysIf(gForceCrash); if (gShowOptions) OnButtonOptions(); KillSumatra(); if (!CheckInstallUninstallPossible()) return; WCHAR *userInstallDir = win::GetText(gHwndTextboxInstDir); if (!str::IsEmpty(userInstallDir)) str::ReplacePtr(&gGlobalData.installDir, userInstallDir); free(userInstallDir); // note: this checkbox isn't created if we're already registered as default // (in which case we're just going to re-register) gGlobalData.registerAsDefault = gHwndCheckboxRegisterDefault == nullptr || IsCheckboxChecked(gHwndCheckboxRegisterDefault); // note: this checkbox isn't created when running inside Wow64 gGlobalData.installPdfFilter = gHwndCheckboxRegisterPdfFilter != nullptr && IsCheckboxChecked(gHwndCheckboxRegisterPdfFilter); // note: this checkbox isn't created on Windows 2000 and XP gGlobalData.installPdfPreviewer = gHwndCheckboxRegisterPdfPreviewer != nullptr && IsCheckboxChecked(gHwndCheckboxRegisterPdfPreviewer); // note: this checkbox isn't created if the browser plugin hasn't been installed before gGlobalData.keepBrowserPlugin = gHwndCheckboxKeepBrowserPlugin != nullptr && IsCheckboxChecked(gHwndCheckboxKeepBrowserPlugin); // create a progress bar in place of the Options button RectI rc(0, 0, dpiAdjust(INSTALLER_WIN_DX / 2), gButtonDy); rc = MapRectToWindow(rc, gHwndButtonOptions, gHwndFrame); gHwndProgressBar = CreateWindow(PROGRESS_CLASS, nullptr, WS_CHILD | WS_VISIBLE, rc.x, rc.y, rc.dx, rc.dy, gHwndFrame, 0, GetModuleHandle(nullptr), nullptr); SendMessage(gHwndProgressBar, PBM_SETRANGE32, 0, GetInstallationStepCount()); SendMessage(gHwndProgressBar, PBM_SETSTEP, 1, 0); // disable the install button and remove all the installation options SafeDestroyWindow(&gHwndStaticInstDir); SafeDestroyWindow(&gHwndTextboxInstDir); SafeDestroyWindow(&gHwndButtonBrowseDir); SafeDestroyWindow(&gHwndCheckboxRegisterDefault); SafeDestroyWindow(&gHwndCheckboxRegisterPdfFilter); SafeDestroyWindow(&gHwndCheckboxRegisterPdfPreviewer); SafeDestroyWindow(&gHwndCheckboxKeepBrowserPlugin); SafeDestroyWindow(&gHwndButtonOptions); EnableWindow(gHwndButtonInstUninst, FALSE); SetMsg(_TR("Installation in progress..."), COLOR_MSG_INSTALLATION); InvalidateFrame(); gGlobalData.hThread = CreateThread(nullptr, 0, InstallerThread, nullptr, 0, 0); }
void OnUninstallationFinished() { DestroyWindow(gHwndButtonInstUninst); gHwndButtonInstUninst = NULL; CreateButtonExit(gHwndFrame); SetMsg(TAPP L" has been uninstalled.", gMsgError ? COLOR_MSG_FAILED : COLOR_MSG_OK); gMsgError = gGlobalData.firstError; InvalidateFrame(); CloseHandle(gGlobalData.hThread); }
HRESULT CXFrame::SetBackground2(CXDraw* pDraw) { if(m_pBackground2 == pDraw) return E_FAIL; if(m_pBackground2) { delete m_pBackground2; } m_pBackground2 = pDraw; InvalidateFrame(); return S_OK; }
static void OnButtonUninstall() { KillSumatra(); if (!CheckInstallUninstallPossible()) return; // disable the button during uninstallation EnableWindow(gHwndButtonInstUninst, FALSE); SetMsg(L"Uninstallation in progress...", COLOR_MSG_INSTALLATION); InvalidateFrame(); gGlobalData.hThread = CreateThread(NULL, 0, UninstallerThread, NULL, 0, 0); }
HRESULT CXFrame::MarkRelayout() { if(!m_bNeedRelayout) { if(GetWindow()) { m_pWindow->MarkRelayout(this); InvalidateFrame(); } m_bNeedRelayout = TRUE; } return S_OK; }
NS_IMETHODIMP nsProgressFrame::AttributeChanged(int32_t aNameSpaceID, nsIAtom* aAttribute, int32_t aModType) { NS_ASSERTION(mBarDiv, "Progress bar div must exist!"); if (aNameSpaceID == kNameSpaceID_None && (aAttribute == nsGkAtoms::value || aAttribute == nsGkAtoms::max)) { nsIFrame* barFrame = mBarDiv->GetPrimaryFrame(); NS_ASSERTION(barFrame, "The progress frame should have a child with a frame!"); PresContext()->PresShell()->FrameNeedsReflow(barFrame, nsIPresShell::eResize, NS_FRAME_IS_DIRTY); InvalidateFrame(); } return nsContainerFrame::AttributeChanged(aNameSpaceID, aAttribute, aModType); }
void OnInstallationFinished() { DestroyWindow(gHwndButtonInstUninst); gHwndButtonInstUninst = NULL; DestroyWindow(gHwndProgressBar); gHwndProgressBar = NULL; if (gGlobalData.success) { CreateButtonRunSumatra(gHwndFrame); SetMsg(_TR("Thank you! SumatraPDF has been installed."), COLOR_MSG_OK); } else { CreateButtonExit(gHwndFrame); SetMsg(_TR("Installation failed!"), COLOR_MSG_FAILED); } gMsgError = gGlobalData.firstError; InvalidateFrame(); CloseHandle(gGlobalData.hThread); }
void OnInstallationFinished() { SafeDestroyWindow(&gHwndButtonInstUninst); SafeDestroyWindow(&gHwndProgressBar); if (gGlobalData.success) { CreateButtonRunSumatra(gHwndFrame); SetMsg(_TR("Thank you! SumatraPDF has been installed."), COLOR_MSG_OK); } else { CreateButtonExit(gHwndFrame); SetMsg(_TR("Installation failed!"), COLOR_MSG_FAILED); } gMsgError = gGlobalData.firstError; InvalidateFrame(); CloseHandle(gGlobalData.hThread); if (gGlobalData.autoUpdate && gGlobalData.success) { // click the Start button PostMessage(gHwndFrame, WM_COMMAND, IDOK, 0); } }