Rev 9731 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9731 | Rev 9903 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | (* |
1 | (* |
2 | Copyright 2021, 2022 Anton Krotov |
2 | Copyright 2021-2023 Anton Krotov |
Line 3... | Line 3... | ||
3 | 3 | ||
Line 4... | Line 4... | ||
4 | This file is part of CEdit. |
4 | This file is part of CEdit. |
5 | 5 | ||
Line 29... | Line 29... | ||
29 | btnRight* = btnID - 2; |
29 | btnRight* = btnID - 2; |
30 | tabHeight* = 22; |
30 | tabHeight* = 22; |
31 | curTabHeight = 26; |
31 | curTabHeight = 26; |
32 | scrWidth = 15; |
32 | scrWidth = 15; |
33 | btnCloseColor* = 0EF999FH; |
33 | btnCloseColor* = 0EF999FH; |
- | 34 | modifColor = 0FF0000H; |
|
- | 35 | strLen = 30; |
|
Line 34... | Line 36... | ||
34 | 36 | ||
Line 35... | Line 37... | ||
35 | TYPE |
37 | TYPE |
Line 36... | Line 38... | ||
36 | 38 | ||
37 | tItem = POINTER TO RECORD (List.tItem) |
39 | tItem = POINTER TO RECORD (List.tItem) |
Line 38... | Line 40... | ||
38 | 40 | ||
Line 39... | Line 41... | ||
39 | val: RW.tFileName; |
41 | val: ARRAY strLen + 1 OF CHAR; |
Line 89... | Line 91... | ||
89 | END; |
91 | END; |
90 | K.DrawLine(x, y2, x, y, K.colors.line); |
92 | K.DrawLine(x, y2, x, y, K.colors.line); |
Line 91... | Line 93... | ||
91 | 93 | ||
92 | K.DrawText866bk(x + K.fontWidth + K.fontWidth DIV 2, y + (height - K.fontHeight) DIV 2, textColor, color, s); |
94 | K.DrawText866bk(x + K.fontWidth + K.fontWidth DIV 2, y + (height - K.fontHeight) DIV 2, textColor, color, s); |
93 | IF modified THEN |
95 | IF modified THEN |
94 | K.DrawText866bk(x + K.fontWidth DIV 2, y + (height - K.fontHeight) DIV 2, textColor, color, "*") |
96 | K.DrawText866bk(x + K.fontWidth DIV 2, y + (height - K.fontHeight) DIV 2, modifColor, color, "*") |
95 | END; |
97 | END; |
96 | K.CreateButton(id + ORD({30}) + btnID, x + 1, y - 1, width - 1, height - 1, 0, ""); |
98 | K.CreateButton(id + ORD({30}) + btnID, x + 1, y - 1, width - 1, height - 1, 0, ""); |
97 | left := x + width - btnCloseSize - 5; |
99 | left := x + width - btnCloseSize - 5; |
98 | K.CreateButton(id + btnClose, left, top, btnCloseSize, btnCloseSize, closeColor, ""); |
100 | K.CreateButton(id + btnClose, left, top, btnCloseSize, btnCloseSize, closeColor, ""); |
Line 182... | Line 184... | ||
182 | END; |
184 | END; |
183 | t.freeX := x |
185 | t.freeX := x |
184 | END draw; |
186 | END draw; |
Line -... | Line 187... | ||
- | 187 | ||
- | 188 | ||
- | 189 | PROCEDURE setText (item: tItem; s: ARRAY OF CHAR); |
|
- | 190 | VAR |
|
- | 191 | i: INTEGER; |
|
- | 192 | BEGIN |
|
- | 193 | IF LENGTH(s) > strLen THEN |
|
- | 194 | FOR i := 0 TO strLen - 4 DO |
|
- | 195 | item.val[i] := s[i] |
|
- | 196 | END; |
|
- | 197 | item.val[strLen - 3] := 0X; |
|
- | 198 | U.append8(item.val, "...") |
|
- | 199 | ELSE |
|
- | 200 | COPY(s, item.val) |
|
- | 201 | END |
|
- | 202 | END setText; |
|
185 | 203 | ||
186 | 204 | ||
187 | PROCEDURE add* (t: tTabs; s: ARRAY OF CHAR); |
205 | PROCEDURE add* (t: tTabs; s: ARRAY OF CHAR); |
188 | VAR |
206 | VAR |
189 | item: tItem; |
207 | item: tItem; |
190 | BEGIN |
208 | BEGIN |
191 | NEW(item); |
209 | NEW(item); |
192 | item.val := s; |
210 | setText(item, s); |
193 | item.modified := FALSE; |
211 | item.modified := FALSE; |
Line 194... | Line 212... | ||
194 | List.append(t.strings, item); |
212 | List.append(t.strings, item) |
195 | END add; |
213 | END add; |
Line 210... | Line 228... | ||
210 | PROCEDURE rename* (t: tTabs; n: INTEGER; s: ARRAY OF CHAR); |
228 | PROCEDURE rename* (t: tTabs; n: INTEGER; s: ARRAY OF CHAR); |
211 | VAR |
229 | VAR |
212 | item: List.tItem; |
230 | item: List.tItem; |
213 | BEGIN |
231 | BEGIN |
214 | item := List.getItem(t.strings, n); |
232 | item := List.getItem(t.strings, n); |
215 | item(tItem).val := s |
233 | setText(item(tItem), s) |
216 | END rename; |
234 | END rename; |
Line 217... | Line 235... | ||
217 | 235 | ||
218 | 236 |