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.


Keeping a table cell highlighted (highlit?)


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-03-2008, 05:44 AM
Junior Member
 
Join Date: May 2008
Posts: 32
Default Keeping a table cell highlighted (highlit?)

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!
Reply With Quote
  #2 (permalink)  
Old 06-03-2008, 06:51 AM
Senior Member
 
Join Date: May 2007
Posts: 130
Awards Showcase
Beta Tester 
Total Awards: 1
Default

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
Reply With Quote
  #3 (permalink)  
Old 06-04-2008, 04:32 AM
Junior Member
 
Join Date: May 2008
Posts: 32
Default

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)
Attached Files
File Type: sbp simplecontact.sbp (16.6 KB, 7 views)
Reply With Quote
  #4 (permalink)  
Old 06-04-2008, 11:08 AM
Senior Member
 
Join Date: May 2007
Posts: 130
Awards Showcase
Beta Tester 
Total Awards: 1
Default

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
Attached Files
File Type: sbp buttonnavigate.sbp (2.1 KB, 3 views)
__________________
Rioven

Sony Ericsson XPERIA X1i WM6.1
480x800 Display Resolution
with QWERTY keyboard

Last edited by Rioven : 06-04-2008 at 11:14 AM.
Reply With Quote
  #5 (permalink)  
Old 06-14-2008, 09:19 PM
Junior Member
 
Join Date: May 2008
Posts: 32
Default

Sadly smartphone doesn't support Button or ImageButton
Will play with images but it's going to be time consuming!
Reply With Quote
  #6 (permalink)  
Old 06-15-2008, 02:33 AM
Junior Member
 
Join Date: Feb 2008
Posts: 45
Default Had the same problem

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)
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
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


All times are GMT. The time now is 01:03 PM.


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