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

Removing minimize/maximize buttons for outer shell

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

    Removing minimize/maximize buttons for outer shell

    I usually remove the minimize/maximize buttons for a form so I can control the user's exit from the form, but I can't find the way to do this at the highest level, where I want to retain the toolbars but eliminate the minimize, maximize, and exit buttons for controlling the exit from Alpha. Sure, I can create an OnExit event to disable exiting in general and enable it via an exit button, but I would like to make those three controls disappear.

    I've looked around for the same settings you would use in a form's properties under window/window style but no luck. Is there such a place for the "outer shell"?

    Thank you.

    Jeff

    #2
    Re: Removing minimize/maximize buttons for outer shell

    Originally posted by Jeff Fried View Post
    I usually remove the minimize/maximize buttons for a form so I can control the user's exit from the form, but I can't find the way to do this at the highest level, where I want to retain the toolbars but eliminate the minimize, maximize, and exit buttons for controlling the exit from Alpha. Sure, I can create an OnExit event to disable exiting in general and enable it via an exit button, but I would like to make those three controls disappear.

    I've looked around for the same settings you would use in a form's properties under window/window style but no luck. Is there such a place for the "outer shell"?

    Thank you.

    Jeff
    As an alternative if I can't remove the upper right red x close control, have you ever used the CanDatabaseClose command? It behaves like the Autoexec, and if you put a simple cancel() in it, Alpha will be prevented from closing.

    Does anyone know how to override it from an exit button I have on the Main Menu so the only route to close Alpha is from that button. It would be something like:

    can_database_exit(.t.)
    a5.close()

    but can_database_exit does not take this syntax.

    I'm sure there is a simple answer, but I sure can't find it.

    Thank you.

    Jeff

    Comment


      #3
      Re: Removing minimize/maximize buttons for outer shell

      This first UDF is called in the autoexec and keeps the X from closing the app
      The second script is on a button on the Main Menu or a Main Menu tool bar.
      '****************************************************
      Code:
      FUNCTION x_exit_lock AS C ( )
      	
      ' Lock the Windows "X" button from closing the form
             DIM code as C
              code = <<%code%
              CANCEL()
              	DIM vForm as C
      			vForm = a_form_current
              	evaluate_template(":"+vcFNow+".close(.f.)")
       			:Form.view("menumain")
      		%code%
              can_database_exit(code)
              
      END FUNCTION
      '****************************************************
      Code:
      dim vexit as C
      vexit=ui_dlg_box("Exit",<<%dlg%
      {background=pale blue}{xmargin=2,2}
      {lf};
      <25EXIT APPLICATION!exit> <25CANCEL>
      {lf};
      %dlg%)
      
      if vexit = "exit" then
      	system_event_drop("database_canexit","1")
         	:a5.close()
      else
      	ui_msg_box("","Exit Cancelled")
      end if
      Mike W
      __________________________
      "I rebel in at least small things to express to the world that I have not completely surrendered"

      Comment


        #4
        Re: Removing minimize/maximize buttons for outer shell

        Originally posted by Mike Wilson View Post
        This first UDF is called in the autoexec and keeps the X from closing the app
        The second script is on a button on the Main Menu or a Main Menu tool bar.
        '****************************************************
        Code:
        FUNCTION x_exit_lock AS C ( )
        	
        ' Lock the Windows "X" button from closing the form
               DIM code as C
                code = <<%code%
                CANCEL()
                	DIM vForm as C
        			vForm = a_form_current
                	evaluate_template(":"+vcFNow+".close(.f.)")
         			:Form.view("menumain")
        		%code%
                can_database_exit(code)
                
        END FUNCTION
        '****************************************************
        Code:
        dim vexit as C
        vexit=ui_dlg_box("Exit",<<%dlg%
        {background=pale blue}{xmargin=2,2}
        {lf};
        <25EXIT APPLICATION!exit> <25CANCEL>
        {lf};
        %dlg%)
        
        if vexit = "exit" then
        	system_event_drop("database_canexit","1")
           	:a5.close()
        else
        	ui_msg_box("","Exit Cancelled")
        end if
        Hi Mike,

        Thanks for this. Haven't tried it yet but will let you know my findings.

        Jeff

        Comment


          #5
          Re: Removing minimize/maximize buttons for outer shell

          Originally posted by Jeff Fried View Post
          Hi Mike,

          Thanks for this. Haven't tried it yet but will let you know my findings.

          Jeff
          Hi Mike,

          Unfortunately it's not clear how I should make this work in the autoexec. I guess I can't just paste it in to inline xbasic and change the name to my main menu file. What would I do to make this function work? Do I feed it a parameter?

          Thanks.

          Jeff

          Comment


            #6
            Re: Removing minimize/maximize buttons for outer shell

            Originally posted by Jeff Fried View Post
            Hi Mike,

            Unfortunately it's not clear how I should make this work in the autoexec. I guess I can't just paste it in to inline xbasic and change the name to my main menu file. What would I do to make this function work? Do I feed it a parameter?

            Thanks.

            Jeff
            I meant to say main menu form, not file. I named the main menu form "MainMenu", so I substituted your "menumain" for my "mainmenu", but something else is stopping this from working - probably something with which I have no experience.

            Thanks.

            Jeff

            Comment


              #7
              Re: Removing minimize/maximize buttons for outer shell

              do you mean
              -NOMINMAX and -NOSYSMENU in your start command line?
              Dave Mason
              [email protected]
              Skype is dave.mason46

              Comment


                #8
                Re: Removing minimize/maximize buttons for outer shell

                Originally posted by DaveM View Post
                do you mean
                -NOMINMAX and -NOSYSMENU in your start command line?
                Here's all I'm trying to do. I want to prevent a user from being able to exit out of the application without going through an exit button I have on the main menu of the application. There are various ways one can exit. For example, if you press F8 on a form and go into the browse, then rather than press F8 to go back to the form you click on the X, you're out. At the same time, I want to make the browse -- this or any other -- stretchable and certain disabling of those min/max/close buttons take that away.

                Some approach that loads with the autoexec that disables any exit, but undoes that within my main menu exit button would be perfect. I tried what I was given earlier in this thread but it did not work out of the gate. I must be missing something, or there's something not quite right with the syntax.

                And by the way, the min or max of a form is not an issue -- it's only the ability for users to suddenly find themselves in Alpha without an application, or out of Alpha without my orderly exit from the main menu, where I capture such things as the exit time in a log, where the autoexec captured an entry time in that log.

                Thanks.

                Jeff
                Please help if you have an answer.

                Comment


                  #9
                  Re: Removing minimize/maximize buttons for outer shell

                  Jeff,
                  I'm sorry, it has been so long since I have visited this. I have a base template app that has all the app login, navigation and base constant functionality already built so I begin an app with that all in place and haven't revisited it in a while. I guess I need to, huh....

                  Start again:
                  I have 3 scripts that control this with the autoexec. At the beginning of the autoexec, I dim the global navigation variables:
                  Code:
                         ' dim the global navigation variables
                           dim global vproceed as C
                           dim global vcFNow as C
                           dim global vcFfrom as C
                           dim global vcFname as C
                  1. x_exit_lock() - This is called from the autoexec near the end.
                  Code:
                  FUNCTION x_exit_lock AS C ( )
                   	' Lock the Windows "X" button from closing the application instead returns to the Main App Menu
                         DIM code as C
                          code = <<%code%
                          CANCEL()
                          evaluate_template(":"+vcFNow+".close(.f.)")
                   	:Form.view("menumain")
                  	%code%
                          can_database_exit(code)
                  END FUNCTION
                  2. Form_nav() - form_nav() is called from the OnInit of every form
                  Code:
                  FUNCTION form_nav AS C ( )
                     vcFfrom = vcFNow
                     vcFNow = a_form_current
                     vcFname = a_form_current
                  END FUNCTION
                  3. App_exit - a script played within the Main Menu toolbar EXIT button
                  Code:
                  dim vexit as C
                  vexit=ui_dlg_box("Exit",<<%dlg%
                  {background=pale blue}{xmargin=2,2}
                  {lf};
                  <25EXIT APPLICATION!exit> <25CANCEL>
                  {lf};
                  %dlg%)
                  
                  if vexit = "exit" then
                  	system_event_drop("database_canexit","1")
                     	:a5.close()
                  else
                  	ui_msg_box("","Exit Cancelled")
                  end if
                  Finally, the last lines of the autoexec opens the main menu which then runs the form_nav() and sets the navigation global variables to the menumain form...
                  Code:
                  'Open Main App Menu
                  	:form.view("menumain")
                  Last edited by Mike Wilson; 04-17-2013, 02:20 PM.
                  Mike W
                  __________________________
                  "I rebel in at least small things to express to the world that I have not completely surrendered"

                  Comment


                    #10
                    Re: Removing minimize/maximize buttons for outer shell

                    Mike,

                    It looks very interesting. I will set it up and try it soon. Thanks for your follow-up.

                    As an aside, have you ever looked at the CanDatabaseClose? When you place a cancel() in it, it prevents all closing and seems to be the answer. However, I haven't figured out how to override it for use in an exit button on the main menu. Do you have any idea how you would override it and accomplish the close?

                    Jeff

                    Comment


                      #11
                      Re: Removing minimize/maximize buttons for outer shell

                      Mike,

                      I see what this is doing, and it looks like a winning solution. However, the code I placed in the exit button of the Main Menu came up with the following:

                      ScriptOnPush line:64
                      system_event_drop("database_canexit","1")
                      unable to get the address of the event pointer for event 'database_canexit' for name '1' in 'system_event_destroy'

                      I haven't tried to play with this to solve it since maybe you will see right away what the problem is. Thanks.

                      Jeff

                      Comment


                        #12
                        Re: Removing minimize/maximize buttons for outer shell

                        The error message doesn't come up anymore after I determined that in the autoexec I already had a line opening the main menu before yours ran. I eliminated that, so now the error message doesn't appear, but the exit button also does not exit. So again, maybe you see what the problem is.

                        Jeff

                        Comment


                          #13
                          Re: Removing minimize/maximize buttons for outer shell

                          Have you looked at the workspace properties startup tab from the a5 menu? ~ Select "Maximize the form" & you'll see additional option to turn off min/max/restore. (Gives the appearance of SDI program)
                          Robert T. ~ "I enjoy manipulating data... just not my data."
                          It's all about the "framework." (I suppose an "a5-induced" hard drive crash is now in order?)
                          RELOADED: My current posting activity here merely represents a "Momentary Lapse Of Reason."

                          Comment


                            #14
                            Re: Removing minimize/maximize buttons for outer shell

                            Originally posted by SNusa View Post
                            Have you looked at the workspace properties startup tab from the a5 menu? ~ Select "Maximize the form" & you'll see additional option to turn off min/max/restore. (Gives the appearance of SDI program)
                            This sounds like exactly what I want. In the startup tab there is a "Maximize Alpha Five", if this is what you mean. I check it but how do I get the additional option. Nothing happens when I check it and press OK.

                            Comment


                              #15
                              Re: Removing minimize/maximize buttons for outer shell

                              Never mind my last comment. I see that you first need to check opening a startup form. I open it in the autoexec, but regardless, when I do check the main menu as the startup form and maximize the form, then check turn off min/max/restore, it does not eliminate the min/max/restore of the top level form. I already turn off the min/max/restore of the individual forms, but I need a way to turn it off on the very top line.

                              Comment

                              Working...
                              X