02-12-2008 02:47 PM
02-12-2008 03:58 PM
In CVI you can have multiple panels and have some of them opened at the same time and others that are opened and closed upon some condition (signals coming from outside or user interaction or whatever you can think of). Differently from VB you don't have that rigid association one-panel-one-file: you can store multiple panels into a single UIR file and manage all of them in one source file only or divide your code into several .UIR and .C files according to your needs / desires / habits.
So how do you handle all of this? Normally one panel (let's call it the main panel) is loaded inside the main { } function and displayed immediately before RunUserInterface ( ) function, which starts event handling.
Supposing on the main panel ther's a button to load a new panel, in the button callback you will call LoadPanel and DisplayPanel and that's all: the events related to controls on that panel will be automatically handled by the system in the correct way. In the same way, when a panel is no longer needed you can hide it with HidePanel (in that case you can reshow it simply with a new DisplayPanel) or discard it from memory with DiscardPanel (in which case you will need to reload it before using it again).
Each panel is identified by a panel handle, which permits to address it and all objects that are on it. This permits to load more than one instance of the same panel as separate and independent entities. Or to have the same callback associated to controls on different panels, so to reuse the code when needed.
02-12-2008 05:07 PM
02-12-2008 08:27 PM
02-16-2008 12:04 PM
02-16-2008 12:22 PM