Is it possible to set the stateof a command button

I want to call a function when the user presses a command button (left click), then wait until he releases the mouse button, then call a second function.
Here is the code for EVENT_LEFT_CLICK:
CallFunction_1(...)
GetRelativeMouseState(panel, control, 0, 0, &mouseLButton, 0, 0);
while(mouseLButton)
ProcessSystemEvents();
ProcessDrawEvents ();
GetRelativeMouseState(panel, control, 0, 0, &mouseLButton, 0, 0);
CallFunction_2(...)
My Problem is, that the button does not chage its state to "pressed", so it appears to the user that he has not clicked on it.
Is there any possibility to set the command button th the pressed state?

The reason for this is that the LEFT_CLICK event has not been processed yet. We allow you to "swallow" any event to basically eliminate the built in effect of that event. In your case you want the normal effect of the LEFT_CLICK event to occur (button appears pressed on the panel), but you also want to launch a loop to check when the mouse has been released. This is easily done through posting a deferred call. A deferred call allows the current event to be completed and then calls the deferred callback after that. So your code would be changed to:
In LEFT_CLICK,
CallFunction_1(...)
PostDeferredCall (funcName, (void*)control);
Then write a function "funcName" with prototype:
void CVICALLBACK funcName (void *callbackData);
and code:
void CVICALLBACK fu
ncName (void *callbackData)
int control = (int)callbackData;
int mouseLButton = 0;
GetRelativeMouseState (panel, control, 0, 0,
&mouseLButton, 0, 0);
while(mouseLButton)
ProcessSystemEvents();
ProcessDrawEvents ();
GetRelativeMouseState (panel, control, 0, 0,
&mouseLButton, 0, 0);
CallFunction_2(...)
This should solve your problem.
Best Regards,
Chris Matthews
Measurement Studio Support Manager

Similar Messages

  • Is it possible to set the child index of items in the design view?

    Is it possible to set the child index of items in the design view? I have a large png that is on top of everything in design view which is really annoying

    Yes it is possible to do so. Goto View>>Tools Pallete. This will open up a tools pallete which you can use to modify the colours and other viewing options of graphs and anything else on the front panel.
    For your purpose u select the background of the graph and  click on the "set colour squares" present in the lower bottom corner of the pallete. This will open up a whole range of colors you can select for the purpose. There in the black and white strip of colours, there is a box titled "T" on the right most corner. Select that "T" and your background color will go transparent.
    Have a nice day. Happy codings.
    Regards
    Asad Tirmizi
    Design Engineer
    Institute of Avionics and Aeronautics
    " Its never too late to be, what u want to be"
    Using LabVIEW 8.2

  • Is it possible to set the firefox back button to a custom action in the context of a websocket connexion?

    Simply, is it possible to set the firefox back and forward button to custom javascript function to navigate in a websocket application.
    Thanks in advance

    You may get lucky, especially as Today is a "Sumo Day" with more contributors around than usual. Such a question tends to be slightly off topic, being a hack of a standard Firefox installation.
    What I would suggest is that you try other forums, either a specialist linux forum or the popular Mozillazine forums: http://forums.mozillazine.org/index.php

  • [Q]Is it possible to set the hostname as DBCS character like Korean

    My question is that is it possible to set the hostname as double byte character set like Korean or Japanese.
    If possible, What kind of limitation does exist?
    Thanks

    Not that I've found, no : http://www.apple.com/feedback/ipad.html

  • Is it possible to set the default colours in the swatches palette in Illustrator CS4?

    Is it possible to set the default colours in the swatches palette in Illustrator CS4? What I mean is replace the swatches default colour palette with my own, so that each time I create a new document it comes up with my colours rather than Illustrators.

    You might also consider using color groups with Illustrator. Let me know what you think. It may help you out with projects that use the same color preferences.
    Check out the tutorial here:
    http://www.adobe.com/designcenter/illustrator/articles/lrvid4019_ai.html
    Let me know if this helps you.
    Vicente Tulliano

  • Is it possible to set the project selection?

    The scripting guide tells me app.project.selection is read-only, so this might be a stupid question.  But I could swear I ran across a script recently that was able to select items in the project window (yes, it would be helpful if I could remember which script does this).  I'm hoping to write a script that will select in the project window all the comps that are queued for render.  Is it even possible to set the selection?

    Paul Tuersley over at aenhancers came up with the answer:
    http://www.aenhancers.com/viewtopic.php?f=8&t=1374&p=5243#p5243
    You add and remove items from the project selection by setting the item's .selected flag.

  • Is it possible to get the decline and answer buttons from sleep mode?

    The way my iphone operates now, when a call comes in and the phone is in sleep/locked mode, the only option is to slide the lock to answer the call. When a call comes in and the phone is not locked, it gives the option to decline the call with a red button and answer the call with a green button. My question is this: Is it possible to set the phone so it gives the decline/answer option coming straight out of sleep/locked mode?

    Nope. But single clicking the Sleep/Wake button will silence the ring, and double-clicking the Sleep/Wake button will send the call to voicemail, having the same effect as "Decline."

  • Is it possible to move the "Add.." button at contacts on top of the custom label list? I add a lot of custom lables and tired of scrolling down every time.

    Is it possible to move the "Add.." button at contacts on top of the custom label list? I add a lot of custom lables and tired of scrolling down every time.

    No way to move any buttons in iOS devices.

  • I want to refresh my jsf page on the click of command button.

    Hi all,
    i m using JDEV 11.1.2.1.0
    i have created one jsf page with fragment i want to refresh my whole page on the click of command button which is present in fragment page.Besause i want to refresh some field but those are present in jsf page so i cant apply partial trigger because command button property in fragment page backing bean class and those attribute which i want to refresh its property in other class.
    thanks.
    Rafat

    i didnt get you from your content so i go with subject for giving your answer
    refreshing some of the fields
    BindingContainer bindings = getBindings();
    DCIteratorBinding dciter = (DCIteratorBinding)bindings.get("xIterator");
    ViewObject vo = dciter.getViewObject();
    Row row = vo.getCurrentRow();
    vo.executeQuery();or else drop execute operation as button to execute vo.
    to refresh a page
    partial trigger nice options.
    to performs instant refresh
    af:poll component
    so if you don mine give me some scenario using hrschema i may give a liitle try to my small brain :)

  • Is it possible to set the NLS_DATE_FORMAT for my sessions at apex.oracle.co

    Hi,
    Is this possible?
    I'm in the UK and getting the invalid month error when storing dates.
    Thanks in advance
    Bryan

    Hey John,
    For the 9606 there is a Real-Time clock (RTC) onboard that will use a battery to keep time even if the sbRIO is powered off. Please see the specification manual. http://digital.ni.com/manuals.nsf/websearch/E065536DC595BDD886257C2E00704610
    Once youve set the time the RTC will keep ticking away while powered and when powered off the battery will keep only the RTC powered. So on the next boot the time is kept because of the RTC. You'll need to connect a battery to the RTC VBat line documented in the specification. 
    Kyle Hartley
    RIO Product Support Engineer
    National Instruments

  • Is it possible to set the cell height in a cell style?

    In the attached screenshot, the cell height is set to exactly 0.125. I put my cursor in the cell, then opened the cell styles panel and created a new cell style based on this cell. But when I apply the cell style to other cells, it does not apply the cell height. There were no overrides or other styles applied to the other cells. I also opened up the cell style definition from the cell styles panel, but don't see anywhere to set the cell height there either. Is there another way to do this that I am missing?

    It is possible - and it's fairly simple.
    To set the row height as part of the cell style, all you have to do is use the cell inset above and below. As long as you set the style as 'At least' then this works perfectly well for having predefined cell styles.
    I have been using this successfully for large financial documents for some time without any hitches. For example I use it to get separation between sections within the tables by having a style with extra space above, and similarly for totals rows at the bottom of the table. It can of course also apply different stroke styles at the same time. Having the style set as 'At Least' also allows for multiple line entries to still have the correct spacing above and below.
    So if you spend a bit of time calculating required heights and setting up your styles, then apply a keyboard shortcut to each style, you can then save a whole lot of time when formatting the document.
    I've just finished nearly 400 pages of financials using this method over the past couple of days!
    This solution may not suit your sitation, but if you have a lot of tables to get through it's got to be worth giving it a try.

  • Is it possible to set the heap size limits in system-wide config?

    Hi,
    I am trying to set the JRE heap size limits (-Xms and -Xmx) by using the system-level deployment.properties file. The JRE version is 1.6 update 6.
    Normally, I would have something like this in the user-level deployment.properties file:
    deployment.javapi.jre.1.6.0_06.args=-Xms64M -Xmx192MHowever, when the same line is put in the system-level properties, it does not seem to have any effect. I have tried different options, also unsuccessfully:
    javaplugin.vm.options=-Xms64M -Xmx192M
    or
    javaplugin.minHeapSize=64m
    javaplugin.maxHeapSize=192mIs it not possible to address this setting via system-level properties at all? I am hoping that I will not have to resort to per-user config files.
    Best regards,
    Martin

    Hi Michael,
    thank you for your answer. I am sorry, I was unable to find the link to the message 10144001.
    My ultimate goal would be setting the system level settings as opposed to settings per applet. I was unable to find any mentioning of "deployment.javapi.jre.X.X.X_XX.args" in the official documentation here: http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/properties.html
    Best regards,
    Martin

  • It's possible to set the number of frame?

    It is recommand to set the number of channels as low as possible, and it is easy to do. But it is recommended to decrease the number of frames? If yes, how can i do it? It seems to me that the manuals do not mention this aspect.
    Thanks.

    Yes but if it is so why it is recommended to set the numbers of channels as low as possible?
    It is sure that is not possible to to set the number of frame? I remember that long time ago  maybe I find something about how to set the frame's number, but
    it is possible that I'm wrong. 
    Thank you.

  • Is it possible to set the blog as the main page?

    instead of the wiki?
    for example, when a user types "wiki.company.com/groups/wikigroup" it takes you directly to the wiki page. at the top right corner, you see 2 links: 1 for wiki and 1 for blog.
    is it possible to set this up where if the user types in the URL above, it takes them straight to the blog section?
    after doing some research on my own, i don't see how this is possible but i wanted to double-check here to confirm my hypothesis.
    thanks in advance.

    You might try something like
    public void setMenuFont( MenuElement element, Font font ) {
        element.getComponent().setFont( font );
        MenuElement[] subElements = element.getSubElements();
        for ( int k = 0 ; k < subElements.length ; k++ )
            setMenuFont( subElements[k], font );
    // Create menu elements, then
    setMenuFont( mbMenuBar, fMenuBar );

  • Is it possible to set the SYSTEM.MODE to 'NORMAL'?? How to do a CANCEL-QUERY??

    Hi All;
    I have a form in which i have created 'ENTER-QUERY', 'EXECUTE-QUERY', 'CLEAR', 'SAVE' & 'EXIT'.
    Now i want to create a 'CANCEL-QUERY', but i exactly don't know what code to put in so that it functions like 'CANCEL-QUERY' of DEFAULT&SMARTBAR.
    Can you please let me know??
    And also , actually i tried the following for 'CANCEL-QUERY' in WHEN-BUTTON-PRESSED trigger .
    BEGIN
      CLEAR_BLOCK(NO_VALIDATE);
      IF :SYSTEM.MODE = 'ENTER-QUERY'
      THEN SYSTEM.MODE := 'NORMAL';
      END IF;
    END;
    I got an error saying A READ-ONLY bind variable used in OUT or IN-OUT context.
    So i guess, i cannot alter or set the status of SYSTEM.MODE. Ofcourse i can't, How can I..
    So what do i put in the Code to do CANCEL_QUERY action??
    Thank You.
    Oracle Forms 6i.
    Oracle 9i.

    I'd just like to know did you manage to cancel a query using my code ,Please try..
    IF :SYSTEM.MODE = 'ENTER-QUERY'
      THEN
      EXIT_FORM(NO_VALIDATE);
    END IF;
    Hope it works..:)

Maybe you are looking for