Dialog Displays Differently
-
Yes.
John P.
Ok, so how are you instantiating and creating the "login" dialog?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Ok, so how are you instantiating and creating the "login" dialog?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
I create an instantiation of CLogin clog. This creates the login dialog which has text boxes for holding the UserID and PIN values. There are buttons to select the entry for the UserId and PIN and this in turn calls the Keypad dialog. When the user enters the UserID and PIN numbers, they are placed in the text boxes (one at a time).
John P.
-
I create an instantiation of CLogin clog. This creates the login dialog which has text boxes for holding the UserID and PIN values. There are buttons to select the entry for the UserId and PIN and this in turn calls the Keypad dialog. When the user enters the UserID and PIN numbers, they are placed in the text boxes (one at a time).
John P.
jparken wrote:
I create an instantiation of CLogin clog.
Do you then call
Create()
,CreateIndirect()
, orInitModalIndirect()
?"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
jparken wrote:
I create an instantiation of CLogin clog.
Do you then call
Create()
,CreateIndirect()
, orInitModalIndirect()
?"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
I don't call any of these, David. And none of these are called for Keypad as well.
John P.
-
I don't call any of these, David. And none of these are called for Keypad as well.
John P.
I guess I've failed to understand the problem. What is meant by "user design?"
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
I guess I've failed to understand the problem. What is meant by "user design?"
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
I guess that was a poor choice of wording on my part. Almost all the dialogs have been created from a template. So I guess the proper terminology would be "owner drawn".
John P.
-
I guess that was a poor choice of wording on my part. Almost all the dialogs have been created from a template. So I guess the proper terminology would be "owner drawn".
John P.
Ok, so what is an "owner drawn" dialog, and how does it differ from a non-owner drawn dialog?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Ok, so what is an "owner drawn" dialog, and how does it differ from a non-owner drawn dialog?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
In order to explain that, I would have to enter the code for the module that from which just about all the other dialogs are derived. That would be a couple of pages of code that I doubt anyone would want me to paste on the Forum. Here's just a small example of what I'm referring to:
const UINT CIosDialog::BTN_ID[CIosDialog::NUM_BUTTONS] = { IDC_BN_0, IDC_BN_1, IDC_BN_2, IDC_BN_3, IDC_BN_4, IDC_BN_5, IDC_BN_6, IDC_BN_7, IDC_BN_8, IDC_BN_9, IDC_BN_10, IDC_BN_11, IDC_BN_12, IDC_BN_13, IDC_BN_14, IDC_BN_15, IDC_BN_16, IDC_BN_17, IDC_BN_18, IDC_BN_19, IDC_BN_20, IDC_BN_21, IDC_BN_22, IDC_BN_23, IDC_BN_24, IDC_BN_25, IDC_BN_26, IDC_BN_27, IDC_BN_28, IDC_BN_29, IDC_BN_30, IDC_BN_31, IDC_BN_32, IDC_BN_33, IDC_BN_34, IDC_BN_35, IDC_BN_36, IDC_BN_37, IDC_BN_38, IDC_BN_39, IDC_BN_40, IDC_BN_41, IDC_BN_42, IDC_BN_43, IDC_BN_44, IDC_BN_45, IDC_BN_46, IDC_BN_47, IDC_BN_48, IDC_BN_49, IDC_BN_50, IDC_BN_51, IDC_BN_52, IDC_BN_53, IDC_BN_54, IDC_BN_55, IDC_BN_56, IDC_BN_57, IDC_BN_58, IDC_BN_59, IDC_BN_60, IDC_BN_61, IDC_BN_62, IDC_BN_63, IDC_BN_64, IDC_BN_65, IDC_BN_66, IDC_BN_67, IDC_BN_68, IDC_BN_69 };
The same is done for labels, text ids, etc. Then for example in another file:CEnvironmentControl::BTN_INFO_STRUCT CEnvironmentControl::btnInfo[] = { //******************* // Atmospheric control //******************* {true, IDB_BLUE_BTN_WIDE_OFF, IDB_BLUE_BTN_WIDE_ON, "B A R O P R E S S U R E\n-->\n", BaroPressure, CStringType, &baroPressureString,NULL,"", 0}, //&trainerData.baroPresString, NULL, "", 0}, {true, IDB_BLUE_BTN_WIDE_OFF, IDB_BLUE_BTN_WIDE_ON, "A I R P O R T T E M P\n-->\n", AirportTemp, FloatType, &trainerData.envInfo.CURRENT_AIRPORT_TEMP, NULL, " \272 C", 0}, {true, IDB_BLUE_BTN_WIDE_OFF, IDB_BLUE_BTN_WIDE_ON, "S U R F A C E W I N D S\n-->\n", SurfaceWinds, CStringType, &envData.surfaceWindsString, NULL, "", 0}, {true, IDB_BLUE_BTN_WIDE_OFF, IDB_BLUE_BTN_WIDE_ON, "A L O F T W I N D S\n( 8000' MIN ALTITUDE )\n-->\n", AloftWinds, CStringType, &envData.aloftWindsString, NULL, "", 0}, {true, IDB_BLUE_BTN_WIDE_OFF, IDB_BLUE_BTN_WIDE_ON, "W I N D G U S T S\n-->\n", WindGusts, FloatType, &envData.info.GUSTS, NULL, " kts", 0}, {true, IDB_BLUE_BTN_WIDE_OFF, IDB_BLUE_BTN_WIDE_ON, "T U R B U L E N C E\n-->\n", Turbulence, IntegerType, &
-
In order to explain that, I would have to enter the code for the module that from which just about all the other dialogs are derived. That would be a couple of pages of code that I doubt anyone would want me to paste on the Forum. Here's just a small example of what I'm referring to:
const UINT CIosDialog::BTN_ID[CIosDialog::NUM_BUTTONS] = { IDC_BN_0, IDC_BN_1, IDC_BN_2, IDC_BN_3, IDC_BN_4, IDC_BN_5, IDC_BN_6, IDC_BN_7, IDC_BN_8, IDC_BN_9, IDC_BN_10, IDC_BN_11, IDC_BN_12, IDC_BN_13, IDC_BN_14, IDC_BN_15, IDC_BN_16, IDC_BN_17, IDC_BN_18, IDC_BN_19, IDC_BN_20, IDC_BN_21, IDC_BN_22, IDC_BN_23, IDC_BN_24, IDC_BN_25, IDC_BN_26, IDC_BN_27, IDC_BN_28, IDC_BN_29, IDC_BN_30, IDC_BN_31, IDC_BN_32, IDC_BN_33, IDC_BN_34, IDC_BN_35, IDC_BN_36, IDC_BN_37, IDC_BN_38, IDC_BN_39, IDC_BN_40, IDC_BN_41, IDC_BN_42, IDC_BN_43, IDC_BN_44, IDC_BN_45, IDC_BN_46, IDC_BN_47, IDC_BN_48, IDC_BN_49, IDC_BN_50, IDC_BN_51, IDC_BN_52, IDC_BN_53, IDC_BN_54, IDC_BN_55, IDC_BN_56, IDC_BN_57, IDC_BN_58, IDC_BN_59, IDC_BN_60, IDC_BN_61, IDC_BN_62, IDC_BN_63, IDC_BN_64, IDC_BN_65, IDC_BN_66, IDC_BN_67, IDC_BN_68, IDC_BN_69 };
The same is done for labels, text ids, etc. Then for example in another file:CEnvironmentControl::BTN_INFO_STRUCT CEnvironmentControl::btnInfo[] = { //******************* // Atmospheric control //******************* {true, IDB_BLUE_BTN_WIDE_OFF, IDB_BLUE_BTN_WIDE_ON, "B A R O P R E S S U R E\n-->\n", BaroPressure, CStringType, &baroPressureString,NULL,"", 0}, //&trainerData.baroPresString, NULL, "", 0}, {true, IDB_BLUE_BTN_WIDE_OFF, IDB_BLUE_BTN_WIDE_ON, "A I R P O R T T E M P\n-->\n", AirportTemp, FloatType, &trainerData.envInfo.CURRENT_AIRPORT_TEMP, NULL, " \272 C", 0}, {true, IDB_BLUE_BTN_WIDE_OFF, IDB_BLUE_BTN_WIDE_ON, "S U R F A C E W I N D S\n-->\n", SurfaceWinds, CStringType, &envData.surfaceWindsString, NULL, "", 0}, {true, IDB_BLUE_BTN_WIDE_OFF, IDB_BLUE_BTN_WIDE_ON, "A L O F T W I N D S\n( 8000' MIN ALTITUDE )\n-->\n", AloftWinds, CStringType, &envData.aloftWindsString, NULL, "", 0}, {true, IDB_BLUE_BTN_WIDE_OFF, IDB_BLUE_BTN_WIDE_ON, "W I N D G U S T S\n-->\n", WindGusts, FloatType, &envData.info.GUSTS, NULL, " kts", 0}, {true, IDB_BLUE_BTN_WIDE_OFF, IDB_BLUE_BTN_WIDE_ON, "T U R B U L E N C E\n-->\n", Turbulence, IntegerType, &
So are these controls added to the dialog in
OnInitDialog()
or some other initialization function? The problem, then, is that they do not show up the first time the dialog is rendered but do show up each time thereafter. Is that correct?"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
So are these controls added to the dialog in
OnInitDialog()
or some other initialization function? The problem, then, is that they do not show up the first time the dialog is rendered but do show up each time thereafter. Is that correct?"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
Yes, these controls are added in the OnInitDialog(). It is not these other dialogs that have a problem with displaying properly. That only occurs with the Keypad dialog, and the Keypad dialog is not created (derived) from the IosDialog. It is derived from the common CDialog. The class definition is shown below:
///////////////////////////////////////////////////////////////////////////// // CKeypad dialog class CKeypad : public CDialog { // Construction public: CKeypad(CWnd* pParent, const WinInfoStruct); ~CKeypad(); bool Get_Integer(CString Label, int Min, int Max, int *result=0); bool Get_Float(CString Label, float Min, float Max, float *result=0); bool Get_Latitude(CString Label, LAT_DEGREES *result=0); bool Get_Longitude(CString Label, LON_DEGREES *result=0); bool Get_Angle(CString Label, DEGREES *result=0); bool Get_Day(CString Label, int Min, int Max, int *result=0); bool Get_Month(CString Label, int Min, int Max, int *result=0); bool Get_Time (CString Label, TimeFormats Format, SECONDS Min, SECONDS Max, SECONDS *result=0); bool Get_BaroPress (CString Label, float Min, float Max, float *result=0); // Dialog Data //{{AFX_DATA(CKeypad) enum { IDD = IDD_KEYPAD }; //}}AFX_DATA private: // Attributes enum CONSTANTS { NUM_BUTTONS = 14 }; WinInfoStruct winInfo; CSuperFrame superFrame; CSuperButton m_EntryBtn[NUM_BUTTONS]; CSuperButton m_Backspace; CSuperButton m_Enter; CSuperButton m_Cancel; CSuperButton m_sbNorth; CSuperButton m_sbSouth; CSuperButton m_sbEast; CSuperButton m_sbWest; CEntryBuffer m_EntryBuffer; CString m_Title; CString m_ErrorBuffer; bool settingLat; bool m_bShowDirections; CRect titleRect; //----------------------------------------------------------- // Static Data //----------------------------------------------------------- const static UINT btnId[NUM_BUTTONS]; //----------------------------------------------------------- private: // Methods void ProcessCharacter(char C); void UpdateDisplay(bool New_Title); // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CKeypad) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL protected: // Generated message map functions //{{AFX_MSG(CKeypad) afx_msg void OnBn1(); afx_msg void OnBn2(); afx_msg void OnBn3(); afx_msg void OnBn4(); afx_msg void OnBn5(); afx_msg void OnBn6(); afx_msg void OnBn7();
-
Yes, these controls are added in the OnInitDialog(). It is not these other dialogs that have a problem with displaying properly. That only occurs with the Keypad dialog, and the Keypad dialog is not created (derived) from the IosDialog. It is derived from the common CDialog. The class definition is shown below:
///////////////////////////////////////////////////////////////////////////// // CKeypad dialog class CKeypad : public CDialog { // Construction public: CKeypad(CWnd* pParent, const WinInfoStruct); ~CKeypad(); bool Get_Integer(CString Label, int Min, int Max, int *result=0); bool Get_Float(CString Label, float Min, float Max, float *result=0); bool Get_Latitude(CString Label, LAT_DEGREES *result=0); bool Get_Longitude(CString Label, LON_DEGREES *result=0); bool Get_Angle(CString Label, DEGREES *result=0); bool Get_Day(CString Label, int Min, int Max, int *result=0); bool Get_Month(CString Label, int Min, int Max, int *result=0); bool Get_Time (CString Label, TimeFormats Format, SECONDS Min, SECONDS Max, SECONDS *result=0); bool Get_BaroPress (CString Label, float Min, float Max, float *result=0); // Dialog Data //{{AFX_DATA(CKeypad) enum { IDD = IDD_KEYPAD }; //}}AFX_DATA private: // Attributes enum CONSTANTS { NUM_BUTTONS = 14 }; WinInfoStruct winInfo; CSuperFrame superFrame; CSuperButton m_EntryBtn[NUM_BUTTONS]; CSuperButton m_Backspace; CSuperButton m_Enter; CSuperButton m_Cancel; CSuperButton m_sbNorth; CSuperButton m_sbSouth; CSuperButton m_sbEast; CSuperButton m_sbWest; CEntryBuffer m_EntryBuffer; CString m_Title; CString m_ErrorBuffer; bool settingLat; bool m_bShowDirections; CRect titleRect; //----------------------------------------------------------- // Static Data //----------------------------------------------------------- const static UINT btnId[NUM_BUTTONS]; //----------------------------------------------------------- private: // Methods void ProcessCharacter(char C); void UpdateDisplay(bool New_Title); // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CKeypad) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL protected: // Generated message map functions //{{AFX_MSG(CKeypad) afx_msg void OnBn1(); afx_msg void OnBn2(); afx_msg void OnBn3(); afx_msg void OnBn4(); afx_msg void OnBn5(); afx_msg void OnBn6(); afx_msg void OnBn7();
So what was the previous mention of
CLogin
for? Is that somehow related toCKeypad
?"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
So what was the previous mention of
CLogin
for? Is that somehow related toCKeypad
?"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
Keypad is called to enter the UserID and PIN for the login, and Keypad is called from within CLogin,
CKeypad kp(mainFramePtr->wndPtr, winInfo); if (kp.Get_Integer("Enter ID Number", 0, 99999, &intValue))
John P.