Results 1 to 4 of 4

Thread: Positionning Inputbox$ , MsgBox popup window

  1. #1
    Junior Member
    Join Date
    Jan 2020
    Location
    France
    Posts
    11
    Rep Power
    6

    Positionning Inputbox$ , MsgBox popup window

    Hello everybody (second this day)



    I wonder if there is a way to force the place of UI boxes in the screen, and to choose the screen when multiple displays are used ?
    And also have a control of the size of font in the input box ?



    Many thanks for help.


    Justin
    Last edited by justin045; 23-11-2024 at 00:53.

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,155
    Rep Power
    736
    Hi Justin,

    thank you for your question!

    I think you could re-use the following functions from TBGL module for the moment:

    TBGL_DisplayGetCount()
    TBGL_DisplayGetInfo( displayNumber, variableWidth, variableHeight [, variableDepth] )
    TBGL_SendWindowToDisplay( windowHandle, displayNumber [, newX [, newY]] )
    TBGL_GetWindowDisplay( hWnd )

    I currently sadly do not have multi-display setup, so cannot test if it works correctly for UI module windows.

    Let us know!


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3
    Junior Member
    Join Date
    Jan 2020
    Location
    France
    Posts
    11
    Rep Power
    6

    Question Still moving questions

    Quote Originally Posted by Petr Schreiber View Post
    Hi Justin,

    thank you for your question!

    I think you could re-use the following functions from TBGL module for the moment:

    TBGL_DisplayGetCount()
    TBGL_DisplayGetInfo( displayNumber, variableWidth, variableHeight [, variableDepth] )
    TBGL_SendWindowToDisplay( windowHandle, displayNumber [, newX [, newY]] )
    TBGL_GetWindowDisplay( hWnd )

    I currently sadly do not have multi-display setup, so cannot test if it works correctly for UI module windows.

    Let us know!

    Petr
    Hi Petr,

    Thanks for the answer.

    But I don't see how to get the Handle for InputBox who returns a string, and when the window is created the script is suspended until the box is closed (with or without an answer) .
    And MsgBox, as seen in TBGL_SendWindowToDisplay help page retuns a number, always '1' in all my tests.
    I made this test script.
    uses "console","tbgl"
    Dim  ConsoleHandle as DWord
      ConsoleHandle = Console_GetHandle
      printl " consolehandle = " , consolehandle
      hwnd = consolehandle
      
    
    Dim hWnd      As DWord
    Dim displaysFound, display, width, height, bitDepth As Long
    dim retcode as long
    
    '...
     
      
      displaysFound = tbgl_DisplayGetCount() 
      retcode = MsgBox hWnd, "Found "+Format$(displaysFound)+" display(s), TBGL window is on no."+Format$(TBGL_GetWindowDisplay(hWnd) )
      printl  "phase1 "  , retcode   
    
    For display = 1 To displaysFound
      tbgl_DisplayGetInfo(display, width, height, bitDepth)
      
      retcode = MsgBox hWnd, "Display "+Format$(display) + ": " + width + "x" + height + " " + bitDepth +"bit color"
      printl   "phase2 " , retcode 
    Next                                                                 
    
    If displaysFound = 1 Then
        retcode = MsgBox hWnd, "Just one display found"
        printl   "phase3 ", retcode 
    Else
      For display = 1 To displaysFound  
       printl " before sendwindow"
       tbgl_SendWindowToDisplay(hWnd, display, display * 200, display * 10)
       printl " after sendwindow"
       retcode = MsgBox hWnd, "TBGL window sent to display no."+Format$(display)
       printl  "phase4" , retcode 
      Sleep 2000
      Next
    End If
    
    printl "waitkey"
    WaitKey(100)
    
    This script opens a console window which is effectively moved around screens, but I still don't see how to get the 'hWnd' of InputBox$ and MsgBox.


    Best regards

    Justin

  4. #4
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,155
    Rep Power
    736
    Hi Justin,

    I see, thank you for the clarification.

    Based on the current design of InputBox$ and MsgBox you cannot retrieve their handles (they are blocking calls), however, you can try this "trick":
    - create tiny dialog on desired display
    - pass the handle of this tiny dialog as parent to inputBox or MsgBox (for both functions it is the optional hParent parameter)


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

Similar Threads

  1. Replies: 1
    Last Post: 15-05-2021, 23:24
  2. message-buttons-popup-wonder :)
    By Lionheart008 in forum Sources, Templates, Code Snippets, Tips and Tricks, Do you know ...
    Replies: 1
    Last Post: 15-01-2009, 08:48
  3. msgbox owner window?
    By sandyrepope in forum UI (User Interface)
    Replies: 1
    Last Post: 31-01-2008, 20:31
  4. popup message box with 3 or 4 choices
    By sandyrepope in forum thinBasic General
    Replies: 21
    Last Post: 28-03-2007, 07:33

Members who have read this thread: 3

Posting Permissions

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