src/window.cpp
branchnoai
changeset 9601 b499fdd106d5
parent 9599 949374e83b78
child 9620 31e38d28a0af
equal deleted inserted replaced
9600:59cc173953ae 9601:b499fdd106d5
   233 
   233 
   234 		if (right > v->left &&
   234 		if (right > v->left &&
   235 				bottom > v->top &&
   235 				bottom > v->top &&
   236 				left < v->left + v->width &&
   236 				left < v->left + v->width &&
   237 				top < v->top + v->height) {
   237 				top < v->top + v->height) {
   238 			if (left < (x=v->left)) {
   238 			if (left < (x = v->left)) {
   239 				DrawOverlappedWindow(wz, left, top, x, bottom);
   239 				DrawOverlappedWindow(wz, left, top, x, bottom);
   240 				DrawOverlappedWindow(wz, x, top, right, bottom);
   240 				DrawOverlappedWindow(wz, x, top, right, bottom);
   241 				return;
   241 				return;
   242 			}
   242 			}
   243 
   243 
   244 			if (right > (x=v->left + v->width)) {
   244 			if (right > (x = v->left + v->width)) {
   245 				DrawOverlappedWindow(wz, left, top, x, bottom);
   245 				DrawOverlappedWindow(wz, left, top, x, bottom);
   246 				DrawOverlappedWindow(wz, x, top, right, bottom);
   246 				DrawOverlappedWindow(wz, x, top, right, bottom);
   247 				return;
   247 				return;
   248 			}
   248 			}
   249 
   249 
   250 			if (top < (x=v->top)) {
   250 			if (top < (x = v->top)) {
   251 				DrawOverlappedWindow(wz, left, top, right, x);
   251 				DrawOverlappedWindow(wz, left, top, right, x);
   252 				DrawOverlappedWindow(wz, left, x, right, bottom);
   252 				DrawOverlappedWindow(wz, left, x, right, bottom);
   253 				return;
   253 				return;
   254 			}
   254 			}
   255 
   255 
   256 			if (bottom > (x=v->top + v->height)) {
   256 			if (bottom > (x = v->top + v->height)) {
   257 				DrawOverlappedWindow(wz, left, top, right, x);
   257 				DrawOverlappedWindow(wz, left, top, right, x);
   258 				DrawOverlappedWindow(wz, left, x, right, bottom);
   258 				DrawOverlappedWindow(wz, left, x, right, bottom);
   259 				return;
   259 				return;
   260 			}
   260 			}
   261 
   261 
   821 	} else {
   821 	} else {
   822 		switch (desc->left) {
   822 		switch (desc->left) {
   823 			case WDP_ALIGN_TBR: { /* Align the right side with the top toolbar */
   823 			case WDP_ALIGN_TBR: { /* Align the right side with the top toolbar */
   824 				w = FindWindowById(WC_MAIN_TOOLBAR, 0);
   824 				w = FindWindowById(WC_MAIN_TOOLBAR, 0);
   825 				pt.x = (w->left + w->width) - desc->width;
   825 				pt.x = (w->left + w->width) - desc->width;
   826 			}	break;
   826 			} break;
   827 			case WDP_ALIGN_TBL: /* Align the left side with the top toolbar */
   827 			case WDP_ALIGN_TBL: /* Align the left side with the top toolbar */
   828 				pt.x = FindWindowById(WC_MAIN_TOOLBAR, 0)->left;
   828 				pt.x = FindWindowById(WC_MAIN_TOOLBAR, 0)->left;
   829 				break;
   829 				break;
   830 			case WDP_AUTO: /* Find a good automatic position for the window */
   830 			case WDP_AUTO: /* Find a good automatic position for the window */
   831 				pt = GetAutoPlacePosition(desc->width, desc->height);
   831 				pt = GetAutoPlacePosition(desc->width, desc->height);
  1078 
  1078 
  1079 /** Update all the widgets of a window based on their resize flags
  1079 /** Update all the widgets of a window based on their resize flags
  1080  * Both the areas of the old window and the new sized window are set dirty
  1080  * Both the areas of the old window and the new sized window are set dirty
  1081  * ensuring proper redrawal.
  1081  * ensuring proper redrawal.
  1082  * @param w Window to resize
  1082  * @param w Window to resize
  1083  * @param x delta x-size of changed window (positive if larger, etc.(
  1083  * @param x delta x-size of changed window (positive if larger, etc.)
  1084  * @param y delta y-size of changed window */
  1084  * @param y delta y-size of changed window */
  1085 void ResizeWindow(Window *w, int x, int y)
  1085 void ResizeWindow(Window *w, int x, int y)
  1086 {
  1086 {
  1087 	Widget *wi;
  1087 	Widget *wi;
  1088 	bool resize_height = false;
  1088 	bool resize_height = false;