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

Add an Exit button to a logon Dialog

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

    Add an Exit button to a logon Dialog

    I know this is probably a very easy answer although I have not worked with dialogs very much at this point and could use some assistance. I would like to add an Exit button directly to the left of the "Log On" button and check for which button was pressed.

    Code:
        ok_button_label = "Log On"
        vLogonDialog = ui_dlg_box(" Logon",<<%dlg%
        {toolcaption}
        {font=Arial,9}
        {frame=1,1: Enter your Username and Password }
        {region}
        {lf};
        Username:| [.40gvUserName];
        Password:| [%p%.40vUserPassword];
        {lf};
        {endregion};
        {lf};
        {region}
        {justify=right}
        <*15=ok_button_label>
        {endregion};
        %dlg%)
    To add the button, I tried the code below although there is "extra" space between the two buttons

    Code:
        exit_button_label = "Exit"
        ok_button_label = "Log On"
        vLogonDialog = ui_dlg_box(" iTrackAll",<<%dlg%
        {toolcaption}
        {font=Arial,9}
        {frame=1,1: Enter your Username and Password }
        {region}
        {lf};
        Username:| [.40gvUserName];
        Password:| [%p%.40vUserPassword];
        {lf};
        {endregion};
        {lf};
        {region}
        {justify=right}
        <*15=ok_button_label>    
        <*15=ok_button_label>
        {endregion};
        %dlg%)

    #2
    Re: Add an Exit button to a logon Dialog

    1-You have 2 "OK" buttons
    2-What do you want the "Exit" Button to do? Exit of course. But, that's what any button will do unless you add a code to your xdlg
    3-Are you trying to get rid of the space?

    Comment


      #3
      Re: Add an Exit button to a logon Dialog

      1. Sorry about that, that was not the actual code I tried, I had typed it in and just forgot to chane the second button. It would be something like this....

      Code:
          exit_button_label = "Exit"
          ok_button_label = "Log On"
          vLogonDialog = ui_dlg_box(" iTrackAll",<<%dlg%
          {toolcaption}
          {font=Arial,9}
          {frame=1,1: Enter your Username and Password }
          {region}
          {lf};
          Username:| [.40gvUserName];
          Password:| [%p%.40vUserPassword];
          {lf};
          {endregion};
          {lf};
          {region}
          {justify=right}
          <*15=exit_button_label>    
          <*15=ok_button_label>
          {endregion};
          %dlg%)
      2. I would like the Exit button to Exit the application.
      3. I would like the spacing on the buttons to be the normal spacing if one button is placed next to the other, just as a standard dialog would be if you had an "OK" and "Cancel" button.

      Comment


        #4
        Re: Add an Exit button to a logon Dialog

        You can control the spacing like

        <*15=exit_button_label>{sp=5}<*15=ok_button_label>

        You want the exit button to quit Alpha?
        There can be only one.

        Comment


          #5
          Re: Add an Exit button to a logon Dialog

          Yes, Exit Alpha

          Comment


            #6
            Re: Add an Exit button to a logon Dialog

            Code:
            exit_button_label = "Exit"
            ok_button_label = "Log On"
            vLogonDialog = ui_dlg_box(" iTrackAll",<<%dlg%
            {toolcaption}
            {font=Arial,9}
            {frame=1,1: Enter your Username and Password }
            {region}
            {lf};
            Username:| [.40gvUserName];
            Password:| [%p%.40vUserPassword];
            {lf};
            {endregion};
            {lf};
            {region}
            {justify=right}
            <*15=exit_button_label>{sp=5}<*15=ok_button_label>
            {endregion};
            %dlg%,<<%code%
            if (a_dlg_button = "Exit") then
                a5.close()
            end if
            if (a_dlg_button = "Log On") then
                'logon routine here
                '... end the dialog
            end if
            %code%)
            There can be only one.

            Comment


              #7
              Re: Add an Exit button to a logon Dialog

              Thanks Stan and Gabe, I am running off to a meeting and will try it this afternoon.

              Comment


                #8
                Re: Add an Exit button to a logon Dialog

                Scott,

                For what its worth, this is my code for our login dialog. It runs in the on_init event of the main menu form. I have an "OK", "Clear" (in case they typed wrong), and an "Exit". There is much more code, but this should get you started. (aa.bcbss is addin variable space I use for many variables I need in the app)

                Code:
                userid = ""
                passwd = ""
                
                f = file.open(aa.bcbss.path+"\bcbss\seal.jpg",FILE_RO_SHARED)
                UI_BITMAP_LOAD("BCBSS",F.READB(10000000))
                f.close()
                
                rslt = ui_dlg_box(aa.bcbss.agency+" - Security",<<%dlg%
                {background=#255+253+159}
                {frame=1,1}
                {region1}
                {justify=center}
                {image=BCBSS};
                {lf};
                Welcome to the {text=38aa.bcbss.agency};
                {lf};
                Before proceeding, You Must Enter {font=arial,8,B}YOUR{font=arial,8,N} User-ID and Password
                {lf};
                {endregion1};
                {lf};
                {frame=1,1:Please Sign In:}
                {region2}
                {justify=left}
                {lf};
                {sp=10} Enter User-ID: |{initial_focus}[5.8userid!userid_killfocus] ;
                {lf};
                {sp=10} Enter Password: |[%p%6.8passwd] ;
                {lf};
                {endregion2};
                {lf};
                {color=Red on Pale Yellow} 
                {frame=1,1:Error Messages:}
                {region3}
                {color=Black on Pale Yellow} 
                {sp=5}{text=60,2errmsg}
                {endregion3};
                {frame=1,1}
                {region4}
                {justify=center}
                <10&OK ?.not.(userid="").and.errmsg=""> {sp=4} <&Clear> {sp=4} <10&Exit>
                {endregion4}
                %dlg%, <<%code%
                IF a_dlg_button = "&Exit"
                	:A5.close()
                END IF
                IF a_dlg_button = "&Clear"
                	a_dlg_button = ""
                	if upper(left(errmsg,3))="USE"
                		errmsg = ""
                		userid = ""
                		passwd = ""
                		ui_dlg_ctl_goto(aa.bcbss.agency+" - Security","userid")
                	end if
                	if upper(left(errmsg,3))="PAS"
                		errmsg = ""
                		passwd = ""
                		ui_dlg_ctl_goto(aa.bcbss.agency+" - Security","passwd")
                	end if
                end if
                if a_dlg_button = "userid_killfocus"
                	a_dlg_button = ""
                  	if ((left(userid,3)="SYS".or.left(userid,3)="ADM".or.left(userid,3)="SSS".or.left(userid,3)="CLE".or.left(userid,3)="CSP".or.left(userid,3)="LEG".or.left(userid,3)="FIN".or.left(userid,3)="REL").and.len(userid)<5).or.len(userid)<4
                  		'OK now
                  		a_dlg_button = "" 	
                   	  else
                   		a_dlg_button = ""
                		'get the secure2 user_id and password
                		TBL_SECURE = table.open("secure2.dbf",FILE_RW_SHARED)
                		TBL_SECURE.index_primary_put("User")
                
                		recno=TBL_SECURE.fetch_find(UT(userid))
                		if recno < 0
                			errmsg = "User_ID Entered is Invalid - Click \"Clear\""
                			trys = trys+1
                			IF trys <4 THEN
                				'OK now
                	  		  ELSE
                	  		  	a_dlg_button = "&Exit"
                				ui_msg_box(aa.bcbss.agency+" - Security Error","Too many tries, Application Closing")
                				:A5.Close()
                			END IF
                		end if
                 	 end if
                end if
                if a_dlg_button = "&OK"
                	if ut(passwd) <> tbl_secure.passwd
                		a_dlg_button = ""
                		if errmsg = ""
                			errmsg = "Password Entered is Invalid - Click \"Clear\""
                		  ELSE
                		  	errmsg = errmsg+crlf()+"Password Entered is Invalid - Click \"Clear\""
                		end if
                		trys = trys+1
                		IF trys <4 THEN
                			'OK now
                	  	  ELSE
                	  	  	a_dlg_button = "&Exit"
                			ui_msg_box(aa.bcbss.agency+" - Security Error","Too many tries, Application Closing")
                			:A5.Close()
                		END IF
                	ui_dlg_ctl_goto(aa.bcbss.agency+" - Security",passwd)
                	end if
                	'tbl_secure.close()
                end if
                %code%)
                
                'place this after a dialog box to see if the user clicked on the "X"
                'rslt is the name of the variable created by the dialog 
                'if it is created by the dialog genie, it is called varC_result
                if rslt =""
                	ui_msg_box(aa.bcbss.agency+" - Security","Action Cancelled at user request")
                	:A5.Close()
                end if
                Hope it helps.

                Tom
                Attached Files

                Comment


                  #9
                  Re: Add an Exit button to a logon Dialog

                  Thanks guys, Here is what I ended up with....
                  Code:
                      exit_button_label = "Exit"
                      ok_button_label = "Log On"
                      vLogonDialog = ui_dlg_box(" Title",<<%dlg%
                      {toolcaption}
                      {font=Arial,9}
                      {frame=1,1: Enter your Username and Password }
                      {region}
                      {lf};
                      Username:| [.40gvUserName];
                      Password:| [%p%.40vUserPassword];
                      {lf};
                      {endregion};
                      {lf};
                      {region}
                      {justify=right}
                      <15=exit_button_label>
                      <*15=ok_button_label>
                      {endregion};
                      %dlg%)
                  I did not end up needing the spacing tag and removed the "*" on the exit button so the "Log On" buttton had focus.

                  I would like to have the OnFlyover and OnFlyoverLeave colors match everything else within the app. How do I do that?
                  Attached Files

                  Comment

                  Working...
                  X