-
How to change the color of the dialog box, I have overridden the getPalette() method as required, but this does not work, the dialog box displays red by default, why? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hi @600888! Sorry for the late answer. I am uncertain why you are facing this issue. The white-over-red color is automatically used when there is something wrong with the palette. However, I don't see anything wrong in your definition of Note, however, that if your only purpose is to use the blue dialog palette, you can also achieve this not by overriding class MyDialog : public TDialog
{
public:
MyDialog(const TRect &bounds, TStringView title) :
TWindowInit(initFrame),
TDialog(bounds, title)
{
palette = dpBlueDialog;
}
}; Cheers. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Okay, I see where the problem is. Here are some screenshots from the Turbo Vision's programming guide that will help you understand how palettes actually work. Turbo Vision's palette system has the disadvantage that when you design a palette, you have to take into account the class into which your view will be inserted. The cause of your issue is that There are two possible basic solutions that come to my mind:
Cheers. |
Beta Was this translation helpful? Give feedback.
Okay, I see where the problem is.
Here are some screenshots from the Turbo Vision's programming guide that will help you understand how palettes actually work.
Turbo Vision's palette system has the disadvantage that when you design a palette, you have to take into account the class into which your view will be inserted.
The cause of your issue is that
YcViewDialog
s andYxViewDialog
s are being inserted intoStationViewDialog
s, but still use standardTDialog
palettes which assume the owner view will be aTApplication
orTDesktop
.There are two possible basic solutions that come to my mind:
YcViewDialog
s andYxViewDialog
s into the desktop and not into another dialog (which is the …