updated mac specific file dialog changes

set directory path first then set file name
remove cast from const char* to char*, it is not necessary