File open dialog error on Mac (bitmaps)
by Scott Coursey · in Torque Game Builder · 09/01/2008 (6:01 am) · 5 replies
I'm back into TGB development on my game which I started on TGB 1.5.1 (took a hiatus =] ).
I've noticed a problem that I don't see a solution yet (I'll dig into the TGB code today). When I go into the GUI editor, I drop a GuiBitmapButonCtrl (or even the GuiBitmapCtrl for something on the screen). I click on the "..." button to load the bitmap, but when the dialog comes up, I'm not allowed to select anything from the list (bmp, jpg, or png).
The buttons work fine if I hand-code the "bitmap" variable, so it has to be the File Open call.
Has anyone seen this before? I certainly hope so.
Thanks,
ScottC
I've noticed a problem that I don't see a solution yet (I'll dig into the TGB code today). When I go into the GUI editor, I drop a GuiBitmapButonCtrl (or even the GuiBitmapCtrl for something on the screen). I click on the "..." button to load the bitmap, but when the dialog comes up, I'm not allowed to select anything from the list (bmp, jpg, or png).
The buttons work fine if I hand-code the "bitmap" variable, so it has to be the File Open call.
Has anyone seen this before? I certainly hope so.
Thanks,
ScottC
#2
I'm fine with using all PNG files so this fix is fine for me. Thanks!
09/22/2008 (4:00 pm)
Scott, can you tell me where in the engine scripts this is located? I'm on a Mac so I have the same bug :(I'm fine with using all PNG files so this fix is fine for me. Thanks!
#3
My current Filters line is:
Filters = "png|*.png|bmp|*.bmp|cs|*.cs|gui|*.gui|jpg|*.jpg|";
09/23/2008 (6:05 am)
TorqueGameBuilder/tgb/tools/gui/openFileDialog.ed.csMy current Filters line is:
Filters = "png|*.png|bmp|*.bmp|cs|*.cs|gui|*.gui|jpg|*.jpg|";
#4
09/23/2008 (6:18 am)
Awesome, thanks! This is a huge help.
#5
07/01/2009 (8:21 am)
I just started using TGB yesterday. I was tired so I searched the internet for a video tutorial. Right in the beginning of the GUI lesson I could not add an image. I tried using a .bmp, .jpg and a .png. Nothing worked! My friend who also has TGB tried this on a PC and had no issues. Being new to mac I thought I was in big trouble. I will try your fix when I get home tonight... Thanks for the post and fix.
Torque Owner Scott Coursey
Yellow Duck Software
%dlg = new OpenFileDialog()
{
Filters = "PNG|*.png";
DefaultFile = %currentFile;
ChangePath = false;
MustExist = true;
MultipleFiles = false;
};
and the open file works (note the Filters line; the rest is unchanged). It's not acceptable to leave the filter set to PNG as it's supposed to be looking for any and all files. I even tried changing it to "*.p*" which should have looked for *.png but it didn't work. The dialog appears to not like wildcards on the file extension (it did work on *.dmg). It also failed on *.?*
I'll leave it as PNG for now, just so I can get working on my project.