Resolution

ZGE Source Code discussion. Ask questions, present your changes, propose patches etc.

Moderator: Moderators

Post Reply
User avatar
Kjell
Posts: 1650
Joined: Sat Feb 23, 2008 11:15 pm

Resolution

Post by Kjell » Wed Jun 18, 2008 1:01 pm

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
Attachments
resolution.zip
(73.89 KiB) Downloaded 432 times

User avatar
VilleK
Site Admin
Posts: 1924
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Wed Jun 18, 2008 2:09 pm

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?

User avatar
Kjell
Posts: 1650
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell » Wed Jun 18, 2008 2:23 pm

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

User avatar
VilleK
Site Admin
Posts: 1924
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Wed Jun 18, 2008 2:46 pm

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.

User avatar
Kjell
Posts: 1650
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell » Wed Jun 18, 2008 2:59 pm

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

User avatar
VilleK
Site Admin
Posts: 1924
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Wed Jun 18, 2008 3:12 pm

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.

User avatar
Kjell
Posts: 1650
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell » Thu Jun 19, 2008 6:21 pm

:)

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
Attachments
HD.gif
HD.gif (1.14 KiB) Viewed 5257 times

Post Reply