wxMaxima
Loading...
Searching...
No Matches
LabelCell.h
1// -*- mode: c++; c-file-style: "linux"; c-basic-offset: 2; indent-tabs-mode: nil -*-
2//
3// Copyright (C) 2004-2015 Andrej Vodopivec <andrej.vodopivec@gmail.com>
4// (C) 2014-2018 Gunter Königsmann <wxMaxima@physikbuch.de>
5//
6// This program is free software; you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation; either version 2 of the License, or
9// (at your option) any later version.
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15//
16//
17// You should have received a copy of the GNU General Public License
18// along with this program; if not, write to the Free Software
19// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20//
21// SPDX-License-Identifier: GPL-2.0+
22
23#ifndef LABELCELL_H
24#define LABELCELL_H
25
26#include "TextCell.h"
27
33//cppcheck-suppress ODR
34class LabelCell final : public TextCell
35{
36public:
38 LabelCell(GroupCell *group,
39 Configuration *config, const wxString &automaticLabel,
40 TextStyle style = TS_MAIN_PROMPT);
41 LabelCell(GroupCell *group, const LabelCell &cell);
42 std::unique_ptr<Cell> Copy(GroupCell *group) const override;
43 const CellTypeInfo &GetInfo() override;
44
45 void Recalculate(AFontSize fontsize) override;
46 void Draw(wxPoint point, wxDC *dc, wxDC *antialiassingDC) override;
47 void SetStyle(TextStyle style) override;
48 wxString ToString() const override;
50 void SetUserDefinedLabel(const wxString &userDefinedLabel);
52 wxString GetXMLFlags() const override;
53 void UpdateDisplayedText() override;
54 const wxString &GetAltCopyText() const override;
55 void SetAltCopyText(const wxString &WXUNUSED(text)) override;
56 wxString ToXML() const override;
57
58private:
59//** Large objects (48 bytes)
60//**
62 wxString m_userDefinedLabel;
63
64//** Bitfield objects (0 bytes)
65//**
66 static void InitBitFields_LabelCell()
67 { // Keep the initialization order below same as the order
68 // of bit fields in this class!
69 }
70};
71
72#endif // LABELCELL_H
TextStyle
All text styles known to wxMaxima.
Definition: TextStyle.h:231
A Type-Safe Fixed-Point Font Size.
Definition: FontAttribs.h:98
A class that carries information about the type of a cell.
Definition: Cell.h:93
The configuration storage for the current worksheet.
Definition: Configuration.h:85
A cell grouping input (and, if there is one, also the output) cell to a foldable item.
Definition: GroupCell.h:74
A label cell.
Definition: LabelCell.h:35
std::unique_ptr< Cell > Copy(GroupCell *group) const override
Create a copy of this cell.
Definition: LabelCell.cpp:49
wxString GetXMLFlags() const override
Returns the XML flags this cell needs in wxMathML.
Definition: LabelCell.cpp:164
void Recalculate(AFontSize fontsize) override
Recalculate the size of the cell and the difference between top and center.
Definition: LabelCell.cpp:172
void SetUserDefinedLabel(const wxString &userDefinedLabel)
Set the automatic label maxima has assigned the current equation.
Definition: LabelCell.cpp:76
void UpdateDisplayedText() override
The text we actually display depends on many factors, unfortunately.
Definition: LabelCell.cpp:81
void SetStyle(TextStyle style) override
Sets the TextStyle of this cell.
Definition: LabelCell.cpp:155
const CellTypeInfo & GetInfo() override
Returns the information about this cell's type.
wxString ToString() const override
Returns the cell's representation as a string.
Definition: LabelCell.cpp:162
wxString ToXML() const override
Convert this cell to a representation fit for saving in a .wxmx file.
Definition: LabelCell.cpp:109
const wxString & GetAltCopyText() const override
Get the text set using SetAltCopyText - may be empty.
Definition: LabelCell.cpp:184
void Draw(wxPoint point, wxDC *dc, wxDC *antialiassingDC) override
Draw this cell.
Definition: LabelCell.cpp:55
A Text cell.
Definition: TextCell.h:38