Re: Units of Measure in Edit Controls
From: Dan McCarty (dmccarty_at_gmail.com)
Date: 12/28/04
- Next message: Ayman Shoukry [MSFT]: "RE: CreateThread and BeginThreadex"
- Previous message: Jeevan: "Re: saving a file"
- In reply to: Dan McCarty: "Units of Measure in Edit Controls"
- Next in thread: David Lowndes: "Re: Units of Measure in Edit Controls"
- Reply: David Lowndes: "Re: Units of Measure in Edit Controls"
- Messages sorted by: [ date ] [ thread ]
Date: 28 Dec 2004 12:07:55 -0800
Seeing how no one has replied yet,* maybe I should be more specific
about my app.
I have an app that I'm moving to WinCE (4.2) with MFC and there are a
number of complicated dialogs--about 30--that each contain a number of
various fields. In each dialog there are a lot of different units of
measure in use. (e.g., 5.08 metres, 185 PSI, 1.8 in, 200 mm, 1.2 ms, 2
s, etc.).
Instead of maintaining a separate chunk of code in each dialog like
this...
value.Format("%d ms", m_value1)
c_value1.SetWindowText(value)
value.Format("%d ms", m_value2)
c_value2.SetWindowText(value)
...
...ad infinitum
...I thought that I might be able to come up with a custom property or
number for each field that defines its units of measure and store that
value along with the field.
Could I set the field's label's caption to something like "%d ms" and
store it as the format as the dialog init'd, then use that value to
format the field later? Alternatively, could I use a global handler
and use the unique field ID (I will maintain nightly vigil over the
resource file to make sure they are unique) to retrieve the field's
formatting? Alternatively, could I just shoot my foot off for coming
up with such silly ideas? I don't know, are they silly?
I guess my real problem is that I'm not very familiar with MFC. I'm
sure that this must be an easy problem, but I'm just not bright enough
to see the easy solution. I've spent some time running Google and
Usenet searches but haven't come up with anything. There are only n
types of units of measure, so there must be some way to store which
type of n belongs to each field, but I just don't see how to do it.
Thanks in advance for any help,
Dan.
* Whenever I post something and don't get any replies, I like to
convince myself that my question was just too specific and advanced for
everybody. But it usually turns out that I was just so far off the
deep end that everyone ignored me.
- Next message: Ayman Shoukry [MSFT]: "RE: CreateThread and BeginThreadex"
- Previous message: Jeevan: "Re: saving a file"
- In reply to: Dan McCarty: "Units of Measure in Edit Controls"
- Next in thread: David Lowndes: "Re: Units of Measure in Edit Controls"
- Reply: David Lowndes: "Re: Units of Measure in Edit Controls"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|