Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Basic4ppc Wishlist > Bug Reports
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Bug Reports Post about errors or bugs encountered.

Desktop/Device Display Differences

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-14-2009, 05:46 AM
Senior Member
 
Join Date: Apr 2007
Location: Arlington, Washington USA
Posts: 180
Default Desktop/Device Display Differences

I am writing a simple application to record bridge hands and after quite a bit of tweaking I managed to get it to work well on the desktop. I use a Table control with several rows and columns. Since I want the four hands (North, East, South, and West) visually seperated I use extra columns covered with a blue Label control. A screen capture is attached.

However, when I compile for the device, the Table and Labels no longer align correctly and this renderes the application useless (a device screen capture is also attached). What am I missing here? How can I reliably design applications on the desktop that will look the same on the device? The device in question is an Ipaq 1945 with a QVGA screen. I am using Vasic4ppc version 6.5 under Windows Vista.

One more problem. When I use optimized compilation for the device, the program runs but the checking/unchecking of the cells does not work. If I compile without optimizing then the checking/unchecking of the cells works properly. I tried replicating this bug with simpler code but failed. The source file is attached.
Attached Images
File Type: jpg DesktopCap.jpg (40.1 KB, 30 views)
Reply With Quote
  #2 (permalink)  
Old 03-14-2009, 11:13 AM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 4,463
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

I had a look at your problem.
- There is unfortunately a different definition of ColWidth. On the desktop the width is the total width but on the PPC it's the internal width that means on the PPC the colum width is 1 pixel more than on the desktop. Who knows why ?
The same is for the row height, 1 pixel more on the PPC

As a workaround I could suggest you to add the following code after the table cloumn definition.
Code:
<font face="Courier New"><font size="2"><font face="Courier New"><font size="2">Table1.AddCol(</font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">cString</font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2">,</font></font></font></font><font face="Courier New"><font size="2"><font color="#800000"><font face="Courier New"><font size="2"><font color="#800000"><font face="Courier New"><font size="2"><font color="#800000">"17"</font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2">,</font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">12</font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2">)</font></font>
<font size=
"2"><font face="Courier New">Table1.AddCol(</font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">cString</font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2">,</font></font></font></font><font face="Courier New"><font size="2"><font color="#800000"><font face="Courier New"><font size="2"><font color="#800000"><font face="Courier New"><font size="2"><font color="#800000">"18"</font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2">,</font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">12</font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2">)</font></font>
<font size=
"2"><font face="Courier New">Table1.AddCol(</font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">cString</font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2">,</font></font></font></font><font face="Courier New"><font size="2"><font color="#800000"><font face="Courier New"><font size="2"><font color="#800000"><font face="Courier New"><font size="2"><font color="#800000">"19"</font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2">,</font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">12</font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2">)</font></font></font></font>
 
<font face=
"Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff">If </font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">cPPC </font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff">Then</font></font></font>
</font></font></font></font></font></font><font face=
"Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff">  For</font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2"> i=</font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">0 </font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff">To </font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">19</font></font></font>
</font></font></font></font></font></font><font face=
"Courier New"><font size="2"><font face="Courier New"><font size="2">    Table1.ColWidth(i)=Table1.ColWidth(i)-</font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">1</font></font></font>
</font></font></font></font></font></font><font face=
"Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff">  Next</font></font></font>
<font size=
"2"><font face="Courier New"><font color="#0000ff">End </font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff">If</font></font></font></font></font></font></font></font></font>
Then for the cell checking/unchecking problem there is a mistake in your code.
Code:
<font size="2"><font face="Courier New"><font color="#0000ff"><font size="2"><font face="Courier New"><font color="#0000ff"><font size="2"><font face="Courier New"><font color="#0000ff">If</font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2"> y$=</font></font></font></font><font face="Courier New"><font size="2"><font color="#800000"><font face="Courier New"><font size="2"><font color="#800000"><font face="Courier New"><font size="2"><font color="#800000">"X" </font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff">Then</font></font></font>
</font></font></font></font></font></font><font face=
"Courier New"><font size="2"><font face="Courier New"><font size="2">  y$=</font></font></font></font><font face="Courier New"><font size="2"><font color="#800000"><font face="Courier New"><font size="2"><font color="#800000"><font face="Courier New"><font size="2"><font color="#800000">""</font></font></font></font></font></font></font></font></font>
<font size=
"2"><font face="Courier New"><font size="2"><font face="Courier New">  ccount(PlayerIndex) = ccount(PlayerIndex) - </font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">1</font></font></font>
</font></font></font></font></font></font><font face=
"Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff">  Select</font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2"> PlayerIndex</font></font>
</font></font><font face=
"Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff">  Case </font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">1</font></font></font>
</font></font></font></font></font></font><font face=
"Courier New"><font size="2"><font face="Courier New"><font size="2">    Nlbl.Color=</font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">220</font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2">,</font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">220</font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2">,</font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">220</font></font></font>
</font></font></font></font></font></font><font face=
"Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff">  Case </font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">2</font></font></font>
</font></font></font></font></font></font><font face=
"Courier New"><font size="2"><font face="Courier New"><font size="2">    Elbl.Color=</font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">220</font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2">,</font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">220</font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2">,</font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">220</font></font></font>
</font></font></font></font></font></font><font face=
"Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff">  Case </font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">3</font></font></font>
</font></font></font></font></font></font><font face=
"Courier New"><font size="2"><font face="Courier New"><font size="2">    Slbl.Color=</font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">220</font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2">,</font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">220</font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2">,</font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">220</font></font></font>
</font></font></font></font></font></font><font face=
"Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff">  Case </font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">4</font></font></font>
</font></font></font></font></font></font><font face=
"Courier New"><font size="2"><font face="Courier New"><font size="2">    Wlbl.Color=</font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">220</font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2">,</font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">220</font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2">,</font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">220</font></font></font>
</font></font></font></font></font></font><font face=
"Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff">  End </font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff">Select</font></font></font>
<font size=
"2"><font face="Courier New"><font color="#0000ff">Else</font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2"> y$=</font></font></font></font><font face="Courier New"><font size="2"><font color="#800000"><font face="Courier New"><font size="2"><font color="#800000"><font face="Courier New"><font size="2"><font color="#800000">"X"</font></font></font>
</font></font></font></font></font></font><font face=
"Courier New"><font size="2"><font face="Courier New"><font size="2">  ccount(PlayerIndex) = ccount(PlayerIndex) + </font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">1</font></font></font>
</font></font></font></font></font></font><font face=
"Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff">End </font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff">If</font></font></font>
</font></font></font></font></font></font>
You have If y$="X" Then and Else y$="X" .

Two problems:
- you try to test 2 times the same value?
- the syntax of Else is either:
- Else or
- Else If y$="Y" Then

The optimized compiler is more strict on syntax than the standard one.

Best regards
__________________
Klaus
Switzerland

Beginner's Guide / User's Guide

Last edited by klaus : 03-14-2009 at 11:15 AM.
Reply With Quote
  #3 (permalink)  
Old 03-14-2009, 02:10 PM
Senior Member
 
Join Date: Apr 2007
Location: Arlington, Washington USA
Posts: 180
Default

Thanks, Klaus, for your prompt and helpful answer. The information about differences in row and column height is very good to know. I will try your code and incorporate similar code in future projects.

You were also correct about my poor syntax in the if-then-else code, although it took me a little while to understand your point: Since I was using the multiline version the "else" should be on a line by itself. Essentially, I had:
if y$ = "X" then
y$ = ""
else y$ = "X"
end if

This should have been:
if y$ = "X" then
y$ = ""
else
y$ = "X"
end if

I made that change, recompiled, and indeed that solved the problem.

Thanks again for your great assistance!

Kindest regards

Dave
Washington, USA
Reply With Quote
  #4 (permalink)  
Old 03-14-2009, 02:54 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 4,463
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

Sorry for not having been clear enough.

What I wanted to point out was the possibility of either
If a=b Then
Else
End
If

or

If a=b Then
Else
If a=c Then
Else
If a=d Then
Else
End
If

Best regards.
__________________
Klaus
Switzerland

Beginner's Guide / User's Guide
Reply With Quote
  #5 (permalink)  
Old 03-14-2009, 05:31 PM
Senior Member
 
Join Date: Apr 2007
Location: Arlington, Washington USA
Posts: 180
Default

Klaus, you were clear enough - you did lead me to the correct solution.

I have completed the application. The column width issue was handled elegantly with your code. I got around the row height issue by changing the Table1.FontSize to 8 whenever cPPC is true.

Thanks again for your fast and accurate help.

If there are any other bridge players out there that would like a copy of the final, let me know and I'll post it. I'm also working on a couple of other bridge related apps.

Kindest regards

Dave
Washington, USA
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 Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Web browser for desktop and device agraham Additional Libraries 73 03-11-2012 03:44 PM
Using rapi from desktop to copy file from device to desktop sunnyboyj Questions (Windows Mobile) 19 10-27-2010 01:08 PM
Device or Desktop DaveW Questions (Windows Mobile) 2 11-07-2008 12:04 PM
Different behaviour DeskTop and Device HARRY Questions (Windows Mobile) 2 02-22-2008 12:36 PM
calculating differences in time sunnyboyj Questions (Windows Mobile) 1 02-07-2008 07:36 PM


All times are GMT. The time now is 03:35 PM.


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