PDA

View Full Version : TBGL window events: Discussion



Petr Schreiber
05-12-2015, 12:14
Hi,

Rene mentioned in other thread it would be nice to capture some events occuring to TBGL window. I started to write notes on paper and quickly found out this can be expanded further.

I would like to discuss first, what would be considered the best approach.

My currently considered syntax is:


TBGL_BindWindowEvent( hWnd, <eventType>, handlerFunction)

Where eventType would be:
%TBGL_OnOpen
%TBGL_OnClose
%TBGL_OnMaximize
%TBGL_OnMinimize
%TBGL_OnSizeChanging
%TBGL_OnSizeChanged

Your handler function could process the event as you want, and some events could be cancelled also by using return value:
%TBGL_Cancel
%TBGL_Pass (default)

The handler functions would receive metadata to easen the processing. For example:
Client.Width, Client.Height, Window.Position.x, Window.Position.y, Window.Width, Windows.Height


Let me know...
Petr

ReneMiner
05-12-2015, 12:37
since we have already a TBGL_BindWindowEvent for OnDropFiles (remember?) the syntax was already clear.
I did not dare to ask for minimize & maximize because we can already retrieve size. But if we had this, then we could differ maximized & normalized size much easier.

Only thing I can think of that we probably can't do right now - except to avoid closing the window is to request from TBGL if TBGL-window is the one that has currently focus.

Also in some cases it could be useful to know the real size (not just client-size) of the window. But i fear this one is complicated.

Petr Schreiber
05-12-2015, 18:05
Hi Rene,

as usually - great feedback, thank you :) Information about focus is nice catch. What about %TBGL_OnGotFocus, %TBGL_OnLostFocus?


Petr

ReneMiner
05-12-2015, 18:19
Yes sounds great. Not just to retrieve the current state (hasFocus) but being able to react on state-change immediately without the need to watch current state myself is much better :)