dialog background

This forum is for eXpress++ general support.
Post Reply
Message
Author
skiman
Posts: 1186
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

dialog background

#1 Post by skiman »

Hi,

I want the background of my dialogs in another color. I thought that would be easy with XBPSYSCLR_DIALOGBACKGROUND in a presentation array. However, it seems as this isn't working.

Is there a way to change the background of my application with one change?
Best regards,

Chris.
www.aboservice.be

User avatar
Tom
Posts: 1176
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: dialog background

#2 Post by Tom »

Hi, Chris.

Code: Select all

FUNCTION SetDefOptions() // sets basic GetOptions for the app
LOCAL GetOptions := {}

DCGET OPTIONS .... COLOR naMyDialogColor

DC_GetOptDefault(GetOptions)
RETURN NIL
This will set all options you don't set when creating the dialogs. Any option set there will overwrite the standard options. If the user changes preferences, just call "SetDefOptions()" again.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

skiman
Posts: 1186
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: dialog background

#3 Post by skiman »

Tom,

I don't understand why this isn't working. This is what I do.

Code: Select all

DCGETOPTIONS ;
   WINDOWHEIGHT nWindowHeight ;
   WINDOWWIDTH nWindowWidth ;
   NOBUSY ;
   COLOR { 100,150,200 } ;
   FITPAD 25 ;
   SAYFONT cSayFont ;
   GETFONT cGetFont ;
   FONT cSayFont ;
   COLPIXELS nColPixels ;
   ROWPIXELS nRowPixels ;
   ROWSPACE nRowPixels ;
   TOOLTIPCOLOR GRA_CLR_BLACK, GRA_CLR_YELLOW ;
   ABORTQUERY MSG {||DC_MsgBox(,,{'Stoppen ? / Arreter ?'},"Logiciel ABO Software" ,,,.t.,1,,,,,'10.Arial.bold')} ;
   CLOSEQUERY MSG {||DC_MsgBox(,,{'Stoppen ? / Arreter ?'},"Logiciel ABO Software",,,.t.,1,,,,,'10.Arial.bold')} ;
   COLORGETS { { GRA_CLR_BLACK , GraMakeRGBColor({255,255,190}) } }

   DC_GetOptDefault(GetOptions)

   DCREAD GUI ;
	   TITLE '...' ;
	   OPTIONS GetOptions ;
	   PARENT @oDlg ;
           ....
My background remains the standard gray, which looks rather old fashioned.
Best regards,

Chris.
www.aboservice.be

User avatar
Tom
Posts: 1176
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: dialog background

#4 Post by Tom »

Hi, Chris.

This should work. It does in my app. But I use it this way:

Code: Select all

COLOR GraMakeRGBColor({ 100,150,200 })
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

skiman
Posts: 1186
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: dialog background

#5 Post by skiman »

Tom,

Yes, it should work, it also works in my samples and tests. It didn't in my application.

I just found the cause of it. However it doesn't seem logical to me.

In my main function, I had dcgetoptions twice. This was what I had:

In the start of my code
dcgetoptions ..... without the COLOR clause
DC_GetOptDefault(GetOptions) // set this as default in my application

Before the dcread gui
dcgetoptions ..... with the COLOR clause
DC_GetOptDefault(GetOptions) // set this as default from now on

dcread gui options getoptions ....

The dcread is using the first getoptions, without the color clause. :?:

Anyway, problem solved. Now adding the possibility for a user to select his own background color.
Best regards,

Chris.
www.aboservice.be

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: dialog background

#6 Post by Cliff Wiernik »

I thing you need to do it slightly differently if you want to do 2 sets of options.

Code: Select all

  
    DC_GetOptDefault(GetOptions)               
    DCADDGETOPTION BITMAP 'FEATHERTEXTURE.BMP' HIDE

skiman
Posts: 1186
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: dialog background

#7 Post by skiman »

Hi Cliff,

I don't want two sets active at the same time. I supposed that the second would overwrite the first one.
The second has the color clause, the first one not. I would expect it is added.

Anyway, my problem is solved.
Best regards,

Chris.
www.aboservice.be

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: dialog background

#8 Post by Cliff Wiernik »

My understanding is that it adds to an existing Setup only, not overriding the defaults.

Cliff

Post Reply