On Tuesday 01 September 2009, Alex Martin wrote:
> Jeroen van der Zijp wrote:
> > On Tuesday 01 September 2009, you wrote:
> >
> >> Jeroen,
> >>
> >> Sorry to bug you directly...
> >>
> >> Somehow I am receiving "
foxgui-users@..." list email
> >> but I cannot post to the list.
> >>
> >> How do I fix this?
> >>
> >> Thanks,
> >> Alex Martin
> >>
lists@...
> >>
> >>
> >> Alex Martin wrote:
> >>
> >>> Testing, any list member would you reply to me if you see this email?
> >>>
> >>> Thanks,
> >>> Alex
> >>>
> >>> Alex Martin wrote:
> >>>
> >>>> Hello,
> >>>>
> >>>> Right now I do a lot of object->setBackColor(white) at the start of
> >>>> my application, for example I have a white theme for a data logger /
> >>>> plotter including all buttons, filemenus, etc.
> >>>>
> >>>> Is there a way I can set the default colors for my app (so that
> >>>> things will default to white) without modifying the source for foxdll?
> >>>>
> >>>> If that is not clear I can expand on that.
> >>>>
> >>>> Thanks,
> >>>> Alex
> >>>>
> >>>>
> >>>
> >>
> >>
> >
> > Well, the first suggestion I would offer is to populate the registry with
> > the desired colors. Either edit the file under .foxrc/<VendorKey>/<AppKey>
> > and change the colors (*NIX) or use the registry editor (WIN32).
> >
> > Graphically, this can be accomplished with the FOX Contrl Panel.
> >
> > Alternatively, you can do it programmatically. Change the colors in FXApp
> > *prior* to constructing any other widgets. This way, the colors you set
> > will be copied into all the widgets as they are constructed.
> >
> > Hope this helps,
> >
> >
> > - Jeroen
> >
> >
> How exactly do change the colors in FXApp programmatically?
>
> I see this in FXApp.cpp:
>
> // Init colors
> borderColor=FXRGB(0,0,0);
> baseColor=FXRGB(212,208,200);
> hiliteColor=makeHiliteColor(baseColor);
> shadowColor=makeShadowColor(baseColor);
> backColor=FXRGB(255,255,255);
> foreColor=FXRGB(0,0,0);
> selforeColor=FXRGB(255,255,255);
> selbackColor=FXRGB(10,36,106);
> tipforeColor=FXRGB(0,0,0);
> tipbackColor=FXRGB(255,255,225);
> selMenuTextColor=FXRGB(255,255,255);
> selMenuBackColor=FXRGB(10,36,106);
>
> These are private member variables declared in FXApp.h
>
> Can you provide a little more direction?
Sure.
They can be set using the API's only:
app->setBorderColor(FXRGB(255,0,0)); // Set to red, for example
app->setBaseColor((FXRGB(0,255,0)); // Set to blue
...
...
app->setSelMenuBackColor(FXRGB(244,244,244)); // Off-white
Now, normally the order of things is as follows:
1) FXApp's constructor set things to stock values.
2) FXApp::init() populates colors from WIN32 Registry (on Windows only)
3) FXApp::init() then reads FOX registry and overwrites colors again;
note, if no values are set in FOX registry then we keep the last
value.
4) We construct a MainWindow; all widgets constructed take on colors
copied from FXApp.
5) We then create the tree and run the app.
So, the best opportunity to change color programmatically is between steps (3)
and (4). You can change colors later, but then you'd have to change them
individually for each widget. This may be a lot of work, depending on how
many widgets were created. The FOX Calculator program uses this approach
since it wants different buttons to have different colors.
Regards,
- Jeroen
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.
http://p.sf.net/sfu/bobj-july_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users