View Issue Details

IDProjectCategoryView StatusLast Update
0018390LazarusOtherpublic2011-01-11 19:59
ReporterIdo KannerAssigned ToFelipe Monteiro de Carvalho 
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionfixed 
Product VersionProduct Build 
Target VersionFixed in Version0.9.31 (SVN) 
Summary0018390: The UniHighlighter extension does not support the new build of TNotebook
DescriptionThe changes for TNotebook broke UniHighlighter, due to missing properties that used to exists.

I'm attaching a patch to fix the issue.
TagsNo tags attached.
Fixed in Revision28908
LazTarget0.99.0
Widgetset
Attached Files
  • synunidesigner.pas.diff (2,273 bytes)
    Index: components/synunihighlighter/synunidesigner.pas
    ===================================================================
    --- components/synunihighlighter/synunidesigner.pas	(revision 28865)
    +++ components/synunihighlighter/synunidesigner.pas	(working copy)
    @@ -407,7 +407,7 @@
     
       CreateComponent(TControl(PageControl), TNotebook, pProp, alClient);
       {$IFDEF SYN_LAZARUS}
    -  PageControl.ShowTabs:=false;
    +  //PageControl.ShowTabs:=false;
       {$ENDIF}
     
       {$IFDEF SYN_LAZARUS}
    @@ -822,7 +822,7 @@
     procedure TSynUniDesigner.SampleMemoKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
     begin
       ////TL! replaced ActivePage with ActivePageComponent
    -  if (key=vk_Return) and (ssCtrl in Shift) and (PageControl.ActivePageComponent=KeyWords) then
    +  if (key=vk_Return) and (ssCtrl in Shift) and (PageControl.Page[PageControl.PageIndex] = KeyWords) then
         begin
           memo.lines.add(samplememo.SelText);
           TotalUpdate;
    @@ -957,7 +957,7 @@
            SetControlAttributes(Node);
            pNum.visible:=true;
            ////TL! replaced ActivePage with ActivePageComponent
    -       PageControl.ActivePageComponent:=Range;
    +       PageControl.PageIndex := PageControl.Pages.IndexOf(Range.Name);
          end;
        ntRootRange:begin
            SetControlAttributes(Node);
    @@ -965,7 +965,7 @@
            pNum.visible:=true;
            cCaseSensitiveRt.Checked:=TSynRange(Node.data).CaseSensitive;
            ////TL! replaced ActivePage with ActivePageComponent
    -       PageControl.ActivePageComponent:=RootRange;
    +       PageControl.PageIndex := PageControl.Pages.IndexOf(RootRange.Name);
          end;
        ntKeyWords: begin
            SetControlKWAttributes(node);
    @@ -975,7 +975,7 @@
            ////TL added @
            Memo.OnChange:=@KwListChange;
            ////TL! replaced ActivePage with ActivePageComponent
    -       PageControl.ActivePageComponent:=KeyWords;
    +       PageControl.PageIndex := PageControl.Pages.IndexOf(Keywords.Name);
          end;
      End;
      UpdatingControls:=false;
    @@ -1022,7 +1022,7 @@
     Procedure TSynUniDesigner.SampleDblClick(Sender:TObject);
     begin
       ////TL! replaced ActivePage with ActivePageComponent
    -  if (PageControl.ActivePageComponent=KeyWords) then
    +  if (PageControl.Page[PageControl.PageIndex]=KeyWords) then
           memo.Lines.Add(SampleMemo.SelText);
     end;
     
    
    synunidesigner.pas.diff (2,273 bytes)

Activities

2011-01-04 19:24

 

synunidesigner.pas.diff (2,273 bytes)
Index: components/synunihighlighter/synunidesigner.pas
===================================================================
--- components/synunihighlighter/synunidesigner.pas	(revision 28865)
+++ components/synunihighlighter/synunidesigner.pas	(working copy)
@@ -407,7 +407,7 @@
 
   CreateComponent(TControl(PageControl), TNotebook, pProp, alClient);
   {$IFDEF SYN_LAZARUS}
-  PageControl.ShowTabs:=false;
+  //PageControl.ShowTabs:=false;
   {$ENDIF}
 
   {$IFDEF SYN_LAZARUS}
@@ -822,7 +822,7 @@
 procedure TSynUniDesigner.SampleMemoKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
 begin
   ////TL! replaced ActivePage with ActivePageComponent
-  if (key=vk_Return) and (ssCtrl in Shift) and (PageControl.ActivePageComponent=KeyWords) then
+  if (key=vk_Return) and (ssCtrl in Shift) and (PageControl.Page[PageControl.PageIndex] = KeyWords) then
     begin
       memo.lines.add(samplememo.SelText);
       TotalUpdate;
@@ -957,7 +957,7 @@
        SetControlAttributes(Node);
        pNum.visible:=true;
        ////TL! replaced ActivePage with ActivePageComponent
-       PageControl.ActivePageComponent:=Range;
+       PageControl.PageIndex := PageControl.Pages.IndexOf(Range.Name);
      end;
    ntRootRange:begin
        SetControlAttributes(Node);
@@ -965,7 +965,7 @@
        pNum.visible:=true;
        cCaseSensitiveRt.Checked:=TSynRange(Node.data).CaseSensitive;
        ////TL! replaced ActivePage with ActivePageComponent
-       PageControl.ActivePageComponent:=RootRange;
+       PageControl.PageIndex := PageControl.Pages.IndexOf(RootRange.Name);
      end;
    ntKeyWords: begin
        SetControlKWAttributes(node);
@@ -975,7 +975,7 @@
        ////TL added @
        Memo.OnChange:=@KwListChange;
        ////TL! replaced ActivePage with ActivePageComponent
-       PageControl.ActivePageComponent:=KeyWords;
+       PageControl.PageIndex := PageControl.Pages.IndexOf(Keywords.Name);
      end;
  End;
  UpdatingControls:=false;
@@ -1022,7 +1022,7 @@
 Procedure TSynUniDesigner.SampleDblClick(Sender:TObject);
 begin
   ////TL! replaced ActivePage with ActivePageComponent
-  if (PageControl.ActivePageComponent=KeyWords) then
+  if (PageControl.Page[PageControl.PageIndex]=KeyWords) then
       memo.Lines.Add(SampleMemo.SelText);
 end;
 
synunidesigner.pas.diff (2,273 bytes)

Felipe Monteiro de Carvalho

2011-01-09 00:52

developer   ~0045006

thanks, applied

Issue History

Date Modified Username Field Change
2011-01-04 19:24 Ido Kanner New Issue
2011-01-04 19:24 Ido Kanner File Added: synunidesigner.pas.diff
2011-01-04 22:45 Vincent Snijders LazTarget => 0.99.0
2011-01-04 22:45 Vincent Snijders Assigned To => Felipe Monteiro de Carvalho
2011-01-04 22:45 Vincent Snijders Status new => assigned
2011-01-04 22:45 Vincent Snijders Target Version => 0.99.0
2011-01-09 00:52 Felipe Monteiro de Carvalho Fixed in Revision => 28908
2011-01-09 00:52 Felipe Monteiro de Carvalho Status assigned => resolved
2011-01-09 00:52 Felipe Monteiro de Carvalho Fixed in Version => 0.9.31 (SVN)
2011-01-09 00:52 Felipe Monteiro de Carvalho Resolution open => fixed
2011-01-09 00:52 Felipe Monteiro de Carvalho Note Added: 0045006
2011-01-11 19:59 Ido Kanner Status resolved => closed