Hi,
I'm looking for a way to make eGUI button border not visible (I'm using v2.1). I may set (in a scheme) forecolor to the same color as screen background (this makes border not visible) but in this way I have the text in the same color as screen background also. I need the text (on the button) to be of a different color and the button border not visible.
How to do this ?
Regards
Maciek
Solved! Go to Solution.
Hi,
the one way how to do it is, switch off the focus rectangle, in flags that describe the button.
There are two possible ways:
1. If you want do this in whole project for all buttons - So in this case you can in d4d_usr_cfg.h file changed the default behaviour for all buttons in project. (remove D4D_OBJECT_F_FOCUSRECT and uncomment D4D_BTN_F_DEFAULT macro to use it by project)
#define D4D_BTN_F_DEFAULT (D4D_OBJECT_F_VISIBLE | D4D_OBJECT_F_ENABLED | D4D_OBJECT_F_TABSTOP | D4D_OBJECT_F_TOUCHENABLE | D4D_OBJECT_F_FOCUSRECT)
2. If you do it individual. Then you can use the full version of button declaration macro and create the own set of flags. The parameter flags , without D4D_OBJECT_F_FOCUSRECT .
D4D_DECLARE_BUTTON(name, text, x, y, cx, cy, flags, pbmpN, pbmpF, pScheme, fontId, pUser, onclick, pOnUsrMsg)
Gargy
Hi,
the one way how to do it is, switch off the focus rectangle, in flags that describe the button.
There are two possible ways:
1. If you want do this in whole project for all buttons - So in this case you can in d4d_usr_cfg.h file changed the default behaviour for all buttons in project. (remove D4D_OBJECT_F_FOCUSRECT and uncomment D4D_BTN_F_DEFAULT macro to use it by project)
#define D4D_BTN_F_DEFAULT (D4D_OBJECT_F_VISIBLE | D4D_OBJECT_F_ENABLED | D4D_OBJECT_F_TABSTOP | D4D_OBJECT_F_TOUCHENABLE | D4D_OBJECT_F_FOCUSRECT)
2. If you do it individual. Then you can use the full version of button declaration macro and create the own set of flags. The parameter flags , without D4D_OBJECT_F_FOCUSRECT .
D4D_DECLARE_BUTTON(name, text, x, y, cx, cy, flags, pbmpN, pbmpF, pScheme, fontId, pUser, onclick, pOnUsrMsg)
Gargy
Hi,
it doesn't work for me. I'm not sure if I'm clear enough, so I've enclosed an explicit image (on the left is what I have now; on the right is what I would like to have). Red and green widgets on the picture are buttons. I'm experimenting with the demo project for k60n512 from 2.1 distribution of eGUI (if it helps).
This border is visible on all buttons at once, no matter they are 'focused' or not.
Regards
Maciek
It doesn't matter if it focused or not, I'm talking if it has focus rectangle or not:
For example button definition without focus rectangle:
Prototype:
D4D_DECLARE_BUTTON(name, text, x, y, cx, cy, flags, pbmpN, pbmpF, pScheme, fontId, pUser, onclick, pOnUsrMsg)
Used:
D4D_DECLARE_BUTTON(my_button, "My Button", 10, 10, 100, 50, (D4D_OBJECT_F_VISIBLE | D4D_OBJECT_F_ENABLED | D4D_OBJECT_F_TABSTOP | D4D_OBJECT_F_TOUCHENABLE), NULL, NULL, NULL, MY_FONT, NULL, MyOnCLickFunction, NULL)
Best regards
Gargy
Hi,
In the new 3.0 version of eGUI it does work! I had to remove all the flags:
D4D_OBJECT_F_FOCUSRECT,
D4D_BTN_F_3D,
D4D_BTN_F_CONT_RECT
to obtain the border-less button.
In the old 2.1 version it does not work.
I switched to the new version and now working with eGUI 3.0.
It would be very helpful to have these parameters described in a more detailed way in the documentation.
Thanks for help
Maciek
Hi,
the eGUI 3.00 brings a lot of new things and fixed bugs. I recommended to use it, at the moment we are waiting for new Converter utility to support all new features (UNICODE, binary resource files, 24bit colours etc.) to release it on web publicly.
And you right that the documentation is no perfect, but there is a lot of things what could be described better, and for now the document has 250 pages, and we don't want to do from it something terrible big.
Gargy