Two Questions (OpenInsight Specific)
At 30 MAR 1998 07:15:07PM Don Bakke wrote:
Hi,
I have two questions which address the same problem (for me). An answer to either should solve my problem but I would like to get an answer (if one exists) for both questions:
1. What is the proper method for setting the ES_NOHIDESEL style of a control? I'm using a method (*see code from CREATE event below) that gets the style and struct, modifies them appropriately, destroys the control, and then creates the control. However, the cursor appears shifted up and to the left of its normal starting position. Am I doing something wrong?
<code> $insert PS_EQUATES Declare subroutine Utility Style=Get_Property(@Window:".EDITLINE_1", "STYLE") Struct=Get_Property(@Window:".EDITLINE_1", "ORIG_STRUCT") if Style 1,2 _eqc "0x" then convert @lower.case to @upper.case in Style MX") end Style=BitOr(Style, 256) Struct=Style Utility("DESTROY", @Window:".EDITLINE_1") Utility("CREATE", Struct) RETURN 1</code>
2. Is there a way to create PUSHBMP's that won't cause a control to lose its focus? I'm trying to create toolbar buttons for CUT, COPY, and PASTE. Doing this with Menus is easy since they don't have cause a control to lose focus. PUSHBMP's lose the cursor as well as the "selected" look. If I get an answer to my first question, then I can live with it. Every commercial application with toolbar buttons that I've looked at keeps the cursor and the "selected" look intact and that is what I'd like to accomplish if at all possible.
Thanks,
At 31 MAR 1998 09:10AM Carl Pates wrote:
Hi Don,
1. What is the proper method for setting the ES_NOHIDESEL style of a control? I'm using a method (*see code from CREATE event below) that gets the style and struct, modifies them appropriately, destroys the control, and then creates the control. However, the cursor appears shifted up and to the left of its normal starting position. Am I doing something wrong?
Well, sort of, but the PS is not really giving you back what you expect
If you look at the values you get back from the STYLE property you'll see that it doesn't match the value in the STRUCT. There is a flag missing from the STYLE value that tells the control to draw a border so you need to put it back ( this will also move the caret back to the normal location ). If you amend your code as below you should get it to work ( well it does for me anyway )
Also make sure you convert your style back to c-style Hex notation!
$insert PS_EQUATES
Declare subroutine Utility
Struct=Get_Property(@Window:".EDITLINE_1", "ORIG_STRUCT")
Style=Struct
if Style 1,2 _eqc "0x" then
convert @lower.case to @upper.case in StyleMX")
end
Style=BitOr(Style, 256)
Struct=0x" : Oconv(Style,"MX")
Utility("DESTROY", @Window:".EDITLINE_1")
Utility("CREATE", Struct)
RETURN 1
2. Is there a way to create PUSHBMP's that won't cause a control to lose its focus? I'm trying to create toolbar buttons for CUT, COPY, and PASTE. Doing this with Menus is easy since they don't have cause a control to lose focus. PUSHBMP's lose the cursor as well as the "selected" look. If I get an answer to my first question, then I can live with it. Every commercial application with toolbar buttons that I've looked at keeps the cursor and the "selected" look intact and that is what I'd like to accomplish if at all possible
Not with PUSHBMP's AFAIK. Also I imagine the toolbars in other apps don't use the standard button ( usually some unholy MFC construct instead ) or use their own Window Procedure to control them.
What you could do is to use a series of BITMAPS and use the BUTTONDOWN/BUTTONUP/WINMSG events of the window underneath to control them and make them behave like buttons ( changing their image/ firing events etc ). The only problem here is that they'll never truly get focus but you could use menu accelerators to given them keyboard control…..
World Leaders in all things RevSoft (Except VIP)