How to set window's position in a relative way - gwt

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!!

Related

How to move Output or Terminal back into the panel in the window layout?

Recently in VS Code, somewhere around v1.42 or v1.43, we gained the ability to move around the following windows/panels that used to be stuck in the panel:
Terminal
Output
Debug Console
Problems
They could be split into multiple items in the panel itself (side-by-side or top/bottom, depending on whether the panel was at the bottom or left/right), and even dragged into the side-bar.
This was great, but after moving all of these windows to the side-bar while experimenting, I can't find any way to move them back into the panel. The panel is now empty, except for 3 dots (an ellipsis) in the upper left corner. You can still hide/show the panel, and move it left, bottom, or right, but there is nothing in it, and you can't drag anything to it. Dragging the terminal into the panel shows an icon that looks like it will successfully move (it's not the icon with the circle/cross-out you get other places it won't drop), but when releasing the click-drag, nothing happens.
I had just upgraded to v1.45.0 when this happened. It appears to be a defect, unless I'm missing something. Does anyone have a way to put the terminal or one of these other windows back in the panel, or reset their position? I combed the settings, and tried to find default setting's files (system or user) that might hold info on what is in the panel vs. the sidebar, etc., but couldn't find anything via search or on my PC. Any ideas?
Note: This is NOT about moving the panel between the left/right/bottom positions, or selecting the terminal/output/etc. in the panel itself. That's "old news", this is a recent feature.
Here is a view with the Terminal, Output, Debug Console, and Problems put at the top of the sidebar toolbar, and Terminal focused. The Panel is just to the right of the sidebar window, set to the "left" position, completely blank and useless. The "welcome" window on the far right side:
And here are my current settings:
See this issue https://github.com/microsoft/vscode/issues/96117 (Empty panel behaves weird)
Suggested fix:
Run the command View: Reset View Locations in the command palette.
Please see: https://www.technipages.com/visual-studio-reset-window-layout
Menu Window / Reset Window Layout worked for me in VS 2019

How to center electron popup window dialog showOpenDialog

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.

Stop Layout Options icon appearing by default on callouts in Word 2013

This is driving me mad! I love the new layout options in Word 2013, but when a callout gets to a certain size the icon for it obscures the end of the arrow, and you can't move the arrow:
Don't suppose anyone knows either how to get rid of the icon, how to click and drag on the yellow end of the arrow, or how to stop the icon appearing in the first place?
Thanks in advance.
Here are two answers that helped me. The second option gets rid of the floating Layout Options button, but at the cost of disabling some features of Word 2013.
First Option:
http://answers.microsoft.com/en-us/office/forum/office_2013_release-word/any-way-to-disable-the-layout-options-button/47f6af4a-2acd-483e-a953-6415c8530554
It might help to increase the zoom (use the slider at the right end of the status bar) while you work with the picture.
Second Option:
http://answers.microsoft.com/en-us/office/forum/office_2013_release-word/layout-options-icon-word-2013-suddenly-missing/ce304589-9db2-44c5-b1e1-8fd6596b70c4
Is the document in Compatibility Mode (shown by those words appearing in the title bar along with the document name)? If that's the case, click File and then click the Convert button. That will make the Layout Options button appear when a picture is selected, as well as turning on other features that are available only in the 2013 format. When you save, the document file will change to the .docx extension.
I know the second quote is about turning the Layout Options button on, but it works backwards, too. I saved my file as a *.doc instead of a *.docx and the floating button went away.
When you're finished editing your callouts, you can save it again as a *.docx.
One method that helped me was to flip horizontal, change the leader position, then flip back. That way the leader line is temporarily on the opposite side of the layout button, and both handles of the leader line are accessible, then can flip back. It is an extra step, but is another alternative.
In an attempt to automate this to quickly flip the object back and forth, I couldn't find a macro command to make a shortcut, or anything under Customize Ribbon with custom Keyboard Shortcuts to Flip Horizontal (MoreRotationOption opens up a dialog which does not give an option to flip).
The Flip Horizontal command could be called by pressing ALT JD (Format) AY (Rotate Objects) H (Horizontal) when the object is selected...
The best I could do was to add Rotate Objects to the Quick Access Toolbar, then the Flip Horizontal command could be called by pressing ALT # (whatever number you assign) H (Horizontal) which is three keystrokes.

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

emacs: x-popup-menu max size constraints?

I'm working on an intellisense or code-completion capability for C#.
So far, so good. Right now I have basic completion working. There are 2 ways to request completion. The first cycles through all the potential matches. The second presents a popup menu of the matches. It works for types:
And also for local and instance variables:
I'm confronting two problems with x-popup-menu:
the popup menu can expand to consume all available screen space, when the number of choices is large. Literally it can consume the entire screen, and obscure everything else, including the entire emacs window and every other window.
The silly thing is, it's scrollable. First it expands to consume all available space, then it also becomes scrollable. Seems like it would make sense for it to expand to a certain point, and then become scrollable, rather than expanding to take all available space.
Is there a way I can limit the maximum size of x-popup-menu?
To specify the position of the popup menu, I pass in a position, and x-popup-menu uses that as the *middle*, not the left, of the top line of the menu. Why middle? who knows.
What this means is, if I specify (40 . 60) for the location of the menu, and the menu happens to be 100 pixels wide, the menu will extend beyond the left border of the emacs window. You can see this in the 2nd image above.
If I knew how wide the popup would be before specifying the position, I could compensate. But I don't.
Is there a workaround? Is there a way to get x-popup-menu to take its position as the LEFT rather than the middle?
Addendum: Doc for x-popup-menu
x-popup-menu is a built-in function in `C source code'.
(x-popup-menu POSITION MENU)
Pop up a deck-of-cards menu and return user's selection.
PO SITION is a position specification. This is either a mouse button
event or a list ((XOFFSET YOFFSET) WINDOW) where XOFFSET and YOFFSET
are positions in pixels from the top left corner of WINDOW's frame
(WINDOW may be a frame object instead of a window). This controls the
position of the center of the first line in the first pane of the
menu, not the top left of the menu as a whole. If POSITION is t, it
means to use the current mouse position.
Some people like Emacs because it doesn't provide popup windows (see e.g. this blog entry). The more "emacsy" way of presenting your list of possible completions is to show them in a split buffer. That way you would automatically avoid all of the above issues (screen real estate & scrolling) and would probably attract more of the die-hard Emacs users.
But that's pure speculation :-)
You can base your autocompletion backend on company or autocomplete where display of suggestions is handled for you.