2006-03-05 17:24:44 +00:00
|
|
|
/**
|
2007-08-31 22:37:05 +00:00
|
|
|
* \file GuiDelimiter.cpp
|
2006-03-05 17:24:44 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author John Levon
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
2007-08-31 22:37:05 +00:00
|
|
|
#include "GuiDelimiter.h"
|
2007-04-12 16:49:01 +00:00
|
|
|
|
|
|
|
#include "GuiApplication.h"
|
2008-03-20 00:00:53 +00:00
|
|
|
#include "GuiFontLoader.h"
|
2007-04-22 07:54:36 +00:00
|
|
|
#include "GuiView.h"
|
2006-08-16 14:22:47 +00:00
|
|
|
#include "qt_helpers.h"
|
2008-05-23 08:43:07 +00:00
|
|
|
|
2008-06-02 10:05:29 +00:00
|
|
|
#include "FontEnums.h"
|
2008-05-23 08:43:07 +00:00
|
|
|
#include "FontInfo.h"
|
2008-06-02 10:05:29 +00:00
|
|
|
#include "FuncRequest.h"
|
2008-05-23 08:43:07 +00:00
|
|
|
|
2016-05-05 00:00:57 +00:00
|
|
|
#include "support/debug.h"
|
2008-06-02 10:05:29 +00:00
|
|
|
#include "support/docstring.h"
|
2016-05-05 00:00:57 +00:00
|
|
|
#include "support/gettext.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2006-08-16 14:22:47 +00:00
|
|
|
#include <QPixmap>
|
|
|
|
#include <QCheckBox>
|
2007-04-05 12:12:07 +00:00
|
|
|
#include <QListWidgetItem>
|
2006-08-16 14:22:47 +00:00
|
|
|
|
2008-06-02 10:05:29 +00:00
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
|
2007-12-12 10:16:00 +00:00
|
|
|
using namespace std;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2008-06-02 10:05:29 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
2007-10-04 17:35:27 +00:00
|
|
|
static char const * latex_delimiters[] = {
|
|
|
|
"(", ")", "{", "}", "[", "]",
|
|
|
|
"lceil", "rceil", "lfloor", "rfloor", "langle", "rangle",
|
2012-12-16 14:49:42 +00:00
|
|
|
"llbracket", "rrbracket",
|
2007-10-04 17:35:27 +00:00
|
|
|
"uparrow", "updownarrow", "Uparrow", "Updownarrow", "downarrow", "Downarrow",
|
|
|
|
"|", "Vert", "/", "backslash", ""
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static int const nr_latex_delimiters =
|
|
|
|
sizeof(latex_delimiters) / sizeof(char const *);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
static QString const bigleft[] = {"", "bigl", "Bigl", "biggl", "Biggl"};
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
static QString const bigright[] = {"", "bigr", "Bigr", "biggr", "Biggr"};
|
2006-08-16 14:22:47 +00:00
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
static char const * const biggui[] = {
|
|
|
|
N_("big[[delimiter size]]"),
|
|
|
|
N_("Big[[delimiter size]]"),
|
|
|
|
N_("bigg[[delimiter size]]"),
|
|
|
|
N_("Bigg[[delimiter size]]"),
|
|
|
|
""
|
|
|
|
};
|
2006-08-16 14:22:47 +00:00
|
|
|
|
|
|
|
|
2007-04-18 09:44:24 +00:00
|
|
|
// FIXME: It might be better to fix the big delim LFUN to not require
|
|
|
|
// additional '\' prefix.
|
2007-09-05 20:33:29 +00:00
|
|
|
static QString fix_name(QString const & str, bool big)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2007-04-17 20:04:15 +00:00
|
|
|
if (str.isEmpty())
|
2006-03-05 17:24:44 +00:00
|
|
|
return ".";
|
2007-04-07 02:07:15 +00:00
|
|
|
if (!big || str == "(" || str == ")" || str == "[" || str == "]"
|
|
|
|
|| str == "|" || str == "/")
|
2007-04-06 15:57:32 +00:00
|
|
|
return str;
|
2006-08-16 14:22:47 +00:00
|
|
|
|
2007-04-11 00:27:35 +00:00
|
|
|
return "\\" + str;
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
2008-06-02 10:05:29 +00:00
|
|
|
struct MathSymbol {
|
|
|
|
MathSymbol(char_type uc = '?', unsigned char fc = 0,
|
|
|
|
FontFamily ff = SYMBOL_FAMILY)
|
|
|
|
: unicode(uc), fontcode(fc), fontfamily(ff)
|
|
|
|
{}
|
|
|
|
char_type unicode;
|
|
|
|
unsigned char fontcode;
|
|
|
|
FontFamily fontfamily;
|
|
|
|
};
|
|
|
|
|
|
|
|
/// TeX-name / Math-symbol map.
|
|
|
|
static map<std::string, MathSymbol> math_symbols_;
|
|
|
|
/// Math-symbol / TeX-name map.
|
|
|
|
/// This one is for fast search, it contains the same data as
|
|
|
|
/// \c math_symbols_.
|
|
|
|
static map<char_type, string> tex_names_;
|
2007-04-12 16:49:01 +00:00
|
|
|
|
2008-06-02 10:05:29 +00:00
|
|
|
void initMathSymbols()
|
|
|
|
{
|
|
|
|
// FIXME: Ideally, those unicode codepoints would be defined
|
|
|
|
// in "lib/symbols". Unfortunately, some of those are already
|
|
|
|
// defined with non-unicode ids for use within mathed.
|
|
|
|
// FIXME 2: We should fill-in this map with the parsed "symbols"
|
|
|
|
// file done in MathFactory.cpp.
|
2015-05-04 23:33:16 +00:00
|
|
|
math_symbols_["("] = MathSymbol('(', 40, CMR_FAMILY);
|
|
|
|
math_symbols_[")"] = MathSymbol(')', 41, CMR_FAMILY);
|
|
|
|
math_symbols_["{"] = MathSymbol('{', 102, CMSY_FAMILY);
|
|
|
|
math_symbols_["}"] = MathSymbol('}', 103, CMSY_FAMILY);
|
|
|
|
math_symbols_["["] = MathSymbol('[', 91, CMR_FAMILY);
|
|
|
|
math_symbols_["]"] = MathSymbol(']', 93, CMR_FAMILY);
|
|
|
|
math_symbols_["|"] = MathSymbol('|', 106, CMSY_FAMILY);
|
|
|
|
math_symbols_["/"] = MathSymbol('/', 47, CMR_FAMILY);
|
2008-06-02 10:05:29 +00:00
|
|
|
math_symbols_["backslash"] = MathSymbol('\\', 110, CMSY_FAMILY);
|
|
|
|
math_symbols_["lceil"] = MathSymbol(0x2308, 100, CMSY_FAMILY);
|
|
|
|
math_symbols_["rceil"] = MathSymbol(0x2309, 101, CMSY_FAMILY);
|
|
|
|
math_symbols_["lfloor"] = MathSymbol(0x230A, 98, CMSY_FAMILY);
|
|
|
|
math_symbols_["rfloor"] = MathSymbol(0x230B, 99, CMSY_FAMILY);
|
|
|
|
math_symbols_["langle"] = MathSymbol(0x2329, 104, CMSY_FAMILY);
|
|
|
|
math_symbols_["rangle"] = MathSymbol(0x232A, 105, CMSY_FAMILY);
|
2012-12-16 14:49:42 +00:00
|
|
|
math_symbols_["llbracket"] = MathSymbol(0x27e6, 74, STMARY_FAMILY);
|
|
|
|
math_symbols_["rrbracket"] = MathSymbol(0x27e7, 75, STMARY_FAMILY);
|
2008-06-02 10:05:29 +00:00
|
|
|
math_symbols_["uparrow"] = MathSymbol(0x2191, 34, CMSY_FAMILY);
|
|
|
|
math_symbols_["Uparrow"] = MathSymbol(0x21D1, 42, CMSY_FAMILY);
|
|
|
|
math_symbols_["updownarrow"] = MathSymbol(0x2195, 108, CMSY_FAMILY);
|
|
|
|
math_symbols_["Updownarrow"] = MathSymbol(0x21D5, 109, CMSY_FAMILY);
|
|
|
|
math_symbols_["downarrow"] = MathSymbol(0x2193, 35, CMSY_FAMILY);
|
|
|
|
math_symbols_["Downarrow"] = MathSymbol(0x21D3, 43, CMSY_FAMILY);
|
|
|
|
math_symbols_["downdownarrows"] = MathSymbol(0x21CA, 184, MSA_FAMILY);
|
|
|
|
math_symbols_["downharpoonleft"] = MathSymbol(0x21C3, 188, MSA_FAMILY);
|
|
|
|
math_symbols_["downharpoonright"] = MathSymbol(0x21C2, 186, MSA_FAMILY);
|
|
|
|
math_symbols_["vert"] = MathSymbol(0x007C, 106, CMSY_FAMILY);
|
|
|
|
math_symbols_["Vert"] = MathSymbol(0x2016, 107, CMSY_FAMILY);
|
|
|
|
|
|
|
|
map<string, MathSymbol>::const_iterator it = math_symbols_.begin();
|
|
|
|
map<string, MathSymbol>::const_iterator end = math_symbols_.end();
|
|
|
|
for (; it != end; ++it)
|
|
|
|
tex_names_[it->second.unicode] = it->first;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// \return the math unicode symbol associated to a TeX name.
|
|
|
|
MathSymbol const & mathSymbol(string tex_name)
|
|
|
|
{
|
|
|
|
map<string, MathSymbol>::const_iterator it =
|
|
|
|
math_symbols_.find(tex_name);
|
|
|
|
|
2013-10-07 22:59:05 +00:00
|
|
|
static MathSymbol const unknown_symbol;
|
2008-06-02 10:05:29 +00:00
|
|
|
if (it == math_symbols_.end())
|
|
|
|
return unknown_symbol;
|
|
|
|
|
|
|
|
return it->second;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// \return the TeX name associated to a math unicode symbol.
|
|
|
|
string const & texName(char_type math_symbol)
|
|
|
|
{
|
|
|
|
map<char_type, string>::const_iterator it =
|
|
|
|
tex_names_.find(math_symbol);
|
|
|
|
|
2013-10-07 22:59:05 +00:00
|
|
|
static string const empty_string;
|
2008-06-02 10:05:29 +00:00
|
|
|
if (it == tex_names_.end())
|
|
|
|
return empty_string;
|
|
|
|
|
|
|
|
return it->second;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // anon namespace
|
2007-10-04 17:35:27 +00:00
|
|
|
|
|
|
|
|
2007-11-23 09:44:02 +00:00
|
|
|
GuiDelimiter::GuiDelimiter(GuiView & lv)
|
2008-06-02 10:05:29 +00:00
|
|
|
: GuiDialog(lv, "mathdelimiter", qt_("Math Delimiter"))
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
setupUi(this);
|
|
|
|
|
2006-08-16 14:22:47 +00:00
|
|
|
connect(closePB, SIGNAL(clicked()), this, SLOT(accept()));
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-04-05 12:12:07 +00:00
|
|
|
setFocusProxy(leftLW);
|
2007-04-19 12:25:58 +00:00
|
|
|
|
|
|
|
leftLW->setViewMode(QListView::IconMode);
|
|
|
|
rightLW->setViewMode(QListView::IconMode);
|
2007-05-28 22:27:45 +00:00
|
|
|
|
2010-10-15 07:12:49 +00:00
|
|
|
leftLW->setDragDropMode(QAbstractItemView::NoDragDrop);
|
|
|
|
rightLW->setDragDropMode(QAbstractItemView::NoDragDrop);
|
|
|
|
|
2008-06-02 10:05:29 +00:00
|
|
|
initMathSymbols();
|
|
|
|
|
2016-03-13 00:51:15 +00:00
|
|
|
FontInfo lyxfont;
|
|
|
|
lyxfont.setFamily(CMR_FAMILY);
|
|
|
|
QFontMetrics fm(frontend::getFont(lyxfont));
|
|
|
|
QSize item_size(fm.maxWidth(), fm.height() + 8);
|
|
|
|
|
2007-12-12 19:28:07 +00:00
|
|
|
typedef map<char_type, QListWidgetItem *> ListItems;
|
2007-04-12 16:49:01 +00:00
|
|
|
ListItems list_items;
|
2007-04-05 09:26:09 +00:00
|
|
|
// The last element is the empty one.
|
2007-04-12 16:49:01 +00:00
|
|
|
int const end = nr_latex_delimiters - 1;
|
|
|
|
for (int i = 0; i < end; ++i) {
|
|
|
|
string const delim = latex_delimiters[i];
|
2007-10-07 20:34:09 +00:00
|
|
|
MathSymbol const & ms = mathSymbol(delim);
|
2007-04-12 16:49:01 +00:00
|
|
|
QString symbol(ms.fontcode?
|
|
|
|
QChar(ms.fontcode) : toqstr(docstring(1, ms.unicode)));
|
|
|
|
QListWidgetItem * lwi = new QListWidgetItem(symbol);
|
|
|
|
lyxfont.setFamily(ms.fontfamily);
|
2015-05-03 11:23:27 +00:00
|
|
|
QFont font = frontend::getFont(lyxfont);
|
|
|
|
lwi->setFont(font);
|
|
|
|
lwi->setToolTip(toqstr(delim));
|
2016-03-13 00:51:15 +00:00
|
|
|
lwi->setSizeHint(item_size);
|
2016-05-05 00:00:57 +00:00
|
|
|
switch (ms.fontfamily) {
|
|
|
|
case CMSY_FAMILY:
|
|
|
|
case STMARY_FAMILY:
|
|
|
|
// Hack to work around the broken metrics of these fonts
|
|
|
|
// FIXME: Better fix the fonts or use fonts that are not broken
|
|
|
|
lwi->setTextAlignment(Qt::AlignTop | Qt::AlignHCenter);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
lwi->setTextAlignment(Qt::AlignCenter);
|
|
|
|
}
|
2007-04-12 16:49:01 +00:00
|
|
|
list_items[ms.unicode] = lwi;
|
2007-04-19 08:22:41 +00:00
|
|
|
leftLW->addItem(lwi);
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
2007-04-19 08:22:41 +00:00
|
|
|
for (int i = 0; i != leftLW->count(); ++i) {
|
2007-10-07 20:34:09 +00:00
|
|
|
MathSymbol const & ms = mathSymbol(
|
2007-04-19 08:22:41 +00:00
|
|
|
fromqstr(leftLW->item(i)->toolTip()));
|
|
|
|
rightLW->addItem(list_items[doMatch(ms.unicode)]->clone());
|
2007-04-12 16:49:01 +00:00
|
|
|
}
|
2007-04-19 08:22:41 +00:00
|
|
|
|
2007-04-12 16:49:01 +00:00
|
|
|
// The last element is the empty one.
|
2015-05-03 11:23:27 +00:00
|
|
|
QListWidgetItem * lwi = new QListWidgetItem(qt_("(None)"));
|
|
|
|
QListWidgetItem * rwi = new QListWidgetItem(qt_("(None)"));
|
|
|
|
leftLW->addItem(lwi);
|
|
|
|
rightLW->addItem(rwi);
|
2006-08-16 14:22:47 +00:00
|
|
|
|
2006-12-10 10:07:31 +00:00
|
|
|
sizeCO->addItem(qt_("Variable"));
|
2006-09-12 01:17:03 +00:00
|
|
|
|
2006-08-16 14:22:47 +00:00
|
|
|
for (int i = 0; *biggui[i]; ++i)
|
|
|
|
sizeCO->addItem(qt_(biggui[i]));
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-04-05 12:12:07 +00:00
|
|
|
on_leftLW_currentRowChanged(0);
|
2007-09-05 20:33:29 +00:00
|
|
|
bc().setPolicy(ButtonPolicy::IgnorantPolicy);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-10-07 20:34:09 +00:00
|
|
|
char_type GuiDelimiter::doMatch(char_type const symbol)
|
2007-09-05 20:33:29 +00:00
|
|
|
{
|
2007-10-07 20:34:09 +00:00
|
|
|
string const & str = texName(symbol);
|
2007-09-05 20:33:29 +00:00
|
|
|
string match;
|
|
|
|
if (str == "(") match = ")";
|
|
|
|
else if (str == ")") match = "(";
|
|
|
|
else if (str == "[") match = "]";
|
|
|
|
else if (str == "]") match = "[";
|
|
|
|
else if (str == "{") match = "}";
|
|
|
|
else if (str == "}") match = "{";
|
|
|
|
else if (str == "l") match = "r";
|
|
|
|
else if (str == "rceil") match = "lceil";
|
|
|
|
else if (str == "lceil") match = "rceil";
|
|
|
|
else if (str == "rfloor") match = "lfloor";
|
|
|
|
else if (str == "lfloor") match = "rfloor";
|
|
|
|
else if (str == "rangle") match = "langle";
|
|
|
|
else if (str == "langle") match = "rangle";
|
2012-12-16 14:49:42 +00:00
|
|
|
else if (str == "llbracket") match = "rrbracket";
|
|
|
|
else if (str == "rrbracket") match = "llbracket";
|
2007-09-05 20:33:29 +00:00
|
|
|
else if (str == "backslash") match = "/";
|
|
|
|
else if (str == "/") match = "backslash";
|
|
|
|
else return symbol;
|
|
|
|
|
2007-10-07 20:34:09 +00:00
|
|
|
return mathSymbol(match).unicode;
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-10-07 20:34:09 +00:00
|
|
|
void GuiDelimiter::updateTeXCode(int size)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2007-04-18 09:44:24 +00:00
|
|
|
bool const bigsize = size != 0;
|
2007-04-17 20:04:15 +00:00
|
|
|
|
2007-04-18 09:44:24 +00:00
|
|
|
QString left_str = fix_name(leftLW->currentItem()->toolTip(), bigsize);
|
|
|
|
QString right_str = fix_name(rightLW->currentItem()->toolTip(), bigsize);
|
2007-04-17 20:04:15 +00:00
|
|
|
|
|
|
|
if (!bigsize)
|
|
|
|
tex_code_ = left_str + ' ' + right_str;
|
|
|
|
else {
|
2007-04-18 09:44:24 +00:00
|
|
|
tex_code_ = bigleft[size] + ' '
|
2007-05-28 22:27:45 +00:00
|
|
|
+ left_str + ' '
|
2007-04-18 09:44:24 +00:00
|
|
|
+ bigright[size] + ' '
|
2007-04-17 20:04:15 +00:00
|
|
|
+ right_str;
|
2007-04-18 09:44:24 +00:00
|
|
|
}
|
2007-04-17 20:04:15 +00:00
|
|
|
|
2007-04-18 09:44:24 +00:00
|
|
|
// Generate TeX-code for GUI display.
|
|
|
|
// FIXME: Instead of reconstructing the TeX code it would be nice to
|
|
|
|
// FIXME: retrieve the LateX code directly from mathed.
|
|
|
|
// In all cases, we want the '\' prefix if needed, so we pass 'true'
|
|
|
|
// to fix_name.
|
2007-04-17 20:04:15 +00:00
|
|
|
left_str = fix_name(leftLW->currentItem()->toolTip(), true);
|
|
|
|
right_str = fix_name(rightLW->currentItem()->toolTip(), true);
|
2007-04-18 09:44:24 +00:00
|
|
|
QString code_str;
|
2007-04-17 20:04:15 +00:00
|
|
|
if (!bigsize)
|
2007-04-18 09:44:24 +00:00
|
|
|
code_str = "\\left" + left_str + " \\right" + right_str;
|
2007-04-17 20:04:15 +00:00
|
|
|
else {
|
2007-04-18 09:44:24 +00:00
|
|
|
// There should be nothing in the TeX-code when the delimiter is "None".
|
|
|
|
if (left_str != ".")
|
|
|
|
code_str = "\\" + bigleft[size] + left_str + ' ';
|
|
|
|
if (right_str != ".")
|
|
|
|
code_str += "\\" + bigright[size] + right_str;
|
2007-04-17 20:04:15 +00:00
|
|
|
}
|
|
|
|
|
2007-04-18 19:52:32 +00:00
|
|
|
texCodeL->setText(qt_("TeX Code: ") + code_str);
|
2007-04-17 20:04:15 +00:00
|
|
|
}
|
|
|
|
|
2007-04-18 09:44:24 +00:00
|
|
|
|
2007-10-07 20:34:09 +00:00
|
|
|
void GuiDelimiter::on_insertPB_clicked()
|
2007-04-17 20:04:15 +00:00
|
|
|
{
|
|
|
|
if (sizeCO->currentIndex() == 0)
|
2008-06-02 10:05:29 +00:00
|
|
|
dispatch(FuncRequest(LFUN_MATH_DELIM, fromqstr(tex_code_)));
|
2007-04-17 20:04:15 +00:00
|
|
|
else {
|
|
|
|
QString command = '"' + tex_code_ + '"';
|
|
|
|
command.replace(' ', "\" \"");
|
2008-06-02 10:05:29 +00:00
|
|
|
dispatch(FuncRequest(LFUN_MATH_BIGDELIM, fromqstr(command)));
|
2007-05-28 22:27:45 +00:00
|
|
|
}
|
2007-04-17 20:04:15 +00:00
|
|
|
}
|
|
|
|
|
2007-05-28 22:27:45 +00:00
|
|
|
|
2007-10-07 20:34:09 +00:00
|
|
|
void GuiDelimiter::on_sizeCO_activated(int index)
|
2007-04-17 20:04:15 +00:00
|
|
|
{
|
|
|
|
updateTeXCode(index);
|
2007-04-05 12:12:07 +00:00
|
|
|
}
|
|
|
|
|
2006-08-16 14:22:47 +00:00
|
|
|
|
2007-10-07 20:34:09 +00:00
|
|
|
void GuiDelimiter::on_leftLW_itemActivated(QListWidgetItem *)
|
2007-04-05 12:12:07 +00:00
|
|
|
{
|
2009-03-15 15:53:17 +00:00
|
|
|
// do not auto-apply if !matchCB->isChecked()
|
2009-03-15 13:15:24 +00:00
|
|
|
if (!matchCB->isChecked())
|
|
|
|
return;
|
2007-04-17 20:04:15 +00:00
|
|
|
on_insertPB_clicked();
|
2007-04-05 12:39:22 +00:00
|
|
|
accept();
|
|
|
|
}
|
2007-04-05 12:12:07 +00:00
|
|
|
|
2007-04-05 12:39:22 +00:00
|
|
|
|
2007-10-07 20:34:09 +00:00
|
|
|
void GuiDelimiter::on_rightLW_itemActivated(QListWidgetItem *)
|
2007-04-05 12:39:22 +00:00
|
|
|
{
|
2009-03-15 15:53:17 +00:00
|
|
|
// do not auto-apply if !matchCB->isChecked()
|
2009-03-15 13:15:24 +00:00
|
|
|
if (!matchCB->isChecked())
|
|
|
|
return;
|
2007-04-17 20:04:15 +00:00
|
|
|
on_insertPB_clicked();
|
2007-04-05 12:12:07 +00:00
|
|
|
accept();
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-10-07 20:34:09 +00:00
|
|
|
void GuiDelimiter::on_leftLW_currentRowChanged(int item)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2007-04-05 12:12:07 +00:00
|
|
|
if (matchCB->isChecked())
|
|
|
|
rightLW->setCurrentRow(item);
|
2007-04-06 15:57:32 +00:00
|
|
|
|
2007-04-17 20:04:15 +00:00
|
|
|
updateTeXCode(sizeCO->currentIndex());
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-10-07 20:34:09 +00:00
|
|
|
void GuiDelimiter::on_rightLW_currentRowChanged(int item)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2007-04-05 12:12:07 +00:00
|
|
|
if (matchCB->isChecked())
|
|
|
|
leftLW->setCurrentRow(item);
|
2007-04-06 15:57:32 +00:00
|
|
|
|
2007-04-17 20:04:15 +00:00
|
|
|
updateTeXCode(sizeCO->currentIndex());
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-10-07 20:34:09 +00:00
|
|
|
void GuiDelimiter::on_matchCB_stateChanged(int state)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2006-08-16 14:22:47 +00:00
|
|
|
if (state == Qt::Checked)
|
2007-04-05 12:12:07 +00:00
|
|
|
on_leftLW_currentRowChanged(leftLW->currentRow());
|
2007-04-18 09:44:24 +00:00
|
|
|
|
|
|
|
updateTeXCode(sizeCO->currentIndex());
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
2006-08-16 14:22:47 +00:00
|
|
|
|
2007-11-23 09:44:02 +00:00
|
|
|
Dialog * createGuiDelimiter(GuiView & lv) { return new GuiDelimiter(lv); }
|
2007-10-07 20:34:09 +00:00
|
|
|
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
2006-05-18 08:51:12 +00:00
|
|
|
|
2008-11-14 14:28:50 +00:00
|
|
|
#include "moc_GuiDelimiter.cpp"
|