Tuesday, May 22nd 2012, 1:57am UTC+2

You are not logged in.

  • Login
  • Register

Dani

Trainee

Posts: 68

Location: GERMANY

1

Thursday, December 22nd 2011, 10:30am

JBDialog - StartupLocation

Hey everybody,

when initializing a Jabaco Dialog (Dialog1.BorderStyle = vbFixedSingle)

Jabaco Source

1
2
3
4
Dim Dialog2 As New Dialog1
   Dialog2.Parent.setSize(500,500)
   Dialog2.Parent.setLocationRelativeTo(Me)
   Dialog2.Show(1)


On Windows it will popup right above its owner Form1
On the Mac it will poup in the upper left corner of the screen and jump to the desired location!

Very disturbing behaviour! (Same with a Jabaco Form by the way!)

Now when the same Dialog is borderless (Dialog1.BorderStyle = vbBSNone) everything is fine on the Mac too!?

When I use the JDialog

Jabaco Source

1
2
3
4
5
6
Dim Dialog2 As New JDialog(Me)
   Dialog2.pack()
   Dialog2.setSize(500,500)
   Dialog2.setLocationRelativeTo(Me)
   Dialog2.setModal(True)
   Dialog2.setVisible(True)


I get the expected behavior (popup above its owner) on Windows and Mac!

I found this in the framework, but I am not even sure if I'm in the right spot here.
http://www.google.com/codesearch#pOD0Tthq4jU/trunk/Framework/src/VB/Dialog.jsrc&q=dialog%20package:[url]http://jabacoframework\.googlecode\.com&l=66[/url]

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
' **************** // BAD HACK * I DONT KNOW A BETTER SOLUTION AT THE MOMENT :(
   Parent.setLocation -30000, -30000
   Parent.setVisible True
   Height = Height + (StartHeight - Parent.getContentPane.getHeight)
   Width = Width + (StartWidth - Parent.getContentPane.getWidth)

   Call Me.Form_Load()
   Call DoEvents()
   If myMenuBar.Visible Then Me.Height = Me.Height + myMenuBar.Height
   If myToolBar.Visible Then Me.Height = Me.Height + myToolBar.Height
   Parent.setVisible False
   ' **************** // BAD HACK


It would be great if someone came up with a fix for this issue!

Dani

Rate this thread
WoltLab Burning Board