How to center electron popup window dialog showOpenDialog - popup

I want file open popup to be initially centered, but instead it appears in left top corner of the screen and consequently remembers position where it was closed.
dialog.showOpenDialog(mainWindow,{title:`Open ${type} file`,buttonLabel:'Open'})
I've been taking a look on docs but i cant find center option.
Thanks.

Currently, there is no way to set the x, y position of an Electron dialog via the Electron dialog API.
On Microsoft Windows, Electron dialog's open in the top left corner of the parent window.
On MacOS, Electron dialog's open in the top centre of the parent window.
Whilst it is possible for dialogs to open in the centre of the screen, or at a set x y position relative to a parent window or screen using a lower-level language, this is not possible via the Electron API only.

Related

Perl/TK window with no decoration moving with mouse

I have a Perl/Tk window which is displayed on top of all other windows. It is a MainWindow->Frame->Label with text (it's a security classification banner). It must be a window which is on top. However, right now a user cannot move the window from its set location, so it will occasionally cover up a lower window control.
How can I make this window movable so it can be repositioned?
I don't have easy access to external modules since I'm on a closed network, so simple Perl/Tk code is best.
This is a Linux system running the KDE or Gnome desktop.
I have found that if you remove the decorations from a Perl/TK mainwindow, it cannot then respond to mouse movements.

NSPopover OS X Application

I am developing a menu bar application for os x. I am using NSPopover to create a popup window.
However when some other application is full screen that popup is not visible. What settings should be set, so that popup window is always on top.
I struggled with this as well. When I had this problem, I created a invisible window that would flow above all other windows, including full screen ones. The window would then activate the popover.
However, I found a much cleaner solution here.

AHK - mouseclick coordinates relative to app window

I was reading through AHK documentation but couldn't find one where it explains how to define the coordinates WITHIN a certain application window.
For example, I want to be able to minimize/maximize the ribbon in all microsoft office apps (top right corner). This should work reliably no matter whether the window is maximized or not, and the mouse cursor should not shift (or at least it should shift back) while doing so.
Any idea how i can achieve this?
If you want coordinates to be relative to the active window, you need to use the CoordMode command at the top of your script. The second parameter specifies the coordinate mode will be for mouse coordinates. The third parameter you can specify either Screen or Relative. Relative is what you are looking for.
CoordMode, Mouse, Relative

How to set window's position in a relative way

There's a problem with the window widget. Is there a way to set window's position
without setting the absolute position?
for example:
I want to set the window pop-up to the bottom right corner of the browser.
Now I use setleft and setright (at 1000,800), but the window still at (1000,800)
when i minimized the browser's window.
So, the question is, is there a way to set the pop-up window in a relative way,
can still to the bottom right corner of the browser even when i minimized the browser's
window??
Thanks!!

Dock window in VB6

How to dock form to another form (like VB6's Immediate, Debug forms...)?
I've tried to do it with a MDI Form and a child form, but I couldn't dock child form to MDI parent.
Also I've found some third-party controls but I'd like to do it without them.
Is there any way to do it? Thanks in advance.
You could check out Developer Fusion Dockable Window Control. The screenshots look promising.
From the overview:
This control (only 44KB!) allows you to add a dockable window to your
VB Project.
Dock top, left, right or bottom
'Tear off' to undock form
Autodock by moving form to edge of parent form
'Window memory' (the control remembers the dockable windows last position, which is restored when your application loads again.