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.


Landscape/Portrait...


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-16-2007, 05:29 PM
Knows the basics
 
Join Date: May 2007
Posts: 64
Awards Showcase
Beta Tester 
Total Awards: 1
Default Landscape/Portrait...

Hello,
I am thinking about the landscape and portrait mode handling in the same Basic4PPC program. I am asking myself if I must write different forms, one for each format, doing the same thing and show one or the other as a function of the orientation of the screen, to be able to better use the screen space.

This is not necessarily the most intelligent way of handling things (since I have to handle the fact that controls doing the same thing will have different names in different orientations.

Do you any idea for better handling this problem (which should be met by all of you)? One would need form generated events like HeightChanged (width, height) and WidthChanged (width, height) to be able to detect the change of the orientation. I do not think that these events do exist. Is there an intelligent way of simulating them? I know that FormLIb library does contain a detection event but I would not like to add a library just for this function since I am trying not to use any external library and develop my program on the base of a unique executable file. I would like to create a small and slick proggie. Basic4PPC sh/c/ould handle this, no?

Any advice on this issue?

Best regards,

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
  #2 (permalink)  
Old 11-16-2007, 07:06 PM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 316
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Bonjour - Good Question,
Im a newbie here but just one obvious thought is if u put all the buttons etc in the first 240x240 of the screen - it wont matter which orientation u have it will still show properly! Hows that for a simple idea?

I would also like to know how to detect which way the screen is orientated?
Reply With Quote
  #3 (permalink)  
Old 11-17-2007, 07:43 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,134
Default

You would have to use FormLib library.
Without adding a FormLib object, the form will not redraw itself after a screen orientation change.
After adding FormLib you will also be able to use the Resize event, and in this event you can change the controls layout based on the current form size.

Why don't you want to use external libraries?
Using SetupBuilder you can pack all the files and create a single setup file:
Distributing your applications
Reply With Quote
  #4 (permalink)  
Old 11-17-2007, 09:39 AM
Knows the basics
 
Join Date: May 2007
Posts: 64
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Thanks to both of you.

Dear Colin,
I do already use this trick but in this case you have worst ob both worlds (between landscape and portrait, in terms of screen estate) and this is not very optimal.

Dear Erel,
I really want to have a very small and simple program, very easy to install for others (I can use setup builder, thanks your instructions). In a way, since this is my first program with basic4ppc; I would like to use it as best as I can, without calling other libraries to rescue.
For example, I have remarked that if I put all my controls in a panel, the panel automatically switches when the screen orientation changes and I can do the following :
Panel1.Width = Max(TRPPC.Height,TRPPC.Width)
where TRPPC is a form.

And the panel is resized in order to cover the whole screen without messing the placement of my controls but, of course, their size is not changed. I am thinking now a way for automatizing the location and the size (the latter for some controls that are strategic, like tables to browse or textfields that show some dynamic information) of these controls as a function of the dimensions of the form. I think this is doable.

If I find a satisfactory solution, I will come back and tell it here but I was hoping that someone else has already found the trick, since this is very common problem.

Best regards,

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
  #5 (permalink)  
Old 11-17-2007, 10:05 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,134
Default

Again, the best solution is to use FormLib and the Resize event.
Another solution will be to use a timer to periodically check the screen size and change the layout if required.
Reply With Quote
  #6 (permalink)  
Old 11-17-2007, 02:01 PM
Knows the basics
 
Join Date: May 2007
Posts: 64
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Thanks Erel,

I think I can even live with just a Refresh menu that can handle this resizing manually (yes, I know that I can be quite stubborn ;-) but I really like parcimonous programs).

My main problem is now to find an intelligent way of changing the size of some controls as a function of the screen orientation.

Best regards,

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
  #7 (permalink)  
Old 11-20-2007, 12:10 AM
Knows the basics
 
Join Date: May 2007
Posts: 64
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Dear Erel,

EDIT: Problem solved (see below)


Since the FormLib library is really ridiculously small, I have decided to follow your suggestion and include this library. I am now trying to create a setup file using setup builder. I can create a cab file but when I click on the button "Built setup file", I get a DOS screen about ezsetup with a PAUSE and when I push any key, it continues and closes the screen but I cannot find the TRPPCSetup.exe file in the SetupBuilder folder (or in my application folder). I do not get any error message either. Any idea?
__________________
PC: Laptop CoreDUo, Windows XP SP2 French
PPC: TyTN, WM5 French -> iPAQ 214 WM6 French (to diverge or not to diverge,...)

Last edited by yildi : 11-20-2007 at 11:00 AM.
Reply With Quote
  #8 (permalink)  
Old 11-20-2007, 05:18 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,134
Default

What happens when you press on 'Build Cabs's?
Does it create the cab files?
Reply With Quote
  #9 (permalink)  
Old 11-20-2007, 10:59 AM
Knows the basics
 
Join Date: May 2007
Posts: 64
Awards Showcase
Beta Tester 
Total Awards: 1
Default

I am really sorry Erel,

I have already solved this problem. Normally, I have tried to edit my post yesterday night and to tell it to you but I have probably done something stupid during the edit process.

Yes, my error was very stupid: I was not using the correct ezsetup. I do noy know why, the ezsteup which is on my computer is not the one to which you are pointing from the web site. I have downloaded the SBP version and everything works now.

Sorry again for taking your time for such a stupid problem.

Best regards,
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Panels create scrollbars in landscape sahoopes Questions & Help Needed 2 03-30-2008 06:05 PM
Form color in landscape mode HARRY Questions & Help Needed 8 03-07-2008 03:21 PM
Landscape Night Clock Alex812 Share Your Creations 4 07-03-2007 03:18 PM


All times are GMT. The time now is 02:46 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0