src/window.cpp
changeset 7342 c42f92fe1a60
parent 7341 02515d0d4ced
child 7344 1d44a3182218
equal deleted inserted replaced
7341:02515d0d4ced 7342:c42f92fe1a60
   666 		 * unsigned int, which won't work. */
   666 		 * unsigned int, which won't work. */
   667 		if (w->resize.step_width  > 1) enlarge_x -= enlarge_x % (int)w->resize.step_width;
   667 		if (w->resize.step_width  > 1) enlarge_x -= enlarge_x % (int)w->resize.step_width;
   668 		if (w->resize.step_height > 1) enlarge_y -= enlarge_y % (int)w->resize.step_height;
   668 		if (w->resize.step_height > 1) enlarge_y -= enlarge_y % (int)w->resize.step_height;
   669 
   669 
   670 		ResizeWindow(w, enlarge_x, enlarge_y);
   670 		ResizeWindow(w, enlarge_x, enlarge_y);
       
   671 
       
   672 		WindowEvent e;
       
   673 		e.event = WE_RESIZE;
       
   674 		e.we.sizing.size.x = w->width;
       
   675 		e.we.sizing.size.y = w->height;
       
   676 		e.we.sizing.diff.x = enlarge_x;
       
   677 		e.we.sizing.diff.y = enlarge_y;
       
   678 		w->wndproc(w, &e);
       
   679 
   671 		if (w->left < 0) w->left = 0;
   680 		if (w->left < 0) w->left = 0;
   672 		if (w->top  < 0) w->top  = 0;
   681 		if (w->top  < 0) w->top  = 0;
   673 	}
   682 	}
   674 
   683 
   675 	SetWindowDirty(w);
   684 	SetWindowDirty(w);
  1090 void ResizeWindow(Window *w, int x, int y)
  1099 void ResizeWindow(Window *w, int x, int y)
  1091 {
  1100 {
  1092 	Widget *wi;
  1101 	Widget *wi;
  1093 	bool resize_height = false;
  1102 	bool resize_height = false;
  1094 	bool resize_width = false;
  1103 	bool resize_width = false;
  1095 
       
  1096 	/* X and Y has to go by step.. calculate it.
       
  1097 	 * The cast to int is necessary else x/y are implicitly casted to
       
  1098 	 * unsigned int, which won't work. */
       
  1099 	if (w->resize.step_width  > 1) x -= x % (int)w->resize.step_width;
       
  1100 	if (w->resize.step_height > 1) y -= y % (int)w->resize.step_height;
       
  1101 
  1104 
  1102 	if (x == 0 && y == 0) return;
  1105 	if (x == 0 && y == 0) return;
  1103 
  1106 
  1104 	SetWindowDirty(w);
  1107 	SetWindowDirty(w);
  1105 	for (wi = w->widget; wi->type != WWT_LAST; wi++) {
  1108 	for (wi = w->widget; wi->type != WWT_LAST; wi++) {