window.c
changeset 2026 02dfa0aa2c2f
parent 2021 3be628c59488
child 2154 63a6b880b4c0
equal deleted inserted replaced
2025:b0b897359fdf 2026:02dfa0aa2c2f
   153 	Window *v = w;
   153 	Window *v = w;
   154 	int x;
   154 	int x;
   155 
   155 
   156 	while (++v != _last_window) {
   156 	while (++v != _last_window) {
   157 		if (right > v->left &&
   157 		if (right > v->left &&
   158 		 		bottom > v->top &&
   158 				bottom > v->top &&
   159 				left < v->left + v->width &&
   159 				left < v->left + v->width &&
   160 				top < v->top + v->height) {
   160 				top < v->top + v->height) {
   161 
   161 
   162 			if (left < (x=v->left)) {
   162 			if (left < (x=v->left)) {
   163 				DrawOverlappedWindow(w, left, top, x, bottom);
   163 				DrawOverlappedWindow(w, left, top, x, bottom);
   658 			w->left < _screen.width-20 && w->left > -60 && w->top < _screen.height-20) {
   658 			w->left < _screen.width-20 && w->left > -60 && w->top < _screen.height-20) {
   659 		pt.x = w->left + 10;
   659 		pt.x = w->left + 10;
   660 		if (pt.x > _screen.width + 10 - desc->width)
   660 		if (pt.x > _screen.width + 10 - desc->width)
   661 			pt.x = (_screen.width + 10 - desc->width) - 20;
   661 			pt.x = (_screen.width + 10 - desc->width) - 20;
   662 		pt.y = w->top + 10;
   662 		pt.y = w->top + 10;
   663 	} else if (desc->cls == WC_BUILD_TOOLBAR) {	// open Build Toolbars aligned
   663 	} else if (desc->cls == WC_BUILD_TOOLBAR) { // open Build Toolbars aligned
   664 		/* Override the position if a toolbar is opened according to the place of the maintoolbar
   664 		/* Override the position if a toolbar is opened according to the place of the maintoolbar
   665 		 * The main toolbar (WC_MAIN_TOOLBAR) is 640px in width */
   665 		 * The main toolbar (WC_MAIN_TOOLBAR) is 640px in width */
   666 		switch (_patches.toolbar_pos) {
   666 		switch (_patches.toolbar_pos) {
   667 		case 1:		pt.x = ((_screen.width + 640) >> 1) - desc->width; break;
   667 			case 1:  pt.x = ((_screen.width + 640) >> 1) - desc->width; break;
   668 		case 2:		pt.x = _screen.width - desc->width; break;
   668 			case 2:  pt.x = _screen.width - desc->width; break;
   669 		default:	pt.x = 640 - desc->width;
   669 			default: pt.x = 640 - desc->width;
   670 		}
   670 		}
   671 		pt.y = desc->top;
   671 		pt.y = desc->top;
   672 	} else {
   672 	} else {
   673 		pt.x = desc->left;
   673 		pt.x = desc->left;
   674 		pt.y = desc->top;
   674 		pt.y = desc->top;
  1639 
  1639 
  1640 	if (w == NULL || w->window_class != WC_MAIN_TOOLBAR)
  1640 	if (w == NULL || w->window_class != WC_MAIN_TOOLBAR)
  1641 		w = FindWindowById(WC_MAIN_TOOLBAR, 0);
  1641 		w = FindWindowById(WC_MAIN_TOOLBAR, 0);
  1642 
  1642 
  1643 	switch (_patches.toolbar_pos) {
  1643 	switch (_patches.toolbar_pos) {
  1644 		case 1:		w->left = (_screen.width - w->width) >> 1; break;
  1644 		case 1:  w->left = (_screen.width - w->width) >> 1; break;
  1645 		case 2:		w->left = _screen.width - w->width; break;
  1645 		case 2:  w->left = _screen.width - w->width; break;
  1646 		default:	w->left = 0;
  1646 		default: w->left = 0;
  1647 	}
  1647 	}
  1648 	SetDirtyBlocks(0, 0, _screen.width, w->height); // invalidate the whole top part
  1648 	SetDirtyBlocks(0, 0, _screen.width, w->height); // invalidate the whole top part
  1649 	return w->left;
  1649 	return w->left;
  1650 }
  1650 }
  1651 
  1651