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.


editable table ?


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-13-2007, 11:06 AM
giannimaione's Avatar
Senior Member
 
Join Date: Apr 2007
Location: Naples, Italy
Posts: 155
Send a message via Skype™ to giannimaione
Awards Showcase
Beta Tester 
Total Awards: 1
Question editable table ?

Hi all,
is there a method for make table editable?

Gianni
Reply With Quote
  #2 (permalink)  
Old 05-13-2007, 11:07 AM
giannimaione's Avatar
Senior Member
 
Join Date: Apr 2007
Location: Naples, Italy
Posts: 155
Send a message via Skype™ to giannimaione
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Is it possible to edit a TABLE?
Reply With Quote
  #3 (permalink)  
Old 05-13-2007, 11:34 AM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 650
Default

Hi Gianni,

there is no method for an editable table.
But in the old and lost forum sloopa has provided a code sample as an workaround:

From sloopa:

Version 0.9 of an editable table.

Only "Backspace" for correcting cell-entry works (no cursor-keys (arrow-keys) Embarassed I don't know the word in englisch)

Blinking cursor don't works 100% (sometimes the last letter of the cell-entry blinks for one time)
If you make improvements - please let me know and post it here

Code:
' Editable Tablecell
' ==================
' Add a form1
' Add a textbox1
' Add a table1
' Add a timer1
'
' !!WORKS ONLY ON PPC!!

Sub Globals
   scol = ""
   srow = 0
   I = -1
   scolh = "hidden"
End Sub

Sub App_Start
   Form1.show
   sip(false) ' keine Tastatur
   table1.addcol(cString, "hidden", 0)
   table1.addcol(cString, "Name", 60)
   table1.addcol(cString, "Vorname", 60)
   table1.addrow()
   textbox1.visible = false
End Sub

Sub Table1_SelectionChanged (ColName, Row)
   scol = ColName
   srow = Row
   if table1.selectedcol = "hidden" then
         return ' Abbruch
   end if
   I = -1
   timer1.enabled = true
   SIP(true)
   table1.cell(scolh,srow) = table1.cell(scol,srow) ' Hilfszelle bekommt den Wert der Zelle
End Sub

Sub TextBox1_KeyPress (key)
   if key = chr(13) then  ' Return gedrückt   
      table1.focus = true
      SIP(false)          
      timer1.enabled = false        
      CellFinal
      table1.selectcell("hidden",srow)
      return
   end if
   if key =chr(8) then ' Backspace gedrückt
      if StrLength(table1.cell(scolh,srow)) > 0 then
         cellstr = table1.cell(scolh,srow)
         newstr = substring(cellstr, 0, StrLength(cellstr)-1)
         table1.cell(scolh,srow) = newstr
         table1.cell(scol,srow) = table1.cell(scolh,srow)
         return
      else
         return ' wenns = 0 ist nur return, ansonsten wird ein Block angezeigt
      end if
   end if
   table1.cell(scolh,srow) = table1.cell(scolh,srow) & key
   CellFinal
End Sub

Sub CellFinal
   table1.cell(scol,srow) = table1.cell(scolh,srow)
End Sub

Sub Timer1_Tick
   if I < 0 then
      BlinkOn
   else
      BlinkOff
   end if
   I = I *(-1)
   textbox1.Focus = true
End Sub

Sub BlinkOn
   table1.cell(scol,srow) = table1.cell(scolh,srow) & "I"
End Sub

Sub BlinkOff
   if StrLength(table1.cell(scol,srow)) <> 0 then
         table1.cell(scol,srow) = substring(table1.cell(scol,srow), 0, StrLength(table1.cell(scol,srow))-1)
   end if
End Sub
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
Editable Table - Device & Desktop Erel Code Samples & Tips 11 11-21-2008 09:01 AM
Retrieve table filter from the filtered table? LineCutter Questions & Help Needed 1 09-08-2008 07:20 AM
Editable table davelew1s Questions & Help Needed 6 06-18-2008 04:06 PM
XYCalc -graphs an equation or editable table of figures in regular, bar or pie chart HarleyM Code Samples & Tips 2 11-24-2007 08:21 AM
Editable Table RandomCoder Code Samples & Tips 3 06-29-2007 11:17 PM


All times are GMT. The time now is 06:47 AM.


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