Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » how to position file_select_ex box on screen

This thread is locked; no one can reply to it. rss feed Print
how to position file_select_ex box on screen
raja peter
Member #7,835
October 2006

Too many threads for the same element.I'm sorry.

I want to display the file select box at a particular position on a screen image.

But it has no parameters to specify the position as can be seen below.

int file_select_ex(const char *message, char *path, const char *ext, int size, int w, int h);

pls help.

luv,

raja

miran
Member #2,407
June 2002

Snippet from the file selector source code:

//--snip--
   stretch_dialog(file_selector, width, height);
   centre_dialog(file_selector);
   set_dialog_color(file_selector, gui_fg_color, gui_bg_color);
   ret = popup_dialog(file_selector, FS_EDIT);
//--snip--

Note the second line. It centres the file selector dialog on the screen. Solution: copy and paste the file selector code to a function of your own and replace centre_dialog() with position_dialog() and call this modified selector instead of the built-in one.

--
sig used to be here

raja peter
Member #7,835
October 2006

miran,

I'm afraid U have told me this many a times. I did not know where to get the source of file_select_ex(). That's the problem.

Where to find the source of other functions as well.

Then I have a infinite loop like this.
-----------------------------------------------------------------
while(1)
{

draw_sprite(buffer, opening,x,y);
draw_sprite(screen, buffer, 0, 0);
draw_sprite(screen, exitb, 180, 260);

draw_sprite(buffer, cursor, mouse_x, mouse_y);


ret = file_select_ex("Pick a file", fname, "BMP;GIF", PATH_MAX, 200, 100);
if(ret)
{
//do something

}

if(mouse clicked on exitb)
{
//do something
}

}

--------------------------------------------------

Here the control directly goes to file_select_ex, the exitb(an exit button image)
could not be clicked on. How to fix this. I use an image for cursor at the mouse position.

Thanks

luv,

raja

miran
Member #2,407
June 2002

Quote:

Where to find the source of other functions as well.

http://alleg.sourceforge.net/ ::)

--
sig used to be here

raja peter
Member #7,835
October 2006

I have downloaded this using dev-cpp.

I have a folder called allegro.

But could not find the source but only header file gui.h.:-[

luv,

raja

miran
Member #2,407
June 2002

Click the fscking link I gave you! Download the fscking source! Stop being a fscking retarded noob!!!

--
sig used to be here

Go to: