Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Non-standard Screens


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-14-2009, 06:50 AM
Senior Member
 
Join Date: Apr 2007
Location: Olympia, Washington USA
Posts: 100
Default Non-standard Screens

I'm considering the purchase of a smartphone running Windows Mobile 6, with the intent to use Basic4PPC to program for it. Neither of the two candidates have a standard (VGA or QVGA) screen size. One is 320 x 320, and the other is 240 x 400. This leads to 3 questions:

(1) Is the non-standard screen size going to complicate writing the programs?

(2) Will programs written for the QVGA look funny on the non-standard screen?

(3) Will programs I write for the non-standard screens look funny on standard QVGA and VGA screens?

These smartphones (Samsung Saga and Samsung Omni) are pricy so I'd like to resolve these issue before purchase. Thanks for any informaion you may have!
Reply With Quote
  #2 (permalink)  
Old 02-14-2009, 08:03 AM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Switzerland
Posts: 1,565
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

Till now I have only written programs for QVGA screens and added Fillipo's routine 'ChangeToVGA' to support VGA screens.

Answers to your questions:

1) The programing becomes a little bit more complicated because of the handling of the different screen sizes. From QVGA to VGA it's easy because the width-height ratio is the same and there is just the scale factor of 2. In that case all the Top, Left, Width and Height values are multiplied by the scale factor.

2) The change for screens with different width-height ratios it becomes more complicated.
For example:
-From 240/320 to 240/400 the lower part of the screen will be blank, or you should multiply all Height parameters of the controls by 400/320=1.25 to change their spacing.
-From 240/320 to 320/320 you could stretch the screen horizontally by multiplying all the Left and Width paramters of the controls by 320/240=1.33 otherwise the right third of the screen will be blank.

3) The same reasoning applyes here.
- From 320/320 to 240/320 you will miss the right third of the screen or you must shrink the screen width by 240/320=0.67 (same principle as stretching) with the risk that some controls are too small or you must foresee the control sizes to fit into a 240 pixel width.
- From 240/400 to 240/320 you will miss the lower 80 pixels or shrink the screen vertically.

Or you have a different source code for each screen size, which is also not that convenient.

Best regards.
__________________
Klaus
Switzerland
Reply With Quote
  #3 (permalink)  
Old 02-14-2009, 03:42 PM
Basic4ppc Veteran
 
Join Date: Jan 2008
Posts: 210
Default

Quote:
Originally Posted by klaus View Post
Till now I have only written programs for QVGA screens and added Fillipo's routine 'ChangeToVGA' to support VGA screens.

Answers to your questions:

1) The programing becomes a little bit more complicated because of the handling of the different screen sizes. From QVGA to VGA it's easy because the width-height ratio is the same and there is just the scale factor of 2. In that case all the Top, Left, Width and Height values are multiplied by the scale factor.

2) The change for screens with different width-height ratios it becomes more complicated.
For example:
-From 240/320 to 240/400 the lower part of the screen will be blank, or you should multiply all Height parameters of the controls by 400/320=1.25 to change their spacing.
-From 240/320 to 320/320 you could stretch the screen horizontally by multiplying all the Left and Width paramters of the controls by 320/240=1.33 otherwise the right third of the screen will be blank.

3) The same reasoning applyes here.
- From 320/320 to 240/320 you will miss the right third of the screen or you must shrink the screen width by 240/320=0.67 (same principle as stretching) with the risk that some controls are too small or you must foresee the control sizes to fit into a 240 pixel width.
- From 240/400 to 240/320 you will miss the lower 80 pixels or shrink the screen vertically.

Or you have a different source code for each screen size, which is also not that convenient.

Best regards.
I have a modified version of Filippos changetovga routine that works for all screen sizes (at least in the emulators).
Code:
Sub SetDisplay
' Msgbox("width: " & form1.Width & CRLF & "height: " & form1.Height)

Select form1.Width
		Case 240
			ScaleW=1
		Case 320
			ScaleW=1.5
		Case 480
			ScaleW=2
	End Select
	
	Select  form1.Height+52
		Case 320
			ScaleH=1
		Case 400
			ScaleH=1.5
		Case 640
			ScaleH=2
		Case 800
			ScaleH=2.5
	End Select



    Controls() = GetControls("")
    For i = 0 To ArrayLen(Controls())-1
        Select ControlType(Controls(i))
            Case "ListBox","NumUpDown","Button","TextBox","Label","ComboBox","Panel","RadioBtn","Table","ImageButton","CheckBox","Image"
               Control(Controls(i)).Left = scaleW * Control(Controls(i)).Left
               Control(Controls(i)).Top = scaleH * Control(Controls(i)).Top
                Control(Controls(i)).Height = scaleH * Control(Controls(i)).Height
                Control(Controls(i)).Width = scaleW * Control(Controls(i)).Width
'*** Uncomment these lines if your application includes Tables.
'                If ControlType(Controls(i)) = "Table" Then
'                    tbl = Controls(i)
'                    For i2 = 0 To Control(tbl,Table).ColCount-1
'                        col = Control(tbl,Table).ColName(i2)
'                        Control(tbl,Table).ColWidth(col) = Control(tbl,Table).ColWidth(col) * 2
'                    Next
'                End If
        End Select
    Next
End Sub
Reply With Quote
  #4 (permalink)  
Old 02-16-2009, 04:24 PM
Senior Member
 
Join Date: Apr 2007
Location: Olympia, Washington USA
Posts: 100
Smile

Thanks, the answers are quite helpful!
Reply With Quote
  #5 (permalink)  
Old 02-21-2009, 02:53 AM
Senior Member
 
Join Date: Sep 2008
Posts: 161
Default

It's entirely possible! Gecko can support any bastard resolution you throw at it by using undefined positions. Controls are moved and stretched to accomodate any screen size.

Instead of hello.top=230, put in hello.top=form.height-10 so a bottom bar fits on all screens, for example.

I wrote a tutorial for a much more reliable VGA conversion method.
__________________
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Working with VGA screens Erel Tutorials 29 04-30-2009 01:38 AM
Switching between screens mozaharul Questions & Help Needed 5 02-03-2009 06:23 AM
SMS mit Standard-PIM ? Paulsche German Forum 0 09-18-2008 01:53 PM
What's the difference between Standard And Prof joegoh Questions & Help Needed 2 08-04-2008 12:29 AM
Entwickeln für WM 6 Standard? staggerlee German Forum 2 05-16-2008 08:30 AM


All times are GMT. The time now is 05:29 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0