Check panel position
332257
function checkPanelPosition() {
        const currentPanelRect = panel.getBoundingClientRect();

        if (currentPanelRect.top + currentPanelRect.height > getScrollContainerHeight() &&
          !isDocked) {
          dock();
        } else if (
          isDocked &&
          currentPanelRect.top + currentPanelRect.height +
            getScrollContainerScrollTop() >= getInitialUndockedPosition() + TOGGLE_GAP
        ) {
          undock();
        }
      }
1017380
private void setSelectPosition(int posX, int posY, int height, int width) {

        int useWidth = Window.getClientWidth();
        int bodyWidth = RootPanel.getBodyElement().getClientWidth() + RootPanel.getBodyElement().getOffsetLeft();
        if (bodyWidth > useWidth) {
            useWidth = bodyWidth;
        }
        int useHeight = Window.getClientHeight();
        int bodyHeight = RootPanel.getBodyElement().getClientHeight() + RootPanel.getBodyElement().getOffsetTop();
        if (bodyHeight > useHeight) {
            useHeight = bodyHeight;
        }

        m_overlayLeftStyle.setWidth(posX - m_offset, Unit.PX);
        m_overlayLeftStyle.setHeight(useHeight, Unit.PX);

        m_borderLeftStyle.setHeight(height + (4 * m_offset), Unit.PX);
        m_borderLeftStyle.setTop(posY - (2 * m_offset), Unit.PX);
        m_borderLeftStyle.setLeft(posX - (2 * m_offset), Unit.PX);

        m_overlayTopStyle.setLeft(posX - m_offset, Unit.PX);
        m_overlayTopStyle.setWidth(width + (2 * m_offset), Unit.PX);
        m_overlayTopStyle.setHeight(posY - m_offset, Unit.PX);

        m_borderTopStyle.setLeft(posX - m_offset, Unit.PX);
        m_borderTopStyle.setTop(posY - (2 * m_offset), Unit.PX);
        if (m_hasButtonBar) {
            m_borderTopStyle.setWidth(width + (2 * m_offset) + BUTTON_BAR_WIDTH, Unit.PX);
        } else {
            m_borderTopStyle.setWidth(width + (2 * m_offset), Unit.PX);
        }

        m_overlayBottomStyle.setLeft(posX - m_offset, Unit.PX);
        m_overlayBottomStyle.setWidth(width + m_offset + m_offset, Unit.PX);
        m_overlayBottomStyle.setHeight(useHeight - posY - height - m_offset, Unit.PX);
        m_overlayBottomStyle.setTop(posY + height + m_offset, Unit.PX);

        m_borderBottomStyle.setLeft(posX - m_offset, Unit.PX);
        m_borderBottomStyle.setTop((posY + height) + m_offset, Unit.PX);
        if (m_hasButtonBar) {
            m_borderBottomStyle.setWidth(width + (2 * m_offset) + BUTTON_BAR_WIDTH, Unit.PX);
        } else {
            m_borderBottomStyle.setWidth(width + (2 * m_offset), Unit.PX);
        }

        m_overlayRightStyle.setLeft(posX + width + m_offset, Unit.PX);
        m_overlayRightStyle.setWidth(useWidth - posX - width - m_offset, Unit.PX);
        m_overlayRightStyle.setHeight(useHeight, Unit.PX);

        m_borderRightStyle.setHeight(height + (4 * m_offset), Unit.PX);
        m_borderRightStyle.setTop(posY - (2 * m_offset), Unit.PX);
        if (m_hasButtonBar) {
            m_borderRightStyle.setLeft(posX + width + m_offset + BUTTON_BAR_WIDTH, Unit.PX);
        } else {
            m_borderRightStyle.setLeft(posX + width + m_offset, Unit.PX);
        }

        m_buttonBar.getStyle().setTop(posY - m_offset, Unit.PX);
        m_buttonBar.getStyle().setHeight(height + (2 * m_offset), Unit.PX);
        m_buttonBar.getStyle().setLeft(posX + width + m_offset + 1, Unit.PX);
    }
935824
def gotoNext(self):
        
        index = self._currentPanel.currentIndex() + 1
        if ( self._currentPanel.count() == index ):
            index = 0
            
        self._currentPanel.setCurrentIndex(index)
303164
function tabBrowser_waitForTabPanel(tabIndex, elemString) {
    // Get the specified tab panel element
    var tabPanel = this.getTabPanelElement(tabIndex, elemString);
    
    // Get the style information for the tab panel element
    var style = this._controller.window.getComputedStyle(tabPanel.getNode(), null);
    
    // Wait for the top margin to be 0px - ie. has stopped animating
    // XXX: A notification bar starts at a negative pixel margin and drops down
    //      to 0px.  This creates a race condition where a test may click
    //      before the notification bar appears at it's anticipated screen location
    this._controller.waitFor(function () {
      return style.marginTop == '0px';
    }, "Expected notification bar to be visible: '" + elemString + "' ");
  }
1258590
function() {
		var yOffset = _panOffset.y - self.currItem.initialPosition.y; // difference between initial and current position
		return 1 -  Math.abs( yOffset / (_viewportSize.y / 2)  );
	}
2724
def lbrt(self):
        """"""
        return self._left, self._bottom, self._right, self._top
17938
def InitLocCheck(self):
        """"""
        self.panel = wx.Panel(self, style=wx.SIMPLE_BORDER)

        text = """Step 5:
Check that locations are correctly named.
Fill in any blank cells using controlled vocabularies.
(See Help button for details)

** Denotes controlled vocabulary"""
        label = wx.StaticText(self.panel, label=text)
        #self.Data_hierarchy = self.ErMagic.Data_hierarchy
        self.locations = self.er_magic_data.locations
        #
        if not self.er_magic_data.locations:
            msg = "You have no data in er_locations, so we are skipping step 5.\n Note that location names must be entered at the measurements level,so you may need to re-import your data, or you can add a location in step 3"
            dlg = wx.MessageDialog(None, caption="Message:", message=msg, style=wx.OK|wx.ICON_INFORMATION)
            dlg.ShowModal()
            dlg.Destroy()
            self.panel.Destroy()
            self.InitAgeCheck()
            return

        self.grid_builder = grid_frame2.GridBuilder(self.er_magic_data, 'location',
                                                   self.er_magic_data.headers, self.panel)
        self.loc_grid = self.grid_builder.make_grid(incl_pmag=False)
        self.loc_grid.InitUI()
        self.grid_builder.add_data_to_grid(self.loc_grid, 'location', incl_pmag=False)
        self.grid = self.loc_grid
        # initialize all needed drop-down menus
        self.drop_down_menu = drop_down_menus.Menus("location", self,
                                                     self.loc_grid, None)

        # need to find max/min lat/lon here IF they were added in the previous grid
        sites = self.er_magic_data.sites
        location_lat_lon = self.er_magic_data.get_min_max_lat_lon(self.er_magic_data.locations)

        col_names = ('location_begin_lat', 'location_end_lat', 'location_begin_lon', 'location_end_lon')
        col_inds = [self.grid.col_labels.index(name) for name in col_names]
        col_info = list(zip(col_names, col_inds))
        for loc in self.er_magic_data.locations:
            row_ind = self.grid.row_labels.index(loc.name)
            for col_name, col_ind in col_info:
                info = location_lat_lon[loc.name][col_name]
                self.grid.SetCellValue(row_ind, col_ind, str(info))

        ### Create Buttons ###
        hbox_one = wx.BoxSizer(wx.HORIZONTAL)
        self.helpButton = wx.Button(self.panel, label="Help")
        self.Bind(wx.EVT_BUTTON, lambda event: self.on_helpButton(event, "ErMagicLocationHelp.html"), self.helpButton)
        hbox_one.Add(self.helpButton)

        hboxok = wx.BoxSizer(wx.HORIZONTAL)
        self.saveButton = wx.Button(self.panel, id=-1, label='Save')
        self.Bind(wx.EVT_BUTTON, lambda event: self.on_saveButton(event, self.loc_grid), self.saveButton)
        self.cancelButton = wx.Button(self.panel, wx.ID_CANCEL, '&Cancel')
        self.Bind(wx.EVT_BUTTON, self.on_cancelButton, self.cancelButton)
        self.continueButton = wx.Button(self.panel, id=-1, label='Save and continue')
        self.Bind(wx.EVT_BUTTON, lambda event: self.on_continueButton(event, self.loc_grid, next_dia=self.InitAgeCheck), self.continueButton)
        self.backButton = wx.Button(self.panel, wx.ID_ANY, "&Back")
        previous_dia = self.InitSampCheck
        self.Bind(wx.EVT_BUTTON, lambda event: self.on_backButton(event, previous_dia, current_dia=self.InitLocCheck), self.backButton)

        hboxok.Add(self.saveButton, flag=wx.RIGHT, border=10)
        hboxok.Add(self.cancelButton, flag=wx.RIGHT, border=10)
        hboxok.Add(self.continueButton, flag=wx.RIGHT, border=10)
        hboxok.Add(self.backButton)

        #
        hboxgrid = pw.hbox_grid(self.panel, self.onDeleteRow, 'location', self.grid)
        self.deleteRowButton = hboxgrid.deleteRowButton

        self.Bind(wx.grid.EVT_GRID_LABEL_LEFT_CLICK, self.onLeftClickLabel, self.grid)


        ### Make Containers ###
        vbox = wx.BoxSizer(wx.VERTICAL)
        vbox.Add(label, flag=wx.ALIGN_CENTER|wx.TOP|wx.BOTTOM, border=20)
        vbox.Add(hbox_one, flag=wx.BOTTOM|wx.ALIGN_LEFT, border=10)
        vbox.Add(hboxok, flag=wx.BOTTOM|wx.ALIGN_LEFT, border=10)
        vbox.Add(hboxgrid, flag=wx.BOTTOM|wx.ALIGN_LEFT, border=10)
        vbox.Add(self.loc_grid, flag=wx.TOP|wx.BOTTOM, border=10)
        vbox.AddSpacer(20)

        self.hbox_all = wx.BoxSizer(wx.HORIZONTAL)
        self.hbox_all.AddSpacer(20)
        self.hbox_all.Add(vbox)
        self.hbox_all.AddSpacer(20)

        self.panel.SetSizer(self.hbox_all)
        #if sys.platform in ['win32', 'win64']:
        #    self.panel.SetScrollbars(20, 20, 50, 50)
        self.hbox_all.Fit(self)
        self.Centre()
        self.Show()
        self.Hide()
        self.Show()
1248189
def pos(self, x=None, y=None):
        '''
        if x is None:
            info = CONSOLE_SCREEN_BUFFER_INFO()
            self.GetConsoleScreenBufferInfo(self.hout, byref(info))
            return (info.dwCursorPosition.X, info.dwCursorPosition.Y)
        else:
            return self.SetConsoleCursorPosition(self.hout, 
                                                 self.fixcoord(x, y))
796589
function compareGrabberAndMousePosition(m) {
			if (isScrollbarOver(m)) {
				if (ctrl.horizontal) {
					var start = getScrollbarArea().left + getGrabberOffsetPixelFromPercent(getGrabberOffsetPercentFromBegin($scope.ngBegin));
					if (m.x < start)
						return -1;
					var end = start + getGrabberSizePixelFromPercent(getGrabberSizePercentFromScopeValues());
					if (m.x > end)
						return 1;
					if (m.x >= start && m.x <= end)
						return 0;
				} else {
					var start = getScrollbarArea().top + getGrabberOffsetPixelFromPercent(getGrabberOffsetPercentFromBegin($scope.ngBegin));
					if (m.y < start)
						return -1;
					var end = start + getGrabberSizePixelFromPercent(getGrabberSizePercentFromScopeValues());
					if (m.y > end)
						return 1;
					if (m.y >= start && m.y <= end)
						return 0;
				}
			}
			return Number.NaN;
		}
1328483
def viewbox(self):
        
        return self.left, self.top, self.right, self.bottom
342482
def current_position(self):
        """"""
        token = self.tokenizer.peek(0)
        if token:
            return token.start, token.end

        return self.tokenizer.position, self.tokenizer.position + 1
948184
function getOffsetOverride(containerElement, props) {
  var getPixelPositionOffset = props.getPixelPositionOffset
  //
  // Allows the component to control the visual position of the OverlayView
  // relative to the LatLng pixel position.
  //

  if ((0, _isFunction3.default)(getPixelPositionOffset)) {
    return getPixelPositionOffset(
      containerElement.offsetWidth,
      containerElement.offsetHeight
    )
  } else {
    return {}
  }
}
281818
function(oPositionContainer, oControl, sProp, sPos1, sVal1, sPos2, sVal2) {
		if (sVal1 && sVal2) {
			var oLayout = oPositionContainer.getParent();
			var oProp = getPropertyInfo(oControl, sProp);
			if (oProp) {
				var val = oControl[oProp._sGetter]();
				if (!(!val || val == "" || val == "auto" || val == "inherit")) {
					Log.warning("Position " + sPos2 + "=" + sVal2 + " ignored, because child control " + oControl.getId() + " has fixed " + sProp + " (" + val + ").",
							"", "AbsoluteLayout '" + (oLayout ? oLayout.getId() : "_undefined") + "'");
					return false;
				}
			} else {
				if ((sProp === "width" && !oPositionContainer._disableWidthCheck) || (sProp === "height" && !oPositionContainer._disableHeightCheck)) {
					Log.warning("Position " + sPos2 + "=" + sVal2 + " ignored, because child control " + oControl.getId() + " not resizable.",
							"", "AbsoluteLayout '" + (oLayout ? oLayout.getId() : "_undefined") + "'");
					return false;
				}
			}
		}
		return true;
	}
1364256
def register(self, panel, position=Panel.Position.LEFT):
        
        assert panel is not None
        pos_to_string = {
            Panel.Position.BOTTOM: 'bottom',
            Panel.Position.LEFT: 'left',
            Panel.Position.RIGHT: 'right',
            Panel.Position.TOP: 'top',
            Panel.Position.FLOATING: 'floating'
        }
        logger.debug('adding panel %s at %s' % (panel.name,
                                                pos_to_string[position]))
        panel.order_in_zone = len(self._panels[position])
        self._panels[position][panel.name] = panel
        panel.position = position
        panel.on_install(self.editor)
        logger.debug('panel %s installed' % panel.name)
        return panel
443918
def get_position(self):
        """"""
        rect = _Rect()
        GetWindowRect(self._hwnd, ctypes.pointer(rect))
        return rect.left, rect.top, rect.right, rect.bottom
423695
private void setToolTipPosition(int clientLeft, int clientTop) {

        if (m_toolTip != null) {
            int height = m_toolTip.getOffsetHeight();
            int width = m_toolTip.getOffsetWidth();
            int windowHeight = Window.getClientHeight();
            int windowWidth = Window.getClientWidth();
            int scrollLeft = Window.getScrollLeft();
            int scrollTop = Window.getScrollTop();
            int left = clientLeft + scrollLeft + m_offsetLeft;
            if ((left + width) > (windowWidth + scrollLeft)) {
                left = (windowWidth + scrollLeft) - m_offsetLeft - width;
            }
            m_toolTip.getStyle().setLeft(left, Unit.PX);
            int top = clientTop + scrollTop + m_offsetTop;
            if (((top + height) > (windowHeight + scrollTop)) && ((height + m_offsetTop) < clientTop)) {
                top = (clientTop + scrollTop) - m_offsetTop - height;
            }
            m_toolTip.getStyle().setTop(top, Unit.PX);
        }
    }
310890
private void checkLayout()
    {
        Dimension dim = getLayoutDimension();
        if (currentDimension == null || !currentDimension.equals(dim)) //the dimension has changed
        {
            createLayout(dim);
            //containing box for the new viewport
            viewport.setContainingBlockBox(owner);
            if (owner instanceof BlockBox)
                viewport.clipByBlock((BlockBox) owner);
            
            owner.removeAllSubBoxes();
            owner.addSubBox(viewport);
            currentDimension = new Dimension(dim);
        }
    }