Tibor: I just read your answer, here is my reply:
You can use bmp file format.
There are so many bmp formats in this world...
Place your bmp images into an Images folder somewhere near the resources. (images should be in RFIX/Images)
near resources? What resources? Images SHOULD be in RFIX/Images? Why the should be? Because of compileGRCs.pl from examples? Cause of -p path parameter of ResConv? Please, be more specific, or people will waste so much time guessing the proper settings... just like me
Place icon definition into your grc file:
Code:
'GBMP' <ICON_ID> "Menu Icon" {
"<BMP_FILE_NAME_WITHOUT_EXTENSION>"
}
Where in grc file? Before the use of ^ in menu strings? in FIX or INT? Just so vague like in documentation.
In your XCode project modify the custom build command of the grc, write the following option after the ResConv.exe command:
Code:
-p <IMAGES_FOLDER>
(in our case: -p "RFIX\Images")
I dont think I want to run ResConv.exe on Mac...
Custom build command? In XCode there are no custom build commands (like in Visual Studio), in XCode you provided a perl script
-p "RFIX\Images" ? Again, we are talking about Mac, I guess you know the difference between slash and backlash and Win/Mac. And the relative path of Images - depends from where you run the perl script. If you are talking about API examples, the perl script should be called like RFIX.mac/compileGRCs.pl and the path RFIX/Images (yeah, it looks ugly - as it is)
Add the defined icon to the menu item in your grc file:
Yeah, so simple.. but what if the icon is broken (something else is displayed)? Where is answer to this? You just cant rely that always will be fine with one little given example. in API Examples there isnt any menu icon demonstration...
You could at least mention that ResConv will make tiff file (yeah, again no mention in documentation) from bmp, then copy all tiff files to .ro files (i guess Rez needs that)
Also you could mention that on MAC for GICN 32555 (with given 32555.bmp) will be 32555.tif output, for GBMP 32555 someicon (with given someicon.bmp) will be b32555.tif output... I get this output from ResConv, so I figured out (the b32555.tif i realized from other bundles in AC addons folder) that everything should be fine.. I didnt know that everything should be copied in .bundle contents! Again, no mention, no examples, so many wasted time on this...
I don't think that this is so ugly, so you shouldn't hate this API.
Let me give you an example of nice API and ArchiCAD API and compare it
Nice API:
ACSetMenuItemIcon("../../Resources/Images/mainicon.bmp",TRANSPARENCY_ON,KEEP_PROPORTION); //Backward compatible, the paths work for MAC/Win
ArchiCAD API:
One strange file
'GBMP' 32555 "mainicon" {
"mainicon"
}
'STR#' MENU_OPTIONS_TEST "Menu description" {
/* [ 1] */ "TEST"
/* [ 2] */ "STEST^32555"
}
Call some strange binary to compile
../ResConv -p <some_path_i_dont_know_for_what_cause_of_bad_docs> -another_useless_parameter
And in Code (if you are lucky and you have an API Call for this)
#ifdef macintosh
#ifndef AC15
SomeNonWorkingAPICallWithoutExceptionOrDocumentedError(blabla) //Non backward compatible
#endif
#elif windows
//There should be a simple Window resize API call, I hope they will code it in like 30 years..
#endif
Sorry for rage, but the doc is bad, dont tell me something other... the API is also bad - I will be glad compiling C++ code when I have to compile with GCC... (there are no C++ in API, just C)