04-25-2009, 07:35 PM
Hi Gintaras,
I think I got it, for real this time!!!
I hacked TrackMouseEvent.qml
http://www.quickmacros.com/forum/showthr...p?tid=3126 down to minimum needed for button-swapping.
I had to write accompanying function to turn off the hovered button appearance (id 7) when it became sticky. I don't understand why sometimes it becomes sticky. I think it has to do with the relative size of the images relative to the dialog itself, which is triggering the swapping. Anyway, my bmps were made kind of sloppy so maybe that won't be necessary if I made them more carefuly. Also more likely it is something about the TrackMouseEvent function which I don't yet understand (though I did read about it in MSDN). Anyway, check out my code below. I am sure someone in the community can make it much better since I was basically just hacking at TrackMouseEvent.qml
Function SwapButtonImageOnHoverInDlg
Function TurnOffStickyHover
Anyway, this works. I can make pretty great simulations of the buttons I want in the style of the app using just Paint or even better with program like ButtonGadget2 and then hang the dialog as a hook on a toolbar on the app where I want it.
http://www.buttongadget.com/buttongadget2/default.htm
That program does create javascript onMouseover statements for the button it makes but I think this only works in html. Could those be incorporated into regular dialogs in QM?
I also found a program called 3D Active Button Magic at http://www.multimediasoft.com/
It describes this for incorporating into your projects. I have no idea what any of this means but I know that QM is extendable with additional ActiveX components, etc so hope this helps someone.
Thanks to all!!!,
Stuart
I think I got it, for real this time!!!
I hacked TrackMouseEvent.qml
http://www.quickmacros.com/forum/showthr...p?tid=3126 down to minimum needed for button-swapping.
I had to write accompanying function to turn off the hovered button appearance (id 7) when it became sticky. I don't understand why sometimes it becomes sticky. I think it has to do with the relative size of the images relative to the dialog itself, which is triggering the swapping. Anyway, my bmps were made kind of sloppy so maybe that won't be necessary if I made them more carefuly. Also more likely it is something about the TrackMouseEvent function which I don't yet understand (though I did read about it in MSDN). Anyway, check out my code below. I am sure someone in the community can make it much better since I was basically just hacking at TrackMouseEvent.qml
Function SwapButtonImageOnHoverInDlg
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
def WM_NCMOUSEHOVER 0x2A0
def WM_MOUSEHOVER 0x2A1
def WM_NCMOUSELEAVE 0x2A2
def WM_MOUSELEAVE 0x2A3
type TRACKMOUSEEVENT cbSize dwFlags hwndTrack dwHoverTime
if(!ShowDialog("SwapButtonImageOnHoverInDlg" &SwapButtonImageOnHoverInDlg)) ret
;BEGIN DIALOG
;0 "" 0x90080A44 0x0 0 0 135 17 "TrackMouseEvent"
;1 Button 0x54030001 0x4 38 0 48 14 "OK"
;2 Button 0x54030000 0x4 86 0 48 14 "Cancel"
;6 Button 0x54032000 0x0 1 1 33 15 " "
;7 Button 0x54032000 0x0 1 1 33 15 " "
;END DIALOG
;DIALOG EDITOR: "" 0x2030003 "" "" ""
ret
;messages
sel message
,case WM_INITDIALOG DT_Init(hDlg lParam)
,ont hDlg
,TRACKMOUSEEVENT-- tm
,tm.dwFlags=0x2 ;tm.hwndTrack=(hDlg); tm.dwHoverTime=1 ;tm.cbSize=sizeof(tm);;;
,,int bm=qm.LoadPictureFile("$my pictures$\Open.jpg" 0) ;;loads bmp, gif or jpg. With QM < 2.1.8.4, use int bm=LoadImage(0 _s.expandpath("$qm$\de_ctrl.bmp") IMAGE_BITMAP 0 0 LR_LOADFROMFILE)
,,SendMessage(id(6 hDlg) BM_SETIMAGE IMAGE_BITMAP bm)
,,int bm2=qm.LoadPictureFile("$my pictures$\OpenHover.jpg" 0) ;;loads bmp, gif or jpg. With QM < 2.1.8.4, use int bm=LoadImage(0 _s.expandpath("$qm$\de_ctrl.bmp") IMAGE_BITMAP 0 0 LR_LOADFROMFILE)
,,SendMessage(id(7 hDlg) BM_SETIMAGE IMAGE_BITMAP bm2)
,
,ret 1
,
,case WM_SETCURSOR
,if wParam=id(6 hDlg)
,,hid- id(7 hDlg)
,,Zorder(id(7 hDlg))
,,mac "TurnOffStickyHover"
,,
,case WM_MOUSEMOVE
,,TrackMouseEvent(&tm)
,,hid id(7 hDlg)
,case WM_DESTROY DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK DT_Ok hDlg
,case IDCANCEL DT_Cancel hDlg
,case 7
,,mes "hello"
ret 1Function TurnOffStickyHover
Anyway, this works. I can make pretty great simulations of the buttons I want in the style of the app using just Paint or even better with program like ButtonGadget2 and then hang the dialog as a hook on a toolbar on the app where I want it.
http://www.buttongadget.com/buttongadget2/default.htm
That program does create javascript onMouseover statements for the button it makes but I think this only works in html. Could those be incorporated into regular dialogs in QM?
I also found a program called 3D Active Button Magic at http://www.multimediasoft.com/
It describes this for incorporating into your projects. I have no idea what any of this means but I know that QM is extendable with additional ActiveX components, etc so hope this helps someone.
Thanks to all!!!,
Stuart
Quote:RUN-TIME:
The control's appearance and behavior can also be modified at run-time. For those using the product within the C++ environment, the download package includes a module named 3dabm8.h that will help you with the mnemonic constants required by the control. This module can be found inside the Include directory created by the setup package (the default is C:\Program files\3D Active Button Magic\include).
As explained below, the demo modules for Visual Basic 6, Visual Basic.NET and Visual C# (that were available until version 6 of the control) have been discontinued due to the new internal object-oriented design of the control. Go to the How to use Mnemonic Constants section for details.
Using the control inside Microsoft Visual C++.NET
The use of ActiveX controls within projects developed using Visual C++.NET and MFC creates particular issues users must be aware of: as for Visual C++ 6.0, ActiveX controls require wrapper classes in order to be used in this environment. Usually these wrapper classes are generated automatically by the environment but, due to a bug inside Visual C++.NET, the wrapper class will result incomplete when dealing with ActiveX controls that, in order to maintain backward compatibility, alternates identifiers of properties and methods. For this reason our control comes with its already generated C++ wrapper classes, installed by the setup package inside the "include" directory (by default the complete path should be C:\Program files\3D Active Button Magic\\include\wrappers\cpp.net). This issue implies to perform some manual action when creating a variable associated to the control. We recommend integrating these wrapper classes into your projects using the following procedure:
Copy the following wrapper files into your project directory:
BtnEnh.cpp and BtnEnh.h
Cellsmanager.cpp and Cellsmanager.h
Font.cpp and Font.h
TextDescriptor.cpp and TextDescriptor.h
SurfaceColor.cpp and SurfaceColor.h
Texture.cpp and Texture.h
Add the wrapper files to your project.
Create one variable associated with a 3D Active Button Magic button, declaring the variable itself of type CBtnEnh without using the wizard provided by the environment.
Intellisense will now be able to display all the wrapper functions for all the control's COM interfaces.
