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.


Changing tab order of controls while running


Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 01-19-2008, 09:44 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,900
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

If you can post a bit code that shows the effect for you I'll have a play with it and see if it does the same here.
Reply With Quote
  #12 (permalink)  
Old 01-20-2008, 09:46 PM
willisgt's Avatar
Senior Member
 
Join Date: Aug 2007
Location: Nacogdoches, Texas USA
Posts: 164
Default

I've copied the relevant code into the attached example. It behaves exactly the same way as the larger application it was copied out of.

Thanks for taking the time to look at this...

Gary
Attached Files
File Type: zip meds.zip (6.9 KB, 2 views)
Reply With Quote
  #13 (permalink)  
Old 01-21-2008, 12:41 AM
Junior Member
 
Join Date: May 2007
Location: Norwich, NY
Posts: 13
Send a message via Skype™ to david
Default

Actuallly, I don't think you are missing anything simple.

I have been doing work on a Wasp 3200 bar code device. I have to account for bar code input, key board input and sip input.

In addition, I have to move the user back and forth between fields on lost focus events where I encounter errors.

The primary spec. called for me to move the user around based upon hitting the enter key. That is relatively easy, but once you start adding error messages, on lost focus events and sometimes on key enter events, you start to get weird results.

The particularly application that gave me the most trouble has 29 fields laid out on one screen but on various panels that I expose or hide depending upon the runtime data entry.

I can get it to work perfectly when I create a windows executable, only to have it fail on the device side. Eventually, I used global error flags to keep track of where I was and how the application should respond.

My particular problems seem to be the result of timing that varies from the windows executable (where I do my initial testing) to the finished product on the device.

My conclusion is that it is entirely a Windows .Net problem. It has nothing to do with Basic4PPC (which I think is a wonderful development platform). My application ended working well, but with over 4,000 lines of code.

If you remember, Sun Micro Systems Java advertisements, "Write Once Run Anywhere" and if you ever tried to implement that on multiple platforms, you will know that the slogan was true only if you didn't care which window appeared first or how the various dialogs appeared. I think Microsoft is coming up against the same problem. They will never admit it. They will just leave developers to think they are missing "something really simple".

Good Luck.

Regards,

David
P.S. I really do love Basic4PPC. However, Erel still must work within the confines of .NET. Don't blame him or the product. Just bear in mind that Basic4PPC is years ahead of Microsoft's own Visual Studio products for hand held development.
Reply With Quote
  #14 (permalink)  
Old 01-21-2008, 05:04 AM
willisgt's Avatar
Senior Member
 
Join Date: Aug 2007
Location: Nacogdoches, Texas USA
Posts: 164
Default

David, I'm curious to know more about your approach to this problem. How exactly did you make use of globals to solve the problem?

In this case, the form is static and I can use .lostFocus to direct input to the next field. However, much of this application uses forms where the controls are generated dynamically. LostFocus gets a little dicey on those forms.

So, while I'm hoping to resolve the problem with the code I posted (as it would solve my problem in all cases), I'm looking for alternatives in case it can't be resolved.

This program gets released to our clients on Wednesday, whether the tab order is correct or not.



Gary
Reply With Quote
  #15 (permalink)  
Old 01-22-2008, 10:35 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,900
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

I've played with this now and yes, the tab order doesn't get set properly at runtime. However in the help BringToFront is only documented as setting the Z-order, i.e. the visible layering and not the tab order. It seems to be an unwarranted assumption that because BringToFront and SendToBack seem to affect both Z-order and Tab-Order in the Designer then BringToFront at runtime will do both as well.

You probably know this, but in case others reading this are unaware of it, where the controls are created at design time you can get the tab order you want by selecting the controls by turn in the tab order you want and selecting SendToBack for each one. Whether this is by design, as it is not documented, or a welcome side effect I don't know.

Perhaps Erel will comment if he catches this post?
Reply With Quote
  #16 (permalink)  
Old 01-22-2008, 01:03 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,900
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

You could try playing with this library. No guarantees that it will always work. Only works in optimised compile mode - will warn otherwise.

Code:
 TabOrder.New1(B4PObject(1),TabControlNames(),NumOfControls)
Invoke it as above passing an array of the controls in the required tab order together with how many of them are in the array. If you don't pass all the tabbable controls on a form then you may get odd results.

Version of your example enclosed that tabs properly. I've hacked the library into it - you will want to tidy it up.
Attached Files
File Type: zip TabOrder.zip (9.0 KB, 4 views)
Reply With Quote
  #17 (permalink)  
Old 01-24-2008, 02:22 PM
willisgt's Avatar
Senior Member
 
Join Date: Aug 2007
Location: Nacogdoches, Texas USA
Posts: 164
Default

Very cool - it does exactly what I need!

Naturally, this is something I ( and probably more than a few others ) would like to see incorporated into, say, ControlsEX.dll.

Thanks again for taking time to look at this!

Gary
Reply With Quote
  #18 (permalink)  
Old 01-24-2008, 08:54 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,463
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

All this can be very easely avoided if we can do 2 "simple" things:

1-Plan better our apps and the controls we wich to incorporate...and create/place them at runtime in the inverse order, we wich the tabs to be...
2-Edit or create an automated (app) editing tool to re-write the control creation lines in the .b4p file.

Still I set back and was hopping to see what Agrahams aproch would bring, results wise, and as I espected, only the z-order gets changed...
This is a very common confusion...z-orde=tab order? = FALSE...
So now, and using the words of david:
"In addition, I have to move the user back and forth between fields on lost focus events where I encounter errors."

Wich takes me to my first reply to this thread...
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #19 (permalink)  
Old 01-25-2008, 09:21 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,900
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Cableguy View Post
Still I set back and was hopping to see what Agrahams aproch would bring, results wise, and as I espected, only the z-order gets changed
Sorry Cableguy - I DO understand the differences between tab order and z-order as is clear from my post #15. It IS the tab order that my little library sets. In fact it sets the TabIndex property for each control given to it in the order in which they are placed in the array and obviously works for me and Gary. It needs a library as this property is not available in B4PPC. Why do you think it is setting the z-order?
Reply With Quote
  #20 (permalink)  
Old 01-25-2008, 12:45 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,463
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

I was not refering to your DLL, but to the array/bringtofront aproach...
Sorry if I was somewhat missunderstood...

Still, if the only need is to invert the tab-order, a simple "batch" app would fullfill the need, editing the spb file, and reversing the object creation order..
Your DLL is very usefull, and this feature is also handy if one set the control in an non-inverted tab order....
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
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
Changing the parent of a panel Ricky D Questions & Help Needed 1 10-05-2008 12:03 PM
Changing ROW color in Table? tcgoh Questions & Help Needed 0 04-07-2008 04:25 PM
'Tab' order of controls corwinckler Questions & Help Needed 1 12-18-2007 05:52 AM
Changing the size of a form magi6162 Questions & Help Needed 1 10-24-2007 08:38 AM
Tab Order for Controls BPak Questions & Help Needed 2 05-06-2007 06:58 AM


All times are GMT. The time now is 06:54 PM.


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