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....
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....
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....
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....
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...
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....
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.....
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...
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....
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?
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:
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....
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....
(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
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:
--
Søren Bro Thygesen
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:
--
Søren Bro Thygesen
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:
--
Søren Bro Thygesen
--
Søren Bro Thygesen
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:
--
Søren Bro Thygesen
RIght, structs can have constructors and destructors.
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:
--
Søren Bro Thygesen
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:
--
Søren Bro Thygesen
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:
--
Søren Bro Thygesen
pnI vUse adjHungarian nNotation advToo.
Im 'Thure [drool [
On Wednesday, December 26, 2018, Pete Maclean petemaclean@users.sourceforge.net wrote:
--
Søren Bro Thygesen