|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Sat Feb 05, 2011 6:18 pm Post subject: UNBLANK_CONTROL@ |
|
|
Paul,
There wouldn't by any chance be a REBLANK_CONTROL@ hiding away, undocumented in the library, would there?
I have a working work-around, but it would be more elegant.
Eddie |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Thu Jun 28, 2012 6:34 pm Post subject: |
|
|
Well, I suppose the answer to my original question is a resounding 'No'.
I used, for the first time, %rs[PASSWORD], which works brilliantly. Often found now in Windows 7, and also recommended in the Guide to the Windows look and feel is to have some text in a data box that on gaining focus is all selected so that beginning to type deletes it. While experimenting I came across SET_HIGHLIGHTED@, which would seem to be a partial answer to this conundrum, but I can't for the life of me see how to use it, and anyway, how would one get text into %rd or %rf in the first instance? (Presumably one needs SET_HIGHLIGHTED@ in the first callback for a control, to take effect when it gains focus, but there doesn't seem to be the matching UNSET_HIGHLIGHTED@). It occurs to me that I don't fully understand cursor and focus monitors, so if anyone has a good short example I would appreciate if it could be posted.
Eddie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Thu Jun 28, 2012 7:24 pm Post subject: |
|
|
I seem to have missed your original post.
It don't know of a ClearWin+ routine that meets your needs.
set_highlighted@ has the effect of selecting all text in a given edit control but this can be obscured if the edit control does not have the focus. The highlighting may not be evident whilst clicking on the control can cancel the effect.
set_highlighted@ uses the Windows handle of the control obtained from %lc.
It effectively calls SendMessage using this handle and EM_SETSEL with 0 and -1.
To clear the text you would follow this with a message EM_REPLACESEL |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Fri Jun 29, 2012 10:53 am Post subject: |
|
|
Thanks Paul. I will mull over what you wrote.
I can reset the [initially_blank] characteristic of an edit box by closing a dialog and reopening it. In Windows XP, this gives a distracting 'blink', but Windows 7 (I have much less experience of Vista) gives the dialog a much less distracting shrink-grow type of 'blink', a behaviour that happens at other times, so the user is used to it and doesn't find themselves worrying that they did something wrong.
Regards
Eddie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Mon Jul 02, 2012 10:13 am Post subject: |
|
|
Here is a sample. If you comment out the "replace" line then you will see the highlighting.
Code: | WINAPP
program test
integer winio@,iw,cb,hwnd
external cb
character*80 cv
common hwnd
cv = " "
iw=winio@('%ww&')
iw=winio@('%ca[Your caption...]&')
iw=winio@('%cn%20rs&',cv)
iw=winio@('%lc&',hwnd)
iw=winio@('%nl%cn%^tt[OK]',cb)
end
integer function cb()
include <windows.ins>
integer hwnd,r
character blank
common hwnd
blank = char(0)
r = SendMessage(hwnd,EM_SETSEL,0,-1)
r = SendMessage(hwnd,EM_REPLACESEL,0,blank)
r = SetFocus(hwnd)
cb = 2
end |
|
|
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
|