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.

Scroll bars in Table control have become disabled

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-03-2010, 08:08 PM
RacingDog's Avatar
Senior Member
 
Join Date: Apr 2009
Location: Fleet, Hants, UK
Posts: 183
Send a message via Yahoo to RacingDog
Default Scroll bars in Table control have become disabled

The program I am developing has a number of tables accessed via a Tab control. 4 or 5 days ago, the only one that needs the table's scroll bars was working fine. Since then I have added the rest of the code. Now the scroll bars are still there, but disabled. Given I have no direct access to the scroll bars via any method or property of a Table control, and in any case have no need to access them from the code, this is something of a mystery.

One of the recent additions is the tidy up code to disable the sundry table's events from doing anything whilst programatic changes to contents are being made. I first thought I may have messed that up, but a) I commented it out for that table and it made no difference, so I put it back; b) the table is otherwise working perfectly, I can scroll by selecting a cell and then using cursor keys and the data updating is working fine too.

So, it is literally just the scroll bars on this one table which are disabled, and I ain't touched those!

To find the table in the app, run it and just scroll the Tab bar once and select the Till tab. Then just look at the table with your eyes and it is obviously wrong. In the code the Table is called TillDetails.

As Paul Daniels says, you'll like this, but not a lot.

Any ideas chaps?
Reply With Quote
  #2 (permalink)  
Old 06-03-2010, 08:15 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Please can you try to hack it down to a simpler program that displays the problem. There is just too much code in there for someone who doesn't know what is intended to wade through to see what you are doing and where the problem might be!
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #3 (permalink)  
Old 06-03-2010, 08:40 PM
RacingDog's Avatar
Senior Member
 
Join Date: Apr 2009
Location: Fleet, Hants, UK
Posts: 183
Send a message via Yahoo to RacingDog
Default

Well I can try, but I would have called this trivially small compared to megabyte stuff people expected me to look at when I was working. I just got on with it, that is what I people expected of me.

A simple use of the search facility reveals that the table is accessed in only a few functions, hardly rocket science.

In any case, what do you want to know? I've already said I do nothing with the scroll bars because there is nothing anyone can do with them. What would you be looking for? Something you already know isn't there? Suppose it is the text size? Making things smaller would remove the problem.

Oh well, hang on, this me take a little while and there are other things to do tonight.
Reply With Quote
  #4 (permalink)  
Old 06-03-2010, 09:06 PM
RacingDog's Avatar
Senior Member
 
Join Date: Apr 2009
Location: Fleet, Hants, UK
Posts: 183
Send a message via Yahoo to RacingDog
Default

OK try this, just hope I'm not too late for something else now, oh well.
Attached Files
File Type: sbp hacked.sbp (10.0 KB, 11 views)
Reply With Quote
  #5 (permalink)  
Old 06-04-2010, 07:55 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by RacingDog View Post
Well I can try, but I would have called this trivially small compared to megabyte stuff people expected me to look at when I was working. I just got on with it, that is what I people expected of me.
That is an incredibly arrogant statement, as though you think that this forum is obligated to find a solution for you and should just get on with it. If that is so trivially small compared with what you are used to you are obviously wonderfully talented and so should just get on and just fix it yourself without intervention by us lesser mortals.

I, and others, who provide support on this forum are doing so voluntarily and in our own time. I don't see why we should spend time wading through your code attempting to see what might be relevant to your problem when it is easier for you, who wrote that code, to strip it down to the essentials necessary to demonstrate the problem. It is an obvious courtesy to extend to those who might try to help. When I was running a team of over twenty programmers it is a practice that I would insist on before involving additional man-power to tackle a problem. It maximised efficiency and minimised the impact on others work.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #6 (permalink)  
Old 06-04-2010, 08:37 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

I'm surprised that with all your experience of multi-megabyte stuff you couldn't work this out for yourself!

TillDetails.Enabled = False ' disables the ScrollBars

From the MSDN documentation of DataGrid which is what a Basic4ppc Table is based on.

"When a scrollable control is disabled, the scroll bars are also disabled. For example, a disabled multiline textbox is unable to scroll to display all the lines of text."

P.S. I found it by stripping back your hacked version even further till the problem went away. I've never used a Table in anger and didn't know that disabling it disabled any scrollbars.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.

Last edited by agraham : 06-04-2010 at 08:54 AM.
Reply With Quote
  #7 (permalink)  
Old 06-04-2010, 09:59 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 also a look at this problem and found a 'strange' behaviour with the table control.
Changing a cell value when the Table is disabled, the scrollbars remain disabled even when the table is enabled again.
With this code the Table.ScrollBars remain disabled.
Code:
<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">Sub </font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2">btnTest_Click</font></font>
<font size=
"2"><font face="Courier New"> Table1.Enabled=</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">False</font></font></font>
</font></font></font></font></font></font><font face=
"Courier New"><font size="2"><font face="Courier New"><font size="2"> Table1.Cell(</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">"Test2"</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">1</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">"12"</font></font></font></font></font></font></font></font></font>
<font face=
"Courier New"><font size="2"><font size="2"> Table1.Enabled=</font></font></font><font size="2"><font color="#800080"><font size="2"><font color="#800080"><font size="2"><font face="Courier New"><font color="#800080">True</font></font></font>
</font></font></font></font><font size=
"2"><font color="#0000ff"><font size="2"><font color="#0000ff"><font size="2"><font face="Courier New"><font color="#0000ff">End Sub</font></font></font>
</font></font></font></font>
The Table can be enabled but NOT the ScrollBars.

Commenting out Table1.Cell("Test2",1)="12" it works.

Attached a sample program to show it.

Best regards.
Attached Files
File Type: sbp TestTableScrollbars.sbp (1.1 KB, 10 views)
__________________
Klaus
Switzerland

Beginner's Guide / User's Guide
Reply With Quote
  #8 (permalink)  
Old 06-04-2010, 10:23 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Playing further it seems the scrollbars return on the next assignment to a cell after setting Enable True again.

It looks like a bug in DataGrid. I've poked around in the DataGrid and DataTable CLR code but I can't see anything obviously amiss. However It's all a bit complicated as DataGrid is quite a clever (complicated!) multi-component control that can bind to data sources and do all sorts of ADO stuff.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #9 (permalink)  
Old 06-04-2010, 02:07 PM
RacingDog's Avatar
Senior Member
 
Join Date: Apr 2009
Location: Fleet, Hants, UK
Posts: 183
Send a message via Yahoo to RacingDog
Default

Ah, amid the hot air, somebody saw the point.

The code does not need to be understood, but simply used to trigger an underlying problem namely the Table and it's Scrollbars get out of step. These should never be in different enable/disabled states if the user has no access to the scroll bars. If they are different then the implementation of the control is wrong and needs looking at. That I presumed was obvious from my first post, I said look at the control with your eyes.

Of course I know that using the disable turns everything off, now who is being unecessarily insulting? That was never the problem being reported and the off hand, "oh the user is always wrong" presumption did not go down well. Did you not read the words to the effect that the control was otherwise behaving correctly? It was a rather important phrase to take on board. I was not reporting that the the Table was disabled, so the catty remark that presumed that I was reporting such was totally wide of the target.

The discrepency between the control and its subsidiary control was what was being reported. I'm afraid I got a bit cross at the assumption I was reporting a user error and the request to "please pointlessly strip down the code to reveal something that isn't there". It isn't there because it is in the control.

So sorry about getting angry, I had other things to attend to as I said, and it was already late in the evening, and to me it was blatantly obvious, just by looking at the screen that the problem was in the control, so I really rather thought it would be as blindingly obvious to everybody. Clearly not.

So let's all calm down and look at the real problem, a control which gets into an inconsistent internal state, which is clearly something I cannot look at because I don't have either the sources or the ide used to build the control, that is why I was reporting it.
Reply With Quote
  #10 (permalink)  
Old 06-04-2010, 04:42 PM
RacingDog's Avatar
Senior Member
 
Join Date: Apr 2009
Location: Fleet, Hants, UK
Posts: 183
Send a message via Yahoo to RacingDog
Default

OOer, hang on, if this is a new observation, does that mean most people don't normally protect their event handlers from unwanted recursions and user interference? So for the benefit of those who wonder what on earth I was playing at in this code...... Those who already know, please ignore.

There are two reasons for my code making heavy use of the Enable property.

First, Windows has lots of other things running, whether as tasks or threads. This means that even the swiftest of event handlers can be slugged by other software such that the user has time to interact. This means the state to which you are responding can be changed mid way through handling it. That is unstable. It won't happen often, but it can happen and give you one of those, "but it usually works" seriously hard to find bugs.

Second, disabling a control doesn't stop it producing messages (events in IDE speak) in response to programmatic changes hence you can get unwanted calls to your event handlers, which can similarly destroy the state you are in the middle of handling. It also can cause recursion. If those recursions are unwanted then at best you are slowing down your software, at worst it can fail to terminate and hang and/or crash your software. Now you can use your own flag to control this, but if you already know that you will be using the Enable property because of the first point, then you can shave a resource requirement and use that as the controling flag. This program of mine would misbehave without those checks. I know 'cos I forgot some of them to start with and hence saw it happen. Doh! I really should have known better. That's what happens when you become rusty due to not programming for a few years. It's grim reading health that stopped me, so don't depress yourselves by asking, not that I mind though.

Sometimes you can dispense with the checks, or at least limit where events are allowed, and make use of the internally produced events, but it is always best to keep the user out when tinkering with that which he can see.

OK. Those who skipped this can wake up again now.
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
How do you eliminate scroll bars?? f150xtr Questions (Windows Mobile) 2 04-18-2010 08:56 AM
Table vertical scroll bars jeterry Bug Reports 3 02-18-2009 01:58 PM
My small samples!scroll-textbox and scroll-image to finger Byak@ Share Your Creations 8 11-10-2008 01:36 PM
Horizontal Scroll Bars Dave Mitchell Basic4ppc Wishlist 6 04-13-2008 02:57 PM
Scroll bar on Table control HARRY Questions (Windows Mobile) 1 05-11-2007 09:08 AM


All times are GMT. The time now is 04:00 PM.


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