Qt - Child windows

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
wombats
Enthusiast
Enthusiast
Posts: 664
Joined: Thu Dec 29, 2011 5:03 pm

Qt - Child windows

Post by wombats »

Child windows have their own entry in the dock. I would expect a dialog to not have its own entry there.

Image

Code: Select all

Enumeration
  #Window
  #Button
  #Dialog
  #DialogButton
  #Dialog2
EndEnumeration

OpenWindow(#Window, 0, 0, 400, 350, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ButtonGadget(#Button, 10, 10, 90, 25, "Open Dialog")

Define Event
Repeat
  Event = WaitWindowEvent()
  Select Event
    Case #PB_Event_CloseWindow
      Select EventWindow()
        Case #Window
          Quit = 1
        Case #Dialog
          CloseWindow(#Dialog)
          DisableWindow(#Window, 0)
        Case #Dialog2
          CloseWindow(#Dialog2)
          DisableWindow(#Dialog, 0)
      EndSelect
    Case #PB_Event_Gadget
      Select EventGadget()
        Case #Button
          DisableWindow(#Window, 1)
          OpenWindow(#Dialog, 0, 0, 320, 240, "Dialog", #PB_Window_SystemMenu | #PB_Window_WindowCentered, WindowID(#Window))
          ButtonGadget(#DialogButton, 10, 10, 90, 25, "Open Dialog")
        Case #DialogButton
          DisableWindow(#Dialog, 1)
          OpenWindow(#Dialog2, 0, 0, 320, 240, "Dialog 2", #PB_Window_SystemMenu | #PB_Window_WindowCentered, WindowID(#Dialog))
      EndSelect
  EndSelect
Until Quit = 1

End
#NULL
Addict
Addict
Posts: 1440
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: Qt - Child windows

Post by #NULL »

Maybe try OpenWindow(#Dialog, ... | #PB_Window_Tool.
wombats
Enthusiast
Enthusiast
Posts: 664
Joined: Thu Dec 29, 2011 5:03 pm

Re: Qt - Child windows

Post by wombats »

That does work, but it makes the titlebar smaller.
#NULL
Addict
Addict
Posts: 1440
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: Qt - Child windows

Post by #NULL »

wombats wrote:That does work, but it makes the titlebar smaller.
That's what I expected and remembered (maybe from Windows) but here on my current linux system that doesn't happen (titlebars look the same with .._Tool..). I also tried some other window manager themes.
wombats
Enthusiast
Enthusiast
Posts: 664
Joined: Thu Dec 29, 2011 5:03 pm

Re: Qt - Child windows

Post by wombats »

Ah. Thanks for checking that. I guess it's an OK compromise for now. It would be nice if the Dialog library could be based on QDialog for proper dialog functionality (no flashing when clicking the parent window, for example), but I don't know how complicated that would be under the surface because I know they are just normal windows based on QMainWindow. I used normal windows in this example, but I use the Dialog library in my project for anything except the main window.
Fred
Administrator
Administrator
Posts: 16688
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Qt - Child windows

Post by Fred »

PureBasic doesn't support real dialog yet, moved to feature request
Post Reply