Changeset 16


Ignore:
Timestamp:
Jan 8, 2016, 5:09:58 PM (8 years ago)
Author:
chronos
Message:
  • Added: Preparation for filtering of non visible nodes.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LinuxBuilder.lpi

    r13 r16  
    4949        <Filename Value="LinuxBuilder.lpr"/>
    5050        <IsPartOfProject Value="True"/>
    51         <UnitName Value="LinuxBuilder"/>
    5251      </Unit0>
    5352      <Unit1>
     
    5756        <HasResources Value="True"/>
    5857        <ResourceBaseClass Value="Form"/>
    59         <UnitName Value="UFormMain"/>
    6058      </Unit1>
    6159      <Unit2>
    6260        <Filename Value="UKConfig.pas"/>
    6361        <IsPartOfProject Value="True"/>
    64         <UnitName Value="UKConfig"/>
    6562      </Unit2>
    6663      <Unit3>
     
    7067        <HasResources Value="True"/>
    7168        <ResourceBaseClass Value="Form"/>
    72         <UnitName Value="UFormList"/>
    7369      </Unit3>
    7470      <Unit4>
     
    7874        <HasResources Value="True"/>
    7975        <ResourceBaseClass Value="Form"/>
    80         <UnitName Value="UFormLog"/>
    8176      </Unit4>
    8277      <Unit5>
     
    8681        <HasResources Value="True"/>
    8782        <ResourceBaseClass Value="Form"/>
    88         <UnitName Value="UFormCompare"/>
    8983      </Unit5>
    9084      <Unit6>
     
    9488        <HasResources Value="True"/>
    9589        <ResourceBaseClass Value="Form"/>
    96         <UnitName Value="UFormSearch"/>
    9790      </Unit6>
    9891    </Units>
     
    132125      </Options>
    133126    </Linking>
    134     <Other>
    135       <CompilerMessages>
    136         <MsgFileName Value=""/>
    137       </CompilerMessages>
    138       <CompilerPath Value="$(CompPath)"/>
    139     </Other>
    140127  </CompilerOptions>
    141128  <Debugging>
  • trunk/UFormList.lfm

    r4 r16  
    11object FormList: TFormList
    2   Left = 327
     2  Left = 94
    33  Height = 1193
    4   Top = 34
     4  Top = 0
    55  Width = 1528
    6   Caption = 'FormList'
     6  Caption = 'Options list'
    77  ClientHeight = 1193
    88  ClientWidth = 1528
     
    1111  object Memo1: TMemo
    1212    Left = 8
    13     Height = 1152
    14     Top = 8
     13    Height = 1128
     14    Top = 32
    1515    Width = 1510
    1616    ReadOnly = True
     
    2626    ParentColor = False
    2727  end
     28  object CheckBoxAccessible: TCheckBox
     29    Left = 12
     30    Height = 24
     31    Top = 4
     32    Width = 146
     33    Caption = 'Only accessible'
     34    TabOrder = 1
     35  end
    2836end
  • trunk/UFormList.pas

    r4 r16  
    1313
    1414  TFormList = class(TForm)
     15    CheckBoxAccessible: TCheckBox;
    1516    Label1: TLabel;
    1617    Memo1: TMemo;
     
    2829
    2930uses
    30   UFormMain;
     31  UFormMain, UKConfig;
    3132
    3233{$R *.lfm}
     
    3738var
    3839  List: TStringList;
     40  I: Integer;
    3941begin
    4042  try
     
    4345    Memo1.Lines.Clear;
    4446    FormMain.Config.TopNode.SaveToList(List);
     47    if CheckBoxAccessible.Checked then
     48    for I := List.Count - 1 to 0 do
     49      if not TMenuNode(List.Objects[I]).CanBeVisible then
     50        List.Delete(I);
    4551    List.Sort;
    4652    Memo1.Lines.Assign(List);
  • trunk/UFormMain.lfm

    r15 r16  
    11object FormMain: TFormMain
    2   Left = 703
     2  Left = 596
    33  Height = 587
    4   Top = 236
     4  Top = 245
    55  Width = 857
    66  ActiveControl = TreeView1
    77  Caption = 'LinuxBuilder'
    8   ClientHeight = 561
     8  ClientHeight = 557
    99  ClientWidth = 857
    1010  Menu = MainMenu1
     
    1313  OnDestroy = FormDestroy
    1414  OnShow = FormShow
    15   LCLVersion = '1.3'
     15  LCLVersion = '1.7'
    1616  WindowState = wsMaximized
    1717  object TreeView1: TTreeView
    1818    Left = 8
    19     Height = 504
     19    Height = 500
    2020    Top = 0
    2121    Width = 520
     
    3232    Left = 0
    3333    Height = 26
    34     Top = 535
     34    Top = 531
    3535    Width = 857
    3636    Panels = <   
     
    4646    Left = 0
    4747    Height = 26
    48     Top = 509
     48    Top = 505
    4949    Width = 857
    5050    Align = alBottom
     
    9090  object Memo1: TMemo
    9191    Left = 536
    92     Height = 498
     92    Height = 494
    9393    Top = 0
    9494    Width = 312
     
    162162    object MenuItemArch: TMenuItem
    163163      Caption = 'Architecture'
    164       object MenuItem12: TMenuItem
    165         Caption = 'New Item14'
    166       end
    167164    end
    168165    object MenuItem2: TMenuItem
  • trunk/UFormMain.pas

    r15 r16  
    3535    MenuItem10: TMenuItem;
    3636    MenuItemArch: TMenuItem;
    37     MenuItem12: TMenuItem;
    3837    MenuItemCompareRecent: TMenuItem;
    3938    MenuItem2: TMenuItem;
     
    8180    Config: TConfigMenu;
    8281    procedure Reload;
     82    procedure UpdateInterface;
    8383    procedure FocusTreeNode(Node: TMenuNode);
    8484  end;
     
    137137  LastOpenedListOpen.AddItem(Dir);
    138138  Reload;
     139  UpdateInterface;
    139140end;
    140141
     
    230231end;
    231232
     233procedure TFormMain.UpdateInterface;
     234begin
     235  Caption :=  Config.BaseDir + ' - ' + Application.Title;
     236end;
     237
    232238procedure TFormMain.FocusTreeNode(Node: TMenuNode);
    233239var
     
    274280procedure TFormMain.AExitExecute(Sender: TObject);
    275281begin
    276   Application.Terminate;
     282  FormMain.Close;
    277283end;
    278284
  • trunk/UKConfig.pas

    r15 r16  
    3333    Parent: TExpression;
    3434    function Show: String; virtual;
     35    function CanBeTrue: Boolean; virtual;
    3536    procedure GetList(List: TStringList); virtual;
    3637    constructor Create; virtual;
     
    4445  TExpressionVar = class(TExpression)
    4546    Name: string;
    46     Node: TMenuNode;
     47    //Node: TMenuNode;
    4748    Negative: Boolean;
    4849    Compare: TCompareType;
    4950    Value: string;
     51    function CompareValue: Boolean;
     52    function CanBeTrue: Boolean; override;
    5053    constructor Create; override;
    5154    procedure GetList(List: TStringList); override;
     
    8891    function GetTopNode: TMenuNode; virtual;
    8992    function FindNode(ID: string): TMenuNode; virtual;
     93    function CanBeVisible: Boolean;
    9094    property Visible: Boolean read GetVisible;
    9195  end;
     
    138142{ TExpressionVar }
    139143
     144function TExpressionVar.CompareValue: Boolean;
     145begin
     146
     147end;
     148
     149function TExpressionVar.CanBeTrue: Boolean;
     150begin
     151  if Compare = ctNone then begin
     152
     153  end else
     154  if Compare = ctEqual then begin
     155    Result := Result and CompareValue;
     156  end else
     157  if Compare = ctNotEqual then begin
     158    Result := Result and not CompareValue;
     159  end;
     160//  Result := Node.CanBeVisible;
     161end;
     162
    140163constructor TExpressionVar.Create;
    141164begin
     
    176199  end;
    177200  if Assigned(Parent) then Result := '(' + Result + ')';
     201end;
     202
     203function TExpression.CanBeTrue: Boolean;
     204var
     205  I: Integer;
     206begin
     207  if ExpOperator = eoAnd then begin
     208    Result := True;
     209    for I := 0 to Items.Count - 1 do
     210      Result := Result and TExpression(Items[I]).CanBeTrue;
     211  end else
     212  if ExpOperator = eoOr then begin
     213    Result := False;
     214    for I := 0 to Items.Count - 1 do
     215      Result := Result or TExpression(Items[I]).CanBeTrue;
     216  end;
    178217end;
    179218
     
    320359  I: Integer;
    321360begin
    322   if ID <> '' then List.Add(ID);
     361  if ID <> '' then List.AddObject(ID, Self);
    323362  for I := 0 to Items.Count - 1 do
    324363  with TMenuNode(Items[I]) do begin
     
    403442    end;
    404443  end;
     444end;
     445
     446function TMenuNode.CanBeVisible: Boolean;
     447begin
     448  // TODO
     449  // Check if it can be selected manually if manual option
     450  // Check if it can be selected automatically by other option
     451
    405452end;
    406453
Note: See TracChangeset for help on using the changeset viewer.