Changing the IDCANCEL button to a IDCLOSE button on a propertysheet, taking localization into account









up vote
0
down vote

favorite












This might sound like a dumb question. I know that CMFCPropertyPage has a CancelToClose method but I can't find similar for the sheet object.



I basically want the Cancel button to be "Close" at all times and was hoping to do it in the sheet object.



Is the only way to do this by calling CancelToClose in each of the pages?



I read this and now realise it is not want I want anyway.



This is what I want on my sheet:



  1. A custom Preview button.

  2. A Close button.

The preview button will be to the left side of the close button. I have found a tutorial about adding a custom button.



For the Close button I am not sure what to do.



Update



So, at the moment I have:



Sheet



So it has the custom button (where the existing hidden IDOK button is located). And it has the IDCANCEL button. But I want the button to be "Close".



I know I can use SetWindowText but I am thinking about localization so I wondered what the best way is.










share|improve this question



























    up vote
    0
    down vote

    favorite












    This might sound like a dumb question. I know that CMFCPropertyPage has a CancelToClose method but I can't find similar for the sheet object.



    I basically want the Cancel button to be "Close" at all times and was hoping to do it in the sheet object.



    Is the only way to do this by calling CancelToClose in each of the pages?



    I read this and now realise it is not want I want anyway.



    This is what I want on my sheet:



    1. A custom Preview button.

    2. A Close button.

    The preview button will be to the left side of the close button. I have found a tutorial about adding a custom button.



    For the Close button I am not sure what to do.



    Update



    So, at the moment I have:



    Sheet



    So it has the custom button (where the existing hidden IDOK button is located). And it has the IDCANCEL button. But I want the button to be "Close".



    I know I can use SetWindowText but I am thinking about localization so I wondered what the best way is.










    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      This might sound like a dumb question. I know that CMFCPropertyPage has a CancelToClose method but I can't find similar for the sheet object.



      I basically want the Cancel button to be "Close" at all times and was hoping to do it in the sheet object.



      Is the only way to do this by calling CancelToClose in each of the pages?



      I read this and now realise it is not want I want anyway.



      This is what I want on my sheet:



      1. A custom Preview button.

      2. A Close button.

      The preview button will be to the left side of the close button. I have found a tutorial about adding a custom button.



      For the Close button I am not sure what to do.



      Update



      So, at the moment I have:



      Sheet



      So it has the custom button (where the existing hidden IDOK button is located). And it has the IDCANCEL button. But I want the button to be "Close".



      I know I can use SetWindowText but I am thinking about localization so I wondered what the best way is.










      share|improve this question















      This might sound like a dumb question. I know that CMFCPropertyPage has a CancelToClose method but I can't find similar for the sheet object.



      I basically want the Cancel button to be "Close" at all times and was hoping to do it in the sheet object.



      Is the only way to do this by calling CancelToClose in each of the pages?



      I read this and now realise it is not want I want anyway.



      This is what I want on my sheet:



      1. A custom Preview button.

      2. A Close button.

      The preview button will be to the left side of the close button. I have found a tutorial about adding a custom button.



      For the Close button I am not sure what to do.



      Update



      So, at the moment I have:



      Sheet



      So it has the custom button (where the existing hidden IDOK button is located). And it has the IDCANCEL button. But I want the button to be "Close".



      I know I can use SetWindowText but I am thinking about localization so I wondered what the best way is.







      propertysheet






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 days ago

























      asked 2 days ago









      Andrew Truckle

      4,67131943




      4,67131943






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote



          accepted










          This is how I ended up resolving this issue. I now call this code from CMFCPropertySheet::OnInitDialog():



          void CVisitsRotaPropertySheet::SetupButtons()
          WS_TABSTOP, rctOK, this, IDC_BUTTON_PREVIEW);
          m_btnPreview.SetFont(GetFont());



          The above code adjusts the buttons as I desire. Then, in my CMFCPropertyPage::OnInitDialog() handlers I call CancelToClose().



          The result:



          With custom buttons






          share|improve this answer




















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53225057%2fchanging-the-idcancel-button-to-a-idclose-button-on-a-propertysheet-taking-loca%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote



            accepted










            This is how I ended up resolving this issue. I now call this code from CMFCPropertySheet::OnInitDialog():



            void CVisitsRotaPropertySheet::SetupButtons()
            WS_TABSTOP, rctOK, this, IDC_BUTTON_PREVIEW);
            m_btnPreview.SetFont(GetFont());



            The above code adjusts the buttons as I desire. Then, in my CMFCPropertyPage::OnInitDialog() handlers I call CancelToClose().



            The result:



            With custom buttons






            share|improve this answer
























              up vote
              0
              down vote



              accepted










              This is how I ended up resolving this issue. I now call this code from CMFCPropertySheet::OnInitDialog():



              void CVisitsRotaPropertySheet::SetupButtons()
              WS_TABSTOP, rctOK, this, IDC_BUTTON_PREVIEW);
              m_btnPreview.SetFont(GetFont());



              The above code adjusts the buttons as I desire. Then, in my CMFCPropertyPage::OnInitDialog() handlers I call CancelToClose().



              The result:



              With custom buttons






              share|improve this answer






















                up vote
                0
                down vote



                accepted







                up vote
                0
                down vote



                accepted






                This is how I ended up resolving this issue. I now call this code from CMFCPropertySheet::OnInitDialog():



                void CVisitsRotaPropertySheet::SetupButtons()
                WS_TABSTOP, rctOK, this, IDC_BUTTON_PREVIEW);
                m_btnPreview.SetFont(GetFont());



                The above code adjusts the buttons as I desire. Then, in my CMFCPropertyPage::OnInitDialog() handlers I call CancelToClose().



                The result:



                With custom buttons






                share|improve this answer












                This is how I ended up resolving this issue. I now call this code from CMFCPropertySheet::OnInitDialog():



                void CVisitsRotaPropertySheet::SetupButtons()
                WS_TABSTOP, rctOK, this, IDC_BUTTON_PREVIEW);
                m_btnPreview.SetFont(GetFont());



                The above code adjusts the buttons as I desire. Then, in my CMFCPropertyPage::OnInitDialog() handlers I call CancelToClose().



                The result:



                With custom buttons







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered yesterday









                Andrew Truckle

                4,67131943




                4,67131943



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53225057%2fchanging-the-idcancel-button-to-a-idclose-button-on-a-propertysheet-taking-loca%23new-answer', 'question_page');

                    );

                    Post as a guest














































































                    Popular posts from this blog

                    Use pre created SQLite database for Android project in kotlin

                    Darth Vader #20

                    Ondo