Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow assigning custom THintWindowClass #770

Open
IgitBuh opened this issue Feb 28, 2018 · 2 comments
Open

Allow assigning custom THintWindowClass #770

IgitBuh opened this issue Feb 28, 2018 · 2 comments
Assignees
Milestone

Comments

@IgitBuh
Copy link

IgitBuh commented Feb 28, 2018

VTV doesn't use the application's HintWindowClass, so if a custom one has been assigned (as easy as HintWindowClass := TMyHintWindow;) it's used for all components except for VTV.
Unfortunately, there's no direct way to use a custom hint style, so in order to assign it, one has either to inherit or intercept TVirtualStringTree.

I'm currently doing this:

type
  TVirtualStringTree = class(VirtualTrees.TVirtualStringTree)
  public
    function GetHintWindowClass: THintWindowClass; override;
  end;

function TVirtualStringTree.GetHintWindowClass: THintWindowClass;
begin
  Result := TMyHintWindow;
end;

It works, but I feel like this shouldn't be necessary.

Would it please be possible to have a public property like "HintWindowClass" to easily assign a custom THintWindowClass?
Alternatively or additionally, there could be an option to automatically use the THintWindowClass of the application, like toUseApplicationHintWindowClass.

@joachimmarder
Copy link
Contributor

It works, but I feel like this shouldn't be necessary.

Agreed. I noticed that too a while ago and started digging why VTV needs it own hint window class at all. One outcome was #730.

@joachimmarder
Copy link
Contributor

joachimmarder commented Jun 3, 2018

We should remove TVTHintData.DefaultHint and determine TVTHintData.HintText in TBaseVirtualTree.CMHintShow() and not in TVirtualTreeHintWindow.CalcHintRect(). We should aim that the default VCL THintWindow is working, at least header hints are not shown here.

@joachimmarder joachimmarder added this to the V7.1 milestone Jun 3, 2018
@joachimmarder joachimmarder self-assigned this Sep 6, 2018
joachimmarder added a commit that referenced this issue Sep 6, 2018
…ult, we onyl deliver the actual hint animation type now that should be used.
joachimmarder added a commit that referenced this issue Sep 6, 2018
joachimmarder added a commit that referenced this issue Sep 6, 2018
…s the hint text only using TCMHintShow.HintStr and at the end assignes the compiled hint to FHintData.HintText.
joachimmarder added a commit that referenced this issue Sep 6, 2018
… now rely on the VCL base class THintWindow regarding this.
joachimmarder added a commit that referenced this issue Sep 15, 2018
* Removed TVirtualTreeHintWindow.FDrawBuffer, we now paint on the canvas driectly
* Removed local variable Shadow, as it was never set to a value different from 0.
* Removed property TextHeight as it was never used.
joachimmarder added a commit that referenced this issue Sep 15, 2018
* Turned property HintWindowDestroyed into a function
* Removed WMNCPaint)=, it seems to have no effect and the base implementation seems to work fine.
* TVirtualTreeHintWindow.WMShowWindow() no longer finalizes FHintData, should be done by the compiler just fine.
Sharlikran pushed a commit to ElminsterAU/Virtual-TreeView that referenced this issue Oct 17, 2018
…atSystemDefault, we onyl deliver the actual hint animation type now that should be used.
Sharlikran pushed a commit to ElminsterAU/Virtual-TreeView that referenced this issue Oct 17, 2018
Sharlikran pushed a commit to ElminsterAU/Virtual-TreeView that referenced this issue Oct 17, 2018
… now compiles the hint text only using TCMHintShow.HintStr and at the end assignes the compiled hint to FHintData.HintText.
Sharlikran pushed a commit to ElminsterAU/Virtual-TreeView that referenced this issue Oct 17, 2018
…ed to hint animation, we now rely on the VCL base class THintWindow regarding this.
Sharlikran pushed a commit to ElminsterAU/Virtual-TreeView that referenced this issue Oct 17, 2018
* Removed TVirtualTreeHintWindow.FDrawBuffer, we now paint on the canvas driectly
* Removed local variable Shadow, as it was never set to a value different from 0.
* Removed property TextHeight as it was never used.
Sharlikran pushed a commit to ElminsterAU/Virtual-TreeView that referenced this issue Oct 17, 2018
* Turned property HintWindowDestroyed into a function
* Removed WMNCPaint)=, it seems to have no effect and the base implementation seems to work fine.
* TVirtualTreeHintWindow.WMShowWindow() no longer finalizes FHintData, should be done by the compiler just fine.
joachimmarder added a commit that referenced this issue Oct 27, 2018
…emove the global variable FHintWindowDestroyed, which was needed for coordinating hint animations.
Sharlikran pushed a commit to ElminsterAU/Virtual-TreeView that referenced this issue Oct 28, 2018
…e can also remove the global variable FHintWindowDestroyed, which was needed for coordinating hint animations.
joachimmarder added a commit that referenced this issue Nov 1, 2018
* Removed no longer used protected property TVirtualTreeHintWindow.HintData
* It does not seem to be necessery to override TVirtualTreeHintWindow.WMEraseBkgnd()
Sharlikran pushed a commit to ElminsterAU/Virtual-TreeView that referenced this issue Nov 4, 2018
* Removed no longer used protected property TVirtualTreeHintWindow.HintData
* It does not seem to be necessery to override TVirtualTreeHintWindow.WMEraseBkgnd()
@joachimmarder joachimmarder modified the milestones: V7.1, V7.2 Nov 29, 2018
joachimmarder added a commit that referenced this issue Jan 15, 2019
…ssue #770 as it produced yellow backgrounds occasionally.
Sharlikran pushed a commit to ElminsterAU/Virtual-TreeView that referenced this issue Jan 17, 2019
* Removed no longer used protected property TVirtualTreeHintWindow.HintData
* It does not seem to be necessery to override TVirtualTreeHintWindow.WMEraseBkgnd()
Sharlikran pushed a commit to ElminsterAU/Virtual-TreeView that referenced this issue Jan 17, 2019
@joachimmarder joachimmarder removed this from the V7.2 milestone Jan 27, 2019
@joachimmarder joachimmarder added this to the V7.3 milestone Jan 27, 2019
joachimmarder added a commit that referenced this issue Feb 9, 2019
@joachimmarder joachimmarder modified the milestones: V7.3, V7.4 Oct 2, 2019
@joachimmarder joachimmarder modified the milestones: V7.4, V8.0 Feb 9, 2020
@joachimmarder joachimmarder modified the milestones: V8.0, V8,1 Mar 11, 2023
@joachimmarder joachimmarder modified the milestones: V8.1, V8.2 Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants