Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/LibreOffice/sc/source/ui/inc/   (Office von Apache Version 25.8.3.2©)  Datei vom 5.10.2025 mit Größe 3 kB image not shown  

Quelle  condformatdlg.hxx   Sprache: C

 
/* -*- 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/.
 */


#pragma once

#include <rangelst.hxx>
#include "condformatdlgdata.hxx"
#include "condformatdlgentry.hxx"

#include "anyrefdg.hxx"

#include <memory>

#define DLG_RET_ADD         8
#define DLG_RET_EDIT        16

class ScDocument;
class ScConditionalFormat;
class ScViewData;

class ScCondFormatDlg;

class ScCondFormatList
{
private:
    std::unique_ptr<weld::ScrolledWindow> mxScrollWindow;
    std::unique_ptr<weld::Grid> mxGrid;

    typedef std::vector<std::unique_ptr<ScCondFrmtEntry>> EntryContainer;
    EntryContainer maEntries;

    bool mbFrozen;
    bool mbNewEntry;

    ScDocument& mrDoc;
    ScAddress maPos;
    ScRangeList maRanges;
    ScCondFormatDlg* mpDialogParent;

public:
    ScCondFormatList(ScCondFormatDlg* pParent,
                     ScDocument& rDoc,
                     std::unique_ptr<weld::ScrolledWindow> xWindow,
                     std::unique_ptr<weld::Grid> xGrid);
    weld::Grid* GetGrid() { return mxGrid.get(); }
    ~ScCondFormatList();

    void init(const ScConditionalFormat* pFormat,
        const ScRangeList& rRanges, const ScAddress& rPos,
        condformat::dialog::ScCondFormatDialogType eType);

    void SetRange(const ScRangeList& rRange);

    std::unique_ptr<ScConditionalFormat> GetConditionalFormat() const;
    weld::Window* GetFrameWeld();
    void Freeze() { mbFrozen = true; }
    void Thaw() { mbFrozen = false; }
    void RecalcAll();

    DECL_LINK( AddBtnHdl, weld::Button&, void );
    DECL_LINK( RemoveBtnHdl, weld::Button&, void );
    DECL_LINK( UpBtnHdl, weld::Button&, void );
    DECL_LINK( DownBtnHdl, weld::Button&, void );
    DECL_LINK( EntrySelectHdl, ScCondFrmtEntry&, void );

    DECL_LINK( TypeListHdl, weld::ComboBox&, void );
    DECL_LINK( AfterTypeListHdl, void*, void );
    DECL_LINK( ColFormatTypeHdl, weld::ComboBox&, void );
    DECL_LINK( AfterColFormatTypeHdl, void*, void );
};

class ScCondFormatDlg : public ScAnyRefDlgController
{
private:
    sal_uInt32 mnKey;

    ScAddress maPos;
    ScViewData& mrViewData;

    std::shared_ptr<ScCondFormatDlgData> mpDlgData;

    OUString msBaseTitle;

    formula::RefEdit* mpLastEdit;
    std::unique_ptr<weld::Button> mxBtnOk;
    std::unique_ptr<weld::Button> mxBtnAdd;
    std::unique_ptr<weld::Button> mxBtnRemove;
    std::unique_ptr<weld::Button> mxBtnUp;
    std::unique_ptr<weld::Button> mxBtnDown;
    std::unique_ptr<weld::Button> mxBtnCancel;
    std::unique_ptr<weld::Label> mxFtRange;
    std::unique_ptr<formula::RefEdit> mxEdRange;
    std::unique_ptr<formula::RefButton> mxRbRange;
    std::unique_ptr<ScCondFormatList> mxCondFormList;

    void updateTitle();
    DECL_LINK( EdRangeModifyHdl, formula::RefEdit&, void );
protected:

    virtual void RefInputDone( bool bForced = false ) override;
    void OkPressed();
    void CancelPressed();

public:
    ScCondFormatDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pWindow,
                                 ScViewData& rViewData, const std::shared_ptr<ScCondFormatDlgData>& rItem);
    virtual ~ScCondFormatDlg() override;

    std::unique_ptr<ScConditionalFormat> GetConditionalFormat() const;

    virtual void SetReference(const ScRange&, ScDocument&) override;
    virtual bool IsRefInputMode() const override;
    virtual void SetActive() override;
    virtual bool IsTableLocked() const override;
    virtual void Close() override;

    void InvalidateRefData();
    void OnSelectionChange(size_t nIndex, size_t nSize, bool bSelected = true);

    DECL_LINK( BtnPressedHdl, weld::Button&, void );
    DECL_LINK( RangeGetFocusHdl, formula::RefEdit&, void );
};

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Messung V0.5
C=98 H=100 G=98

¤ Dauer der Verarbeitung: 0.16 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.