Permalink
Browse files

SynEdit's SQL highlighter provides a sample source text. Display that…

… text in the preferences editor panel for SQL colors.
  • Loading branch information...
ansgarbecker committed Nov 26, 2017
1 parent 7a9d367 commit 09e6942f7b7d17b66066e74d823ae548b0b5f15b
Showing with 2 additions and 8 deletions.
  1. +2 −8 source/options.pas
View
@@ -424,14 +424,8 @@ procedure Toptionsform.FormCreate(Sender: TObject);
// SQL
EnumFontFamilies(Canvas.Handle, nil, @EnumFixedProc, LPARAM(Pointer(comboSQLFontName.Items)));
comboSQLFontName.Sorted := True;
SynMemoSQLSample.Text := 'SELECT DATE_SUB(NOW(), INTERVAL 1 DAY),' + CRLF +
#9'''String literal'' AS lit' + CRLF +
'FROM tableA AS ta -- A comment' + CRLF +
'WHERE `columnA` IS NULL; # More comment' + CRLF +
CRLF +
'CREATE TABLE /*!32312 IF NOT EXISTS*/ tableB' + CRLF +
#9'(id INT, name VARCHAR(30) DEFAULT "standard")';
SynSQLSynSQLSample.TableNames.CommaText := 'tableA,tableB';
SynMemoSQLSample.Text := SynMemoSQLSample.Highlighter.SampleSource;
SynSQLSynSQLSample.TableNames.CommaText := 't,sample';
for i:=0 to SynSQLSynSQLSample.AttrCount - 1 do begin
SynSQLSynSQLSample.Attribute[i].AssignColorAndStyle(MainForm.SynSQLSyn1.Attribute[i]);
comboSQLColElement.Items.Add(SynSQLSynSQLSample.Attribute[i].FriendlyName);

0 comments on commit 09e6942

Please sign in to comment.