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

« back to all changes in this revision

Viewing changes to components/ideintf/objectinspector.pp

  • Committer: Package Import Robot
  • Author(s): Paul Gevers, Abou Al Montacir, Paul Gevers
  • Date: 2014-04-25 12:57:26 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20140425125726-6zkdcnnbbleuuvwj
Tags: 1.2+dfsg-1
[ Abou Al Montacir ]
* Packaged QT4 based IDE and LCL units.

[ Paul Gevers ]
* New upstream release
* Drop obsolete patches + refresh spell_errors.diff
* Update dependencies and description for QT4 changes
* Improve deduplication in d/rules (adds lcl-qt4 -> lcl-gtk2 -> lcl-nogui)

Show diffs side-by-side

added added

removed removed

Lines of Context:
220
220
    pgsUpdatingEditControl,
221
221
    pgsBuildPropertyListNeeded,
222
222
    pgsGetComboItemsCalled,
223
 
    pgsIdleEnabled
 
223
    pgsIdleEnabled,
 
224
    pgsCallingEdit   // calling property editor Edit
224
225
    );
225
226
  TOIPropertyGridStates = set of TOIPropertyGridState;
226
227
 
789
790
const
790
791
  DefaultObjectInspectorName: string = 'ObjectInspectorDlg';
791
792
 
792
 
// the ObjectInspector of the IDE can be found in FormEditingIntf
 
793
// the ObjectInspector descendant of the IDE can be found in FormEditingIntf
 
794
 
 
795
function dbgs(s: TOIPropertyGridState): string; overload;
 
796
function dbgs(States: TOIPropertyGridStates): string; overload;
793
797
 
794
798
implementation
795
799
 
824
828
                               TOIPropertyGridRow(Item2).Name);
825
829
end;
826
830
 
 
831
function dbgs(s: TOIPropertyGridState): string;
 
832
begin
 
833
  Result:=GetEnumName(TypeInfo(s),ord(s));
 
834
end;
 
835
 
 
836
function dbgs(States: TOIPropertyGridStates): string;
 
837
var
 
838
  s: TOIPropertyGridState;
 
839
begin
 
840
  Result:='';
 
841
  for s in States do
 
842
  begin
 
843
    if not (s in States) then continue;
 
844
    if Result<>'' then Result+=',';
 
845
    Result+=dbgs(s);
 
846
  end;
 
847
  Result:='['+Result+']';
 
848
end;
 
849
 
827
850
{ TOICustomPropertyGrid }
828
851
 
829
852
constructor TOICustomPropertyGrid.CreateWithParams(AnOwner:TComponent;
1367
1390
    {$ENDIF}
1368
1391
      DebugLn(['#################### TOICustomPropertyGrid.DoCallEdit for ',
1369
1392
               CurRow.Editor.ClassName,' Edit=',Edit=oiqeEdit]);
1370
 
      Include(FStates,pgsApplyingValue);
 
1393
      Include(FStates,pgsCallingEdit);
1371
1394
      try
1372
1395
        if Edit=oiqeShowValue then
1373
1396
          CurRow.Editor.ShowValue
1374
1397
        else
1375
1398
          CurRow.Editor.Edit;
1376
1399
      finally
1377
 
        Exclude(FStates,pgsApplyingValue);
 
1400
        Exclude(FStates,pgsCallingEdit);
1378
1401
      end;
1379
1402
    {$IFNDEF DoNotCatchOIExceptions}
1380
1403
    except
1532
1555
  NewValue: string;
1533
1556
  EditorAttributes: TPropertyAttributes;
1534
1557
begin
 
1558
  //if FRows.Count=0 then
 
1559
  //  debugln(['TOICustomPropertyGrid.SetItemIndex ',DbgSName(Self),' ',dbgsname(FCurrentEdit),' ',dbgs(FStates),' GridIsUpdating=',GridIsUpdating,' FItemIndex=',FItemIndex,' NewIndex=',NewIndex]);
1535
1560
  if GridIsUpdating or (FItemIndex = NewIndex) then
1536
1561
    exit;
1537
 
 
1538
1562
  // save old edit value
1539
1563
  SetRowValue(true);
1540
1564
 
1957
1981
begin
1958
1982
  Result:=
1959
1983
    not GridIsUpdating and IsCurrentEditorAvailable
 
1984
    and (not (pgsCallingEdit in FStates))
1960
1985
    and ((FCurrentEditorLookupRoot = nil)
1961
1986
      or (FPropertyEditorHook = nil)
1962
1987
      or (FPropertyEditorHook.LookupRoot = FCurrentEditorLookupRoot));