Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Mapping "CTRL-D" to A Button

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Mapping "CTRL-D" to A Button

    Hello,

    I just discovered that a "CTL-Delete" with rows highlighted on an embedded browse will select multiple items. Instead of doing a control delete, can I map a button to perform the same function? Ryland

    #2
    Re: Mapping "CTRL-D" to A Button

    You chave a choice between SYS_SEND_KEYS() and the Action Scripting element "Send Keys".
    There can be only one.

    Comment


      #3
      Re: Mapping "CTRL-D" to A Button

      Thanks Stan,

      I looked that function over and it appears to map to other key functions with the send keys. Ordinarily that would be fine. What I would like to do is to have a "delete button" instead of a "CTL Delete" to delete rows of selected info in an embedded browse. My users are pretty simple, so I'm trying to keep user the application options on the screen. Ryland

      Comment


        #4
        Re: Mapping "CTRL-D" to A Button

        Hi Stan,

        Originally posted by Stan Mathews View Post
        You chave a choice between SYS_SEND_KEYS() and the Action Scripting element "Send Keys".
        Sorry, but I have to disagree here with you. SYS_SEND_KEYS() sends keys into the keyboard buffer, and should always be the last resort, as it depends upon context of the current Windows (and that could be outside of A5's window too) to what it feeds keys to.

        But the question is can a button do the delete? I'm not positive about the multiple select, but should be doable.

        If a person want's to trap a hot key, use an ON_KEY (or ONKEY - depends if a form/browse or a dialog box) event handler to process the keys.
        Regards,

        Ira J. Perlow
        Computer Systems Design


        CSDA A5 Products
        New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
        CSDA Barcode Functions

        CSDA Code Utility
        CSDA Screen Capture


        Comment


          #5
          Re: Mapping "CTRL-D" to A Button

          You might want to restate your intent because I'm confused, not unusual.

          You want a button to delete a row or rows in an embedded browse but you don't want to use control-D?
          There can be only one.

          Comment


            #6
            Re: Mapping "CTRL-D" to A Button

            If you have the record numbers corresponding to the rows the user has selected you could delete them, right? So here's a way to get the record numbers of the selected rows.

            Code:
            'This script tested on copy of Invoice form
            'in AlphaSports.  It runs on a button push.
            'It returns a crlf delimited list of records
            'selected by the user in the Browse object on the form.
            
            'Has not been tested for the case where no rows
            'have been selected.
            
            'User row selections are made with down arrow while
            'holding down the Shift key.  Haven't found a way to 
            'select rows with the mouse or Ctrl key.  
            
            'get pointer to browse1 control on form
            dim br_ptr as P
            br_ptr = parentform.child("browse1")
            
            'get record numbers of records selected in browse
            trace.writeln(trim(br_ptr.selected_records()))

            Comment


              #7
              Re: Mapping "CTRL-D" to A Button

              Sorry if I confused all. A button the would serve to delete 1 or multiple selected row instead of the "ctrl-delete" is what my client wants to do.

              Comment


                #8
                Re: Mapping "CTRL-D" to A Button

                Building on the code Tom Cone has posted, this code will select the record numbers of the rows to be deleted, then using that list, opens the invoice items table in Alpha Sports and deletes those records that were highlighted.

                There is no warning message that you are about to delete records, but that could be put in the code.

                You first question about putting CTRL-D in a button will work for single records but will not work for multiple selections - if you do try it on multiple selections, it will only delete the last record highligted.

                Code:
                'This code builds upon what Tom C posted 
                'using the invoice form from Alpha Sports
                'it creates a list of the record numbers to be deleted
                'then opens the table on which the child browse is based and deletes the records
                'the same way using CTRL-D.
                
                'Note  - there is no warning message telling you the records are being deleted
                'it just deletes them - you could put your own code in for that
                
                'get pointer to browse1 control on form
                dim br_ptr as P
                br_ptr = parentform.child("browse1")
                
                'get record numbers of records selected in browse
                
                lst=trim(br_ptr.selected_records())
                
                msgbox("",lst)  'this just shows the record numbers from the selected_records() function
                                     'it can be eliminated or you can put a warning that records are being deleted here
                dim tbl as p
                
                tbl=table.get("invoice_items") ' open the invoice items table in alpha sports on which the browse is based
                
                'This code goes through the list and then delete each record from the invoice items table
                for each foo in lst
                	tbl.fetch_goto(val(foo)) 
                	tbl.change_begin()
                	tbl.delete()
                	tbl.change_end()
                next
                Tom Baker


                To: Tom Cone

                Thanks for posting that small snipet of code - never thought of doing it that way.

                Tom B
                Last edited by Tbaker; January 22, 2009, 10:38 PM.

                Comment


                  #9
                  Re: Mapping "CTRL-D" to A Button

                  I must be missing something here!
                  You could use Ctrl-D to delete multiple records.
                  And..
                  You can use Right-Click to do the same thing.
                  So, why are we re-inventing the wheel?

                  Incidentally, to highlight multiple records in a browse:
                  Drag the mouse down row selector.


                  Video legend:
                  Red circle: left-clk
                  Blue circle: Right-clk

                  Comment


                    #10
                    Re: Mapping "CTRL-D" to A Button

                    Incidentally, to highlight multiple records in a browse:
                    Drag the mouse down row selector.
                    Agreed. Understood. No argument. Have been talking about something else. This will select multiple consecutive rows. Why can't we select every other row? That's the question.

                    Comment


                      #11
                      Re: Mapping "CTRL-D" to A Button

                      Tom:
                      Code:
                      'User row selections are made with down arrow while
                      'holding down the Shift key.  Haven't found a way to 
                      'select rows with the mouse or Ctrl key.
                      How do you select multiple non-consequetive rows with the down arrow while
                      holding down the Shift key?

                      Comment


                        #12
                        Re: Mapping "CTRL-D" to A Button

                        Originally posted by Tom Cone Jr View Post
                        Agreed. Understood. No argument. Have been talking about something else. This will select multiple consecutive rows. Why can't we select every other row? That's the question.
                        Tom,
                        sounds like your jumping to/refering to your other post:

                        https://forum.alphasoftware.com/showthread.php?t=77636
                        Mike W
                        __________________________
                        "I rebel in at least small things to express to the world that I have not completely surrendered"

                        Comment


                          #13
                          Re: Mapping "CTRL-D" to A Button

                          Yes, perhaps I'm getting them confused. Thanks for the info on how to use the mouse to select consecutive rows in a browse. The issue that prompted my wishlist submittal in the other forum was different. Sorry for the confusion.

                          Comment

                          Working...
                          X