Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Windows
 Charting and Real-Time Graphics Tools for Windows
 Buttons instead of menus
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

agbommarito

7 Posts

Posted - 07 Nov 2005 :  13:23:08  Show Profile  Reply with Quote
Is there an easy way of using buttons to perform page or graph functions (such as copy or print or close) instead of using a page menu?

Tony Bommarito

quinncurtis

1164 Posts

Posted - 07 Nov 2005 :  16:08:05  Show Profile  Reply with Quote
Yes, you can do that. The page menu events are processed in the routine WGUserPageProc in hook.c (hook.cpp) or rthook.c (rthook.cpp). You will see calls to WG functions that do things like print (WGPrintPage), and copy (WGCopyPage). Close a page using WGClosePage.

Its up to you to create and processs the events for the the buttons though.
Go to Top of Page

agbommarito

7 Posts

Posted - 09 Nov 2005 :  11:07:07  Show Profile  Reply with Quote
Thanks for the response.

I wasn't explicit in my original question. I know that I can call the functions you mentioned. My difficulty was in getting button events to be processed.

I created some windows of the "Button" class as child windows of the QC page window. The buttons display properly, but the BN_CLICKED message that should be generated when the button is pressed doesn't seem to get sent to WGUserPageProc in hook.cpp or, for that matter, to PageProc in qcwinit.cpp.

I noticed that the graph selector buttons were of the "CusButton" class and carried an instance handle different from my application handle. I wondered if there were some way to get the QC DLL to pass the BN_CLICKED messages as I desired.

Tony Bommarito
Go to Top of Page

quinncurtis

1164 Posts

Posted - 09 Nov 2005 :  13:22:33  Show Profile  Reply with Quote
How are you using the software ? Is this

a C++ application that does not use MFC,

an MFC application that does NOT use our Graphics Class Libraries for MFC,

or an MFC application that DOES use our Graphics Class Libraries for MFC ?
Go to Top of Page

agbommarito

7 Posts

Posted - 09 Nov 2005 :  16:38:59  Show Profile  Reply with Quote
I'm using a C++ application that doesn't use MFC.

Tony Bommarito
Go to Top of Page

quinncurtis

1164 Posts

Posted - 10 Nov 2005 :  08:21:03  Show Profile  Reply with Quote
Show how you are creating the button, and how you are trying to intercept the button click message in the message processing function.

Have you sucessfully used your code in any Windows program, independent of Quinn-Curtis software ?
Go to Top of Page

agbommarito

7 Posts

Posted - 10 Nov 2005 :  11:32:22  Show Profile  Reply with Quote
Thanks for the help, but I've decided to not waste any more time on trying to get this method to work. I'll just create a dialog box with a QC page window embedded in it. Then I can use the normal dialog box handling for buttons and checkboxes, and not have to try and go through the QC DLL.

By the way, I started using your products long ago, with the DOS Fortran library you once sold. Thanks for continuing to sell easy-to-use graphics libraries.

Tony Bommarito
Go to Top of Page

quinncurtis

1164 Posts

Posted - 10 Nov 2005 :  12:40:20  Show Profile  Reply with Quote
Buttons created as child windows using CreateWindow do not send BN_CLICKED messages to the message processing function. Instead they send a WM_COMMAND message to the message processing function, and when that message is trapped you must get the child window ID from the LOWORD of the message wParam, and the Button Notification Code ID, which is what BN_CLICKED actually is, from the HIWORD of the message wParam. See a good Windows programming book (Petzold).

We created a button with a parent Page window that sent its WM_COMMAND message to our WGUserPageProc routine in one of the hook files.


HWND pagewindow;
HWND buttonwindow;

  
   pagewindow = WGGetPageWindow(pPageDesc);
   buttonwindow = CreateWindow("button", "XXXX",
	   WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
	   0, 0, 50, 50,
	   pagewindow, 0, hInst, NULL);
   BringWindowToTop(buttonwindow);
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07