Discussions related to Visual Prolog
User avatar
abdelrahman
Posts: 13
Joined: 13 Sep 2009 6:23

How to change background color of a standard Dialog without making custom control Dialog

Unread post by abdelrahman »

my dear friends ,
i want to change the background color of standard dialog without making custom control
the following is dialog. pro contents
what should i write to change background color and where to write it ?????

Code: Select all

implement color_dialog inherits dialog     open core, vpiDomains   clauses     display(Parent) = Dialog :-         Dialog = new(Parent),         Dialog:show().   clauses     new(Parent) :-         dialog::new(Parent),         generatedInitialize().   % This code is maintained automatically, do not update it manually. facts     ok_ctl : button.     cancel_ctl : button.     help_ctl : button.   predicates     generatedInitialize : (). clauses     generatedInitialize() :-         setText("color_dialog"),         setRect(rct(50, 40, 290, 160)),         setModal(true),         setDecoration(titlebar([frameDecoration::closeButton])),         ok_ctl := button::newOk(This),         ok_ctl:setText("&OK"),         ok_ctl:setPosition(48, 98),         ok_ctl:setSize(56, 16),         ok_ctl:defaultHeight := false,         ok_ctl:setAnchors([control::right, control::bottom]),         cancel_ctl := button::newCancel(This),         cancel_ctl:setText("Cancel"),         cancel_ctl:setPosition(112, 98),         cancel_ctl:setSize(56, 16),         cancel_ctl:defaultHeight := false,         cancel_ctl:setAnchors([control::right, control::bottom]),         help_ctl := button::new(This),         help_ctl:setText("&Help"),         help_ctl:setPosition(176, 98),         help_ctl:setSize(56, 16),         help_ctl:defaultHeight := false,         help_ctl:setAnchors([control::right, control::bottom]). % end of automatic code   end implement color_dialog
Harrison Pratt
VIP Member
Posts: 356
Joined: 5 Nov 2000 0:01

Re: How to change background color of a standard Dialog without making custom control Dialog

Unread post by Harrison Pratt »

Are you using ViP 10?

I don't think changing dialog backgrounds in Vip 9 or earlier can be done easily.
User avatar
Thomas Linder Puls
VIP Member
Posts: 1264
Joined: 28 Feb 2000 0:01

Re: How to change background color of a standard Dialog without making custom control Dialog

Unread post by Thomas Linder Puls »

Assuming that you are using a sufficiently new Vip, you should just write:

Code: Select all

clauses     new(Parent) :-         dialog::new(Parent),         generatedInitialize(),         setBackgroundColor(color_aqua).
Regards Thomas Linder Puls
PDC
User avatar
abdelrahman
Posts: 13
Joined: 13 Sep 2009 6:23

Re: How to change background color of a standard Dialog without making custom control Dialog

Unread post by abdelrahman »

Yes ,, I use VIP 10 CE
it worked well and also simple , i missed this in earlier version of VIP .
thank you very much
User avatar
abdelrahman
Posts: 13
Joined: 13 Sep 2009 6:23

Re: How to change background color of a standard Dialog without making custom control Dialog

Unread post by abdelrahman »

by the way ,
with such like simplicity in changing Dialog background in vip 10
is it possible or there is new Features in vip 10 ce to change
Button control Background color , foreground Text Color or button Shape to ovoid one???
User avatar
Thomas Linder Puls
VIP Member
Posts: 1264
Joined: 28 Feb 2000 0:01

Re: How to change background color of a standard Dialog without making custom control Dialog

Unread post by Thomas Linder Puls »

No, I am afraid not. A button (i.e. a Windows common controls button) does not support this in any simple way, you will have to create an "owner draw" button (which implies handling a lot of events and doing all the drawing yourself).
Regards Thomas Linder Puls
PDC
Post Reply