~ubuntu-branches/ubuntu/vivid/lazarus/vivid

« back to all changes in this revision

Viewing changes to components/synunihighlighter/synunidesigner.pas

  • Committer: Package Import Robot
  • Author(s): Paul Gevers, Abou Al Montacir, Paul Gevers
  • Date: 2014-02-22 10:25:57 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20140222102557-ors9d31r84nz31jq
Tags: 1.2~rc2+dfsg-1
[ Abou Al Montacir ]
* New upstream pre-release.
  + Moved ideintf to components directory.
  + Added new package cairocanvas.
* Remove usage of depreciated parameters form of find. (Closes: Bug#724776)
* Bumped standard version to 3.9.5.
* Clean the way handling make files generation and removal.

[ Paul Gevers ]
* Remove nearly obsolete bzip compression for binary packages
  (See https://lists.debian.org/debian-devel/2014/01/msg00542.html)
* Update d/copyright for newly added dir in examples and components
* Update Vcs-* fields with new packaging location
* Update d/watch file to properly (Debian way) change upstreams versions
* Prevent 46MB of package size by sym linking duplicate files
* Patches
  - refresh to remove fuzz
  - add more Lintian found spelling errors
  - new patch to add shbang to two scripts in lazarus-src
* Drop lcl-# from Provides list of lcl-units-#
* Make lazarus-ide-qt4-# an arch all until it really contains stuff
* Make all metapackages arch all as the usecase for arch any doesn't
  seem to warrant the addition archive hit
* Fix permissions of non-scripts in lazarus-src-#

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
interface
51
51
 
52
52
uses
53
 
{$IFDEF SYN_CLX}
54
 
  Types,
55
 
  kTextDrawer,
56
 
  QGraphics,
57
 
  QControls,
58
 
  QForms,
59
 
  QExtCtrls,
60
 
  QStdCtrls,
61
 
  QComCtrls,
62
 
  QImgList,
63
 
  QDialogs,
64
 
  QMenus,
65
 
{$ELSE}
66
 
  ////TL Windows,
67
53
  LMessages,
68
54
  Graphics,
69
55
  Registry,
77
63
  Menus,
78
64
  GraphType, ////TL Added for TFontStyles
79
65
  LCLType,   ////TL Added for vk_* key declarations
80
 
{$ENDIF}
81
66
  Classes, FileUtil,
82
67
  SysUtils,
83
68
  SynEdit,
85
70
  SynUniHighlighter;
86
71
 
87
72
type
88
 
{$IFDEF SYN_CLX}
89
 
  TNodeText = WideString;
90
 
{$ELSE}
91
73
  TNodeText = String;
92
 
{$ENDIF}
93
74
 
94
75
  CClass=class of TControl;
95
76
 
180
161
 
181
162
implementation
182
163
 
183
 
{$IFDEF SYN_CLX}
184
 
uses
185
 
  Qt;
186
 
 
187
 
const
188
 
  vk_F1 = Key_F1;
189
 
  vk_F2 = Key_F2;
190
 
  vk_Return = Key_Return;
191
 
  vk_Delete = Key_Delete;
192
 
{$ENDIF}
193
 
 
194
164
Function GetFontStyle(bold, italic, underline, strikeout:boolean):TFontStyles;
195
165
begin
196
166
  result:=[];
244
214
  ////TL added 2 @ prefixes
245
215
  f.OnKeyPress:=@FormKeyPress;
246
216
{$WARNING TODO Fix UTF8BIDI issue}
247
 
  {$IFDEF SYN_LAZARUS}
248
217
  f.OnUTF8KeyPress:=nil;
249
 
  {$ELSE}
250
 
  f.OnUTF8KeyPress:=@FormUTF8KeyPress;
251
 
  {$ENDIF}
252
218
  f.OnKeyDown:=@FormKeyDown;
253
219
  f.caption:='Unihighlighter Designer (c) Fantasist, Vit (2002)';
254
220
 
262
228
  pTop.Height:=184;
263
229
 
264
230
  CreateComponent(TControl(pLeft), TPanel, pTop, alLeft);
265
 
  {$IFDEF SYN_LAZARUS}
266
231
  pLeft.Width:=200;
267
 
  {$ENDIF}
268
232
 
269
233
  ImageList:=TImageList.create(F);
270
234
  b:=TBitmap.create;
271
235
  b.Width:=16;
272
236
  b.Height:=16;
273
 
  {$IFNDEF SYN_LAZARUS}
274
 
  b.canvas.Font.Name:='Marlett';
275
 
  {$ENDIF}
276
237
  b.canvas.Font.color:=clRed;
277
238
  b.canvas.Font.Size:=14;
278
239
  b.canvas.TextOut(1,1,#52);
281
242
  b:=TBitmap.create;
282
243
  b.Width:=16;
283
244
  b.Height:=16;
284
 
  {$IFNDEF SYN_LAZARUS}
285
 
  b.canvas.Font.Name:='Marlett';
286
 
  {$ENDIF}
287
245
  b.canvas.Font.color:=clGreen;
288
246
  b.canvas.Font.Size:=14;
289
247
  b.canvas.TextOut(1,1,#52);
292
250
  b:=TBitmap.create;
293
251
  b.Width:=16;
294
252
  b.Height:=16;
295
 
  {$IFNDEF SYN_LAZARUS}
296
 
  b.canvas.Font.Name:='Marlett';
297
 
  {$ENDIF}
298
253
  b.canvas.Font.Size:=14;
299
254
  b.canvas.Font.color:=clblue;
300
255
  b.canvas.TextOut(1,1,#104);
306
261
  Tree.Align:=alClient;
307
262
  Tree.Parent:=pLeft;
308
263
  Tree.Images:=ImageList;
309
 
{$IFNDEF SYN_CLX}
310
264
  Tree.HideSelection:=false;
311
265
  Tree.RightClickSelect:=True;
312
 
{$ENDIF}
313
266
  ////TL added @ prefixes
314
267
  Tree.OnEdited:=@TreeEdited;
315
268
  Tree.OnKeyDown:=@TreeKeyDown;
316
269
  Tree.OnMouseUp:=@TreeMouseUp;
317
270
 
318
271
  CreateComponent(TControl(pAttri), TPanel, pTop, alRight);
319
 
  {$IFDEF SYN_LAZARUS}
320
272
  pAttri.Anchors:=[akRight];
321
 
  {$ENDIF}
322
273
  pAttri.Width:=200;
323
274
  pAttri.BevelInner := bvRaised;
324
275
  pAttri.BevelOuter := bvLowered;
331
282
  Lc.Font.Color := clGreen;
332
283
  Lc.Font.Style := [fsBold];
333
284
 
334
 
  {$IFDEF SYN_LAZARUS}
335
285
  CreateLabel(pAttri, 10, 43, 66, 13, 'Foreground');
336
286
  CreateLabel(pAttri, 10, 66, 66, 13, 'Background');
337
287
  CreateLabel(pAttri, 10, 90, 66, 13, 'Bold');
338
288
  CreateLabel(pAttri, 10, 113, 66, 13, 'Italic');
339
289
  CreateLabel(pAttri, 10, 137, 66, 13, 'Underline');
340
290
  CreateLabel(pAttri, 10, 160, 66, 13, 'StrikeOut');
341
 
  {$ELSE}
342
 
  CreateLabel(pAttri, 22, 43, 54, 13, 'Foreground');
343
 
  CreateLabel(pAttri, 18, 66, 58, 13, 'Background');
344
 
  CreateLabel(pAttri, 55, 90, 21, 13, 'Bold');
345
 
  CreateLabel(pAttri, 54, 113, 22, 13, 'Italic');
346
 
  CreateLabel(pAttri, 31, 137, 45, 13, 'Underline');
347
 
  CreateLabel(pAttri, 32, 160, 44, 13, 'StrikeOut');
348
 
  {$ENDIF}
349
291
 
350
292
  CreatePanel(pDef, pAttri, 79, 19, 58, 161);
351
293
  pDef.BevelInner := bvLowered;
406
348
  pProp.BevelInner:= bvLowered;
407
349
 
408
350
  CreateComponent(TControl(PageControl), TNotebook, pProp, alClient);
409
 
  {$IFDEF SYN_LAZARUS}
410
351
  //PageControl.ShowTabs:=false;
411
 
  {$ENDIF}
412
352
 
413
 
  {$IFDEF SYN_LAZARUS}
414
353
  PageControl.Pages.Add('');
415
354
  RootRange:=PageControl.Page[0];
416
 
  {$ELSE}
417
 
  CreateComponent(TControl(RootRange), TPage, PageControl, alClient);
418
 
  ////TL!! Oh boy... I'm not sure that a TPage is going to cut it as a TTabsheet
419
 
  ////TL!! RootRange.PageControl:=PageControl;
420
 
  ////TL!! RootRange.TabVisible:=false;
421
 
  {$ENDIF}
422
355
 
423
356
  CreateCheckBox(cCaseSensitiveRt,RootRange, 10,10, 140, 17);
424
357
  cCaseSensitiveRt.Caption:='Case Sensitive';
449
382
  AddKeywordRt.OnClick:=@DoAddKeyword;
450
383
 
451
384
 
452
 
  {$IFDEF SYN_LAZARUS}
453
385
  PageControl.Pages.Add('');
454
386
  Range:=PageControl.Page[1];
455
 
  {$ELSE}
456
 
  CreateComponent(TControl(Range), TPage, PageControl, alClient);
457
 
  ////TL!! Oops, again... I'm not sure that a TPage is going to work as a TTabsheet
458
 
  ////TL!! Range.PageControl:=PageControl;
459
 
  ////TL!! Range.TabVisible:=false;
460
 
  {$ENDIF}
461
387
  CreateCheckBox(cCaseSensitiveRg,Range, 10,10, 140, 17);
462
388
  cCaseSensitiveRg.OnClick:=@RangeChange;
463
389
  cCaseSensitiveRg.Caption:='Case Sensitive';
494
420
  EDelimitersRg.Top:=116;
495
421
  EDelimitersRg.Left:=60;
496
422
  EDelimitersRg.Width:=115;
497
 
  {$IFNDEF SYN_LAZARUS}
498
 
  EDelimitersRg.font.Name:='FixedSys';
499
 
  {$ENDIF}
500
423
  EDelimitersRg.Anchors:=[akLeft,akRight, akTop];
501
424
//  EDelimitersRg.font.Charset:=255;
502
425
  EDelimitersRg.OnChange:=@RangeChange;
516
439
  AddKeyword.Caption:='Add Keywords';
517
440
  AddKeyword.OnClick:=@DoAddKeyword;
518
441
 
519
 
  {$IFDEF SYN_LAZARUS}
520
442
  PageControl.Pages.Add('');
521
443
  KeyWords:=PageControl.Page[2];
522
 
  {$ELSE}
523
 
  ////TL! CreateComponent(TControl(KeyWords), TTabsheet, PageControl, alClient);
524
 
  CreateComponent(TControl(KeyWords), TPage, PageControl, alClient);
525
 
  ////TL! KeyWords.PageControl:=PageControl;
526
 
  ////TL! KeyWords.TabVisible:=false;
527
 
  {$ENDIF}
528
444
  CreateComponent(TControl(pMemo), TPanel, KeyWords, alRight);
529
 
  {$IFDEF SYN_LAZARUS}
530
445
  pMemo.Anchors:=[akRight];
531
 
  {$ENDIF}
532
446
  pMemo.Width:=100;
533
447
  pMemo.BevelInner:=bvLowered;
534
448
 
742
656
    try
743
657
      ////TL!! Not there with TColorDialog: CustomColors.text:='ColorA='+inttohex((Sender as TPanel).color,6)+#13#10+'ColorB=FFFFEE'+#13#10+'ColorC=EEFFFF'+#13#10+'ColorD=EEFFEE'+#13#10+'ColorE=EEEEFF'+#13#10+'ColorF=FFEEEE'+#13#10+'ColorG=EEEEEE'+#13#10+'ColorH=FFEEAA'+#13#10+'ColorJ=FFAAEE'+#13#10+'ColorK=AAFFEE'+#13#10+'ColorI=AAEEFF'+#13#10+'ColorL=EEFFAA'+#13#10+'ColorM=EEAAFF'+#13#10+'ColorN=AAAAAA'+#13#10+'ColorO=DDDDDD'+#13#10+'ColorP=999999';
744
658
      Color:=(Sender as TPanel).color;
745
 
{$IFNDEF SYN_CLX}
746
659
      ////TL!! Not there with TColorDialog: Options:=[cdFullOpen];
747
 
{$ENDIF}
748
660
      if Execute then
749
661
        begin
750
662
          (Sender as TPanel).color:=color;