config dialog on-top

Xlobby plugin development

config dialog on-top

Postby dalanik on Tue Jul 11, 2006 2:07 pm

Hi,

If any kind sould could set me on track how to set plugin configuration dialog ontop. Whatever I do, I always have it showing underneath XLobby config dialog (F2)....

Cheers,

D.
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Postby badubo on Tue Jul 11, 2006 2:32 pm

set your form as topmost
badubo
 
Posts: 505
Joined: Mon May 03, 2004 7:33 pm
Location: Belgium

Postby dalanik on Tue Jul 11, 2006 9:01 pm

badubo wrote:set your form as topmost


Thanx... took me some time to find the topmost in properties... :-)
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Postby dalanik on Wed Jul 19, 2006 8:13 am

Not to waste another topic :-) Decided to use this one, it's similar....

Anyways... I'm experimenting with plugin and I wanted to open a dialog/window from it. Now, when I do something like

Dialog1.Show()

for configuration dialog, it works fine.

but when I do it inside plugin itself (i.e. from a command), it just fails to open anything....

With my limited knowlegde of windows programming it is possible that i'm overlooking something, so I decided to ask the experts :-)

Funny that, when I comile my project as EXE (w/o all the XLobby plugin things), I am able to open dialog (i.e. from a form by button click), but not via command in XLobby....

any clues?

Thanx,

Dalibor
Last edited by dalanik on Wed Jul 19, 2006 10:45 am, edited 1 time in total.
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Postby dalanik on Wed Jul 19, 2006 10:45 am

Now that I observe it more carfully - the dialog pops open and closes immediately....

D.
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Postby art on Thu Jul 27, 2006 2:00 am

I'm no expert, but you could try something like this, providing that your form is called Form1:
Code: Select all
Dim myForm As New Form1
myForm.ShowDialog()
art
 
Posts: 284
Joined: Sat Mar 20, 2004 8:40 am
Location: Allen, TX

Postby dalanik on Thu Jul 27, 2006 8:01 am

art wrote:I'm no expert, but you could try something like this, providing that your form is called Form1:
Code: Select all
Dim myForm As New Form1
myForm.ShowDialog()


Thanx, that occured to me and it behaved slightly better, but I still have problems that I don't have in normal windows application, I don't know whether because I'm compilinng a .dll or because of XLobby... It's either not positioned correctly or not on top or dissapears or not correct size or something :-)

Again - funny that when I compile it as an normal exe (and remove all xlobby required stuff) it all works as it should...

D.
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Postby badubo on Thu Jul 27, 2006 8:03 am

I guess that the problem is that your dialog is created on a separe thread (the one of the event) and then as the thread disappear, the dialog UI is killed.

In config dialog, using a form works because you are inside the main thread of xlobby.

Try to precreate your form using CreateControl method in the constructor of your plugin (or during the sethelper)

Then use showdialog in the event. (You will probably have to use Invoke mechanism instead of calling it directly)
badubo
 
Posts: 505
Joined: Mon May 03, 2004 7:33 pm
Location: Belgium

Postby dalanik on Thu Jul 27, 2006 9:44 am

I already see improvement when I create it in the constructor! Cool! All of a sudden it is at correct position and size, on top and doesn't steal focus from xlobby...

THANX man!!!!

D.
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic