LabWindows/CVI Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Wolfgang

Better UI debugging: provide constant names

Status: New

Hello,

 

I don't know if it is possible technically but from a user's perspective it would be convenient for debugging a program (in debug configuration) if the UI constants could be provided in the data tooltips, too. Right now, if something is wrong with my UI I will have to do a lot of detective work to find out which control / control attribute is the problematic one...

 

Example: Consider the code

 

SetCtrlAttribute ( panel_handle, control_id, control_attribute, attribute_value );

 

Right now, if I hover over attribute_value, the tooltip will display something like "attribute_value = 24064". Then I will need to look up userint.h to find out which attribute value this is ( ATTR_CTRL_VAL ). It would be more convenient if the tooltip could include this information, too, and display something like "attribute_value = 24064 ( ATTR_CTRL_VAL )"

 

The same holds for control_id, because a number such as 14 will not immediately help me - I will have to go through the corresponding include file to find the respective UI control (e.g. TABPANEL_2_NUMERIC ).

 

 

3 Comments
tstanley
Active Participant

I would suggest that this could be expanded to panel handles.  Each assigned panel handle appears to be unique, so the debugger should be able to track where a value used for a panel handle came from (or know that the value is not valid).  So for example, the debugger could show things like "panel_handle = 14 (PANEL_2 in MyApp.uir)" or "panel_handle = 7 (NewPanel, line 163 in MyApp.c)" or something similar when hovering over the 'panel_handle' variable in the example above.  This would help troubleshoot the occasional bug I sometimes introduce where I mismatch panel_handles and UI controls by mistake.

LuisG
NI Employee (retired)

For panels, you can at least get the label of the panel in the variables window (but not the tooltip). Because the data type of a panel variable tends to be int, you have to explicitly tell the debugger to interpret it as a panel handle by right-clicking and selecting Specific Type>>Panel Handle.

 

It would be nice to display some of the additional information that you've asked for, such as the constant name or the source .uir, exactly as we do for panel handles in the resource tracking window. Also, showing the same information in the data tooltips would be nice, but it would have to only be after you've already told the debugger (in the variables window) that this is a panel handle.

 

Doing the same for the controls would also be very nice, and very useful. I agree. The problem there is that control ids, by themselves are meaningless. They only identify an actual control when paired with a panel handle. And so, the challenge is how would you associate, in the debugger, a control with a panel handle.

 

But these are all good suggestions. Thanks!

 

Luis

Wolfgang
Trusted Enthusiast

OK,

 

just let me add that while the discussion above focused on 'reverse analysis', already providing constants would be quite useful.

 

Consider the simple case

 

if ( selection_status == VAL_NEW_FILE_SELECTED )

 

At present the data toolstip shows the value of selection_status, but then I still don't know if the condition is true because I possibly may not remember the value of VAL_NEW_FILE_SELECTED. It would be quite helpful if the tooltip would also provide the value of such constants...