Changeset 16 for trunk/UKConfig.pas
- Timestamp:
- Jan 8, 2016, 5:09:58 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UKConfig.pas
r15 r16 33 33 Parent: TExpression; 34 34 function Show: String; virtual; 35 function CanBeTrue: Boolean; virtual; 35 36 procedure GetList(List: TStringList); virtual; 36 37 constructor Create; virtual; … … 44 45 TExpressionVar = class(TExpression) 45 46 Name: string; 46 Node: TMenuNode;47 //Node: TMenuNode; 47 48 Negative: Boolean; 48 49 Compare: TCompareType; 49 50 Value: string; 51 function CompareValue: Boolean; 52 function CanBeTrue: Boolean; override; 50 53 constructor Create; override; 51 54 procedure GetList(List: TStringList); override; … … 88 91 function GetTopNode: TMenuNode; virtual; 89 92 function FindNode(ID: string): TMenuNode; virtual; 93 function CanBeVisible: Boolean; 90 94 property Visible: Boolean read GetVisible; 91 95 end; … … 138 142 { TExpressionVar } 139 143 144 function TExpressionVar.CompareValue: Boolean; 145 begin 146 147 end; 148 149 function TExpressionVar.CanBeTrue: Boolean; 150 begin 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; 161 end; 162 140 163 constructor TExpressionVar.Create; 141 164 begin … … 176 199 end; 177 200 if Assigned(Parent) then Result := '(' + Result + ')'; 201 end; 202 203 function TExpression.CanBeTrue: Boolean; 204 var 205 I: Integer; 206 begin 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; 178 217 end; 179 218 … … 320 359 I: Integer; 321 360 begin 322 if ID <> '' then List.Add (ID);361 if ID <> '' then List.AddObject(ID, Self); 323 362 for I := 0 to Items.Count - 1 do 324 363 with TMenuNode(Items[I]) do begin … … 403 442 end; 404 443 end; 444 end; 445 446 function TMenuNode.CanBeVisible: Boolean; 447 begin 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 405 452 end; 406 453
Note:
See TracChangeset
for help on using the changeset viewer.