void cBorderGump::setGump(unsigned short id, unsigned short hue, bool forceupdate) { if (forceupdate || this->id != id || this->hue != hue) { clear(); // Clear all children this->id = id; this->hue = hue; // Upper Left uleft = new cGumpImage(id, hue); uleft->update(); addControl(uleft); // Upper Right uright = new cGumpImage(id + 2, hue); uright->update(); addControl(uright); // Lower Left lleft = new cGumpImage(id + 6, hue); lleft->update(); addControl(lleft); // Lower Right lright = new cGumpImage(id + 8, hue); lright->update(); addControl(lright); // Top top = new cTiledGumpImage(id + 1, hue); top->update(); addControl(top); // Left left = new cTiledGumpImage(id + 3, hue); left->update(); addControl(left); // Right right = new cTiledGumpImage(id + 5, hue); right->update(); addControl(right); // Bottom bottom = new cTiledGumpImage(id + 7, hue); bottom->update(); addControl(bottom); // Center center = new cTiledGumpImage(id + 4, hue); center->update(); addControl(center); alignControls(); // Align the controls } }
void MainForm::OnSize(UINT nType, int cx, int cy) { CDialog::OnSize(nType, cx, cy); alignControls(); }
/* Change the position of the gump controls. */ void cBorderGump::onChangeBounds(int oldx, int oldy, int oldwidth, int oldheight) { if (oldwidth != width_ || oldheight != height_) { alignControls(); } }