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

<TEXT>.delete()

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

    <TEXT>.delete()

    Try to understand more Xdialogdetails

    Can some one tell me this exemple is complete?
    It looks like missing a lot of lines after line 4
    and the line here presented as line 5 must be something like line 30 or 50
    Anyway the Interactive window does not act.


    Who can help with other documentation than AlphaFiveHelpV9 and/or can explain this function??

    Thanks

    Ton


    <TEXT>.DELETE()
    Syntax
    VariableName.OBJECT.DELETE()
    Description
    The OBJECT.DELETE() method is used with an Xdialog text control. It cuts the currently selected text from the contents of the VariableName text variable.

    Supported By

    Alpha Five Version 6 and Above

    Limitations

    Desktop applications only.

    Examples

    dim ptext as P
    dim ptext.text as C
    dim ptext.object as P
    dim ip as N
    if (a_dlg_button = "delete") then
    a_dlg_button = ""
    ip = ptext.object.get_cursor()
    ptext.object.delete()
    'after clicking the 'cut' button focus is on the button. we want to return focus to the edit control
    ui_dlg_ctl_goto(dlg_title,"ptext")
    if (ip <=len(ptext.text)) then
    ptext.object.set_cursor(ip)
    else
    ptext.object.set_cursor(len(ptext.text))
    end if
    a_dlg_button = ""
    'this causes the text box to scroll if the insertion point is not currently visible
    ptext.object.show_caret()
    end if
    Most things are simple but unfortunately only after the first time

    #2
    Re: &lt;TEXT&gt;.delete()

    I believe the example shown is suitable to include in the code section of your own xdialog.

    ,<<%code%

    'example goes here

    %code%)
    There can be only one.

    Comment


      #3
      Re: &lt;TEXT&gt;.delete()

      Well, anyway to me it does not clear. It only makes it unaccessable.

      Meanwhile I've seen that all the Xdialog Text Control Methods have that unusable examples, and I cannot find it on other places in the V9-documentation.

      Someone has better documentation of these methods in previous versions?

      Ton
      Most things are simple but unfortunately only after the first time

      Comment


        #4
        Re: &lt;TEXT&gt;.delete()

        Ton, I share your confusion. The following example does nothing when the "cut" button is pressed after I select part of the text string with my mouse.

        Code:
        'Create an XDialog dialog box to prompt for parameters.
        DIM SHARED vMyText as p
        DIM SHARED vMyText.text as C = "Tom Cone Jr"
        Dim SHARED vMyText.object as P
        DIM ip as N
        
        DIM SHARED varC_result as C
        ok_button_label = "Cut"
        cancel_button_label = "&Cancel"
        varC_result = ui_dlg_box("Example",<<%dlg%
        {region}
        | [.40vMyText];
        {endregion};
        {line=1,0};
        {region}
        <*15=ok_button_label!Cut> <15=cancel_button_label!CANCEL>
        {endregion};
        %dlg%,<<%Code%
        'msgbox("",a_dlg_button)
        if (a_dlg_button = "Cut") then
        	a_dlg_button = ""
        	ip = vMyText.object.get_cursor()
        	vMyText.object.delete()
        	msgbox("",vMyText.text)
        	'after clicking the 'cut' button focus is on the button. we want to return focus to the edit control
        	ui_dlg_ctl_goto("Example","vMyText")
        	if (ip <=len(vMyText.text)) then
        		vMyText.object.set_cursor(ip)
        	else
        		vMyText.object.set_cursor(len(vMyText.text))
        		a_dlg_button = ""
        	end if
        end if	
        
        if a_dlg_button = "CANCEL" then
            'close dialog 
        end if
        
        %CODE%)

        Comment


          #5
          Re: &lt;TEXT&gt;.delete()

          Hi Tom,

          Thank you for making a completed XDialog.
          Have you ever used these text methods in XDialog?

          With your example I 've seen that the cursorposition can be retrieved and when the text gets focus again, you can set the cursor (again) to that position.

          I feel that these text methods can be usefull for me but I don't know yet for sure.
          Therefore these text controle methods trigger me but the lack of (up to date) documentation...... is another thread .......but prevent me to get it clear as results are indeed confusing and that is unfortunately disappointing.

          I have not seen another place where this was attended, have you?
          Most things are simple but unfortunately only after the first time

          Comment


            #6
            Re: &lt;TEXT&gt;.delete()

            Ton, I've only recently needed to position the cursor in a situation where my code was returning focus to a text control. When focus arrived at the text control the entire text was "selected". Moving the insertion pointer to the end of the text string (with the script) was a better choice than asking the user to lift hands from keyboard to grab mouse and reposition the insertion pointer manually.

            Comment


              #7
              Re: &lt;TEXT&gt;.delete()

              For an interested case I investigated the script 'pointer_arry2' in the Learning XDialog database.

              I have noticed that when a user wants to change the rownumber and first of all uses the backspace to clean the current rownumber there is an error at the moment that this rownumber reaches <1.
              That error does not recover at the moment the rownumber gets a value >0.
              That means that we have to prevent also the use navigating before the end.
              It would we nice if Alpha Software had presented a solution but they do not know about this failure.

              Now we also have to prevent the user to use the backspace of delete key (untill the value is only one digit) by transforming these (next) hits in selecting the current value. This indicates that the user can overwrite the value.
              (or make another work around which achieves the same).

              This must be a basic step and knowledge about text controle methods can be very usefull.
              Tying to accomplish that I struggled with the documentation about the functionality of the text controle methods. Maybe also because I have to translate it for myself into dutch before I can understand it.
              So I don't get this solved.


              Original details:
              look at the lines starting at linenumber 54

              Code:
              if a_dlg_button = "i_changed " then 
              	
              	'prevent the user from navigating past the end
              	a_dlg_button = ""
              		if  i > rec.first_empty("lastname") - 1	then 
              			i = rec.first_empty("lastname") - 1
              			
              		end if
              end if
              ------------------------------------------------------------
              Code:
              if a_dlg_button = "i_changed " then 
              	a_dlg_button = ""
              	
              		'prevent the user from navigating past the end
              			if  i > rec.first_empty("lastname") - 1	then 
              			i = rec.first_empty("lastname") - 1
              		else if i<1
              			i=1
              		        'prevent the user from navigating before the begin.
              		        pseudocode: do not accept backspace or delet-key 
                                      but select (and give focus to) the current value
              		end if
              end if

              Any help is welcome

              Ton
              Last edited by Ton Spies; 07-29-2009, 08:28 AM.
              Most things are simple but unfortunately only after the first time

              Comment

              Working...
              X