07-31-2015 06:05 AM
i have a parent panel then clicking on command button i have displayed a child panel using installpopup , i have placed command buttons on child panel but when i click command button on child panel then i have observed using breakpoints that EVENT_COMMIT is not bieng generated although other event such as mouse movement is bieng generated.
thanks in advance
07-31-2015 11:06 AM - edited 07-31-2015 11:10 AM
Hello smartprogrammer, are you aware of this note from the help for InstallPopup?
Note While you can pass a child panel to this function, it is not recommended. Although the panel will retain its status as a child panel, it will not behave like one while it is modal, which might produce unpredictable results elsewhere in your program. |
Is there a special reason to use a child panel? Can you rethink your framework so that a regular panel is used?
Note: I suppose this discussion and this other one are strictly related: am I right?
08-03-2015 01:54 AM
well you are right and i agree with this , both discussions are related but questions asked are some what diffferent as you told me to post different questions in different threads.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Two questions
1) my question is that when i open a child panel then i dont want my parent panel to receive any events at any of my callbacks of parents panel and when popup is removed then parent panel is again activated. in simple words i want to deactivate my parent panel when a popup is installed.
2) i have a parent panel then clicking on command button i have displayed a child panel using installpopup , i have placed command buttons on child panel but when i click command button on child panel then i have observed using breakpoints that EVENT_COMMIT is not bieng generated although other event such as mouse movement is bieng generated.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
what i want to achieve
my desired task is that i have a front panel as parent panel then whenever i click a command button then a new window opens and the previous one (parent) does not take any command as input.
you can suggest a simpler way or share any code or any helpful matterial.
08-03-2015 05:19 AM - edited 08-03-2015 05:24 AM
The paradigm of InstallPopup is exactly this one:
(from the function help, highlight is mine)
Displays and activates a panel as a modal dialog box.
You must call this function from the thread in which you create the panel.
While the modal dialog box is visible, the user cannot operate any other panels that you created in the same thread.
What is generating confusion here is the "child" concept. CVI considers a child panel the one which loads associated with a parent panel handle: the child panel can appear only inside the area of the parent panel and other limitations apply to it. A panel is loaded as a child one by passing the handle of the parent panel as the first argumento to LoadPanel. Is this the way you are loading your second panel? If yes, then you can simply switch it to a top-level panel passing 0 as parentPanelHandle parameter and display it with InstallPopup being assured that when the modal window is shown no other window in your app can be operated (at least in single-threaded applications).
As far as I can understand, all your problems will disppear with this.
You can also look at a sample project that ships with CVI: open the example finder (Help >> Search examples... menu item) and look for "popup" to locate it, next experiment with the different available popups and see how they behave.
08-03-2015 05:49 AM
my personal testing uptill now tells me that
1) comit event is not generated by popup rather when you click mouse then event left click is generated but not event comit
2) when popup is open then if you click at the parent panel command button then event mouse movement is generated although popup is open.
08-03-2015 07:57 AM
Have you looked at the samples I pointed you to?
Can you post your code?
08-05-2015 02:29 AM
Here is what I am doing now (no child panel requirement any more)
errChk (panelHandle = LoadPanel (0, "workstation.uir", PANEL));
errChk (panelHandle_pass = LoadPanel (0, " workstation.uir", PANEL_pass));
errChk (popup1 = LoadPanel (0, " workstation.uir", pop1));
errChk (popup2 = LoadPanel (0, " workstation.uir", pop2));
NOW the screen displayed below is my popup1 screen with 5 command buttons
I press one command button which will send command on com port and wait for response command; I want that when I press one command button then all the 5 buttons on the screen get suspended (dimmed or disabled) and when all the tasks assigned to one command button are over then all the five buttons are enabled again so that new commands can be send please suggest me better way to do so, I have disabled buttons using
SetInputMode (popup1, pop1_CodeInfo, 0);
And
SetCtrlAttribute (popup1, pop1_CodeInfo, ATTR_DIMMED, 1);
Both are equally good but the issue is that when I use these commands then buttons are disabling after completion of task on function exit not on the entry, due to which while actions to be performed by command button are first executed then buttons are disabled afterwards.
08-06-2015 08:05 AM
See my response here where you posted your code.