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 

%cw forget user selected text

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
Kenneth_Smith



Joined: 18 May 2012
Posts: 505
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Tue Dec 29, 2020 6:21 pm    Post subject: %cw forget user selected text Reply with quote

A simple question, but I cannot find an answer scanning the documentation.

When writing tabular data to a %cw the user can highlight parts of the text. If more lines are then written to the %cw, the new text at the position previously highlighted remains highlighted. Is there a way to prevent this happening, so that none of the new data is highlighted?

The image in the link below shows a highlighted row of data (which the user has copied to another application). When the filter selections are changed and the %cw is updated with new data I would like the 4th row of the data to lose its highlighted status. Is this possible?

https://www.dropbox.com/s/93szdr5xmklwf39/query.jpg?dl=0
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Tue Dec 29, 2020 11:05 pm    Post subject: Reply with quote

Ken

I haven't time to test this but here are the components of a call that should work...

Code:
C_EXTERNAL CANCEL_SELECTION@ '__cancel_selection'(VAL7)
integer(7) hwnd
iw = winio@("%`30.20cw", 10, hwnd)
write(10,*) "Testing"
call CANCEL_SELECTION@(hwnd)
Back to top
View user's profile Send private message AIM Address
Kenneth_Smith



Joined: 18 May 2012
Posts: 505
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Wed Dec 30, 2020 12:46 am    Post subject: Reply with quote

Thank you Paul, that works perfectly ........
Code:
program demo
implicit none
integer iw, m_unit, t_unit
integer, external :: new_data_cb
integer(7) handle_top, handle_main
common m_unit, t_unit, handle_top, handle_main
    m_unit = 30
    t_unit = 40
    iw = winio@('%fn[Consolas]&')
    iw = winio@('%`bg%`30.2cw[local_font]&',rgb@(240,240,240),t_unit,handle_top)
    iw = winio@('%ff%ac[Ctrl+C]&', 'COPY')
    iw = winio@('%cm[Copy]&', 'COPY')
    iw = winio@('%`bg[white]%`30.20cw[vscroll,local_font]&',m_unit,handle_main)
    iw = winio@('%ta%^bt[New_data_1]&',new_data_cb)
    iw = winio@('%sc&', new_data_cb)
    iw = winio@(' ')
end program demo

integer function  new_data_cb()
use clrwin
implicit none
C_EXTERNAL CANCEL_SELECTION@ '__cancel_selection'(VAL7)
integer i
integer m_unit, t_unit
integer(7) handle_top, handle_main
logical :: first=.true.
character(len=28), parameter :: fmt1 = '("    Id   XXXXXX   YYYYYY")'
character(len=35), parameter :: fmt2 = '("-----------------------------")'
character(len=24), parameter :: fmt3 = '(3X,I3,3X,F6.2,3X,F6.2)'
common  m_unit, t_unit, handle_top, handle_main
  if (first) then
    call SET_MAX_LINES@(handle_main,101)
    write(t_unit,fmt1)
    first = .false.
  end if
  call CANCEL_SELECTION@(handle_top)       !### Clears any user selected text in both %cw areas
  call CANCEL_SELECTION@(handle_main)      !###
  write(m_unit,fmt2)
  do i = 1, 100
    write(m_unit,fmt3) i, 100.d0*random@(), random@()
  end do
  new_data_cb = 2
end function new_data_cb
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Wed Dec 30, 2020 8:10 am    Post subject: Reply with quote

I will add this routine to clearwin.ins etc. so the special interface will only be temporary.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
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