Re: [AD] Alert function.

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Dustin Dettmer wrote:
I've rewritten the alert function adding in some new functionality and I'm trying to figure out how to align the x axis of the buttons. The new system has a variable number of buttons, so the solution to my problem cant be solved the same way (that and I can't understand how the old alert3 function did it).


Are the widths of the buttons fixed, ie the dialog adapts it's size, or not? If fixed then it's quite easy (from the top of my head):

const int LEFT_SPACE = 5;
const int SPACE_BETWEEN_BUTTONS = 3;
for (int bn = 0; bn < buttons_count; bn++)
	button[bn]->x = LEFT_SPACE + (button[bn]->w + SPACE_BETWEEN_BUTTONS) * bn;


--
Milan Mimica
http://sparklet.sf.net




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/