LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Disactivating a panel

Hi folks,
 
is there any way to disactivate a panel without setting the ATTR_DIMMED attribute. I am using InstallPopup now to make sure that the user can only control the currently active panel, but this prevents the user from resizing this panel. So what I would like to do is just setting the others panel into an inactive state without making them invisible or dimming them...
0 Kudos
Message 1 of 7
(4,556 Views)

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.

Message 2 of 7
(4,537 Views)

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!

0 Kudos
Message 3 of 7
(4,517 Views)

I knew you were going to ask this...  Smiley Happy

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



Message Edited by LuisG on 04-17-2008 11:18 AM
Message 4 of 7
(4,496 Views)
Hi Luis,
 
Thanks for sharing this list. I must say that it contains some attributes that I missed before. Some weeks ago I posted a question about how to resize that round thing in the middle of a gauge control. Your answer was simply: "sorry, it's fixed". Well, appearantly it isn't Smiley Very Happy Your attributes list contains an undocumented attribute ATTR_GAUGE_FRAME_DIAMETER, which perfectly does what I was asking for Smiley Wink
0 Kudos
Message 5 of 7
(4,467 Views)
Oops Smiley Surprised
 
Yeah, I remember your original question. At the time, I looked into it by dropping a gauge in the ui editor, turning on "scale contents on resize" on the panel, then resized the panel, and checked to see if the diameter of the round thing changed. When it didn't change, I simply assumed that there was no such undocumented, internal attribute that we had created in order to scale that part.
 
My mistake was that I used a standard (lab-style) gauge control, instead of a classic-style gauge. If I had, I would have noticed that for the classic control, the diameter was changing, which implied that such an attribute did exist.
 
I just checked the code, and found a stupid little bug that is causing the lab-style gauge to not be resizing that center part. Ugh.
 
Anyway, I'm glad you found your gauge frame resizer. Sorry for the bad answer! Smiley Happy
 
Luis
0 Kudos
Message 6 of 7
(4,438 Views)

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 Smiley Wink, 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

 

--
To whom it may concern: My alias is also my nickname, I've had it since I was a (very) skinny basketball-playing teen. OK, so I've got a 38 inch waist now, but my hometown friends haven't shaken that appellation for me. I trust that you will someday be OK with that alias, as I have been with that nickname.
0 Kudos
Message 7 of 7
(4,425 Views)