Menu

setting....

Soren Bro
2018-12-26
2018-12-26
  • Soren Bro

    Soren Bro - 2018-12-26

    (AFK)

    Just thinking out loud here. It's mostly rhetorichal, but any opinions are,
    of course, welcome.

    Still fighting a little with these setting. There are two ways to set them.
    Using a toolbar button that will, either, brute-force set them all, or
    maybe check for only changed ones. I will retain this option. If the
    end-users are anything like me, they'll probably press this one just to be
    sure anyway.

    The other one is a notification that a single property has changed. Problem
    is that this one gives me the name of the property changed, where's
    rather like an index, or even a function pointer to call with the new
    value. I have so far found a SetData (lpWord) function, but I can't cram a
    function pointer into a DWORD. Or can I? After all a pointer isn't biggerr
    than a DWORD.

    This would by far be the most elegant solution. (This way I can also change
    the background colour of the property window on invalid input (say, a
    mangled e-mail address).

    The last thing I want is a giant switch or if -else construct....

    Regards

    --
    Søren Bro Thygesen

     
    • Soren Bro

      Soren Bro - 2018-12-26

      Watt...

      A

      std::map <cstring, fpn=""></cstring,>

      Will translate the propertyname to a function pointer by lookup. On the
      other hand the propertynames Are i18n'ed, so if this will work.?

      On Wednesday, December 26, 2018, sbrothy@gmail.com wrote:

      (AFK)

      Just thinking out loud here. It's mostly rhetorichal, but any opinions
      are, of course, welcome.

      Still fighting a little with these setting. There are two ways to set
      them. Using a toolbar button that will, either, brute-force set them all,
      or maybe check for only changed ones. I will retain this option. If the
      end-users are anything like me, they'll probably press this one just to be
      sure anyway.

      The other one is a notification that a single property has changed.
      Problem is that this one gives me the name of the property changed,
      where's rather like an index, or even a function pointer to call with the
      new value. I have so far found a SetData (lpWord) function, but I can't
      cram a function pointer into a DWORD. Or can I? After all a pointer isn't
      biggerr than a DWORD.

      This would by far be the most elegant solution. (This way I can also
      change the background colour of the property window on invalid input (say,
      a mangled e-mail address).

      The last thing I want is a giant switch or if -else construct....

      Regards

      --
      Søren Bro Thygesen

      --
      Søren Bro Thygesen

       
      • Soren Bro

        Soren Bro - 2018-12-26

        That would be:

        include

        using namespace std;

        typedef void (fpnSetValue(void));

        typedef map<cstring, fpnsetvalue=""> SETFUNC, *PSETFUNCS;</cstring,>

        SETFUNCS setters;

        setters [L"3D Loop"] = &func;
        .

        On Wednesday, December 26, 2018, Soren Bro sbrothy@users.sourceforge.net
        wrote:

        Watt...

        A

        std::map <cstring, fpn=""></cstring,>

        Will translate the propertyname to a function pointer by lookup. On the
        other hand the propertynames Are i18n'ed, so if this will work.?

        On Wednesday, December 26, 2018, sbrothy@gmail.com wrote:

        (AFK)

        Just thinking out loud here. It's mostly rhetorichal, but any opinions
        are, of course, welcome.

        Still fighting a little with these setting. There are two ways to set
        them. Using a toolbar button that will, either, brute-force set them all,
        or maybe check for only changed ones. I will retain this option. If the
        end-users are anything like me, they'll probably press this one just to be
        sure anyway.

        The other one is a notification that a single property has changed.
        Problem is that this one gives me the name of the property changed,
        where's rather like an index, or even a function pointer to call with the
        new value. I have so far found a SetData (lpWord) function, but I can't
        cram a function pointer into a DWORD. Or can I? After all a pointer isn't
        biggerr than a DWORD.

        This would by far be the most elegant solution. (This way I can also
        change the background colour of the property window on invalid input (say,
        a mangled e-mail address).

        The last thing I want is a giant switch or if -else construct....

        Regards

        --
        Søren Bro Thygesen

        --
        Søren Bro Thygesen


        setting....
        https://sourceforge.net/p/hermesmail/discussion/general/thread/acfcd0fa45/?limit=25#bcd3/7cd1


        Sent from sourceforge.net because you indicated interest in
        https://sourceforge.net/p/hermesmail/discussion/general/

        To unsubscribe from further messages, please visit
        https://sourceforge.net/auth/subscriptions/

        --
        Søren Bro Thygesen

         
        • Soren Bro

          Soren Bro - 2018-12-26

          As it's a pointer To a member function the syntax might be:

          typedef void (CHermesSettings::fpnSetValue (void));

          I'll See when I get home....

          ---------- Forwarded message ----------
          From: sbrothy@gmail.com
          Date: Wednesday, void 26, 2018
          Subject: [hermesmail:discussion] setting....
          To: "[hermesmail:discussion]" general@discussion.hermesmail.p.re.sourceforge.net

          That would be:

          include

          using namespace std;

          typedef void (fpnSetValue(void));

          typedef map<cstring, fpnsetvalue=""> SETFUNC, *PSETFUNCS;</cstring,>

          SETFUNCS setters;

          setters [L"3D Loop"] = &func;
          .

          On Wednesday, December 26, 2018, Soren Bro sbrothy@users.sourceforge.net
          wrote:

          Watt...

          A

          std::map <cstring, fpn=""></cstring,>

          Will translate the propertyname to a function pointer by lookup. On the
          other hand the propertynames Are i18n'ed, so if this will work.?

          On Wednesday, December 26, 2018, sbrothy@gmail.com wrote:

          (AFK)

          Just thinking out loud here. It's mostly rhetorichal, but any opinions
          are, of course, welcome.

          Still fighting a little with these setting. There are two ways to set
          them. Using a toolbar button that will, either, brute-force set them all,
          or maybe check for only changed ones. I will retain this option. If the
          end-users are anything like me, they'll probably press this one just to be
          sure anyway.

          The other one is a notification that a single property has changed.
          Problem is that this one gives me the name of the property changed,
          where's rather like an index, or even a function pointer to call with the
          new value. I have so far found a SetData (lpWord) function, but I can't
          cram a function pointer into a DWORD. Or can I? After all a pointer isn't
          biggerr than a DWORD.

          This would by far be the most elegant solution. (This way I can also
          change the background colour of the property window on invalid input (say,
          a mangled e-mail address).

          The last thing I want is a giant switch or if -else construct....

          Regards

          --
          Søren Bro Thygesen

          --
          Søren Bro Thygesen


          setting....
          https://sourceforge.net/p/hermesmail/discussion/general/thread/acfcd0fa45/?limit=25#bcd3/7cd1


          Sent from sourceforge.net because you indicated interest in
          https://sourceforge.net/p/hermesmail/discussion/general/

          To unsubscribe from further messages, please visit
          https://sourceforge.net/auth/subscriptions/

          --
          Søren Bro Thygesen

          --
          Søren Bro Thygesen

           
          • Soren Bro

            Soren Bro - 2018-12-26

            The CHermesSettings Class might as well be a structure. All it's members
            are public and, if I remember correctly, structures can have
            constructers/destructors.

            Point is that it has no getters/setters. Those can be made though...

            Regards

            On Wednesday, December 26, 2018, Soren Bro sbrothy@users.sourceforge.net
            wrote:

            As it's a pointer To a member function the syntax might be:

            typedef void (CHermesSettings::fpnSetValue (void));

            I'll See when I get home....

            ---------- Forwarded message ----------
            From: sbrothy@gmail.com
            Date: Wednesday, void 26, 2018
            Subject: [hermesmail:discussion] setting....
            To: "[hermesmail:discussion]" general@discussion.hermesmail.
            p.re.sourceforge.net

            That would be:
            include

            using namespace std;

            typedef void (fpnSetValue(void));

            typedef map<cstring, fpnsetvalue=""> SETFUNC, *PSETFUNCS;</cstring,>

            SETFUNCS setters;

            setters [L"3D Loop"] = &func;
            .

            On Wednesday, December 26, 2018, Soren Bro sbrothy@users.sourceforge.net
            wrote:

            Watt...

            A

            std::map <cstring, fpn=""></cstring,>

            Will translate the propertyname to a function pointer by lookup. On the
            other hand the propertynames Are i18n'ed, so if this will work.?

            On Wednesday, December 26, 2018, sbrothy@gmail.com wrote:

            (AFK)

            Just thinking out loud here. It's mostly rhetorichal, but any opinions
            are, of course, welcome.

            Still fighting a little with these setting. There are two ways to set
            them. Using a toolbar button that will, either, brute-force set them all,
            or maybe check for only changed ones. I will retain this option. If the
            end-users are anything like me, they'll probably press this one just to be
            sure anyway.

            The other one is a notification that a single property has changed.
            Problem is that this one gives me the name of the property changed,
            where's rather like an index, or even a function pointer to call with the
            new value. I have so far found a SetData (lpWord) function, but I can't
            cram a function pointer into a DWORD. Or can I? After all a pointer isn't
            biggerr than a DWORD.

            This would by far be the most elegant solution. (This way I can also
            change the background colour of the property window on invalid input (say,
            a mangled e-mail address).

            The last thing I want is a giant switch or if -else construct....

            Regards

            --
            Søren Bro Thygesen

            --
            Søren Bro Thygesen


            setting....
            https://sourceforge.net/p/hermesmail/discussion/general/
            thread/acfcd0fa45/?limit=25#bcd3/7cd1


            Sent from sourceforge.net because you indicated interest in
            https://sourceforge.net/p/hermesmail/discussion/general/

            To unsubscribe from further messages, please visit
            https://sourceforge.net/auth/subscriptions/

            --
            Søren Bro Thygesen

            --
            Søren Bro Thygesen


            setting....
            https://sourceforge.net/p/hermesmail/discussion/general/thread/acfcd0fa45/?limit=25#bcd3/7cd1/12f5/1391


            Sent from sourceforge.net because you indicated interest in
            https://sourceforge.net/p/hermesmail/discussion/general/

            To unsubscribe from further messages, please visit
            https://sourceforge.net/auth/subscriptions/

            --
            Søren Bro Thygesen

             
            • Pete Maclean

              Pete Maclean - 2018-12-26

              RIght, structs can have constructors and destructors.

               
            • Soren Bro

              Soren Bro - 2018-12-26

              The deeper point is that I'm putting it all together now. As an MDI app.
              Conveniently registrering only one Dcument template. Who knows, maybe down
              the road we will need another one.....

              Rygårds

              On Wednesday, December 26, 2018, sbrothy@gmail.com wrote:

              The CHermesSettings Class might as well be a structure. All it's members
              are public and, if I remember correctly, structures can have
              constructers/destructors.

              Point is that it has no getters/setters. Those can be made though...

              Regards

              On Wednesday, December 26, 2018, Soren Bro sbrothy@users.sourceforge.net
              wrote:

              As it's a pointer To a member function the syntax might be:

              typedef void (CHermesSettings::fpnSetValue (void));

              I'll See when I get home....

              ---------- Forwarded message ----------
              From: sbrothy@gmail.com
              Date: Wednesday, void 26, 2018
              Subject: [hermesmail:discussion] setting....
              To: "[hermesmail:discussion]" general@discussion.hermesmail.
              p.re.sourceforge.net

              That would be:
              include

              using namespace std;

              typedef void (fpnSetValue(void));

              typedef map<cstring, fpnsetvalue=""> SETFUNC, *PSETFUNCS;</cstring,>

              SETFUNCS setters;

              setters [L"3D Loop"] = &func;
              .

              On Wednesday, December 26, 2018, Soren Bro sbrothy@users.sourceforge.net
              wrote:

              Watt...

              A

              std::map <cstring, fpn=""></cstring,>

              Will translate the propertyname to a function pointer by lookup. On the
              other hand the propertynames Are i18n'ed, so if this will work.?

              On Wednesday, December 26, 2018, sbrothy@gmail.com wrote:

              (AFK)

              Just thinking out loud here. It's mostly rhetorichal, but any opinions
              are, of course, welcome.

              Still fighting a little with these setting. There are two ways to set
              them. Using a toolbar button that will, either, brute-force set them all,
              or maybe check for only changed ones. I will retain this option. If the
              end-users are anything like me, they'll probably press this one just to be
              sure anyway.

              The other one is a notification that a single property has changed.
              Problem is that this one gives me the name of the property changed,
              where's rather like an index, or even a function pointer to call with the
              new value. I have so far found a SetData (lpWord) function, but I can't
              cram a function pointer into a DWORD. Or can I? After all a pointer isn't
              biggerr than a DWORD.

              This would by far be the most elegant solution. (This way I can also
              change the background colour of the property window on invalid input (say,
              a mangled e-mail address).

              The last thing I want is a giant switch or if -else construct....

              Regards

              --
              Søren Bro Thygesen

              --
              Søren Bro Thygesen


              setting....
              https://sourceforge.net/p/hermesmail/discussion/general/thre
              ad/acfcd0fa45/?limit=25#bcd3/7cd1


              Sent from sourceforge.net because you indicated interest in
              https://sourceforge.net/p/hermesmail/discussion/general/

              To unsubscribe from further messages, please visit
              https://sourceforge.net/auth/subscriptions/

              --
              Søren Bro Thygesen

              --
              Søren Bro Thygesen


              setting....
              https://sourceforge.net/p/hermesmail/discussion/general/thread/acfcd0fa45/?limit=25#bcd3/7cd1/12f5/1391


              Sent from sourceforge.net because you indicated interest in
              https://sourceforge.net/p/hermesmail/discussion/general/

              To unsubscribe from further messages, please visit
              https://sourceforge.net/auth/subscriptions/

              --
              Søren Bro Thygesen

              --
              Søren Bro Thygesen

               
              • Soren Bro

                Soren Bro - 2018-12-26

                So. Next practical problem will be for CHermesSettings to "guess" what kind
                of data type I'm trying to set with my void*. A boolean, a COLORREF? A font?

                It'l be hilarious, I'm sure.

                R

                On Wednesday, December 26, 2018, Soren Bro sbrothy@users.sourceforge.net
                wrote:

                The deeper point is that I'm putting it all together now. As an MDI app.
                Conveniently registrering only one Dcument template. Who knows, maybe down
                the road we will need another one.....

                Rygårds

                On Wednesday, December 26, 2018, sbrothy@gmail.com wrote:

                The CHermesSettings Class might as well be a structure. All it's members
                are public and, if I remember correctly, structures can have
                constructers/destructors.

                Point is that it has no getters/setters. Those can be made though...

                Regards

                On Wednesday, December 26, 2018, Soren Bro sbrothy@users.sourceforge.net
                wrote:

                As it's a pointer To a member function the syntax might be:

                typedef void (CHermesSettings::fpnSetValue (void));

                I'll See when I get home....

                ---------- Forwarded message ----------
                From: sbrothy@gmail.com
                Date: Wednesday, void 26, 2018
                Subject: [hermesmail:discussion] setting....
                To: "[hermesmail:discussion]" general@discussion.hermesmail.
                p.re.sourceforge.net

                That would be:
                include

                using namespace std;

                typedef void (fpnSetValue(void));

                typedef map<cstring, fpnsetvalue=""> SETFUNC, *PSETFUNCS;</cstring,>

                SETFUNCS setters;

                setters [L"3D Loop"] = &func;
                .

                On Wednesday, December 26, 2018, Soren Bro sbrothy@users.sourceforge.net
                wrote:

                Watt...

                A

                std::map <cstring, fpn=""></cstring,>

                Will translate the propertyname to a function pointer by lookup. On the
                other hand the propertynames Are i18n'ed, so if this will work.?

                On Wednesday, December 26, 2018, sbrothy@gmail.com wrote:

                (AFK)

                Just thinking out loud here. It's mostly rhetorichal, but any opinions
                are, of course, welcome.

                Still fighting a little with these setting. There are two ways to set
                them. Using a toolbar button that will, either, brute-force set them all,
                or maybe check for only changed ones. I will retain this option. If the
                end-users are anything like me, they'll probably press this one just to be
                sure anyway.

                The other one is a notification that a single property has changed.
                Problem is that this one gives me the name of the property changed,
                where's rather like an index, or even a function pointer to call with the
                new value. I have so far found a SetData (lpWord) function, but I can't
                cram a function pointer into a DWORD. Or can I? After all a pointer isn't
                biggerr than a DWORD.

                This would by far be the most elegant solution. (This way I can also
                change the background colour of the property window on invalid input (say,
                a mangled e-mail address).

                The last thing I want is a giant switch or if -else construct....

                Regards

                --
                Søren Bro Thygesen

                --
                Søren Bro Thygesen


                setting....
                https://sourceforge.net/p/hermesmail/discussion/general/thre
                ad/acfcd0fa45/?limit=25#bcd3/7cd1


                Sent from sourceforge.net because you indicated interest in
                https://sourceforge.net/p/hermesmail/discussion/general/

                To unsubscribe from further messages, please visit
                https://sourceforge.net/auth/subscriptions/

                --
                Søren Bro Thygesen

                --
                Søren Bro Thygesen


                setting....
                https://sourceforge.net/p/hermesmail/discussion/general/
                thread/acfcd0fa45/?limit=25#bcd3/7cd1/12f5/1391


                Sent from sourceforge.net because you indicated interest in
                https://sourceforge.net/p/hermesmail/discussion/general/

                To unsubscribe from further messages, please visit
                https://sourceforge.net/auth/subscriptions/

                --
                Søren Bro Thygesen

                --
                Søren Bro Thygesen


                setting....
                https://sourceforge.net/p/hermesmail/discussion/general/thread/acfcd0fa45/?limit=25#bcd3/7cd1/12f5/1391/1cdf/48c4


                Sent from sourceforge.net because you indicated interest in
                https://sourceforge.net/p/hermesmail/discussion/general/

                To unsubscribe from further messages, please visit
                https://sourceforge.net/auth/subscriptions/

                --
                Søren Bro Thygesen

                 
      • Soren Bro

        Soren Bro - 2018-12-26

        Although, even though I use hungarian notation I'm not sure actual
        Hungarian will look at it in suite the same way. :)

        On Wednesday, December 26, 2018, sbrothy@gmail.com wrote:

        Watt...

        A

        std::map <cstring, fpn=""></cstring,>

        Will translate the propertyname to a function pointer by lookup. On the
        other hand the propertynames Are i18n'ed, so if this will work.?

        On Wednesday, December 26, 2018, sbrothy@gmail.com wrote:

        (AFK)

        Just thinking out loud here. It's mostly rhetorichal, but any opinions
        are, of course, welcome.

        Still fighting a little with these setting. There are two ways to set
        them. Using a toolbar button that will, either, brute-force set them all,
        or maybe check for only changed ones. I will retain this option. If the
        end-users are anything like me, they'll probably press this one just to be
        sure anyway.

        The other one is a notification that a single property has changed.
        Problem is that this one gives me the name of the property changed,
        where's rather like an index, or even a function pointer to call with the
        new value. I have so far found a SetData (lpWord) function, but I can't
        cram a function pointer into a DWORD. Or can I? After all a pointer isn't
        biggerr than a DWORD.

        This would by far be the most elegant solution. (This way I can also
        change the background colour of the property window on invalid input (say,
        a mangled e-mail address).

        The last thing I want is a giant switch or if -else construct....

        Regards

        --
        Søren Bro Thygesen

        --
        Søren Bro Thygesen

        --
        Søren Bro Thygesen

         

Log in to post a comment.