/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #include #include #include BrowserHeader::BrowserHeader( BrowseBox* pParent, WinBits nWinBits ) :HeaderBar( pParent, nWinBits ) ,_pBrowseBox( pParent ) { tools::Long nHeight = pParent->IsZoom() ? pParent->CalcZoom(pParent->GetTitleHeight()) : pParent->GetTitleHeight(); SetPosSizePixel( Point( 0, 0), Size( pParent->GetOutputSizePixel().Width(), nHeight ) ); Show(); } BrowserHeader::~BrowserHeader() { disposeOnce(); } void BrowserHeader::dispose() { _pBrowseBox.clear(); HeaderBar::dispose(); } void BrowserHeader::Command( const CommandEvent& rCEvt ) { if ( !GetCurItemId() && CommandEventId::ContextMenu == rCEvt.GetCommand() ) { Point aPos( rCEvt.GetMousePosPixel() ); if ( _pBrowseBox->IsFrozen(0) ) aPos.AdjustX(_pBrowseBox->GetColumnWidth(0) ); _pBrowseBox->GetDataWindow().Command( CommandEvent( Point( aPos.X(), aPos.Y() - GetSizePixel().Height() ), CommandEventId::ContextMenu, rCEvt.IsMouseEvent() ) ); } } void BrowserHeader::EndDrag() { // call before other actions, it looks more nice in most cases HeaderBar::EndDrag(); PaintImmediately(); // not aborted? sal_uInt16 nId = GetCurItemId(); if ( !nId ) return; // handle column? if ( nId == USHRT_MAX-1 ) nId = 0; if ( !IsItemMode() ) { // column resize _pBrowseBox->SetColumnWidth( nId, GetItemSize( nId ) ); _pBrowseBox->ColumnResized( nId ); SetItemSize( nId, _pBrowseBox->GetColumnWidth( nId ) ); } else { // column drag // did the position actually change? // take the handle column into account sal_uInt16 nOldPos = _pBrowseBox->GetColumnPos(nId), nNewPos = GetItemPos( nId ); if (_pBrowseBox->GetColumnId(0) == BrowseBox::HandleColumnId) nNewPos++; if (nOldPos != nNewPos) { _pBrowseBox->SetColumnPos( nId, nNewPos ); _pBrowseBox->ColumnMoved( nId ); } } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ llabora/co-24.04.6'>distro/collabora/co-24.04.6 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2024-05-06loplugin:ostr basicNoel Grandin
2024-05-02use more OUString literal in getBasicTypeNameNoel Grandin
2024-04-09tdf#147132 Flatten Basic function implementationsTuukka Orava
2024-03-27tdf#147132: Flatten Basic function implementationsU-Aarons_Laptop\Aaron
2024-02-13tdf#154285 Check upper bound of arguments in SbRtl_CurDirAdam Seskunas
2024-02-09tdf#147132 tdf#154285 basic: Flatten and check param count of Is* fnsAron Budea
2023-10-13tdf#147132 tdf#154285 Flatten and check param count of IsMissing fnAron Budea
2023-10-07tdf#147132 Flatten Basic function implementationsOmkarAcharekar
2023-09-10using decls should come after #includeNoel Grandin
2023-08-09tdf#147132 Flatten Basic function implementationssahil
2023-03-23rtl::Static to thread-safe-staticNoel Grandin
2023-03-22tdf#147132: Simplify usage of StarBASIC::Error()adityasingh22
2023-03-22Refactor and fix VBA StrConvMike Kaganski
2023-03-14elide some temporary OStringsNoel Grandin
2023-03-07no need to allocate these separatelyNoel Grandin
2023-03-03lok: macro: VBA message dialogs was causing assertion failureMarco Cecchetti
2023-01-20tdf#147132 Flatten Basic function implementationsRadhey Parekh
2022-09-25tdf#151012 - Initialize optional parameters with their default valuesAndreas Heinisch
2022-09-05BASIC : missing parameter check in SbRtl_CreateObjectArnaud VERSINI
2022-07-20move wintypes.hxx from tools to vclChris Sherlock
2022-07-13tdf#147132 Flatten a Basic functionRoman Kuznetsov
2022-06-24tdf#147529 - BASIC MsgBox: Check for missing optional parametersAndreas Heinisch
2022-06-03tdf#147132 Flatten Basic functionRoman Kuznetsov
2022-06-03tdf#147132 Flatten Basic functionRoman Kuznetsov
2022-05-30tdf#147132 Flatten Basic function implementationRoman Kuznetsov
2022-05-10fix --disable-scripting buildCaolán McNamara
2022-05-09Unify and simplify SbRtl_Hex and SbRtl_OctMike Kaganski
2022-05-09Use usual 1899-12-30 base Date in BasicMike Kaganski
2022-05-09sal_Int32 cast to tools::Long to pass to a function taking sal_Int32Mike Kaganski
2022-05-01use more string_view in variousNoel Grandin
2022-04-29use more string_view in INetURLObjectNoel Grandin
2022-04-21tdf#148651: implement VBA.FormatPercentJulien Nabet
2022-04-03tdf#147132 Flatten Basic function implementationsofftkp
2022-02-22tdf#147132: Flatten Basic function implementationsRamreiso Kashung
2022-02-06tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macroVaibhavMalik4187
2022-02-06We know the length hereMike Kaganski
2022-02-02SbRtl_Spc is exactly the same as SbRtl_SpaceMike Kaganski
2022-02-02Use OUStringBuffer in SbRtl_FormatNumberMike Kaganski
2022-01-30tdf#132388: reimplement fix for tdf#142487Mike Kaganski
2022-01-13Recheck modules [a-c]* with IWYUGabor Kelemen