Page 1 of 2

Buttons with rounded corners in dc_msgbox()

Posted: Mon Mar 20, 2023 7:36 am
by skiman
Hi,

I had a visual problem when using buttons with a radius. When a dc_messagebox was displayed, the corners were black.

I changed it in de _dcmsg.prg by changing the TYPE of the DCSTATIC.
@ nLine,0 DCSTATIC TYPE XBPSTATIC_TYPE_FGNDRECT instead of the XBPSTATIC_TYPE_TEXT

Also the icon in the dialog wasn't a perfect circle. I changed this the following way:
@ 10,10 DCSTATIC TYPE nIconType SIZE 40,40 CAPTION nIcon PIXEL

By using the PIXEL clause, the icon is now a perfect circle.

Re: Buttons with rounded corners in dc_msgbox()

Posted: Mon Mar 20, 2023 8:02 am
by rdonnay
I had not seen this problem of black around radiused corners in years.

A DCTOOLBAR is based on XbpStatic.

Can I assume that the buttons that you are putting on the DCSTATIC are DCPUSHBUTTONXP ?

Re: Buttons with rounded corners in dc_msgbox()

Posted: Mon Mar 20, 2023 8:46 am
by skiman
Hi Roger,

dc_messagebox is using pushbuttons in _dcmsg.prg.

Re: Buttons with rounded corners in dc_msgbox()

Posted: Mon Mar 20, 2023 9:06 am
by skiman
Hi,

When I try the BUTPICKER sample, the same effect comes up. AFAIK this wasn't a problem in the past?
button.png
button.png (40.33 KiB) Viewed 2608 times
In the source I see @ 0,0 DCSTATIC TYPE XBPSTATIC_TYPE_TEXT which is the parent of the buttons.

I never had problems in the past with the use of XBPSTATIC_TYPE_TEXT.

After changing the TYPE of the DCSTATIC, the problem is solved.

I have this problem with 1.9sl1 and 2.0 and express build 268.

Re: Buttons with rounded corners in dc_msgbox()

Posted: Mon Mar 20, 2023 9:45 am
by rdonnay
Chris -

Thank you for that feedback.

I see the same problem in the sample program.
There has not been any code changes in many years, so possibly it may be something has changed in Windows 10 or Xbase++.

I'm going to test this on my old laptop with Windows 7 and an older version of Xbase++ and eXpress++.

Regardless, I so no reason why I can't change the sample program to fix it, per your suggestion.
I would also need to change DCTOOLBAR.

Re: Buttons with rounded corners in dc_msgbox()

Posted: Mon Mar 20, 2023 9:59 am
by rdonnay
When I run the BUTTONXP.EXE sample program all the rounded buttons look fine, because they are all on a DCTOOLBAR TYPE XBPSTATIC_TYPE_TEXT.

I think that there is nothing I should so with my eXpress++ code, but I will change the BUTTPICKER sample program per your suggestion.

Re: Buttons with rounded corners in dc_msgbox()

Posted: Mon Mar 20, 2023 12:57 pm
by skiman
Hi Roger,

This is a screenshot of a dc_msgbox() as I get it.
msgbox.png
msgbox.png (11.88 KiB) Viewed 2591 times
- Icon isn't a circle.
- Corners wrong.

Is this working correctly on your system?

Re: Buttons with rounded corners in dc_msgbox()

Posted: Mon Mar 20, 2023 1:41 pm
by rdonnay
I am trying to figure out how you are getting radiused buttons in DCMSGBOX.

Can you send me a test program?

Re: Buttons with rounded corners in dc_msgbox()

Posted: Tue Mar 21, 2023 12:55 am
by skiman
Hi Roger,

I looked at the code of the pushbutton object and I noticed that there is no RADIUS property for it. :o

I have to check what is happening here. I come back to you later when I have found the cause.

Re: Buttons with rounded corners in dc_msgbox()

Posted: Tue Mar 21, 2023 10:08 am
by skiman
Hi Roger,

It seems I have somewhere a system to make the look of the pushbutton the same as the pushbuttonXP. I can't find it, but this is the only explanation for the 'radiused' buttons when I use pushbutton.

I thought I had done this with an include file, but in that case the dclipx would not use it. I didn't change the _dcxbutt.prg the pushbutton class is as the original.

At the startup of my application I have this:
DC_PopupButtonStyle( oConfigLegacy )
DC_PushButtonStyle( oConfigLegacy )

All my buttons looks the same, same color, mouseover, radius, gradient, ... no matter if they are pushbuttons or pushbuttonxp.

I have to check this further. Anyway this will be the cause of my dc_msgbox() problem, since the radius is used there in my version. I changed it according to my needs (and I documented the change :-)).