forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How Do I resize my VDS App?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
starfire
Newbie


Joined: 16 Dec 2008
Posts: 24
Location: Florida USA

PostPosted: Mon Dec 29, 2008 10:43 pm    Post subject: How Do I resize my VDS App? Reply with quote

Hello,

A Newbi needs a little help with how to resize my VDS App to fit a 8.9 inch LED display at 1024X600. I am a little confused how to go about it. Is there a way to write some code that would lets say resize the main Dialog Element with all the 70 elements text, lists, edits, combo..etc that I am using all at once?

So the the 70 elements resize to a smaller and larger size? Like maybe by a percent x value for everything all at the same time?

If this is not possible than how should I go about doing this?

Thanks
Starfire
Back to top
View user's profile Send private message
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Tue Dec 30, 2008 2:21 pm    Post subject: Reply with quote

I believe what you want is "OPTION Scale":

Quote:
OPTION SCALE is used to make a dialog scale itself when different font sizes are used. The value in <pixels-per-inch> should be the same value given by @SYSINFO(PIXPERIN) on the system on which the dialog was designed (see Screen Metrics.) This value is determined by the font size chosen in Control Panel Display Settings. The standard setting is Small Fonts, which gives a value of 96 pixels per inch. If the value on the user's system is different from the value specified in this option then the size of the dialog and the position and size of dialog elements will be scaled to display the correct proportions with the font size chosen.



Hooligan

_________________
Hooligan

Why be normal?
Back to top
View user's profile Send private message
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Fri Jan 02, 2009 12:29 am    Post subject: Reply with quote

Warning...
Do not do the following as it will not give you what you may think.

Code:

Option Scale,@SYSINFO(PIXPERIN)

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Fri Jan 02, 2009 2:57 am    Post subject: Reply with quote

Starfire,

There isn't just a simple call to resize the dialog and reposition or size the elements on the dialog.

You can use the "RESIZABLE" style in the "DIALOG CREATE" statement.

This will cause a "RESIZE" event anytime the main dialog changes size.

Its up to the programmer to calculate and resize/position the elements on the dialog.

Something for you to play with:
Code:
 Title Resize Dialog Example
 DIALOG CREATE,Resize Dialog Example,-1,0,400,300,RESIZABLE
  DIALOG ADD,TEXT,SOMETEXT,15,13,,,SOMETEXT
  DIALOG ADD,EDIT,EDITBOX,40,13,375,19,EDITBOX
  DIALOG ADD,LIST,LISTBOX,70,13,375,174
  DIALOG ADD,BUTTON,BUTTON1,265,325,64,24,BUTTON
 DIALOG SHOW
 List add,LISTBOX,Here are some good basic formulas to use when resizing.
 List add,LISTBOX,
 List add,LISTBOX,Org = Origonal size/position
 List add,LISTBOX,
 List add,LISTBOX,"<new top> = @dlgpos(,H)-(OrgMainHeight-ElementOrgTop)"
 List add,LISTBOX,"<new left> = @dlgpos(,W)-(OrgMainWidth-ElementOrgLeft)"
 List add,LISTBOX,"<new width> = @dlgpos(,W)-(OrgMainWidth-ElementOrgWidth)"
 List add,LISTBOX,"<new height> = @dlgpos(,H)-(OrgMainHeight-ElementOrgHeight)"
 List add,LISTBOX,
 List add,LISTBOX,Remember"," these are just the basics.
 List add,LISTBOX,Depending on the need"," they can get more complicated.
 
:RESIZE
  # Get the new size of the main dialog
  %w = @dlgpos(,W)
  %h = @dlgpos(,H)
  # It's a good idea to set a minimum size, usually the same as the origonal
  If @greater(400,%W)
    Dialog SETPOS,,,,400
    %w = 400
  End
  If @greater(300,%H)
    Dialog SETPOS,,,,,300
    %h = 400
  End
 
  # Now recalculate the element size and position attributes.
  # Attributes that don't need to change leave blank.
  # DIALOG SETPOS, <element name>,<top>,<left>,<width>,<height>
 
  # The TEXT element "SOMETEXT" is static so we won't make changes to it.
 
  # Change the width of "EDITBOX"
  Dialog SETPOS,EDITBOX,,,@sum(%w,-25)
  #Note: Yes, this is the same as @diff(%w,25). For me it's just easier to read.
 
  # Change the width and height of "LISTBOX"
  Dialog SETPOS,LISTBOX,,,@sum(%w,-25),@sum(%h,-126)
 
  # Change the top and left position of "BUTTON1"
  Dialog SETPOS,BUTTON1,@sum(%h,-35),@sum(%w,-75)
 
:Evloop
  wait event
  goto @event()
 
:BUTTON1BUTTON
  goto Evloop

:CLOSE
  exit


Updated from origonal post:

List add,LISTBOX,"<new width> = @dlgpos(,W)-(OrgMainWidth-ElementOrgWidth)"
List add,LISTBOX,"<new height> = @dlgpos(,H)-(OrgMainHeight-ElementOrgHeight)"


Sorry, if I confused anyone Wink
Back to top
View user's profile Send private message Send e-mail
starfire
Newbie


Joined: 16 Dec 2008
Posts: 24
Location: Florida USA

PostPosted: Sun Jan 04, 2009 1:00 pm    Post subject: Reply with quote

Thanks Guys,

Wish there was a easier way to go about resizing. But at least I have an idea as to how to go about it now. It is a lot better than being clueless.

Thanks for the input folks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group