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

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

Questions (Windows Mobile) Post any question regarding Basic4ppc.

Form color in landscape mode

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-05-2008, 11:34 AM
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Netherlands
Posts: 222
Default Form color in landscape mode

Hi,

A program is originally written in portrait mode. When loaded, it investigates the formwidth/formheight relation and, if found that the device is in landscape mode, it rearranges a couple of objects.

The form itself, however, now has two colors;

On the device: the left part, roughly the width of the form in portrait mode, has the correct color, the 'added ' width part is grey;

On the desktop: the left part, roughly the width of the form in portrait mode has become green, the 'added ' width part is grey.

Nowhere in the program the color green is used.

Setting the Form color, after rearranging the objects has no result.

In portrait mode everything is OK.

Reacting on the Resize event, caused by using a hardware button, gives consistently the same results.

Who knows what I am doing wrong?

Harry
Reply With Quote
  #2 (permalink)  
Old 03-05-2008, 01:21 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,733
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Did you add a FormLib object to your form? You should add one for each form.
That way screen orientations will be handled properly.
Reply With Quote
  #3 (permalink)  
Old 03-05-2008, 04:10 PM
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Netherlands
Posts: 222
Default

Erel,

Sure, both Forms have a FormLib object, flb1 and flb2 , used to set FullScreen and to intercept the Screen Size event, caused by the user pressing that Hard Key.

Sub flb1_Resize does some repositioning controls

Sub flb2_resize is empty as no repositioning is necessary

Harry
Reply With Quote
  #4 (permalink)  
Old 03-05-2008, 05:38 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,733
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Can you please post a program that demonstrates this problem?
Reply With Quote
  #5 (permalink)  
Old 03-06-2008, 07:31 AM
Knows the basics
 
Join Date: May 2007
Posts: 64
Awards Showcase
Beta Tester 
Total Awards: 1
Default

I have solved this problem by adding a panel on the form and by adding controls to the panel instead of the form. I have found that panels do resize better than forms. Try it, it will solve your problem, I am pretty sure: add a panel that has the same size as the form (you can make it sure programmatically by Panel.Width=Form.Width, etc.) and place all controls to the panel (using the changeParent utility in the GUI editor or the corresponding method).

Murat
__________________
PC: Laptop CoreDUo, Windows XP SP2 French
PPC: TyTN, WM5 French -> iPAQ 214 WM6 French (to diverge or not to diverge,...)
Reply With Quote
  #6 (permalink)  
Old 03-06-2008, 07:42 AM
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Netherlands
Posts: 222
Default

Erel,

I found the problem myself.

Some time ago I tried to implement some HELP function using the dzHtmlView library. Later on I found another solution, but I forgot to remove from the program the hc.New1("Form1",0,0,240,360) object . In the resize event, I did nothing with this object. By the sceen changing it came apparently to the foreground, although somewhat different on de desktop as on the device.

After removal of that object it works fine.

Your request to send the code urged me to have a second look in order not to bother you again with a no problem.

Harry
Reply With Quote
  #7 (permalink)  
Old 03-06-2008, 10:51 AM
Knows the basics
 
Join Date: May 2007
Posts: 64
Awards Showcase
Beta Tester 
Total Awards: 1
Default

It is strange that I have the same problem without such complications, just by adding controls to a form. When I go to landscape, the right side of the screen is not repainted (it remains gray even if the form is, for example, red). If i include a panel and resize it correctly (as a reaction of the corresponding FormLib event), the background adapts correctly.
Am I the only one having this problem (then I am probably doing something stupid...)?

Murat

EDIT: If I remember well, this problem was only appearing on my VGA PDA, not on the QVGA one.
__________________
PC: Laptop CoreDUo, Windows XP SP2 French
PPC: TyTN, WM5 French -> iPAQ 214 WM6 French (to diverge or not to diverge,...)
Reply With Quote
  #8 (permalink)  
Old 03-06-2008, 03:22 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,733
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Murat, did you add a FormLib object to each form?
Reply With Quote
  #9 (permalink)  
Old 03-07-2008, 02:21 PM
Knows the basics
 
Join Date: May 2007
Posts: 64
Awards Showcase
Beta Tester 
Total Awards: 1
Default

No, only to the main form. I have not understood that it was necessary for all forms. But I can see that all other controls are changed correctly as a consequence of the screen change event fired by the main form, even if I look to another one (this is how the adding of a background panel solves the resizing problem, this panel is automatically resized and it covers the totality of the background). Next time I use the resize trick, I will rather try to follow your suggestion (it will make me economize one panel per form)...

Murat
__________________
PC: Laptop CoreDUo, Windows XP SP2 French
PPC: TyTN, WM5 French -> iPAQ 214 WM6 French (to diverge or not to diverge,...)
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
Panels create scrollbars in landscape sahoopes Questions (Windows Mobile) 2 03-30-2008 05:05 PM
Landscape/Portrait... yildi Questions (Windows Mobile) 8 11-20-2007 09:59 AM
FTP passive mode vinians Questions (Windows Mobile) 0 08-31-2007 01:43 PM
Form.Line color problem - maybe bug? RandomCoder Questions (Windows Mobile) 7 07-31-2007 04:47 PM
Landscape Night Clock Alex812 Share Your Creations 4 07-03-2007 02:18 PM


All times are GMT. The time now is 08:55 AM.


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