|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
Kenneth_Smith
Joined: 18 May 2012 Posts: 697 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Tue Dec 29, 2020 6:21 pm Post subject: %cw – forget user selected text |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Tue Dec 29, 2020 11:05 pm Post subject: |
|
|
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 |
|
|
Kenneth_Smith
Joined: 18 May 2012 Posts: 697 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Wed Dec 30, 2020 12:46 am Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Wed Dec 30, 2020 8:10 am Post subject: |
|
|
I will add this routine to clearwin.ins etc. so the special interface will only be temporary. |
|
Back to top |
|
|
|
|
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
|