New Cargo/Fuel meter |
Thu, 23 June 2011 17:04 |
|
Musmuris | | | Messages: 96
Registered: June 2011 | |
|
I've done a first cut of a new meter for fuel and cargo. This is designed for the cargo transfer dialogs and is clickable (and slideable).
I've put it on the Planet/Fleet details for now (where obviously it's not clickable!) but it uses a gradient for fuel/single cargos so I hope Mono paints this ok!
Will put this on the interfleet cargo box first, then retro-fit to planet/fleet cargo dialog and add some numeric counters for accuracy or typing values.
Report message to a moderator
|
|
|
|
|
|
|
|
Re: New Cargo/Fuel meter |
Thu, 23 June 2011 23:51 |
|
Aeglos | | | Messages: 142
Registered: May 2011 Location: Chile | |
|
Well, i've reverted to r624 to continue working, as I could not fix it.
To my understanding the problem is that the forms must serialize their data so that the underlying code can read it, and this is what the TypeConverters are for, since .Net can't know how to serialize custom controls.
I tried making a TypeConverter for the new control but failed, so I clearly did not make it right. I read somewhere that there is an alternative attribute, DesignerVisibility or such, that allows the data to be serialized to code instead of to resource files, but didn't delve too much into it. The fact that I'm on Mono for the next couple of days does not help the matter either.
I tried deleting the .resx file as you did, but still got errors as the resource manager on PlanetDetails could not find it's associated resources, whichever they are.
Report message to a moderator
|
|
|
Re: New Cargo/Fuel meter |
Fri, 24 June 2011 04:05 |
|
Musmuris | | | Messages: 96
Registered: June 2011 | |
|
deleting it via visual studio must do some other magic - it's gone so so you can get latest.
The .resx files are meant to be used for localizing so would contain different data depending on if you were in Germany, or France or wherever. You might have different strings (obviously) but also positions may change or orderings and other display. A different one can be chosen at runtime then.
Typeconverters in WinForms are mainly a way to convert from Text to Object for the studio designer. e.g. most controls have a Margins property that in the designer properties windows appears like "3,3,3,3". The type convertor takes that string and makes a new Margins(3,3,3,3). In this case it may have wanted one for the Cargo type - e.g. a String like "100,50,20,10" where the numbers would be ironium, boronium, germanium and colonists.
But we don't the .resx and they can be added in the future if we do.
Sorry - I'll try to bear this in mind next time.
Report message to a moderator
|
|
|
|