Popup calendar is closed when year and month selector is shown

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #68370
    Support
    Keymaster

      Popup window is closed because focus lost, I will try to find a solution.

      #68434
      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.

        #68435
        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

          #68441
          Support
          Keymaster

            I have found an universal solution, any popup windows will not be closed automatically if popup menu is opened there. You can test it in the v15.02

            #68444
            HeDiBo
            Participant

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

            Viewing 5 posts - 1 through 5 (of 5 total)
            • The topic ‘Popup calendar is closed when year and month selector is shown’ is closed to new replies.