bool OnResizing(int *width, int *height)
{
+ // Checking *width/*height for zero does not work with minClientSize being set
+ Size initSize = this.initSize;
+ if(this.anchor.left.type != none && this.anchor.right.type != none) initSize.w = 1;
+ if(this.anchor.top.type != none && this.anchor.bottom.type != none) initSize.h = 1;
+
if(buttonStyle.checkBox || buttonStyle.radio || buttonStyle.bevelOver)
{
Bitmap bitmap0 = bitmaps[0] ? bitmaps[0].bitmap : null;
- if(!*width && bitmap0) *width = bitmap0.width;
- if(!*height && bitmap0) *height = bitmap0.height;
+ if(!initSize.w /**width*/ && bitmap0) *width = Max(*width, bitmap0.width);
+ if(!initSize.h /**height*/ && bitmap0) *height = Max(*height, bitmap0.height);
*height = Max(*height, captionHeight + 2);
if(text)
{
if(!caption && bitmap && bitmap.bitmap)
{
- if(!*width)
- *width = bitmap.bitmap.width;
- if(!*height)
- *height = bitmap.bitmap.height;
+ if(!initSize.w /**width*/)
+ *width = Max(*width, bitmap.bitmap.width);
+ if(!initSize.h /**height*/)
+ *height = Max(*height, bitmap.bitmap.height);
}
else if(guiApp.textMode && buttonStyle.bevel)
{
- if(!*width)
+ if(!initSize.w /**width*/)
*width = Max(*width, captionWidth + 8);
- if(!*height)
+ if(!initSize.h /**height*/)
*height = Max(*height, captionHeight + 16);
}
else
{
- if(!*width)
+ if(!initSize.w /**width*/)
*width = Max(*width, captionWidth + /*4*/12);
- if(!*height)
+ if(!initSize.h /**height*/)
*height = Max(*height, captionHeight + /*6*/ 8);
}
}
SNAPUP(thumbPos, textCellH);
}
+ thumb.SetInitSize({ size.w,thumbSize });
thumb.Move(0,thumbPos, size.w,thumbSize);
}
else
SNAPUP(thumbPos, textCellW);
}
+ thumb.SetInitSize({ thumbSize, size.h });
thumb.Move(thumbPos, 0, thumbSize, size.h);
}
}
upBtn.size.h = SB_HEIGHT;
upBtn.anchor = Anchor { left = 0, right = 0, top = 0 };
+ thumb.SetInitSize({ Max(clientSize.w, sbWidth), thumbSize });
thumb.Move(0,0, Max(clientSize.w, sbWidth), thumbSize);
}
else
upBtn.size.w = SB_HEIGHT;
upBtn.anchor = Anchor { left = 0, top = 0, bottom = 0 };
+ thumb.SetInitSize({ thumbSize, Max(clientSize.h, SB_HEIGHT) });
thumb.Move(0,0, thumbSize, Max(clientSize.h, SB_HEIGHT));
}