Results 1 to 4 of 4

Thread: TBGL window events: Discussion

  1. #1
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    6,795
    Blog Entries
    3
    Rep Power
    693

    TBGL window events: Discussion

    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
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 7 64bit - Intel Core 2 Duo T6600 @ 2.2GHz - 4 GB RAM - NVIDIA GeForce G210M 512MB
    Windows 8 64bit - Intel Core i5-3350P @ 3.1GHz - 8 GB RAM - NVIDIA GeForce GT640 3GB

  2. #2
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Philippines
    Age
    47
    Posts
    1,218
    Blog Entries
    1
    Rep Power
    133
    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.
    [TABLE="class: tblf1 tblf-fullwidth tblf-alternate"]
    [TR]
    [TD][COLOR=#b22222][B][SIZE=1]The limit is[/SIZE][/B][/COLOR][/TD]
    [TD="class: isRelinked"] [COLOR=#0000cd][B][SIZE=1]Imagination[/SIZE][/B][/COLOR][/TD]
    [/TR]
    [/TABLE]

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    6,795
    Blog Entries
    3
    Rep Power
    693
    Hi Rene,

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


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 7 64bit - Intel Core 2 Duo T6600 @ 2.2GHz - 4 GB RAM - NVIDIA GeForce G210M 512MB
    Windows 8 64bit - Intel Core i5-3350P @ 3.1GHz - 8 GB RAM - NVIDIA GeForce GT640 3GB

  4. #4
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Philippines
    Age
    47
    Posts
    1,218
    Blog Entries
    1
    Rep Power
    133
    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
    Last edited by ReneMiner; 05-12-2015 at 18:21.
    [TABLE="class: tblf1 tblf-fullwidth tblf-alternate"]
    [TR]
    [TD][COLOR=#b22222][B][SIZE=1]The limit is[/SIZE][/B][/COLOR][/TD]
    [TD="class: isRelinked"] [COLOR=#0000cd][B][SIZE=1]Imagination[/SIZE][/B][/COLOR][/TD]
    [/TR]
    [/TABLE]

Similar Threads

  1. UI & TBGL -- active window
    By RobbeK in forum TBGL General
    Replies: 9
    Last Post: 16-11-2013, 16:37
  2. TBGL module from Petr Schreiber How do I handle events in TBGL?(such as WM_COPYDATA)
    By leonhardt in forum TBGL module by Petr Schreiber
    Replies: 2
    Last Post: 22-05-2013, 14:18
  3. TBGL Development Pipeline Tools ( Vaporware discussion :) )
    By Petr Schreiber in forum TBGL General
    Replies: 1
    Last Post: 29-07-2007, 11:20
  4. tbgl window to a given handle
    By kryton9 in forum TBGL General
    Replies: 2
    Last Post: 04-07-2007, 01:23
  5. TBGL window
    By Reinking in forum TBGL General
    Replies: 15
    Last Post: 16-01-2006, 19:02

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •