Giter Site home page Giter Site logo

zcontrols's People

Contributors

benative avatar benok avatar mahdisafsafi avatar pyscripter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zcontrols's Issues

Allow localization of True/False

I am reopening issue #25 because I found a couple of issues with the solution I suggested there and was implemented.

Suggested changes:

a) Replace BooleanToStr with the following:

function BooleanToStr(B: Boolean): string;
begin
  if B then
    Result := STrueValue
  else
    Result := SFalseValue;
end;

The reason is that the use of the resource strings in the constant does not work because presumably the compiler initializes the constant when the program is loaded and the translated strings are not picked up.

b) Currently BooleanToStr is only used in set properties and not in Boolean properties. Modify the TzCustomValueManager.GetValueName as follows.

  if PItem.IsSetElement then
  begin
    Result := BooleanToStr(SetEnumToBoolean(GetEnumOrdValue(Value), PItem.SetElementValue));
    Exit;
  end
  else if (Value.TypeInfo = TypeInfo(Boolean)) then  //  added this if block
  begin
    Result := BooleanToStr(GetValueAs<Boolean>(Value));
    Exit;
  end

Optional support for non-published properties and fields

I had a play with your great component and was glad to see that you use the new RTTI features, which makes it possible to expose a lot more than just published properties. I did a little test and with only a minor tweak in the sources the control could also show private, protected and public fields and properties. Maybe you should consider making this an optional feature.
As of now I am not aware of any commercial or open source object inspector control that is able to do that.

No hard coded paths, please

Not everyone installed Delphi to the default path. Which leads to ...

In InspDemo.vrc

AmethystKamri VCLSTYLE "e:\coding\XE8\Redist\styles\vcl\Studio\15.0\Styles\AmethystKamri.vsf"
CyanDusk VCLSTYLE "e:\coding\XE8\Redist\styles\vcl\Studio\15.0\Styles\CyanDusk.vsf"
Luna VCLSTYLE "e:\coding\XE8\Redist\styles\vcl\Studio\15.0\Styles\Luna.vsf"

[BRCC32 Error] InspDemo.vrc(66): file not found: C:\Users\Public\Documents\Embarcadero\Studio\15.0\Styles\AmethystKamri.vsf
[BRCC32 Error] InspDemo.vrc(67): file not found: C:\Users\Public\Documents\Embarcadero\Studio\15.0\Styles\CyanDusk.vsf
[BRCC32 Error] InspDemo.vrc(68): file not found: C:\Users\Public\Documents\Embarcadero\Studio\15.0\Styles\Luna.vsf

Wrong ItemHeight when ParentFont is True in Delphi 11

Delphi 11 changed the default font to Segoe UI 9 pts. The default FItemHeight of 17 is too small for that font. The problem is much worse with High DPI applications. See image below:

image

The problem is that when using the default font (ParentFont is True) TzScrollObjInspectorList.CMFONTCHANGED, which correctly sets FItemHeight is not called.

Solution:

Add another method TzScrollObjInspectorList.CMPARENTFONTCHANGED with the following code:

procedure TzScrollObjInspectorList.CMPARENTFONTCHANGED(
  var Message: TCMParentFontChanged);
begin
  inherited;
  if ParentFont then
  begin
    Canvas.Font.Assign(Font);
    FItemHeight := Canvas.TextHeight('WA') + 4;
  end;
end;

This method is always called and the problem is solved. And while fixing this you may want to expose the ParentFont property.

Exception when removing TzObjectInspector from form at design time

I am seeing an exception when deleting a TzObjectInspector from a form at design time.
Solution
Change TzScrollObjInspectorList.UpdateScrollBar to:

procedure TzScrollObjInspectorList.UpdateScrollBar;
begin
  if Assigned(Parent) and not(csDestroying in ComponentState) then
  begin
    FSI.cbSize := SizeOf(FSI);
    FSI.fMask := SIF_RANGE or SIF_PAGE;
    FSI.nMin := 0;
    FSI.nMax := VisiblePropCount - 1;
    FSI.nPage := GetMaxItemCount;
    SetScrollInfo(Handle, SB_VERT, FSI, False);
    InvalidateNC;
  end;
end;

Object Inspector - Lazarus

Hello,
I want to write my own Object Inspector. My code was available to Lazarus. Can I model your code? I mainly mean the way of grouping properties of objects into categories.

Regards

Drawing a border when styles are enabled

Is it possible to fix the drawing of the border when styles are enabled? The border is not rendered now. You can see that there is a non-client area when the border style is bsSingle. But there is no border. Thanks!

Enhancement: Allow localization of True/False

It would be nice to allow localization of the the lables "True" and "False"
All you need is to replace:

function BooleanToStr(B: Boolean): string;
const
  BoolStrs: array [Boolean] of String = ('False', 'True');
begin
  Result := BoolStrs[B];
end;

with

resourcestring
  rsFalseLabel = 'False';
  rsTrueLabel = 'True';
function BooleanToStr(B: Boolean): string;
const
  BoolStrs: array [Boolean] of String = (rsFalseLabel, rsTrueLabel);
begin
  Result := BoolStrs[B];
end;

Delphi 2007

Problem with component installation in Delphi 2007: when trying to open zControls.groupproj message: "project XXX could not be loaded. Only one top-level element is allowed in an XML document."

Support for mouse wheel scrolling events

In the sources I forked I added basic support for mouse wheel scrolling events:

    function DoMouseWheelDown(Shift: TShiftState; MousePos: TPoint): Boolean; override;
    function DoMouseWheelUp(Shift: TShiftState; MousePos: TPoint): Boolean; override;

Use the TzObjectInspector component as the Configuration Editor.

This is not a issue, it is a question.
Will there be any way to use the TzObjectInspector component to modify the configuration options of my program?
I do not want to modify the properties of the objects, but I can add configuration options and modify them. As delphi does. If not, this could be another good component that you could add to zControls.
Greetings.
Sorry my bad english.

options inspector

Access violation after editing a property and moving the focus by key (up, down).

Easy to reproduce.
Edit a string property say by typing a few characters and without pressing Enter, press up/down key.
procedure. The problem is in the method below.

TzCustomObjInspector.UpdateEditControl(const SetValue: Boolean);
var
  PItem: PPropItem;
  BtnWidth: Integer;
  LTxtValRect: TRect;
begin
  if Assigned(FPropInspEdit) then
    if Assigned(FPropInspEdit.Parent) then
    begin
      FPropInspEdit.PropInfo := nil;
      FPropInspEdit.Visible := False;
    end;

It first sets PropInfo to nil and then Visible to false. The second statement results in a KILLFOCUS message which calls DoSetValueFromEdit with FPropInfo equal to nil.

** Solution: **
Reverse the statements, so that first the value gets updated and then PropInfo is set to nil.
i.e.

  if Assigned(FPropInspEdit) then
    if Assigned(FPropInspEdit.Parent) then
    begin
      FPropInspEdit.Visible := False;
      FPropInspEdit.PropInfo := nil;
    end;

Using of the inspector control would block TAB key for the entire windows 7 system.

If you compile and run the supplied demo, then switch any other programs else, for example, your text editor or the Delphi IDE, you press TAB and it no longer works. you quit the demo program and the issue goes away.

I have the same issue in the program that uses TZObjectInspector.
That's a wired issue, but the inspector control is great!

Assigning custom property value editors

I know it is now possible by assigning the global DefaultValueManager variable to your own overridden class of TzCustomValueManager.
It would be cleaner to add a public TzCustomValueManagerClass property to TzObjInspectorBase (or even better: an interface type that is implemented by TzCustomValueManager).
Another way to provide your own property value editors could be through an extra event property in which you can provide your own class or instance of the value editor:

OnGetEditorClass(
      Sender           : TObject;
      AInstance        : TObject;
      APropInfo        : PPropInfo;
      var AEditorClass : TzPropertyEditorClass
);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.