![]() |
|
[A5] al_create_native_file_dialog() Windows source? |
Neil Roy
Member #2,229
April 2002
![]() |
Could someone point me to where the Windows source code for the al_create_native_file_dialog() function is? I want to dig through it and see if I can improve it, at least for my own needs anyhow. (preferably without any sarcasm) --- |
Matthew Leverton
Supreme Loser
January 1999
![]() |
Look in the add-ons native dialog folder. Or, if you have git installed: git grep al_create_native_file_dialog |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
addons/native_dialog/dialog.c line 43 although you are probably more interested in _al_show_native_file_dialog which is in My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Neil Roy
Member #2,229
April 2002
![]() |
Thanks. I may be in over my head here. Trying to figure out how I can get this thing to accept a default filename when opening a save dialog. :/ --- |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
A5 git said:
191 if (flags & OFN_OVERWRITEPROMPT) {
192 ret = GetSaveFileName(&ofn);
193 }
194 else {
195 ret = GetOpenFileName(&ofn);
196 }
GetOpenFileName is called on a OPENFILENAME structure. It looks like the lpstrFile field needs to be initialized for it to accept a default selected file. What allegro does currently : 172 if (fd->fc_initial_path) {
173 ofn.lpstrInitialDir =
174 al_path_cstr(fd->fc_initial_path, ALLEGRO_NATIVE_PATH_SEP);
175 }
My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
beoran
Member #12,636
March 2011
|
Thanks for trying to help out! It will be easiest if you clone Allego's git repository, so you can make a patch easily with git diff or git format-patch. The Allegro Git repository is explained here: |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
lpstrFile is a LPTSTR type, which is dependent on whether UNICODE is defined before including windows.h. UNICODE is not currently defined in any files included in win_dialog.c. That makes LPTSTR a typedef for unsigned char*[1]. So it should be okay to use a char* str in its place, I think... So, we can set lpstrFile to the filename held in fc_initial_path I believe. I will test this later tonight. Edit My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|