Page 1 of 1

Resolution

Posted: Wed Jun 18, 2008 1:01 pm
by Kjell
Hi guys,

My next source code project is to implement custom Resolution Width & Height. More when it hits ( login to download attached examples ) 8)

K

Posted: Wed Jun 18, 2008 2:09 pm
by VilleK
Looks promising Kjell!

How do you plan to implement it? The current solution with ScreenMode property has got a dependency to the optiondialog, as well as being backwards compatible which I want to be as far as possible. Perhaps two new properties CustomScreenWidth, CustomScreenHeight. If set to zero (default) they are ignored?

Posted: Wed Jun 18, 2008 2:23 pm
by Kjell
Hej Ville,

I was planning to use a boolean checkbox to determine whether or not you want to overwrite the ScreenMode property .. but testing if the values are set to zero would do the trick too.

By the way, I'm trying to add a zptInteger2i type ( or something based on TZPointi ), no luck so far .. but I guess that's just a matter of diving into the source a little further. If worse comes to worse I'll just go with 2 integer fields as you described.

Regards,
Kjell

Posted: Wed Jun 18, 2008 2:46 pm
by VilleK
Yes adding a new datatype is pretty hairy and require lots of small changes in many places so I would advice against that :) . Just from the top of my head you need changes in: streaming, gui, set value, set default value etc etc. And it adds up to a significant amount of code growth so I don't add datatypes unless absolutely necessary. Go for two separate integers is my suggestion.

Posted: Wed Jun 18, 2008 2:59 pm
by Kjell
Hmm,

The current zptInteger field is slightly iffy too though, as you can just input float's / decimals. I assume the value does get converted / cast to a integer?

K

Posted: Wed Jun 18, 2008 3:12 pm
by VilleK
The value is always cast to an integer. You should notice it if you enter a value, leave the field, and then return. It should not accept any other characters than numbers and "-", but it is a bit messy to add that kind of validation to a delphi TEdit control so I haven't bothered yet.

Posted: Thu Jun 19, 2008 6:21 pm
by Kjell
:)

Ville: Ah you're right, then it's just purely cosmetic .. so never mind :roll:
Everybody: Custom Resolution will be available in the next release!

K