LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

shows user answer control in generic message popup panel

Hi,
I have an issue with the generic message pop up and the prompt popup functions, in CVI help it appears to have a control to allow user to type an answer but when I use the function it does not appear.
Why is that?

Thanxs by advance
Olivier
0 Kudos
Message 1 of 9
(4,563 Views)

Hello Olivier,

the only reason why the string control could not appear is when the buffer is set to NULL (0). When using PromptPopup, make sure that ResponseBuffer (3rd parameter) refers to a valid buffer. When using GenericMessagePopup, this is the 6th parameter.

0 Kudos
Message 2 of 9
(4,562 Views)
Hi, thank you but could you explain me what should be the right declaration to allocate a buffer and to define its size for this function because I am not sure I have got it understood well

Olivier
0 Kudos
Message 3 of 9
(4,557 Views)

Hello Olivier.

The easiest way is just something like:

char string[500];

This will allocate a buffer of 500 bytes.

0 Kudos
Message 4 of 9
(4,555 Views)
HI,
and thanks, but I am going to bother you a little bit more, my point is to make a listbox and, when the user double right click on it he can add a double value and a time value on the line maybe separated by a tab or something else, maybe my buffer declaration array should be dynamical, but I don't know how to do it. plus I don't understand how to initialize values in my declaration, do I have to initialize them with zeros why can't it be empty at initialization. moreover in the function ListInsertItem(LISTBOX,PtrToItem, itemlistsize); what is the PtrToItem needed for?

Here is the callback attached to the list box.

int CVICALLBACK LISTBOX_CB (int panel, int control, int event,
        void *callbackData, int eventData1, int eventData2)
{
    int itemlistsize;
    char PtrToItem[500];
    //void *listPtr;
    ListType LISTBOX=0;
    char answerbuff[500]; 
    switch (event)
    {
        case EVENT_LEFT_DOUBLE_CLICK:
            itemlistsize = ListGetItemSize(LISTBOX);
            //PromptPopup("Speed and duration popup", "Enter Speed and duration for this step", answerbuff, 100);
            GenericMessagePopup ("Speed and duration popup","Enter Speed and duration for this step", "OK", 0,0 , answerbuff, 100, 0, VAL_GENERIC_POPUP_INPUT_STRING,VAL_GENERIC_POPUP_BTN1, VAL_GENERIC_POPUP_BTN2); 
            ListInsertItem(LISTBOX,PtrToItem, itemlistsize);

            break;
    }
    return 0;
}


Really thank you
0 Kudos
Message 5 of 9
(4,538 Views)
Hello Olivier,
 
You should use the User Interface Library functions to add the entered string to the listbox (from the menu: Library->User Interface->Controls/Graphs/Strip Charts->List/Tree (Label/Value) Controls. You are using the List functions from the Toolbox Smiley Tongue
 
I wrote you a small example, attached to this post.
 
If you have any more questions: just post!


Message Edited by Wim S on 01-18-2008 11:55 AM
0 Kudos
Message 6 of 9
(4,530 Views)


Message Edited by Wim S on 01-18-2008 11:56 AM
0 Kudos
Message 7 of 9
(4,529 Views)
Looks like something went wrong. Never mind these last two posts Smiley Indifferent


Message Edited by Wim S on 01-18-2008 11:57 AM
0 Kudos
Message 8 of 9
(4,528 Views)
OK nevermind,
I'll check it out
I'll let you know if I have any understanding problems.

Thanks again
0 Kudos
Message 9 of 9
(4,520 Views)