Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ syntax highlighter for Abaqus, show short filename on tabs
- Loading branch information
Showing
6 changed files
with
139 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/*************************************************************************** | ||
* Copyright (c) 2015 Werner Mayer <wmayer[at]users.sourceforge.net> * | ||
* * | ||
* This file is part of the FreeCAD CAx development system. * | ||
* * | ||
* This library is free software; you can redistribute it and/or * | ||
* modify it under the terms of the GNU Library General Public * | ||
* License as published by the Free Software Foundation; either * | ||
* version 2 of the License, or (at your option) any later version. * | ||
* * | ||
* This library is distributed in the hope that it will be useful, * | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
* GNU Library General Public License for more details. * | ||
* * | ||
* You should have received a copy of the GNU Library General Public * | ||
* License along with this library; see the file COPYING.LIB. If not, * | ||
* write to the Free Software Foundation, Inc., 59 Temple Place, * | ||
* Suite 330, Boston, MA 02111-1307, USA * | ||
* * | ||
***************************************************************************/ | ||
|
||
|
||
#include "PreCompiled.h" | ||
#ifndef _PreComp_ | ||
# include <QRegExp> | ||
#endif | ||
|
||
#include "AbaqusHighlighter.h" | ||
|
||
using namespace FemGui; | ||
|
||
/** | ||
* Constructs a syntax highlighter. | ||
*/ | ||
AbaqusHighlighter::AbaqusHighlighter(QObject* parent) | ||
: SyntaxHighlighter(parent) | ||
{ | ||
} | ||
|
||
/** Destroys this object. */ | ||
AbaqusHighlighter::~AbaqusHighlighter() | ||
{ | ||
} | ||
|
||
void AbaqusHighlighter::highlightBlock(const QString &text) | ||
{ | ||
for (int i = 0; i < text.length(); ++i) { | ||
if (text.mid(i, 2) == QLatin1String("**")) { | ||
setFormat(i, text.length() - i, this->colorByType(SyntaxHighlighter::Comment)); | ||
break; | ||
} | ||
else if (text.mid(i, 1) == QLatin1String("*")) { | ||
setFormat(i, text.length() - i, this->colorByType(SyntaxHighlighter::Defname)); | ||
break; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/*************************************************************************** | ||
* Copyright (c) 2015 Werner Mayer <wmayer[at]users.sourceforge.net> * | ||
* * | ||
* This file is part of the FreeCAD CAx development system. * | ||
* * | ||
* This library is free software; you can redistribute it and/or * | ||
* modify it under the terms of the GNU Library General Public * | ||
* License as published by the Free Software Foundation; either * | ||
* version 2 of the License, or (at your option) any later version. * | ||
* * | ||
* This library is distributed in the hope that it will be useful, * | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
* GNU Library General Public License for more details. * | ||
* * | ||
* You should have received a copy of the GNU Library General Public * | ||
* License along with this library; see the file COPYING.LIB. If not, * | ||
* write to the Free Software Foundation, Inc., 59 Temple Place, * | ||
* Suite 330, Boston, MA 02111-1307, USA * | ||
* * | ||
***************************************************************************/ | ||
|
||
|
||
#ifndef FEMGUI_ABAQUSHIGHLIGHTER_H | ||
#define FEMGUI_ABAQUSHIGHLIGHTER_H | ||
|
||
#include <Gui/SyntaxHighlighter.h> | ||
|
||
namespace FemGui { | ||
|
||
/** | ||
* Syntax highlighter for Abaqus. | ||
* @author Werner Mayer | ||
*/ | ||
class AbaqusHighlighter : public Gui::SyntaxHighlighter | ||
{ | ||
public: | ||
AbaqusHighlighter(QObject* parent); | ||
virtual ~AbaqusHighlighter(); | ||
|
||
protected: | ||
void highlightBlock(const QString &text); | ||
}; | ||
|
||
} // namespace FemGui | ||
|
||
#endif // FEMGUI_ABAQUSHIGHLIGHTER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters