HeDiBo

Forum Replies Created

Viewing 20 posts - 261 through 280 (of 1,174 total)
  • Author
    Posts
  • HeDiBo
    Participant

    It’s fixed indeed. You can close this topic.
    Thanks 👍

    HeDiBo
    Participant

    I already saw that in the modified sMonthCalendar you sent me. Thanks a million.

    in reply to: sMonthCalendar produces wrong date #68439
    HeDiBo
    Participant

    Wow!! Much much better now.
    Thanks 👍

    in reply to: sMonthCalendar produces wrong date #68436
    HeDiBo
    Participant

    Please, please make sure the date clicked is returned in the OnClick event. Not some date that happens to be highlighted.

    HeDiBo
    Participant

    I 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

    HeDiBo
    Participant

    I 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.

    in reply to: Show hints even if control is disabled #68432
    HeDiBo
    Participant

    If 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.
    in reply to: Show hints even if control is disabled #68428
    HeDiBo
    Participant

    I’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.
    in reply to: sMonthCalendar produces wrong date #68411
    HeDiBo
    Participant

    Here 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.
    in reply to: sMonthCalendar produces wrong date #68402
    HeDiBo
    Participant

    Do 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.

    in reply to: Show hints even if control is disabled #68401
    HeDiBo
    Participant

    So, WM_MOUSEHOVER is not sent, even if TrackMouseEvent specifies the parent‘s handle?

    in reply to: Show hints even if control is disabled #68380
    HeDiBo
    Participant

    A 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.
    in reply to: Show hints even if control is disabled #68376
    HeDiBo
    Participant

    I’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.
    HeDiBo
    Participant

    Thank 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).

    in reply to: TsWebBrowser with generated html #68362
    HeDiBo
    Participant

    Glad you made it work.
    You’re welcome to use any code from my sample project.

    in reply to: TsWebBrowser with generated html #68355
    HeDiBo
    Participant

    I’m afraid with my code it still works.
    So, a demo is needed.

    in reply to: TsWebBrowser with generated html #68352
    HeDiBo
    Participant

    In my case the problem was solved.
    Maybe you should send in a little test project showing your issue.

    in reply to: File Open dialog distorted. #68348
    HeDiBo
    Participant

    It’s still a mess in 15.01

    HeDiBo
    Participant

    I 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.
    HeDiBo
    Participant

    Thus, changing skins had nothing to do with it.

Viewing 20 posts - 261 through 280 (of 1,174 total)