src/window.cpp
changeset 10426 4a77f7049b5e
parent 10238 5076964d81a1
child 10438 51bff16a04c9
equal deleted inserted replaced
10425:4a880a6ab2ac 10426:4a77f7049b5e
   459 	this->DeleteChildWindows();
   459 	this->DeleteChildWindows();
   460 
   460 
   461 	if (this->viewport != NULL) DeleteWindowViewport(this);
   461 	if (this->viewport != NULL) DeleteWindowViewport(this);
   462 
   462 
   463 	this->SetDirty();
   463 	this->SetDirty();
   464 	free(this->widget);
   464 
       
   465 	if (this->widget != NULL) {
       
   466 		for (const Widget *wi = this->widget; wi->type != WWT_LAST; wi++) {
       
   467 			if (wi->type == WWT_EDITBOX) _no_scroll--;
       
   468 		}
       
   469 		free(this->widget);
       
   470 	}
   465 }
   471 }
   466 
   472 
   467 /**
   473 /**
   468  * Find a window by its class and window number
   474  * Find a window by its class and window number
   469  * @param cls Window class
   475  * @param cls Window class
   688 		for (const Widget *wi = widget; wi->type != WWT_LAST; wi++) index++;
   694 		for (const Widget *wi = widget; wi->type != WWT_LAST; wi++) index++;
   689 
   695 
   690 		w->widget = MallocT<Widget>(index);
   696 		w->widget = MallocT<Widget>(index);
   691 		memcpy(w->widget, widget, sizeof(*w->widget) * index);
   697 		memcpy(w->widget, widget, sizeof(*w->widget) * index);
   692 		w->widget_count = index - 1;
   698 		w->widget_count = index - 1;
       
   699 
       
   700 		for (const Widget *wi = w->widget; wi->type != WWT_LAST; wi++) {
       
   701 			if (wi->type == WWT_EDITBOX) _no_scroll++;
       
   702 		}
   693 	} else {
   703 	} else {
   694 		w->widget = NULL;
   704 		w->widget = NULL;
   695 		w->widget_count = 0;
   705 		w->widget_count = 0;
   696 	}
   706 	}
   697 }
   707 }