Hi,
I have a dialog that displays a bitmap. For that, I use a simple BitmapButton
customgui. However, I want the bitmap to fill the whole width of the dialog, but that doesn't seem to be possible. There is always a small margin between bitmap and window borders.
Here's some code:
class AboutDialog : public GeDialog
{
INSTANCEOF(AboutDialog, GeDialog);
static const Int32 IDC_LOGOAREA = 10000;
public:
virtual Bool CreateLayout() override
{
SUPER::CreateLayout();
SetTitle(GeLoadString(IDS_ABOUTCOMMAND));
GroupBorderSpace(0, 0, 0, 0);
GroupSpace(0, 0);
GroupBorderNoTitle(BORDER_NONE);
// Add logo to dialog title
BaseContainer logoBc;
logoBc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_BITMAPBUTTON);
logoBc.SetInt32(BITMAPBUTTON_BORDER, BORDER_NONE);
logoBc.SetBool(BITMAPBUTTON_NOBORDERDRAW, true);
logoBc.SetBool(BITMAPBUTTON_BUTTON, false);
logoBc.SetBool(BITMAPBUTTON_TOGGLE, false);
logoBc.SetBool(BITMAPBUTTON_DRAWPOPUPBUTTON, false);
BitmapButtonCustomGui* logoButton = (BitmapButtonCustomGui*)AddCustomGui(IDC_LOGOAREA, CUSTOMGUI_BITMAPBUTTON, String(), BFH_CENTER|BFV_CENTER, SizePix(256L), SizePix(40L), logoBc);
if (logoButton)
{
const Filename logoFilename = GeGetPluginPath() + Filename("res") + Filename("logo.tif");
if (GeFExist(logoFilename))
logoButton->SetImage(logoFilename, false);
}
return true;
}
I was hoping that GroupBorderSpace(0, 0, 0, 0);
, GroupSpace(0, 0);
, or GroupBorderNoTitle(BORDER_NONE);
would do the trick. Or maybe setting BITMAPBUTTON_NOBORDERDRAW
in the BitmapButton
's container. But none of these changes anything. I also tried putting the BitmapButton
into a group, and then again throwing all those above mentioned things into the group. No change at all.
I noticed it works if I open the dialog with DLG_TYPE::ASYNC_POPUPEDIT
, but I would prefer a dialog with a title bar and the standard window gadgets.
Any tips?
Thanks in advance & greetings,
Frank