Page 1 of 1

dialog background

Posted: Wed Sep 08, 2010 2:50 am
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?

Re: dialog background

Posted: Wed Sep 08, 2010 2:54 am
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.

Re: dialog background

Posted: Wed Sep 08, 2010 3:13 am
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.

Re: dialog background

Posted: Wed Sep 08, 2010 4:25 am
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 })

Re: dialog background

Posted: Wed Sep 08, 2010 5:27 am
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.

Re: dialog background

Posted: Wed Sep 08, 2010 12:48 pm
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

Re: dialog background

Posted: Thu Sep 09, 2010 4:48 am
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.

Re: dialog background

Posted: Fri Sep 10, 2010 7:59 am
by Cliff Wiernik
My understanding is that it adds to an existing Setup only, not overriding the defaults.

Cliff