Autor |
Beitrag |
Csharp-programmierer
Beiträge: 696
Erhaltene Danke: 10
Windows 8.1
C# (VS 2013)
|
Verfasst: Sa 25.03.17 10:56
Achsoo, vielen Dank. Ich habe jetzt eine DLL erzeugt, aber da ich in dem Projekt bereits die alte Version des ScintillaNETs habe, weigert sich VS die neue Version aufzunehmen, weil die bereits existiert. Wie kann ich die alte Version (den alten Verweis) löschen?
_________________ "Wer keinen Sinn im Leben sieht, ist nicht nur unglücklich, sondern kaum lebensfähig" - Albert Einstein
|
|
Frühlingsrolle
Ehemaliges Mitglied
Erhaltene Danke: 1
|
Verfasst: Sa 25.03.17 11:28
- Nachträglich durch die Entwickler-Ecke gelöscht -
|
|
Csharp-programmierer
Beiträge: 696
Erhaltene Danke: 10
Windows 8.1
C# (VS 2013)
|
Verfasst: Sa 25.03.17 11:41
Vielen Dank, jetzt habe ich die neue Version. Jetzt habe ich auch als Lexer Jason. Hier ist der Quelltext zum Konstruieren des Scintillas:
C#-Quelltext 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
| Scintilla scintilla = new Scintilla(); scintilla.Lexer = Lexer.Html; scintilla.Dock = DockStyle.Fill; scintilla.BorderStyle = BorderStyle.None;
scintilla.SetKeywords(1, "function alert");
scintilla.StyleResetDefault(); scintilla.Styles[Style.Default].Font = Programmeinstellungen.Editor_Font.Name; scintilla.Styles[Style.Default].Size = (int)Programmeinstellungen.Editor_Font.Size; scintilla.StyleClearAll();
scintilla.Styles[Style.Html.Default].ForeColor = Color.White; scintilla.Styles[Style.Html.Default].BackColor = BackgroundColor; scintilla.Styles[Style.Html.Default].FillLine = true;
scintilla.Styles[Style.Json.Keyword].ForeColor = Color.Blue; scintilla.Styles[Style.Json.Keyword].BackColor = BackgroundColor; scintilla.Styles[Style.Json.LdKeyword].Bold = true;
scintilla.Styles[Style.Default].BackColor = BackgroundColor; |
Es funktioniert aber immer noch nicht :/
_________________ "Wer keinen Sinn im Leben sieht, ist nicht nur unglücklich, sondern kaum lebensfähig" - Albert Einstein
|
|
Frühlingsrolle
Ehemaliges Mitglied
Erhaltene Danke: 1
|
Verfasst: So 26.03.17 00:40
- Nachträglich durch die Entwickler-Ecke gelöscht -
|
|
Csharp-programmierer
Beiträge: 696
Erhaltene Danke: 10
Windows 8.1
C# (VS 2013)
|
Verfasst: So 26.03.17 09:01
Oh man, so langsam fange ich an zu verzweifeln. Ich habe es jetzt so gemacht, wie du gesagt hast
C#-Quelltext 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27:
| Scintilla scintilla = new Scintilla(); scintilla.Dock = DockStyle.Fill; scintilla.Tag = (string)file; scintilla.CaretForeColor = Color.White; scintilla.BorderStyle = BorderStyle.None;
scintilla.StyleResetDefault(); scintilla.Styles[Style.Default].Font = Programmeinstellungen.Editor_Font.Name; scintilla.Styles[Style.Default].Size = (int)Programmeinstellungen.Editor_Font.Size; scintilla.StyleClearAll();
scintilla.Styles[Style.Html.Script].BackColor = BackColor; scintilla.Styles[Style.Html.Script].FillLine = true; scintilla.Styles[Style.Html.Script].ForeColor = Color.White;
using (StreamReader reader = new StreamReader(file)) { scintilla.Text = reader.ReadToEnd(); reader.Close(); }
scintilla.Lexer = Lexer.Html; scintilla.SetKeywords(1, "function alert { } var");
Scintillas.Add(file, scintilla); |
Aber es will einfach nicht funktionieren
_________________ "Wer keinen Sinn im Leben sieht, ist nicht nur unglücklich, sondern kaum lebensfähig" - Albert Einstein
|
|
Frühlingsrolle
Ehemaliges Mitglied
Erhaltene Danke: 1
|
Verfasst: So 26.03.17 09:25
- Nachträglich durch die Entwickler-Ecke gelöscht -
|
|
Csharp-programmierer
Beiträge: 696
Erhaltene Danke: 10
Windows 8.1
C# (VS 2013)
|
Verfasst: So 26.03.17 09:43
Ich setze jetzt ersten die Lexer und dann die Keywords, den Text lese ich zum Schluss ein. Es passiert aber immer noch nichts
_________________ "Wer keinen Sinn im Leben sieht, ist nicht nur unglücklich, sondern kaum lebensfähig" - Albert Einstein
|
|
Th69
Beiträge: 4777
Erhaltene Danke: 1054
Win10
C#, C++ (VS 2017/19/22)
|
Verfasst: So 26.03.17 09:52
Hallo,
am besten du probierst ersteinmal die ScintillaNET.Demo aus, ob diese bei dir funktioniert. Und dann schaust du dir die Unterschiede zu deinem Programmcode an (sonst wird das wohl hier noch ein Endlos-Thema).
Als weitere Alternative entferne (bzw. auskommentiere) ersteinmal deine ganzen eigenen Style-Anpassungen und schau, was der Lexer.Html standardmäßig schon anzeigt (jetzt, wo du ja eine neuere Version hast).
|
|
Csharp-programmierer
Beiträge: 696
Erhaltene Danke: 10
Windows 8.1
C# (VS 2013)
|
Verfasst: So 26.03.17 18:09
Vielen Dank, der JavaScript Code wird in der HTML Datei jetzt richtig dargestellt. Nun brauch ich aber ein Scintilla für PHP. Dieses Scintilla muss HTML und PHP "können". Als Lexer lege ich HTML fest, definiere aber Styles auch für PHP, dann setze ich die Lexer auf HTML und zum Schluss setze ich die Keywords
C#-Quelltext 1:
| scintilla.SetKeywords(4, "$_GET $_POST <?php ?>"); |
Aber er färbt die eingegebenen Keywords nicht :/
EDIT: An sich funktioniert es jetzt schon mit den Styles von PHP, aber nur dann, wenn das Scintilla erstellt wird. Wenn ich eine neue Variable bsp. eingebe, wird diese noch nicht gefärbt. Wenn ich dies aber speichere und neu öffne, wird sie gefärbt. Also jetzt funktioniert es, aber nicht automatisch. Woran liegt das?
_________________ "Wer keinen Sinn im Leben sieht, ist nicht nur unglücklich, sondern kaum lebensfähig" - Albert Einstein
|
|
Csharp-programmierer
Beiträge: 696
Erhaltene Danke: 10
Windows 8.1
C# (VS 2013)
|
Verfasst: So 26.03.17 18:17
Danke an alle Helfer, jetzt funktioniert es
_________________ "Wer keinen Sinn im Leben sieht, ist nicht nur unglücklich, sondern kaum lebensfähig" - Albert Einstein
|
|
Th69
Beiträge: 4777
Erhaltene Danke: 1054
Win10
C#, C++ (VS 2017/19/22)
|
Verfasst: Mo 27.03.17 09:04
Es wäre schön, wenn du dann den betreffenden Code hier posten würdest, damit andere auch etwas von der Lösung haben.
|
|