[MSEide-MSEgui-talk] Issue with hint window

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[MSEide-MSEgui-talk] Issue with hint window

Krzysztof
Hi Martin,

Another issue which I think worked long time ago. In my app I have
volume form which inherit from hint window. Main behavior of this form
is that it should be freed when click on ANY other widget or just
hidden when click on window from another app (and bring back when
click on my app). So basically similar behavior of popup menu.
Everything is working fine except that volume window is not released
when click on window decorator (top bar outside the X window which
have _ and X buttons). In this topic I mentioned about this but you
wrote that it is hard to implement:
https://www.mail-archive.com/mseide-msegui-talk@.../msg09969.html
Although, I remember that I reported same issue for popup menu and you
finally managed to fix it (which you also see on attached video). So
my question is, what trick did you use in popup menu? OnDeactivate and
OnExit events are not triggered. Thought that this proc has to be
extended:

procedure TfrmVolume.applicationev(const sender: tactcomponent;
  var aevent: tmseevent; var handled: Boolean);
begin
  writeln('Event ', aevent.kind);
  if (aevent.kind = ek_buttonpress) then begin
   with tmouseevent(aevent) do begin
    if (fwinid <> window.winid) or //click in other window
                            not pointinrect(fpos,widgetsizerect) then begin
                                   //click out of window in case of modal
     writeln('Release volume');
     release();
    end;
   end;
  end;
end;

... but none events are triggered when click on decorator :/

Regards and happy new year by the way :)

https://drive.google.com/open?id=1D-i8pN0Pq4mBYz7798u3QkewKHNT8X9g

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

volumeissue.7z (9K) Download Attachment
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Issue with hint window

mse
Administrator
On Saturday 30 December 2017 22:30:51 Krzysztof wrote:

> Hi Martin,
>
> Another issue which I think worked long time ago. In my app I have
> volume form which inherit from hint window. Main behavior of this form
> is that it should be freed when click on ANY other widget or just
> hidden when click on window from another app (and bring back when
> click on my app). So basically similar behavior of popup menu.
> Everything is working fine except that volume window is not released
> when click on window decorator (top bar outside the X window which
> have _ and X buttons). In this topic I mentioned about this but you
> wrote that it is hard to implement:
> https://www.mail-archive.com/mseide-msegui-talk@.../msg09
>969.html Although, I remember that I reported same issue for popup menu and
> you finally managed to fix it (which you also see on attached video). So my
> question is, what trick did you use in popup menu?

"
constructor TfrmVolume.create(const atransientfor: twidget);
begin
  inherited create(nil);
  width := 80;
  sdVolume.onsetvalue := @InternalVolumeChanged;
  cbMute.onchange := @InternalMuteChanged;
  application.registeronapplicationactivechanged(@AppActiveChanged);
  show(ml_none,atransientfor);
  window.capturemouse(); //<<<------------
end;
"
Alternatively the demo
https://gitlab.com/mseide-msegui/mseuniverse/tree/master/samples/forms/popupform
repositions the popup form while dragging the base form by window decorator
instead to close the popup form.
>
> Regards and happy new year by the way :)
>
Happy new year!

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Issue with hint window

Krzysztof
Works. Thanks!

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Issue with hint window

Krzysztof
Quick question. How to obtain screen / desktop resolution? I want to
adjust volume window position if it popup outside desktop

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Issue with hint window

Krzysztof
Ok I think I found it, in application object:

   function screenrect(const awindow: twindow = nil): rectty;
                          //nil -> virtualscreeen
   function workarea(const awindow: twindow = nil): rectty;
                          //nil -> current active window

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk