Open gb.Form.Dialog maximised (full screen)

Post

Posted
Rating:
#1 (In Topic #665)
Trainee
 Is it possible to automatically open gb.Form.Dialog full screen (i.e.maximized)? I know it is possible to click on the maximize button after the dialog is opened but this is an unnecessarily annoying extra step to get a better view of the directory structure when looking for a file.  If it's not possible then I guess I'll just have to go with a file chooser on a  maximized form.

bazzvn
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Guru
cogier is in the usergroup ‘Guru’
 I have had a look at this, and I can't work out how to do this. Sorry.
Online now: No Back to the top

Post

Posted
Rating:
#3
Regular
vuott is in the usergroup ‘Regular’
I suggest some resources of the "DesktopWatcher " and "DesktopWindows " Classes by activating the gb.desktop and gb.desktop.x11 Components:

Code (gambas)

  1. Private wa As DesktopWatcher
  2. Private dw As DesktopWindow
  3.  
  4.  
  5. Public Sub Form_Open()
  6.  
  7. ' It watchs all windows, present and future, on the desktop:
  8.   wa = New DesktopWatcher As "DWatch"
  9.  
  10.  
  11. Public Sub Button1_Click()
  12.  
  13. ' The "title" of the Dialog window must be certain and unique:
  14.     .Title = "Abcde"
  15.     If .OpenFile() Then Return
  16.  
  17.  
  18. Public Sub DWatch_Windows()  ' If the window list on the desktop has changed...
  19.  
  20. ' ...then checks if the "Abcde" window has opened:
  21.   If Desktop.FindWindow("Abcde", Null, Null).Count > 0 Then
  22. ' If so, the Dialog window is resized:
  23.     With dw = New DesktopWindow(Desktop.FindWindow("Abcde", Null, Null)[0])
  24.       .Resize(Screen.AvailableWidth, Screen.AvailableHeight)
  25.     End With
  26.   Endif
  27.  

Europaeus sum !

<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Online now: No Back to the top

Post

Posted
Rating:
#4
Avatar
Regular
stevedee is in the usergroup ‘Regular’

bazzvn said

…If it's not possible then I guess I'll just have to go with a file chooser on a  maximized form.

Don't know if this helps, but you can make Controls expand when the mouse enters the control.

As an example, open a new project and add a Splitter, put a DirChooser inside on the left and a TextArea inside on the right.

Code (gambas)

  1. Public Sub Form_Open()
  2.  
  3.   Splitter1.Layout = [5, 95]
  4.   Splitter1.Expand = True
  5.   TextArea1.Text = "Blah, blah, blah, blah.........................................."
  6.  
  7.  
  8. Public Sub DirChooser1_Enter()
  9.    
  10.   Splitter1.Layout = [95, 5]
  11.    
  12.  
  13. Public Sub DirChooser1_Leave()
  14.    
  15.   Splitter1.Layout = [5, 95]
  16.    

When the mouse enters the DirChooser, it is expanded to [almost] the full size of the form.
Online now: No Back to the top

Post

Posted
Rating:
#5
Trainee
Thank you all, especially Vuott. Your code works wonderfully.
The only thing I had to add was 1 line of code after resizing, to reposition the form:

Code

 .Resize(Screen.AvailableWidth, Screen.AvailableHeight)
  .Move(0,0) 'Move the dialog

With best wishes,
bazzvn
Online now: No Back to the top
1 guest and 0 members have just viewed this.