Re: [AD] Alert function.

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


yeah the dialog adapts its size, but if the dialog has extra space (ie the text of the alert box) then the buttons all have to move over so their centered.

Milan Mimica wrote:
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


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
--
https://lists.sourceforge.net/lists/listinfo/alleg-developers



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