410 Sonderspalten in Grids- F2-Fenstern » Historie » Version 1
[X] Lutz G, 19.09.2016 18:08
1 | 1 | [X] Lutz G | h1. Sonderspalten in Grids- F2-Fenstern |
---|---|---|---|
2 | |||
3 | h1. CimColor per SQL |
||
4 | |||
5 | Auflistung weiterer Steuerfelder : [[Sonderfelder im SQL]] |
||
6 | bekannte CimFarb-Konstanten : [[CimColor]] (z.B. CimRed) |
||
7 | Entwicklungs-Tickets : {{collapse(Aufklappen) |
||
8 | #6977 Weitere Farben zur Hervorhebung: CimColor in Grids |
||
9 | #5495 CIM-Farben in Assistenten und dynam. Oberflächen verfügbar machen |
||
10 | #6109 Joined Columns in CimColumnHandler integrieren |
||
11 | }} |
||
12 | |||
13 | Farben per SQL in Prodat werden per Spaltenname und BOOL an bestimmten Oberflächen erzeugt. |
||
14 | Mehrere gleichartige Spaltenbezeichnungen werden interpretiert und bei True dargestellt. |
||
15 | -Gelb gewinnt vor Grün, Rot gewinnt vor Gelb und Grün.- Feldreihenfolge: der Erste mit True gewinnt |
||
16 | |||
17 | Verfügbare Farben: |
||
18 | * CimRed CimYellow CimGreen CimBlue CimBrown CimGray |
||
19 | |||
20 | Verfügbare Oberflächen: |
||
21 | * F2s |
||
22 | * tabellarische Oberflächen (EditTable) |
||
23 | * Assistenten (Stand 06.2016: bei Einigen schon vorhanden, aber soll demnächst bei Allen dran > http://redmine.prodat-sql.de/issues/5495) |
||
24 | * SQL - abfragen |
||
25 | * und überall, wo der TCimColumnHandler angebunden ist |
||
26 | |||
27 | Beispiel: |
||
28 | <pre><code class="sql"> |
||
29 | SELECT 1, true AS CimGreen, false AS CimYellow, false AS CimRed -- Grün |
||
30 | UNION |
||
31 | SELECT 2, false, true, false -- Gelb |
||
32 | UNION |
||
33 | SELECT 3, false, false, true -- Rot |
||
34 | UNION |
||
35 | SELECT 4, true, true, false -- Grün (Gelb überstimmt) |
||
36 | UNION |
||
37 | SELECT 5, true, true, true -- Grün (Gelb und Rot überstimmt) |
||
38 | |||
39 | ORDER BY 1 |
||
40 | </code></pre> |
||
41 | |||
42 | |||
43 | |||
44 | h1. Ausführliche Beschreibung |
||
45 | |||
46 | {{collapse(Aufklappen) |
||
47 | |||
48 | h2. mögliche Felder |
||
49 | |||
50 | <pre> |
||
51 | CimRed CimYellow CimGreen CimBlue CimBrown CimGray |
||
52 | CimColor |
||
53 | CimBold CimItalic |
||
54 | CimFontRed CimFontGreen |
||
55 | CimFormat |
||
56 | </pre> |
||
57 | |||
58 | * Gültigkeit: ganzzeilig |
||
59 | * Gültigkeit: Spalte oder Zelle mit Feldname als Präfix "field_format" (z.B. ak_nr_cimred) |
||
60 | * Auswertung: das erste Vorkommen (ungleich NULL, FALSE und '') hat immer Vorrang |
||
61 | ** es gilt die Erstellungsreihenfolge der Columns -> stimmt aber meistens mit der Reihenfolge der SQL-Felder überein (Daten aus Cache des Grids) |
||
62 | * doppelt gejoint möglich (cimred, cimred_1, cimred_2 bis cimred_3) |
||
63 | |||
64 | |||
65 | |||
66 | h2. Parameter für CimFormat (das Präfix "Cim" kann entfallen) |
||
67 | |||
68 | <pre> |
||
69 | CimRed CimYellow CimGreen CimBlue CimBrown CimGray + CimDarkRed CimOrange CimDarkOrange CimLightBlue CimDarkBlue |
||
70 | clBlack clMaroon clGreen clOlive clNavy clPurple clTeal clGray clSilver clRed clLime clYellow clBlue clFuchsia clAqua clLtGray clDkGray clWhite clMoneyGreen clSkyBlue clCream clMedGray clInfoBk clHotLight |
||
71 | CimColor |
||
72 | CimBold CimItalic |
||
73 | CimFontRed CimFontGreen |
||
74 | CimFontName/Font |
||
75 | CimFontSize/Size |
||
76 | </pre> |
||
77 | |||
78 | * Mehrere Angaben per *Komma* getrennt. |
||
79 | * @'cimred=True'@, @'cimred'@ (nur für Booleanwerte und gilt als True) oder @'cimred=:ag_done'@ (Referenz auf Booleanspalte) |
||
80 | * ebefalls ganzzeilig und zellenweise möglich ("field_format -> ak_nr_cimred=True) |
||
81 | * ungültige/unbekannte Formatnamen werden ignoriert (nichts ins Log geschrieben, da je ein Aufruf pro gezeichneter Zelle) |
||
82 | |||
83 | |||
84 | |||
85 | h2. Werte für CimColor |
||
86 | |||
87 | * @CimRed CimYellow CimGreen CimBlue CimGray + CimOrange CimDarkOrange CimDarkRed CimDarkBlue@ |
||
88 | * @clBlack clGreen clGray clSilver clRed@ uvm. (siehe http://docwiki.embarcadero.com/Libraries/XE7/de/Vcl.Graphics.TColor) |
||
89 | * @'#RRGGBB'@ oder @'#RGB'@ (HTML/CSS, siehe Tabelle mit RGB-Farbwerten https://meta.wikimedia.org/wiki/Wiki_color_formatting_help http://html-color-codes.info/webfarben_hexcodes/) |
||
90 | * @'$BBGGRR'@, @'Dezimal'@ oder @Dezimal@ (TColor/Integer/Float) |
||
91 | * @x'BBGGRR'::INT@ = DB-seitig HEX zu INT konvertiert |
||
92 | |||
93 | |||
94 | |||
95 | h2. Datentypen der DB-Felder |
||
96 | |||
97 | * CimColor/Color = Integer oder Text |
||
98 | * CimFormat = Text |
||
99 | * CimFontName = Text (z.B. Arial oder Microsoft Sans Serif -> siehe charmap.exe) |
||
100 | * CimFontSize = Integer (Default = 9) |
||
101 | * alles Andere = Boolean oder ':field' (verlinkung mit anderem Booleanfeld) |
||
102 | |||
103 | |||
104 | |||
105 | h2. Beispiele |
||
106 | |||
107 | * Reihenfolge |
||
108 | |||
109 | <pre><code class="sql"> |
||
110 | SELECT 'rot ' AS a, true AS cimred, true AS cimgreen; |
||
111 | |||
112 | SELECT 'grün' AS a, true AS cimgreen, true AS cimred; |
||
113 | </code></pre> |
||
114 | |||
115 | * Zeile oder Zelle/Spalte |
||
116 | |||
117 | <pre><code class="sql"> |
||
118 | SELECT 1 AS a, 2 AS b, 3 AS c, true AS cimred, false AS b_cimred -- ganze Zeile |
||
119 | UNION |
||
120 | SELECT 1 AS a, 2 AS b, 3 AS c, false AS cimred, true AS b_cimred -- nur B |
||
121 | </code></pre> |
||
122 | |||
123 | * Konkatenieren für CimFormat |
||
124 | |||
125 | <pre><code class="sql"> |
||
126 | SELECT 1 AS a, concat_ws(',', |
||
127 | 'cimgreen', |
||
128 | IfThen(true, 'bold', null), |
||
129 | IfThen(false, 'fontsize=4', null) |
||
130 | ) AS CimFormat --'cimgreen,bold' AS CimFormat |
||
131 | </code></pre> |
||
132 | |||
133 | * Alles das Gleiche (mehrere Varianten zur Übergabe von CimRed) |
||
134 | |||
135 | <pre><code class="sql"> |
||
136 | SELECT 1 AS aaa, true AS xxx, |
||
137 | true AS cimred, --xxx AS cimred, |
||
138 | ':xxx' AS cimred, |
||
139 | concat_ws(',', |
||
140 | 'red', |
||
141 | 'cimred', |
||
142 | 'cimred=True', |
||
143 | 'cimred=:xxx', |
||
144 | IfThen(true, 'cimred', null) --IfThen(xxx, 'cimred', null) |
||
145 | ) AS cimformat |
||
146 | </code></pre> |
||
147 | |||
148 | * Definition der Farbwerte |
||
149 | |||
150 | <pre><code class="sql"> |
||
151 | SELECT |
||
152 | 'A' AS a, '$0000FF' AS a_cimcolor, |
||
153 | 'B' AS b, x'0000FF'::INT AS b_cimcolor, -- 255 AS b_cimcolor |
||
154 | 'C' AS c, '#FF0000' AS c_cimcolor, |
||
155 | 'D' AS d, 'clRed' AS d_cimcolor, |
||
156 | 'E' AS e, 'CimRed' AS e_cimcolor, |
||
157 | 'Z' AS z, NULL::INT AS z_cimcolor |
||
158 | </code></pre> |
||
159 | |||
160 | * Megademo |
||
161 | !CCHMegademo.png! |
||
162 | |||
163 | <pre><code class="sql"> |
||
164 | SELECT |
||
165 | a, b, c, a=1 AS CimRed, 'Size=5' AS a_CimFormat, |
||
166 | b=5 AS b_CimBlue, IfThen(b=8, x'FFAAFF'::INT, null)::INT AS b_CimColor, --IfThen macht aus dem INT ein DECIMAL |
||
167 | 'cimgreen,bold' AS c_CimFormat |
||
168 | FROM ( |
||
169 | SELECT 1 AS a, 2 AS b, 3 AS c |
||
170 | UNION |
||
171 | SELECT 4, 5, 6 |
||
172 | UNION |
||
173 | SELECT 7, 8, 9 |
||
174 | ) AS x |
||
175 | ORDER BY a |
||
176 | </code></pre> |
||
177 | |||
178 | * Megademo (vollständig) |
||
179 | |||
180 | <pre><code class="sql"> |
||
181 | SELECT |
||
182 | a, b, c, |
||
183 | |||
184 | a=1 AS CimRed, a=1 AS CimYellow, false AS CimGreen, false AS CimBlue, false AS CimGray, null::INT AS CimColor, |
||
185 | false AS CimBold, false AS CimItalic, false AS CimFontRed, false AS CimFontGreen, |
||
186 | null::VARCHAR AS CimFormat, |
||
187 | |||
188 | false AS a_CimRed, false AS a_CimYellow, false AS a_CimGreen, false AS a_CimBlue, false AS a_CimGray, null::INT AS a_CimColor, |
||
189 | false AS a_CimBold, false AS a_CimItalic, false AS a_CimFontRed, false AS a_CimFontGreen, |
||
190 | 'Size=5' AS a_CimFormat, |
||
191 | |||
192 | false AS b_CimRed, false AS b_CimYellow, false AS b_CimGreen, b=5 AS b_CimBlue, b=5 AS b_CimGray, IfThen(b=8, x'FFAAFF'::INT, null) AS b_CimColor, |
||
193 | false AS b_CimBold, false AS b_CimItalic, false AS b_CimFontRed, false AS b_CimFontGreen, |
||
194 | null AS b_CimFormat, |
||
195 | |||
196 | false AS c_CimRed, false AS c_CimYellow, false AS c_CimGreen, false AS c_CimBlue, false AS c_CimGray, null::INT AS c_CimColor, |
||
197 | false AS c_CimBold, false AS c_CimItalic, false AS c_CimFontRed, false AS c_CimFontGreen, |
||
198 | concat_ws(',', 'cimgreen', IfThen(true, 'bold', null)) AS c_CimFormat --'cimgreen,bold' AS c_CimFormat |
||
199 | FROM ( |
||
200 | SELECT 1 AS a, 2 AS b, 3 AS c |
||
201 | UNION |
||
202 | SELECT 4, 5, 6 |
||
203 | UNION |
||
204 | SELECT 7, 8, 9 |
||
205 | ) AS x |
||
206 | ORDER BY a |
||
207 | </code></pre> |
||
208 | |||
209 | }} |
||
210 | |||
211 | --- |