View Single Post
  #4 (permalink)  
Old 06-04-2008, 11:08 AM
Rioven Rioven is offline
Senior Member
 
Join Date: May 2007
Posts: 132
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, 4 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