Forum Replies Created
-
AuthorPosts
-
February 9, 2020 at 3:06 pm in reply to: AC 15.00 Memory corruption in combi button animation and dynamic skin switching. #68445HeDiBoParticipant
It’s fixed indeed. You can close this topic.
Thanks 👍February 9, 2020 at 1:39 pm in reply to: Popup calendar is closed when year and month selector is shown #68444HeDiBoParticipantI already saw that in the modified sMonthCalendar you sent me. Thanks a million.
HeDiBoParticipantWow!! Much much better now.
Thanks 👍HeDiBoParticipantPlease, please make sure the date clicked is returned in the OnClick event. Not some date that happens to be highlighted.
February 7, 2020 at 5:33 pm in reply to: Popup calendar is closed when year and month selector is shown #68435HeDiBoParticipantI now realize that the label CloseInhibited is too geared toward a popup form. Keeping it restricted to the calendar itself, please implement this:
public ... property PopupShown: Boolean read GetPopupShown; function TsMonthCalendar.GetPopupShown: boolean; begin Result := (PopMenu <> nil) and (PopMenu.PopupComponent <> nil); end;
Thanks
February 7, 2020 at 2:49 pm in reply to: Popup calendar is closed when year and month selector is shown #68434HeDiBoParticipantI saw your solution in the popup form of tsDateEdit:
type TAccessCalendar = class(TsMonthCalendar); procedure TsPopupCalendar.FormCloseQuery(Sender: TObject; var CanClose: Boolean); begin with TAccessCalendar(sMonthCalendar1) do CanClose := (PopMenu = nil) or (PopMenu.PopupComponent = nil); end;
So, a simple public boolean property TsMonthCalendar.CloseInhibited would do the trick.
HeDiBoParticipantIf mouse is above a child control then we can start procedure of hint showing.
But we can do it with WM_MOUSEMOVE also. How TrackMouseEvent can make it better than WM_MOUSEMOVE?With WM_MOUSEMOVE, you’ll have to do the hover logic yourself: wait whule the mouse cursor hovers without movement for the hint delay time. That is already worked out in the TrackMouseEvent logic.
For the general logic, I would concentrate on the setting of the Enabled property to False. Then I would add that control to a list maintained by the parent control, but only if the parent does not have a hint of its own and only if the control added has a hint to show.
At the moment the cursor enters the parent control, check whether it has a list of controls for which the hint needs to be handled. If it has, call TrackMouseEvent. At WM_MOUSEHOVER time, check whether the cursor is over one of these controls, the parent still has no hint of its own and show the control’s hint.This is of course a very sketchy description, there are all kind of details to be taken care of, like when the control’s Enabled property goes to True, but I hope this gives a general idea.
Keep up the good work 🎈
- This reply was modified 4 years, 9 months ago by HeDiBo.
HeDiBoParticipantI’ve made a small demo project to show you what I mean.
The left panel shows that mouse move messages arrive in the panel, when the control Edit1 is disabled (they will not arrive if the control is Enabled and the mouse hovers over it).
The right panel shows that WM_MOUSEHOVER messages appear, if the StartMouseEvents function is called, when the mouse cursor is over the panel. In that case, they also appear when the Edit2 control is disabled and the mouse cursor is over the edit box.Attachments:
You must be logged in to view attached files.HeDiBoParticipantHere is a test project.
I noticed the error because I happened to run it near the beginning of Februari. So, I had to hustle a bit to reshow it.
In the main form, click “Show Popup”.
In the popup calendar go to the next year and click anywhere on a date. I dare you to predict what the date will be in the label below the calendar. It should be CellDate[1,0].This also brings me to the second point: clicking on a dimmed date, should still return the date clicked. Dimmed does not mean it cannot be clicked. It only means it cannot be returned for selected date.
Attachments:
You must be logged in to view attached files.HeDiBoParticipantDo you mean the result should be empty?
I have 21-01-2020 when “CellDate[1,0]” is called…Which is wrong, as the highlighted cell clearly shows 27-01-2020.
Which brings me to the next observation: the CellDate of the clicked cell should give the date of the clicked cell. Not the highlighted cell and certainly not a cell from last month.HeDiBoParticipantSo, WM_MOUSEHOVER is not sent, even if TrackMouseEvent specifies the parent‘s handle?
HeDiBoParticipantA nice overview by microsoft:
docs.microsoft.com/en-us/windows/win32/learnwin32/other-mouse-operations
A comprehensive set of samples:
http://www.codeproject.com/Articles/1745/Adding-mouse-functionality-to-any-control- This reply was modified 4 years, 9 months ago by HeDiBo.
HeDiBoParticipantI’m not sure you should keep following the mouse.
As soon as the TrackMouseEvent for the parent control has been given, WM_MOUSEHOVER and WM_MOUSELEAVE can be catched. It’s actually great that the hover event only comes once.
I think this is a good scenario:TrackMouseEvent for the parent control, if that control does not have a hint itself.
When the hover event occurs, check whether the event is over a disabled control.
If it is, show the Hint (if any).
In both cases TrackMouseEvent again.It is very well possible that you see problems that I cannot. In that case, I apologize.
- This reply was modified 4 years, 9 months ago by HeDiBo.
February 2, 2020 at 2:28 pm in reply to: AC 15.00 Memory corruption in combi button animation and dynamic skin switching. #68372HeDiBoParticipantThank you, I will check it.
Can you send me the Exe file also, please?I’ve sent it by separate mail (too big for here).
HeDiBoParticipantGlad you made it work.
You’re welcome to use any code from my sample project.HeDiBoParticipantI’m afraid with my code it still works.
So, a demo is needed.HeDiBoParticipantIn my case the problem was solved.
Maybe you should send in a little test project showing your issue.HeDiBoParticipantIt’s still a mess in 15.01
January 29, 2020 at 5:48 pm in reply to: AC 15.00 Memory corruption in combi button animation and dynamic skin switching. #68346HeDiBoParticipantI found a way to reproduce this bug (it’s still present in AC 15.01).
The bug is that AC modifies memory after it was freed.
You can only find it if you use a project with full debug fastmm4 included (otherwise the bug is simply not tested). Since I test all my projects like this, I’m in a lot of pain now.So run this test project, click one button, then click the other one: voila.
Attachments:
You must be logged in to view attached files.January 28, 2020 at 7:14 pm in reply to: AC 15.00 Memory corruption in combi button animation and dynamic skin switching. #68345HeDiBoParticipantThus, changing skins had nothing to do with it.
-
AuthorPosts