04-16-2008 05:24 AM
04-16-2008 12:09 PM
There are a couple of ways of doing that:
1. You could swallow every mouse click and keypress event in each and every control callback. (A quick-and-dirty way of doing that, assuming that you don't want to modify all the individual control callbacks, is to use the Programmer's Toolbox callback chaining mechanism to add an additional callback to each control)
2. You could create a transparent canvas control, at the top of the z-plane order, the same size as the panel and make it visible whenever you want to disable input. That will take care of mouse clicks, but of course users could still tab from control to control and type.
3. There's an undocumented panel attribute (attribute id: 21501) that you can use to allow popup panels to be sizable. See if it works for you. Make sure you set this attribute before you call InstallPopup.
04-17-2008 03:18 AM
Hi Luis.
Your third suggestion works great! Just wondering why this attribute is undocumented. Appearantly, CVI has more undocumented attributes, like the one to change the size of the up and down arrows on a ring control (that suggestion also came from you). Is there a list available of these undocumented attributes? And why are they undocumented in the first place (not fully tested perhaps)?
Thanks a lot!
04-17-2008 11:16 AM - edited 04-17-2008 11:18 AM
I knew you were going to ask this...
Yes, in many cases these attributes haven't been fully tested, or they might not fit in very well what some library-wide assumptions that we have established, or we just didn't think that they would be useful to most people, and might be confusing to try to explain. Or there might be subtle aspects of their behavior that would cause problems when they interact with other attributes.
In many cases, the reason they exist at all is because we needed that functionality in the CVI ADE, yet we weren't quite ready to make them available for general UI use (and yes, I realize this is somewhat hypocritical). We just thought it would be safer to pretend that they didn't exist.
There really aren't any undocumented attributes that implement major features, or anything like that. It's mostly small stuff. But since you asked, (and I think Roberto has asked about it at some point, also) here's a list of all of the undocumented UI attributes, as of 8.5. But do keep in mind that they might not always work as expected. And they might be removed with some future version of CVI. We won't remove them (or break them) gratuitously, of course, but there might be a good reason why we would need to.
Unfortunately, I don't have any documentation that I can provide for each one. In most cases the constant names give a pretty good clue as to what they do. And I'll be happy to answer any questions you, or anyone else, might have about any of them.
Luis
04-18-2008 02:49 AM
04-18-2008 11:54 AM
04-18-2008 05:21 PM
Luis, it is small nuggets like this "attributes.c" file that make this forum very much worth coming back to on a regular basis.
Thanks for the contribution.
My personal thoughts regarding your fears of allowing undocumented CVI features like this into the mainstream:
I'm guessing that NI's CVI (and TestStand) user-base is, for the most part, of a much higher (programming) caliber than your general population of NI IDE users (I'm talking about LabVIEW and MStudio/VStudio). Now, before you LabVIEW and MStudio/VStudio users out there start throwing rocks in my direction , what I'm saying is that I think that the CVI users are used to digging into library documentation a lot more than users in those other, more "comfy" IDE's. Here's another take on it: Up in the northeast U.S. where I am located, most of the CVI users that I know are in the aerospace or the instrumentation industries, and that sort of user base keeps using CVI for its unparalled source code compatibility and IDE stability (for example, have you ever compared the thickness of the CVI and LabVIEW release notes with every one of their major and minor revisions over the years? I know several LabVIEW users who have had to reluctantly do significant edits on their old LabVIEW projects to keep them fresh). And since the life of an aerospace or instrumentation CVI project is at least a decade (and sometimes more), you are interfacing between many generations of Windows programming, so you have to stay abreast of the various ways to do Windows (PSDK via C or MFC, COM/DCOM and now .NET).
My point is that: that category of CVI users are used to digging into details well below the surface. I would not object to seeing even more undocumented features. Let the dogs out...
JB