Delphi/CB
•  Greatis •  Security •  AppDatabase •  Utilities •  Visual Basic • .NET •  just4fun
Delphi / C++ Builder
Components, utilities and tips for Delphi and C++ Builder developers
More info
Object Inspector FAQ
Object Inspector Home
Delphi Components
See also
Products
Form Designer
Runtime Fusion
Print Suite
Commented Image
Image Editor  new!
Delphi Toys
Ultimate Pack  hot!

FAQs
Form Designer FAQ
Print Suite FAQ
Image Editor FAQ

Links
Software for .NET
Software for VB 6
Delphi Tips & Tricks

Services
Outsourcing
How to use TCommonInspector?
In first, the ItemCount property must be set. You can change this property at design time by Delphi's Object Inspector and at runtime from your code.

To use TCommonInspector you have to create handlers at least for 3 events:
OnGetName - this event must return the property name
OnGetValue - this event must return the property value
OnSetValue - this event must set the property value

TheIndex passed to each event is index of the item that must be processed, TheIndex for the first item is 0.

var
  // values list, use your own data instead
  UserValues: array[0..9] of string;

...

procedure TForm1.CommonInspector1GetName(Sender: TObject;
  TheIndex: Integer; var Value: String);
begin
  Value:='Property name #'+IntToStr(TheIndex);
end;

procedure TForm1.CommonInspector1GetValue(Sender: TObject;
  TheIndex: Integer; var Value: String);
begin
  Value:=UserValues[TheIndex];
end;

procedure TForm1.CommonInspector1SetValue(Sender: TObject;
  TheIndex: Integer; const Value: String);
begin
  UserValues[TheIndex]:=Value;
end;
By default the value is changed (and the OnSetValue is fired) only if the user pressed the Enter key after editing, but this can be changed by OnGetAutoApply event - just change the passed Value to True and the value will be set when user leaves the edited item:
procedure TForm1.CommonInspector1GetAutoApply(Sender: TObject;
  TheIndex: Integer; var Value: Boolean);
begin
  Value:=True;
end;

Greatis Software Greatis | Security | AppDatabase | Utilities | Delphi/CB | Visual Basic | .NET | just4fun

Contacts | Add to Favorites | Recommend to a Friend | Privacy Policy | Copyright © 1998-2008 Greatis Software