![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I have a table that I'm using to fake tabbed navigation on a smartphone (I've tried using the ControlsEx TabControl but it doesn't seem to work on smartphone?)
So I have a table across the top of the page with a cell for each tab I have a SelectionChanged event that lets me toggle visibility on the panels I'm using for the tabs (and then I set focus to the top field in the selected panel) But.... I can't find a way to keep the cell selected (visibly highlighted) in the table. Table is one row deep and the header.visible is false I'd also like to be able to move from tab (table cell) to tab and only have the focus change to the panel if I click up/down/center on the D-Pad (left/right being used to move left and right obviously) but couldn't work out what events I needed to attach to the table (and even with the focus being set turned off on the panel field the table cells didn't highlight). If we can work that out I still want to fire the SelectionChanged events to move between panels. Hope that makes some sense!
__________________
Random Thoughts of an Offbeatmammal |
|
|||
|
Maybe be better if you post even portion of your code that anyone could review.
Have you already used table1.SelectCell(col,row) to highlight the cell and trigger the SelectionChanged event?
__________________
Rioven Sony Ericsson XPERIA X1i WM6.1 480x800 Display Resolution with QWERTY keyboard |
|
|||
|
I'd tried the tblView.SelectCell(tblView.SelectedCol,tblView.Sel ectedRow) code to try and get it to highlight without much success.
I'd also tried using AddEvent(....,Click,....) or cMiddle etc but no luck Source is attached... feel free to beat it up (it's weird on the desktop and only designed for 320x240 smartphone)
__________________
Random Thoughts of an Offbeatmammal |
|
|||
|
The problem is, once focus leaves the table and focus to other controls, the highlight on cell disappears, this is at the moment the b4p tables behaves, and this also I could not solve myself for just a simple table content inputs.
But for your application, you may try other work-around, as sample below may help. Controls can be image controls, buttons, etc.Code:
'Create Form1, button0 to button3,
'left and right button arCOLs, Arraylist1, and label1
Sub Globals
'Declare the global variables here.
COL=1
End Sub
Sub App_Start
Form1.Show
MouseOnButton
BControl(COL-1) 'initialize selection
End Sub
''''''''''''''''''''''''''FOR BUTTON/PPC KEYS''''''''''''''''''''''''''''''''''''
Sub RightArrow_Click 'or driven by PPC keys
COL = (COL ) Mod 4 + 1 'loops to right direction
BControl(COL-1)
End Sub
Sub LeftArrow_Click 'or driven by PPC keys
COL = (COL + 2) Mod 4 + 1 'loops to left direction
BControl(COL-1)
End Sub
'''''''''''''''''''''''''''''''PROCESSES'''''''''''''''''''''''''''''''
Sub BControl(x)
For i=0 To 3
Control("button"&i,button).Color=212,208,200
Next
Control("button"&x,button).Color=cGreen
label1.Text="You are at button"&x 'or do something
End Sub
''''''''''''''''''''''''''FOR MOUSE''''''''''''''''''''''''''''''''''''
Sub MouseOnButton
For i=0 To 3 'record button names to arraylist1
Arraylist1.Add("button"&i)
Next
For i=0 To Arraylist1.Count-1 'to indicate where control mouse click
AddEvent (Arraylist1.Item(i), click, "ButtonClick")
Next
End Sub
Sub ButtonClick 'button control mouse click
s = Control (Sender).Name
For i=0 To Arraylist1.Count-1
If s=Control(Arraylist1.Item(i)).Name Then
COL=i+1
BControl(COL-1)
End If
Next i
End Sub
__________________
Rioven Sony Ericsson XPERIA X1i WM6.1 480x800 Display Resolution with QWERTY keyboard Last edited by Rioven : 06-04-2008 at 11:14 AM. |
|
|||
|
Sadly smartphone doesn't support Button or ImageButton
![]() Will play with images but it's going to be time consuming!
__________________
Random Thoughts of an Offbeatmammal |
|
|||
|
My solution was something like selecting another cell and then re-selecting the correct one. This works on my WM6 PPC but does not work in the desktop IDE.
table1.Focus table1.SelectCell("AnotherColumn",1) table1.SelectCell("TheTargetColumn",1) |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| event doubleclick and click on the cell (table object)... | micro | Questions & Help Needed | 2 | 08-19-2008 06:50 PM |
| Double clicks on a cell in a table list, possible? | davidcoderlab | Questions & Help Needed | 3 | 06-01-2008 03:09 PM |
| Changing cell color in table control | aureolevoyager | Questions & Help Needed | 2 | 04-10-2008 10:41 PM |
| no event changingselected cell in a table? | moharj | Bug Reports | 5 | 02-02-2008 06:41 PM |
| Keeping Hardware Alive | corwinckler | Questions & Help Needed | 1 | 12-18-2007 08:00 PM |