Robert, Chris,
even if Chris way to solve it sounds easier and faster to me, Roberts way with subclassing and defining the type of class of the FormDialog in the subclass of the Datawindow seems more familiar and flexible.
But this is just my opinion. Both ways would fit my needs for now.
Heiko
How to solve class related code issues possible in VO but not in .Net?
How to solve class related code issues possible in VO but not in .Net?
Maybe a hybrid solution can be used, to introduce a global that holds the default value for symFormDialog. This way this trick can be used even in existing code that does not use common window subclasses and without needing any additional code, other than defining the class and assigning this global to the name of that class.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
How to solve class related code issues possible in VO but not in .Net?
Hello Heiko,
the solution Robert has proposed was available also in later versions of VO, so you can apply that change also to your VO code. Unfortunately I cannot find any reference to it in the various 2.8 whatsnew documents, so maybe it was added somewhere in the 2.7 versions.
I suspect that it was Robert that has added it.
Wolfgang
the solution Robert has proposed was available also in later versions of VO, so you can apply that change also to your VO code. Unfortunately I cannot find any reference to it in the various 2.8 whatsnew documents, so maybe it was added somewhere in the 2.7 versions.
I suspect that it was Robert that has added it.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
How to solve class related code issues possible in VO but not in .Net?
Hello Robert, Chris,
Sounds good.
I also have a library called AFHook27 included which uses this Dispatch. When I define a METHOD BeforeHook in a datawindow I can use code like this:
LOCAL lDone AS LOGIC
IF lCtrlPressed
IF wParam = 65
SELF:oDCLV1:SelectAllItems()
lDone := TRUE
ENDIF
ENDIF
RETURN lDone
This code sample ensures that Ctrl A selects all items n a ListView and I have other appliances of course, all to do with shortcut keys in controls, e.g. also there is an option to scroll through tabs of a tabwindow using a hotkey.
Could I do that easier in X#, without this library?
Dick
Sounds good.
I also have a library called AFHook27 included which uses this Dispatch. When I define a METHOD BeforeHook in a datawindow I can use code like this:
LOCAL lDone AS LOGIC
IF lCtrlPressed
IF wParam = 65
SELF:oDCLV1:SelectAllItems()
lDone := TRUE
ENDIF
ENDIF
RETURN lDone
This code sample ensures that Ctrl A selects all items n a ListView and I have other appliances of course, all to do with shortcut keys in controls, e.g. also there is an option to scroll through tabs of a tabwindow using a hotkey.
Could I do that easier in X#, without this library?
Dick
How to solve class related code issues possible in VO but not in .Net?
Wolfgang, Robert,
great! I didn´t knew that, that was easy to change.
Thank you!
Heiko
great! I didn´t knew that, that was easy to change.
Thank you!
Heiko
How to solve class related code issues possible in VO but not in .Net?
Hi Dick,
You can definitely do it by subclassing the control. Not sure how this library works to tell if there's an easier way to do it, can you post the complete source code?ic2 wrote:Hello Robert, Chris,
Sounds good.
I also have a library called AFHook27 included which uses this Dispatch. When I define a METHOD BeforeHook in a datawindow I can use code like this:
LOCAL lDone AS LOGIC
IF lCtrlPressed
IF wParam = 65
SELF:oDCLV1:SelectAllItems()
lDone := TRUE
ENDIF
ENDIF
RETURN lDone
This code sample ensures that Ctrl A selects all items n a ListView and I have other appliances of course, all to do with shortcut keys in controls, e.g. also there is an option to scroll through tabs of a tabwindow using a hotkey.
Could I do that easier in X#, without this library?
Dick
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
How to solve class related code issues possible in VO but not in .Net?
Hello Chris,
The library AEFHook27 is written by Lutz.Eckert, who also wrote WildSeek and contains 55 entities so I don't think you want to see all code .
I just wondered if assigning shortcut keys to control in X# could be achieved easier, without this DLL.
If not, I will, in later attempts, try to convert this library and see if it works as it does in VO. If not, I will ask later. What I will do is mail you the DLL, just in case you want to check it out.
Dick
The library AEFHook27 is written by Lutz.Eckert, who also wrote WildSeek and contains 55 entities so I don't think you want to see all code .
I just wondered if assigning shortcut keys to control in X# could be achieved easier, without this DLL.
If not, I will, in later attempts, try to convert this library and see if it works as it does in VO. If not, I will ask later. What I will do is mail you the DLL, just in case you want to check it out.
Dick
How to solve class related code issues possible in VO but not in .Net?
Hi Dick,
In order to see how this library achieves this and tell if there's an easier way to do it (apart from simply subclassing the control), we need to see at least all the relevant code. So yes, please send the library .aef (not the dll) to have a look. Although I suppose this is a free library and the author wouldn't mind if you just posted it here, for other peoples benefit as well. Or I might be wrong about this
Edit: Ah OK, I see you have already sent the aef!
In order to see how this library achieves this and tell if there's an easier way to do it (apart from simply subclassing the control), we need to see at least all the relevant code. So yes, please send the library .aef (not the dll) to have a look. Although I suppose this is a free library and the author wouldn't mind if you just posted it here, for other peoples benefit as well. Or I might be wrong about this
Edit: Ah OK, I see you have already sent the aef!
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
-
- Posts: 774
- Joined: Wed May 17, 2017 8:50 am
- Location: Germany
How to solve class related code issues possible in VO but not in .Net?
Hi Dick,
I don't remember the AFHook27, but are there hits if you search the sources for those words:
AfterDispatch
BeforeDispatch
RegisterHotKey
SetWindowsHook
As the name 'Hook' suggests, i´m pretty sure that at least SetWindowsHook or SetWindowsHookEx are found
regards
Karl-Heinz
I don't remember the AFHook27, but are there hits if you search the sources for those words:
AfterDispatch
BeforeDispatch
RegisterHotKey
SetWindowsHook
As the name 'Hook' suggests, i´m pretty sure that at least SetWindowsHook or SetWindowsHookEx are found
regards
Karl-Heinz
How to solve class related code issues possible in VO but not in .Net?
Hello Karl-Heinz,
Chris had a look at the library and although it is capable of quite some functions, in some cases it may not even be needed. For example, I subclassed the ListView and assigning a (select all) shortcut key in that case can also be done directly in the Dispatch of the window with that ListView on it.
My suggestion was that should I still need this library and it wouldn't work in some point in the future (that is: when I continue to convert VO->X# and probably with a later X# version) I can better report then what doesn't work than that Chris spends time on checking if the planned modifications would or would not work with a library that may not be used widely and/or can be omitted with a bit of work.
Dick
Chris had a look at the library and although it is capable of quite some functions, in some cases it may not even be needed. For example, I subclassed the ListView and assigning a (select all) shortcut key in that case can also be done directly in the Dispatch of the window with that ListView on it.
My suggestion was that should I still need this library and it wouldn't work in some point in the future (that is: when I continue to convert VO->X# and probably with a later X# version) I can better report then what doesn't work than that Chris spends time on checking if the planned modifications would or would not work with a library that may not be used widely and/or can be omitted with a bit of work.
Dick