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.

Tables - column position

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-15-2008, 10:26 PM
LineCutter's Avatar
Senior Member
 
Join Date: May 2007
Location: Daarsit
Posts: 161
Awards Showcase
Beta Tester 
Total Awards: 1
Default Tables - column position

I've been redoing the EditableTable.sbp to be more generic (i.e. reading much of the data needed from the table data itself rather than programming it with the table design)...
But (there's always a but!) - if I resize the columns too large (or load a wide table) then the horizontal scroll bar appears. If I use it then my edit-textbox disappears off of the right hand of the screen (offset is vs. left of table, not left of displayed table).
Does anyone know of a way to read the offset of the columns from the left hand edge of the displayed table (or a way to stop resizing, or a way to locate the caret in X&Y coordinates on the form)?
Reply With Quote
  #2 (permalink)  
Old 02-15-2008, 11:03 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

There is a method to get/set the columns Width and height, so estableshing the ofset of the selected cell should be straight foward...
Something like...

Sub Table_SelectionChanged
Textbox1.Left=TB.ColNumber(TB.SelectedCol)*TB.ColW idth(TB.SelectedCol)+1
'Textbox left value = selected Column index * The column Width + 1 to place the TextBox INSIDE the CELL
'The same Aplies to the TOP propertie...

End Sub
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!
Reply With Quote
  #3 (permalink)  
Old 02-16-2008, 05:23 PM
LineCutter's Avatar
Senior Member
 
Join Date: May 2007
Location: Daarsit
Posts: 161
Awards Showcase
Beta Tester 
Total Awards: 1
Unhappy Almost!

Nearly...what you have described is what I've been doing.

Consider the following:
I have a table control 500 pixels wide.
I load a table with 10 columns, each 100 pixels wide.
I scroll horizontally to column 9 & click in the cell to edit it.

If I calculate the left offset of the cell (as 900) then the edit box ends up 400 pixels to the right of the cell, in the area that the cell would have been if my control were 1000 pixels wide.
Reply With Quote
  #4 (permalink)  
Old 02-16-2008, 06:47 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Please up-Load the code, and I'll try to make some sense of it...
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!
Reply With Quote
  #5 (permalink)  
Old 02-16-2008, 09:45 PM
LineCutter's Avatar
Senior Member
 
Join Date: May 2007
Location: Daarsit
Posts: 161
Awards Showcase
Beta Tester 
Total Awards: 1
Default

OK, I present an updated version of the really rather good already EditableTable1.1.
Feed it any table you like, preferably a wide one, & then use the scroll bar to move to the right. Click a cell & see if you can spot the textbox (you could make the form wider if you can't see it at all). Also try activating the textbox & then moving the scroll bar.

I've got a way to go to get this right...
Attached Files
File Type: sbp EditableTable1.2.sbp (2.0 KB, 22 views)
Reply With Quote
  #6 (permalink)  
Old 02-17-2008, 10:18 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

Hi Linecutter
I had a look at your problem and I am afraid that there is no solution at that time for the positionning of the text box.
The problem is that there is information missing:
- the x value from the beginning of the table to the first part of the first displayed column, even the ColWidth value is of no help because the table displays also a partial first column.
- the row number of the first displayed row.
- or the Values of the integrated VScrollBar and HScrollBar of the table.

As long as these values are not available you cannot position your TextBox onto a Cell.

In trying to solve your problem I found a problem with the ColWidth values.
I posted a Bug report:
http://www.basic4ppc.com/forum/showt...=9746#post9746

Best regards
Klaus
Switzerland
Reply With Quote
  #7 (permalink)  
Old 02-22-2008, 02:30 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

Hi LineCutter,
After your post in the thread
http://www.basic4ppc.com/forum/bug-reports/1777-colwidth-problem-tables.html

Quote:
Klaus: It seems that the scrollbar control available in ControlsEx.dll might be a workaround... if the change in column width can trigger an event so that we know when to add the control, or we accept that it needs to be there all the time & for every table event we bring the scrollbar to the front, hiding the real one if it's being displayed.
Haven't played with it yet, nor thought through the maths - that has to wait until we can tell if the total table (column) width has changed.
I have looked at it and you find joined a first solution. There is still some finetuning to do, espacilly for the device, but it works.

I am not really convinced on an editable Table like this, I prefer having a Panel with all the data for one record set available and editable, but this is just an opinion.

Hope this will help you.

Best regards.
Klaus
Switzerland
Attached Files
File Type: zip EditableTable1.4.zip (10.2 KB, 32 views)
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
Tables J12345T Questions (Windows Mobile) 11 12-10-2009 08:51 AM
Appending a hidden column mozaharul Questions (Windows Mobile) 3 05-14-2008 03:48 PM
Column names in a table pmu5757 Questions (Windows Mobile) 2 05-07-2008 02:50 PM
Remove Column derez Bug Reports 1 11-01-2007 05:16 PM
tables Fotis Nakos Questions (Windows Mobile) 3 04-29-2007 08:40 AM


All times are GMT. The time now is 07:00 AM.


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