forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

%lv edit_cells
Goto page 1, 2, 3, 4, 5  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
IanLambley



Joined: 17 Dec 2006
Posts: 482
Location: Sunderland

PostPosted: Sun Dec 17, 2006 1:19 pm    Post subject: %lv edit_cells Reply with quote

When editing a list view cell, typing normal characters results in a callback with reason 'EDIT_KEY_DOWN'. If for example, the delete key is pressed, no callback occurs and so the program is unaware of this type of change to the text. Surely this is an omission?

There is also no response to function keys, and the action of the TAB key can be quite strange.

FTN95 Version 4.9.1.
Back to top
View user's profile Send private message Send e-mail
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7086
Location: Salford, UK

PostPosted: Mon Dec 18, 2006 8:35 am    Post subject: Reply with quote

Ian

Thanks for this. I will add it to the list of things to investigate.
Back to top
View user's profile Send private message AIM Address
IanLambley



Joined: 17 Dec 2006
Posts: 482
Location: Sunderland

PostPosted: Mon Dec 18, 2006 1:26 pm    Post subject: Trying to find a workaround Reply with quote

Paul,

I used add_keyboard_monitor@, and am now able to detect the required key presses, however, I can't read the cell because

clearwin_string@('EDITED_TEXT'),
clearwin_info@('COLUMN_NUMBER')
clearwin_info@('ROW_NUMBER')

all produce no sensible result, due to the keyboard monitor having nothing to do with the list view. Is there some way to read an arbitary cell in the list view window?

Regards

Ian
Back to top
View user's profile Send private message Send e-mail
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7086
Location: Salford, UK

PostPosted: Thu Dec 21, 2006 9:16 am    Post subject: Reply with quote

Ian

I think the data may be stored dynamically in the CHARACTER array in your code. If this is the case then you will be able to access the content of any cell directly.

Regarding the interactive processing of key strokes, the only temporary workaround that I can suggest is to try using %mg with WM_KEYDOWN.
Back to top
View user's profile Send private message AIM Address
IanLambley



Joined: 17 Dec 2006
Posts: 482
Location: Sunderland

PostPosted: Thu Dec 21, 2006 12:09 pm    Post subject: % lv - edit cells Reply with quote

Paul,

I tried looking in the character arrays, and these have to be updated manually in response to the callback, so that didn't work.

What does the %mg do - I havn't a clue - is there and example.

Using the add_keyboard_monitor@ worked but I can't read the cell contents. I looked listviews up on microsoft, see link.
http://msdn2.microsoft.com/en-us/library/system.windows.forms.listview.getitemat.aspx

but i have no idea how to call getitemat method in FTN95 or even whether this is the correct function to get the cell contents.

Help!

Ian
Back to top
View user's profile Send private message Send e-mail
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7086
Location: Salford, UK

PostPosted: Fri Dec 22, 2006 8:57 am    Post subject: Reply with quote

Ian

At first sight it looks like the documentation for %lv in ftn95.chm is incomplete. Additional information can be found in the ClearWin enhancements file (probably cw.enh). You can return the value 4 from the callback to reject a character or an ascii value to translate to a different key. I guess other returned values will accept the key. You should be able to use the CHARACTER array to see what is in any cell.

%mg is documented in ftn95.chm. Examples are hard to come by.
Back to top
View user's profile Send private message AIM Address
IanLambley



Joined: 17 Dec 2006
Posts: 482
Location: Sunderland

PostPosted: Tue Feb 13, 2007 1:53 pm    Post subject: Original and other problems with %lv Reply with quote

I am still persevering with the %lv display and using it for editing and have a few other problems. The system I am writing allows for some columns to be editable and others to be display only. The problems are:

1. There is no callback response to the delete and backspace keys, so although it appears to have been edited, the result cannot be obtained.

2. Un-fathomable operation of the tab key.

3. When in a non-editable field, (callback result=4), in column 1, the field is highlighted and up-down cursor keys move from row to row, initiating an appropriate scroll at the control's boundaries. When in an editable field, the scroll does not happen.

4. When in an non-editable field, there is noway out of the field using the keyboard. Must resort to the mouse.

5. When a non-column 1, non-editable field is clicked, it is not highlighted, all sense of position is lost, i.e. different response to column 1.

6. When moving from one editable field to another, with keyboard cursor keys, there is no way to initiate a partial edit of the cell without resorting to the mouse. A function like Excel or Explorer, whereby F2 initiates an edit would be useful.

7. No way to determine the cursor character position within the field when the callback is initiated, or even to set this position.

Regards

Ian
Back to top
View user's profile Send private message Send e-mail
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7086
Location: Salford, UK

PostPosted: Thu Feb 15, 2007 5:54 pm    Post subject: Reply with quote

Although I would like to help you with this, realistically the task is too large to attempt without direct funding. If you would like to single out one priority item from your list, I will add it to the list of jobs to do.
Back to top
View user's profile Send private message AIM Address
IanLambley



Joined: 17 Dec 2006
Posts: 482
Location: Sunderland

PostPosted: Thu Feb 15, 2007 7:16 pm    Post subject: My priority Reply with quote

Paul,

I would say that the highest priority is for the callback response, but could I suggest that the callback is initiated for all keys, maybe with a different callback reason, ('CONTROL_KEY_DOWN' perhaps). This would maintain backward compatibility. A new function of clearwin_info@('CONTROL_KEY') would then be useful to determine the intent of the keypress and leave the rest up to the programmer.

I would also be pleased if you could put the rest of these items on the list and ponder them in your own time. As far as direct funding is concerned, I might stretch to 20.00 above and beyond the maintainance that I have been paying for about the last 11 years. Sadly the users of the programs I write, seem to pay even less than I can stretch to, and they are all labours of love.

At the time of writing, this forum topic has had 463 views, (no! not all by me!) and it could therefore be dear to the hearts of others.

Regards

Ian Lambley
Back to top
View user's profile Send private message Send e-mail
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7086
Location: Salford, UK

PostPosted: Thu Feb 15, 2007 7:31 pm    Post subject: Reply with quote

Forgive me if I am amused by the bit about "ponder them in your own time". However, my offer remains and if you want to supply sample code for your priority issue it would speed things up when I get to this item in the list of jobs.
Back to top
View user's profile Send private message AIM Address
IanLambley



Joined: 17 Dec 2006
Posts: 482
Location: Sunderland

PostPosted: Mon Mar 05, 2007 3:16 pm    Post subject: % lv - edit cells Reply with quote

You are forgiven for you amusement status, and I am glad that my comments are able to raise a smile. I have tried to e-mail you with some sample code, but the e-mails just seem to remain in the outbox and I do not know whether you receive them.
Back to top
View user's profile Send private message Send e-mail
JohnCampbell



Joined: 16 Feb 2006
Posts: 2339
Location: Sydney

PostPosted: Tue Mar 06, 2007 5:37 am    Post subject: Reply with quote

Paul,
I also have messages to you in my outbox, but no idea of how they get to the sent box, which I presume is where they would go when they are sent ??
Any advice on how the message system works ?

John
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7086
Location: Salford, UK

PostPosted: Tue Mar 06, 2007 9:52 am    Post subject: Reply with quote

I do not routinely read my message box on this forum. Questions that are potentially of general interest should be posted in the main forum. When directed I will pick up files that have been posted in my message box but I may need to be reminded.

I now have Ian's zip file and I will take a look at it as soon as I can.

John, I have now read your message and will send a reply.
Back to top
View user's profile Send private message AIM Address
IanLambley



Joined: 17 Dec 2006
Posts: 482
Location: Sunderland

PostPosted: Thu Mar 08, 2007 1:27 pm    Post subject: Moving Forward Reply with quote

A big thanks to "BB" who e-mailed me some code. It appears that the "EDITED_TEXT" function is best called when the edit is complete and the "END_EDIT" callback reason is in force. I was originally trying to use this within "EDIT_KEY_DOWN" to check the contents of the cell in response to each keystroke, something that I regularly do for the %rd, %rf & %rs formats. Instant updating of the calculation would then have been possible in the way that it is for those other controls. However, as the control callback does not respond to every keypress, then this did not work. I can now only use the data after exiting from the edited cell.

Other spurious events and responses still apply.
Back to top
View user's profile Send private message Send e-mail
IanLambley



Joined: 17 Dec 2006
Posts: 482
Location: Sunderland

PostPosted: Wed Oct 01, 2008 1:22 pm    Post subject: Reply with quote

Paul,

I am still baffled with this one. It appears that if a cell is selected for editing and the text is changed, then if the user moves to another cell using the mouse, the callback reason sequence is "END_EDIT" followed by a "BEGIN_EDIT" for the newly selected cell. If the user exits using the return or a cursor key, then the callback sequence is "BEGIN_EDIT", "END_EDIT", "BEGIN_EDIT".

In my code I use "BEGIN_EDIT" to determine the cell being edited and so because an extra one is initiated with keys movement mode, the edited contents of the previous cell are deposited in the the newly selected cell.

I would appreciate a bit of help.

Regards

Ian

[code:1:38baf1dbef]
winapp
include <windows.ins>
character*100 text,singular_text,temporary_text
common/callback_status/in_callback
common/lv_data/text(5),singular_text(10,4),temporary_text
COMMON/LV_INFO/IROW,ICOL,irow_last,icol_last,ichanged
character*20 callback_history
common/cb_hist/callback_history(1000)
common/cb_hist_number/nhist,irows(1000),icols(1000)
integer*4 sel(4),view
external lv_callback
callback_history=' '
nhist = 0
in_callback = 0
irow_last = 0
icol_last = 0
irow = 0
icol = 0
sel=0
view=1
text=' '
do i=1,4
singular_text(1,i)='one'
singular_text(2,i)='two'
singular_text(3,i)='three'
enddo
do i=1,4
do j=1,3
text(i+1)=trim(text(i+1))//'|'//trim(singular_text(j,i))
enddo
enddo
!text='||| '
text(1)='|a1_|a2_|a3_'
i=winio@('%ca[LV edit test]%ww&')
i=winio@('%^lv[show_selection_always,edit_cells,full_row_select,go_down_on_return]',500,200,text,5,sel,view,lv_callback)
print 100,(trim(text(i)),i=1,5)
do i=1,nhist
print*,i,callback_history(i),irows(i),icols(i)
enddo
100 format(a)


end
integer*4 function lv_callback()
include <windows.ins>
!character*100 edited_cell
common/callback_status/in_callback
COMMON/LV_INFO/IROW,ICOL,irow_last,icol_last,ichanged
character*100 text,singular_text,temporary_text
common/lv_data/text(5),singular_text(10,4),temporary_text
character*20 callback_history
common/cb_hist/callback_history(1000)
common/cb_hist_number/nhist,irows(1000),icols(1000)
lv_callback=2
!if(in_callback .eq. 0)then
! in_callback = 1
nhist = nhist + 1
callback_history(nhist) = clearwin_string@('callback_reason')
! print *,clearwin_string@('callback_reason')
if(clearwin_string@('callback_reason') .eq. 'BEGIN_EDIT')then
! irow_last = irow
! icol_last = icol
! print *,'clearwin_info@(''ROW_NUMBER'') ',clearwin_info@('ROW_NUMBER')
! print *,'clearwin_info@(''COLUMN_NUMBER'')',clearwin_info@('COLUMN_NUMBER')
irow=clearwin_info@('ROW_NUMBER')
ICOL=clearwin_info@('COLUMN_NUMBER')
endif
if(clearwin_string@('callback_reason') .eq. 'END_EDIT')then
! print *,'clearwin_string@(''EDITED_TEXT'')',clearwin_string@('EDITED_TEXT')
temporary_text = clearwin_string@('EDITED_TEXT')
irow_use = irow
icol_use = icol
if(icol_last .ne. icol)then
if(icol_last .ne. 0)icol_use = icol_last
endif
if(irow_last .ne. irow)then
if(irow_last .ne. 0)irow_use = irow_last
endif
if(temporary_text .ne. singular_text(icol_use,irow_use))then
ichanged = 1
singular_text(icol_use,irow_use)=clearwin_string@('EDITED_TEXT')
text(irow_use+1)=' '
do j=1,3
text(irow_use+1)=trim(text(irow_use+1))//'|'//trim(singular_text(j,irow_use))
enddo
call window_update@(text)
else
ichanged
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Goto page 1, 2, 3, 4, 5  Next
Page 1 of 5

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group