Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Trapping Key ESCAPE before is processed by a CNiNumEdit Control that has the Focus

Hi well,

If you run the program in debug mode, what are the actual memory locations for both hWndCtl and m_cwspinEdit.m_hWnd? If they are not equal, does the same problem happen with one of the built in controls in MFC like CEdit?

Regards,
0 Kudos
Message 11 of 13
(1,763 Views)
Hi, James
Thank you for your time.
Actually there are of different memory location. But if I use MFC CEdit instead,
the handle of focus window will be m_mfcEdit.m_hWnd when I press a key.
Attached file is a simple program on this test.(Run without breakpoint set and
look at the output window of VC2005)
 
I also have another question would you please give me a help.
How do I programmly set axis of CNiGraph to a integer number axis or to a floating number axis ?
(Because I need to change display between a integer serial numbers and a floating point serial  numbers. The X-axis ticks always display floating number. Would you please provide a example to demo the usage of 
XAxis.Discrete
XAxis.DiscreteInterval
XAxis.DiscreteBase
XAxis.Ticks.MajorUnitsBase
XAxis.Ticks.MajorUnitsInterval
XAxis.Ticks.MajorDivisions
 
Many Thanks!
0 Kudos
Message 12 of 13
(1,757 Views)
Hi well,

The reason you cannot get the CNiNumEdit control to focus is due to the fact that it composed of multiple controls. For further information and discussion of a work-around for this issue, please refer to the following knowledge base:
Why Do I Get an Incorrect Resource ID String from the CNiNumEdit Measurement Studio Control?

As for the axes, the graph will display both floating point and integer datasets continuously so its really a matter of what ticks you see. As you have already found, you must set the MajorUnitsBase, MajorUnitsInterval, and MajorDivisions. Setting MajorDivisions will force the graph to only display a certain number of ticks and it will calculate the interval between ticks based on the data you pass into the graph. For instance, if you set MajorDivisions to 7, and your data goes from 0 to 50, you will see ticks at 7.14268, 14.2857, ..., 42.8571, 50.

Instead, if you set
MajorUnitsBase to .5 and MajorUnitsInterval to 9, with the same data you will see ticks at .5, 9.5, 18.5, ..., 45.5. Basically, the units base will define the granularity of the tick marks, and the interval defines how many units in terms of your data, exists between these ticks.

Regards,
Message 13 of 13
(1,734 Views)