How do I add mouse-drag functionality?

A friend of mine asked me for help. He is building a program to look at a
grid of 100 components. He has a 2D array of on/off buttons that control
which components the program will look at. He would like to make it easier
for the user to select which of the 100 he wants to check so he'd like to be
able to choose sets of buttons using left-click and drag. Any ideas?

A very interesting problem indeed.
As pointed out by Craig, a solution for you can be to use a transparent picture control over your array of buttons. That is how I would have done this too. Because to handle 100 buttons without this drag function will be difficult and take long time for the user.
The implementation of a drag a function might at first seem tricky, but in fact it is rather straightforward. The key is to extract the mouse position when the mouse button was pressed and later released and to convert these two positions to coordinates of the buttons affected. With the powerful library of functions in LabVIEW this can be done easily.
I attach a simple example to show how it works. I decided to use a 2D array of 10x10 elements (like yours) and I
added a feature that draws a rectangle during the drag operation. What is inside the selected area will be inverted which allows for both selecting and unselecting. My main program is named Select100.vi and it is calling InvertButtons.vi that changes the 2D array according to the mouse coordinates when the user drags the mouse over an area.
I hope this helps and good luck in helping your friend with his program.
/Mikael
Attachments:
select100.vi.vi ‏43 KB
invertbuttons.vi.vi ‏35 KB

Similar Messages

  • Mouse Dragging Function Disable Help plz!

    Anyone know how to disable the Dragging functions of the Mouse? I am attempting to Play World of Warcraft and it extremly difficult to move my Charcter around with the mouse dragging function on .....Please HELP
    Also I am using a Gamer Mouse not a Apple mouse . I cant be the only one who finds this annoying lolz

    Not sure, but you might want to take a look at SteerMouse which lets you configure your mouse in various ways.
    Other possibilities:
    ControllerMate
    USB Overdrive

  • How do I add a zoom function to a digital magazine (.swf file) in InDesign CS6?

    Hi,
    Im creating an interactive digital magazine for our company which will go on the iPad, but also online for computers.
    The iPad (.folio) has zoom functions, but on screen (.swf) the magazine is very static and peaple can't zoom and scroll (the zooming buttons function in InDesign doesn't work here).
    So, how do I add a zoom function to a digital magazine (.swf file) in InDesign CS6?
    (I read older posts regarding this problem in CS5... It's not possible for me to purchase an additional product for that. I have Flash, if there is a tutorial on how to do it, that'd be helpful too)
    Thanks for your help!
    Best regards!

    Although the help implies this should work, and I've seen it written in a book to do things this way, it's not how I do things:
    var content_req1:URLRequest = new URLRequest("text/hales.txt");
    var content_ldr:URLLoader = new URLLoader(content_req1);
    content_ldr.addEventListener(Event.COMPLETE, onComplete1);
    Instead, try:
    var content_req1:URLRequest = new URLRequest("text/hales.txt");
    var content_ldr:URLLoader = new URLLoader();
    content_ldr.addEventListener(Event.COMPLETE, onComplete1);
    content_ldr1.load(content_req1);

  • How can i add a new function to the Basic IVI class vi's?

    I need to use the IVI vi's to control some instruments, let's say a DC Power Supply.
    Since there's a DC Power supplyclass, i can used those VI's but waht if one of the VI's does not contains all the functions that i need?. How can i add more functions to the IVI classes?. What do i need to do to add a new function to the iviFGen class?

    If you would like to try developing your own instrument driver (or modify the existing one), we have documentation, model instrument drivers, and driver templates to help at :
    http://www.ni.com/devzone/idnet/development.htm
    We also have a syndicate of third party vendors that specialize in National Instruments' products and services. Some of the vendors specialize in driver development. I would suggest contacting one of the Alliance members at:
    http://www.ni.com/alliance

  • How can i add waveform datasaving functions to 2 channels oscillosco​pe demo

    How can I add waveform datasaving options to my .vi for example Oscar Gomez Fuentes 2channel oscilloscope demo, So that i can later on read the data and print graph.
    Mikko

    Look at the example Export Waveforms to Spreadsheet File Example.vi that ships with LabView 6 or 7. For your purposes, look at the first two file operations, Write Waveforms to File.vi and Read Waveform from File.vi. You can wire the output of Read Waveform from File.vi directly to a waveform graph. For your application, you don't actually need to call Export Waveforms to Spreadsheet File.vi (unless you're planning on using Excel to manipulate the data).

  • How to Retrieve a Mouse-Dragged Blocked Text from a TextComponent

    I have some text in a text component and I use the mouse to drag over some text thereby selecting the text or I use Shift + Arrow Key to block some text, How do I get the blocked text from Swing API?
    Any tips will be appreciated

    -> Well maybe I got the answers to the question before the forum answer came.
    Well, then maybe you should reply to the posting stating that so people don't waste time attempting to answer the question.
    Or maybe you should post the answer so that people who use the forum correctly by searching first before asking the question can benefit from your experience.
    Either way any question you ask should be followed up with a response.

  • How do I add/modify "Callto" functionality?

    We have an application that we use for a phone system. Our call center has a link (button) that they click on to call a potential customer. We are now rolling out Lync to all of our workstations. What is happening is that Lync is supplanting the Callto function in our browsers. For IE, I have set a group policy that determines what application to use. However, I am having difficulty figuring out how to set it for Firefox. Adding to the confusion is that on some of the machines I have been testing, Callto isn't even defined in the Applications section of the Options. So my questions:
    1. How do I ensure that the Callto function is available in Firefox (Tools - Options - Applications)?
    2. How do I ensure that the Callto function is set to the proper application?
    3. How do I do this across the enterprise (2500+ systems)?
    Thanks for your time!

    Is it a protocol? In other words, instead of http: links, these are callto: links?
    Firefox has a mechanism for adding protocol handlers pushed by a web page, described in this article: https://developer.mozilla.org/en-US/docs/Web-based_protocol_handlers
    However, this may be stored in mimeTypes.rdf or another file that is difficult to augment externally using a script.
    Maybe you can integrate it into the software your users use so they are prompted to add it the first time they visit it?

  • When building a vacation leave holiday system using SharePoint Foundation 2010 and SharePoint Designer workflows how can I add half day functionality?

    Hi,
    I have built a vacation leave holiday system for SharePoint Foundation 2010 using SharePoint Designer workflows and Javascript. Everything works perfectly but I'm struggling to design a solution for users to specify half day requests that span over dates
    greater than 1 day, i.e. my half day solution works but only when the start and end date are the same. How would I change the user interface to allow users to choose which day they want the half day to be requested when the vacation leave holiday request is
    from, say,  6th - 10th Jan 2014?
    Thanks.

    Hi ,
    I have a test on my machine with a custom approval workflow and it can work normally .Here are the detailed steps :
    1.      
    Open the site in SharePoint Designer .Create a workflow to associate with the document library .Set the workflow to start when an item is created and when an item is changed
    .Also allow the workflow to start manually .
    2.      
    Choose ‘Collect Data from a user’ .
    3.      
    Click on the data and give a name to the Task created .
    4.      
    Define the custom form field name as ‘Approve ?’ .Set the information type as Choice .
    5.      
    Set the choices as ‘Approve’ and ’Reject’ .Display as Checkboxes .Uncheck the ‘Allow fill-in values’ and ‘Allow blank values’
    .Click finish to save .
    6.      
    Click on users and add the users who will approve the documents .
    7.      
    Keep the output to variable as collect .
    8.      
    Add a new step .Choose ‘If any value equals value ’ .Set the any value ‘Data source’ as  workflow variables and parameters .Set the ‘Field
    from source’ as Variable: collect .
    9.      
    Set the value behind ‘equals ’ as ‘Approve’ .
    10.  
    Add a new action ‘Update list item ’ .Set the item as current item .Add the field Approval status as Approved .
    11.  
    Add an Else-if branch to update the Approval status as Rejected .
    12.  
    Publish the workflow and test in your site .
    Thanks,
    Entan Ming

  • How can I add customer partner function entries in LSMW?

    I am using SAP ECC 6.0 with best practices installed. I am able to create sold-to customers using the batch input program RFBIDE00. 
    When I try to add partner function entries using structure BKNVP, it appears that the partner ID stored in KTONR is not populating SAPMF02D screen 324 after it is entered on screen 2324. I receive a “Data is incomplete; check” error.  I could not find an SAP note or other solution to correct this problem. 
    While searching for a solution, I found a few recommendations to use the IDOC message DEBMAS to create the partners function entries instead of batch input.  When I try to use this approach, I am receiving an error “Deletion is not allowed: SP is mandatory function”.  I was trying to add an SH (WE Ship-To) at the time. I found a reference that explained that all partners were replaced when this IDOC message is used.  It further explained that this should work if all partner references were included in the message.  This approach did not work either. I still receive this error if I omit or include an SP (AG Sold-To) record.
    Does anyone have a solution to either problem or another approach?

    Hi
       You can use LSMW :-
    1) Create a project , sub project and an object.
    2) execute it from 1 st screen to enter the object.
    3) You will find proces steps.
    4) In Maintain Object Attributes  choose Program Name RFBIDE00.
    or I-DOC or the way you want the input to be.
    5) You can proceed from there following the instruction..

  • How to get  the mouse drag event ?

    I Have a JTextField and I want to move a selected text in the JTextField from a location to another by pressing the mouse on selected text and dragging it to newer
    location in the same text field (Same as Microsoft word does).Will u help me out please .

    But i can't get it working for the same component i.e dragging a text from the JTextField and dropping it in the same text field
    will u please help me with the sample code for 1 JTextField.I will really be very thankful to u
    Please

  • How do I add an autoSize function to a Tooltip (AS 2)?

    Hi,
    I downloaded an Interactive Map from Active Den ... it came with an XML file that allows me to change some parts, but the part thatI need to change is not covered in the XML ... it needs to be changed in the Action Script.
    You can see the map here http://vnd-ink.com/Pat/main/index1.html
    Basically when a landmark is moused over ... a box pops up that contains hrml (images, text. links, etc)
    The XML file allows me to set the max width of the pop up box.
    The issue is that i need a box that is 225 px wide ... I also need another box that is 400 px wide
    The XML only allows me the set one width ... so I need another box (one for vertical layout, and one for horizontal layout)
    I thought I could duplicate the pop up box mc, and the box's Action Script (give them different names) and that would work, but I don't know exactly which parts to edit.
    I posted the XML file, and the Action Script beneath the map here http://vnd-ink.com/Pat/main/index1.html
    Also, there is a screen shot of all movie clips, but the only mc that has any actions attached to it is "zoom_pan" it's at the very bottom of the list.
    Been working on this a couple of days now, and getting nowhere.
    If anyone could help, that would be great.
    THANKS!

    first thing you need is a tooltip that's positioned correctly.  that will fix the displayed problem and may eliminate the need for a left, right, center tooltip.

  • How do you add a function to an existing Rules Dictionary via the SDK?

    The how to SDK describes creating a new dictionary and adding functions and other items. However, in reading the Java API docs, it is not apparent how one would add a new function to an existing dictionary.
    Once you have a reference to the RuleDictionary, there is a getDataModel method, but it returns a oracle.rules.sdk.datamodel.DataModel instead of the oracle.rules.sdk.editor.datamodel.DataModel. It appears that this DataMode class is different than the DataModel class in the editor sub-package. Further this DataModel class is not described in the API docs.
    There is an addFunction method, but I do not see how to create an instance of the Function class.
    Thanks,
    Bret

    Look at the oracle.rules.sdk.editor.datamodel.DataModel Constructor:
    Constructor Summary
    DataModel(RuleDictionary dict)
    Constructor used to edit a datamodel.
    So, the call would look something like:
    RuleDictionary dict = ...;
    oracle.rules.sdk.editor.datamodel.DataModel dm = new oracle.rules.sdk.editor.datamodel.DataModel(dict);

  • How to add user defined functions in Menu bar of a Selection Screen?

    Hi,
    Can anybody please suggest me that how can I add user defined functions in the menu bar of a Selection Screen?
    Regards
    s@k

    Dear Amit,
    I am referring to the standard SAP program: RIEQUI20.
    On the initial screen, there are 3 tabs.
    Code:
    SELECTION-SCREEN BEGIN OF TABBED BLOCK tab FOR 25 LINES.
    SELECTION-SCREEN TAB (20) tab1 USER-COMMAND ucomm1
                         DEFAULT SCREEN 001.
    SELECTION-SCREEN TAB (20) tab2 USER-COMMAND ucomm2
                         DEFAULT SCREEN 002.
    SELECTION-SCREEN TAB (20) tab3 USER-COMMAND ucomm2
                         DEFAULT SCREEN 003.
    SELECTION-SCREEN END OF BLOCK tab.
    AT SELECTION-SCREEN.
      CLEAR gv_okcode.
      gv_okcode = sy-ucomm.
      CLEAR sy-ucomm.
      CASE gv_okcode.
        WHEN 'IH08'.
          CALL TRANSACTION 'IH08'. "Equipment Selection
        WHEN 'IW29'.
          CALL TRANSACTION 'IW29'. "Notification Selection
        WHEN 'IW39'.
          CALL TRANSACTION 'IW39'. "Order List Selection
        WHEN OTHERS.
      ENDCASE.
    *   Check date:                                         
      IF NOT datuv IS INITIAL                            
      AND NOT datub IS INITIAL.                         
        IF datub >= datuv.                              
        ELSE.                                           
          MESSAGE e884(ih) WITH datuv datub.            
        ENDIF.                                           
      ENDIF.                                             
      IF variant IS INITIAL AND
         dy_vari IS INITIAL.
        PERFORM get_default_variant_f14 USING variant.
      ENDIF.
      PERFORM variant_existence_f14 USING variant.
      IF datuv IS INITIAL.
        datuv = sy-datum.
      ENDIF.
      IF datub IS INITIAL.
        datub = sy-datum.
      ENDIF.
      IF sy-ucomm = 'ADDR'.
        PERFORM adress_sel_f01 USING 'EQUIR'.
      ENDIF.
      PERFORM check_parnr_f76.
    *  AT SELECTION SCREEN OUTPUT
    AT SELECTION-SCREEN OUTPUT.
      STATICS: l_slset TYPE sy-slset.
    *--- Set initial variant
      PERFORM variant_init_f14 USING 'INST' 'INST' 'INST' 'RIEQUI20'.
      IF variant IS INITIAL AND
         dy_vari IS INITIAL AND
        gv_variant_flag IS INITIAL.
        PERFORM get_default_variant_f14 USING variant.
        gv_variant_flag = 'X'.
      ENDIF.
    *--- Set Icon for adress-button
      PERFORM set_icon_f01 USING dy_adrfl ad_icon text-ad0 text-ad1.
    *--- get classification data from select option
    *--- (if new variant or if called via submit or F3)
      IF ( l_slset NE sy-slset ) OR
         ( s_comw[] IS NOT INITIAL AND gt_clsd_comw[] IS INITIAL ).
        l_slset = sy-slset.
        gv_class_old = dy_class.
        gv_klart_old = dy_klart.
        PERFORM copy_selopt_comw_f79 TABLES gt_clsd_comw s_comw.
        PERFORM class_search_init_f77 USING 'EQUI'.
      ENDIF.
    *--- set Icon for classification
      LOOP AT gt_clsd_comw TRANSPORTING NO FIELDS          
                          WHERE atcod > '0'.               
        EXIT.                                              
      ENDLOOP.                                             
      IF sy-subrc IS INITIAL.
        gv_comw_flag = 'X'.
      ELSE.
        CLEAR gv_comw_flag.
      ENDIF.
      PERFORM set_icon_f01 USING gv_comw_flag cl_icon text-cl0 text-cl1.
      CALL METHOD cl_uid_cust=>selection_screen_output.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR variant.
      PERFORM variant_inputhelp_f14 USING variant 'RIEQUI20'.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR dy_parnr.
      PERFORM f4_for_parnr_f76.
    AT SELECTION-SCREEN ON BLOCK clse.
      IF dy_class NE gv_class_old
        OR dy_klart NE gv_klart_old.
        gv_class_old = dy_class.
        gv_klart_old = dy_klart.
        CLEAR gv_comw_flag.
        REFRESH gt_clsd_comw.
        REFRESH s_comw.
      ENDIF.
      PERFORM class_exist_f77 USING dy_klart dy_class 'DY_CLASS'.
      IF sy-ucomm = 'COMW'.
        CALL FUNCTION 'IHCLSD_VALUATION_POPUP'
          EXPORTING
            i_klart               = dy_klart
            i_class               = dy_class
            i_language            = sy-langu
            i_key_date            = sy-datum
            i_also_subclasses     = dy_subcl
          TABLES
            ct_comw               = gt_clsd_comw
          EXCEPTIONS
            exc_no_class          = 1
            exc_klart_not_allowed = 2.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    *--- fill classification data in select option
        PERFORM copy_comw_selopt_f79 TABLES gt_clsd_comw s_comw.
      ENDIF.
      IF sy-ucomm = 'ONLI'.
        sscrfields-ucomm = sy-ucomm.
      ENDIF.
    Regards
    s@k
    Edited by: siemens.a.k on Jan 15, 2010 10:10 AM

  • I want to add one Continuous function in Producer consumer event??

    Hello,
    producer consumer event vi is base example for me ,I have design my system according to it.
    Now I am dealing with photo sensor in that its measure continuous data according to intensity of light,for continuous function I have make while structure for photo sensor but the problem is that I don't know how to add this while loop in producer consumer event ,if I add then its run continuously and then my operation is stuck there.
    Will you please guide me that how can I add this continuous function in this structure so simultaneously I can do other function like pause reset..Etc...
    Here in attachment I have attaché one example regarding to this in that I have add simply increment function in case structure and when I execute my vi then execution is stuck at while loop until it manually stop.
    Thank you very much...
    Attachments:
    ProducerConsumerEvents 1.vi ‏15 KB

    Hi AnkitRamani,
    I made a simple example with a UI queue and a second producer which is pushing data into its own consumer, displaying the signal and its spectrum.
    Maybe this is what u need.
    Marco Brauner NIG
    Attachments:
    ProducerConsumerEventsData.vi ‏70 KB

  • How do you add multiple cells to the LARGE function?

    I want to add several cells which are contained on different sheets and tables to the same LARGE function and select the first ranking cell value.
    How do I add these cells as a single argument for this function?

    "...and select the first ranking cell value."
    Hi eobet,
    If your actual goal is as stated, you could use MAX, which will accept a list, a range, or a list of ranges as arguments.
    LARGE accepts only a single argument to establish the set of values, plus a single argument to establish the rank of the desired value. That means you need to collect all of the vlues into a sngle contiguous group/range, then specify that range as the set. The avantage, ofcourse, is that with LARGE, you can specify that you want the 'third largest' value in the set.
    Here's an example.
    The data set is column B on tables Data 1 and Data 2.
    The set is collected into a single contiguous range on the table Aux (which may be hidden, or placed on a separate sheet).
    LARGE collects the nth value from the collected set in Aux, using this formula in the table Summary:
    A2, and filled down: =LARGE(Aux :: A:B,ROW()-1)
    MAX returns the largest value from the original data set on Data 1 and Data 2, using this formula on the table Summary-1:
    A2: =MAX(Data 1 :: B,Data 2 :: B)
    Regards,
    Barry

Maybe you are looking for

  • Generate a report with date range and year as POV with Hyp Planning ?

    Hi everybody, I am starting with hyp planning and i need your help please. I have to create some forms. In those forms, the final user is supposed to be able to display data in the forms between 2 dates and for a specific year. My first problem : I d

  • Functinality to compare two material price with reference to BOM in CO

    Hi All, Is there is any functionality in Controlling which can compare the costing for two FERT materials. or is there is  any functionality where we can compare two material price with reference to BOM in controlling Please help me to compare the ma

  • Homogeneous system copy for 4.7.x.1.1 windows/oracle 9.2.0.3.0

    I plan Homogeneous system copy for 4.7.x.1.1 windows/oracle at a customer downloaded tools(do I have to put extracted files on the sorce machine in kernel directory?): MIGMON_2-20001410 MIGMON_2-20001410.SAR MIGTIME_2-20001410 MIGTIME_2-20001410.SAR

  • Oracle Application Server 10g R2 + quad core

    sorry, but i don't speak english so much, my question is the next Oracle Application Server 10g R2 works in quad core processors?? do you know some testimonials about this? some links? thanks I hope you can understend me. and can help me,

  • Error Installing DVDSP 3 Upgrade

    New to discussions. First post. Recently acquired DVD Studio Pro v1 + v3 upgrade intending to install under OS X 10.3.9 on mirrored RAID drives. Tried to install v3 upgrade without first installing v1, hoping it would merely prompt for valid license.