|
If I remove the template, then I get nothing when I call the keypad class.
The operation of this application is quite large. I'm not sure if you have some idea of what an "Instructor Operating System (IOS)" is to a flight simulator, but it controls every aspect of the flight simulator as far as settings go. In order to use this system, it was decided that it should be user and password protected, so that not just anyone could enter the cockpit and use the simulator. Before I added the password protection modules, the keypad came up as it was designed (being the user design and not just the template). The user design uses some of the template and adds on to it's functionality. It would take paragraphs to fully explain the inner workings of this application, so I'm not sure that you might be able to come up with a viable suggestion as to how to make this work correctly.
I was wondering if it was possible to 'create' the keypad at some other location that's not visible, and then delete it, so that when I call it again, it will not be the first time it has been called and created??
John P.
|
|
|
|
|
Are you using MFC?
"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.
|
|
|
|
|
jparken wrote: I create an instantiation of CLogin clog.
Do you then call Create() , CreateIndirect() , or InitModalIndirect() ?
"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 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.
|
|
|
|
|
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:
<br />
const UINT CIosDialog::BTN_ID[CIosDialog::NUM_BUTTONS] =<br />
{<br />
IDC_BN_0, IDC_BN_1, IDC_BN_2, IDC_BN_3, IDC_BN_4, <br />
IDC_BN_5, IDC_BN_6, IDC_BN_7, IDC_BN_8, IDC_BN_9, <br />
IDC_BN_10, IDC_BN_11, IDC_BN_12, IDC_BN_13, IDC_BN_14, <br />
IDC_BN_15, IDC_BN_16, IDC_BN_17, IDC_BN_18, IDC_BN_19, <br />
IDC_BN_20, IDC_BN_21, IDC_BN_22, IDC_BN_23, IDC_BN_24, <br />
IDC_BN_25, IDC_BN_26, IDC_BN_27, IDC_BN_28, IDC_BN_29,<br />
IDC_BN_30, IDC_BN_31, IDC_BN_32, IDC_BN_33, IDC_BN_34, <br />
IDC_BN_35, IDC_BN_36, IDC_BN_37, IDC_BN_38, IDC_BN_39,<br />
IDC_BN_40, IDC_BN_41, IDC_BN_42, IDC_BN_43, IDC_BN_44, <br />
IDC_BN_45, IDC_BN_46, IDC_BN_47, IDC_BN_48, IDC_BN_49, <br />
IDC_BN_50, IDC_BN_51, IDC_BN_52, IDC_BN_53, IDC_BN_54, <br />
IDC_BN_55, IDC_BN_56, IDC_BN_57, IDC_BN_58, IDC_BN_59, <br />
IDC_BN_60, IDC_BN_61, IDC_BN_62, IDC_BN_63, IDC_BN_64, <br />
IDC_BN_65, IDC_BN_66, IDC_BN_67, IDC_BN_68, IDC_BN_69<br />
};
The same is done for labels, text ids, etc.
Then for example in another file:
CEnvironmentControl::BTN_INFO_STRUCT CEnvironmentControl::btnInfo[] =<br />
{<br />
{true, IDB_BLUE_BTN_WIDE_OFF, IDB_BLUE_BTN_WIDE_ON, <br />
"B A R O P R E S S U R E\n-->\n", BaroPressure, CStringType, <br />
&baroPressureString,NULL,"", 0},<br />
<br />
{true, IDB_BLUE_BTN_WIDE_OFF, IDB_BLUE_BTN_WIDE_ON, <br />
"A I R P O R T T E M P\n-->\n", AirportTemp, FloatType, <br />
&trainerData.envInfo.CURRENT_AIRPORT_TEMP, NULL, " \272 C", 0}, <br />
<br />
{true, IDB_BLUE_BTN_WIDE_OFF, IDB_BLUE_BTN_WIDE_ON, <br />
"S U R F A C E W I N D S\n-->\n", SurfaceWinds, CStringType, <br />
&envData.surfaceWindsString, NULL, "", 0},<br />
<br />
{true, IDB_BLUE_BTN_WIDE_OFF, IDB_BLUE_BTN_WIDE_ON, <br />
"A L O F T W I N D S\n( 8000' MIN ALTITUDE )\n-->\n", AloftWinds, CStringType, <br />
&envData.aloftWindsString, NULL, "", 0},<br />
<br />
{true, IDB_BLUE_BTN_WIDE_OFF, IDB_BLUE_BTN_WIDE_ON, <br />
"W I N D G U S T S\n-->\n", WindGusts, FloatType, <br />
&envData.info.GUSTS, NULL, " kts", 0},<br />
<br />
{true, IDB_BLUE_BTN_WIDE_OFF, IDB_BLUE_BTN_WIDE_ON, <br />
"T U R B U L E N C E\n-->\n", Turbulence, IntegerType, <br />
&envData.info.TURBULENCE, NULL, "", 0},<br />
.<br />
.<br />
.<br />
<br />
Hope this helps explain it a little more. I know it's confusing. I originally, and still do, feel somewhat overwhelmed by this application.
John P.
|
|
|
|
|
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:
<br />
class CKeypad : public CDialog<br />
{<br />
public:<br />
CKeypad(CWnd* pParent, const WinInfoStruct); <br />
~CKeypad();<br />
<br />
bool Get_Integer(CString Label, int Min, int Max, int *result=0);<br />
bool Get_Float(CString Label, float Min, float Max, float *result=0);<br />
bool Get_Latitude(CString Label, LAT_DEGREES *result=0);<br />
bool Get_Longitude(CString Label, LON_DEGREES *result=0);<br />
bool Get_Angle(CString Label, DEGREES *result=0);<br />
bool Get_Day(CString Label, int Min, int Max, int *result=0);<br />
bool Get_Month(CString Label, int Min, int Max, int *result=0);<br />
bool Get_Time (CString Label, TimeFormats Format, SECONDS Min,<br />
SECONDS Max, SECONDS *result=0);<br />
bool Get_BaroPress (CString Label, float Min, float Max, float *result=0);<br />
enum { IDD = IDD_KEYPAD };<br />
<br />
private:
<br />
enum CONSTANTS { NUM_BUTTONS = 14 };<br />
<br />
WinInfoStruct winInfo;<br />
CSuperFrame superFrame;<br />
CSuperButton m_EntryBtn[NUM_BUTTONS];<br />
CSuperButton m_Backspace;<br />
CSuperButton m_Enter;<br />
CSuperButton m_Cancel;<br />
CSuperButton m_sbNorth;<br />
CSuperButton m_sbSouth;<br />
CSuperButton m_sbEast;<br />
CSuperButton m_sbWest;<br />
CEntryBuffer m_EntryBuffer;<br />
CString m_Title;<br />
CString m_ErrorBuffer;<br />
bool settingLat;<br />
bool m_bShowDirections;<br />
CRect titleRect;<br />
<br />
const static UINT btnId[NUM_BUTTONS];<br />
<br />
private:
<br />
void ProcessCharacter(char C);<br />
void UpdateDisplay(bool New_Title);<br />
<br />
<br />
protected:<br />
virtual void DoDataExchange(CDataExchange* pDX);
<br />
protected:<br />
afx_msg void OnBn1();<br />
afx_msg void OnBn2();<br />
afx_msg void OnBn3();<br />
afx_msg void OnBn4();<br />
afx_msg void OnBn5();<br />
afx_msg void OnBn6();<br />
afx_msg void OnBn7();<br />
afx_msg void OnBn8();<br />
afx_msg void OnBn9();<br />
afx_msg void OnBn0();<br />
afx_msg void OnBn00();<br />
afx_msg void OnBn000();<br />
afx_msg void OnBnDec();<br />
afx_msg void OnBnNeg();<br />
afx_msg void OnBnEnter();<br />
afx_msg void OnBnBs();<br />
afx_msg void OnBnEast();<br />
afx_msg void OnBnNorth();<br />
afx_msg void OnBnSouth();<br />
afx_msg void OnBnWest();<br />
virtual BOOL OnInitDialog();<br />
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);<br />
afx_msg void OnPaint();<br />
virtual void OnCancel();<br />
DECLARE_MESSAGE_MAP()<br />
};<br />
<br />
<br />
#pragma pack(pop)<br />
<br />
#endif // !defined(AFX_KEYPAD_H__A3105D12_254A_11D2_804C_00104B2D1F4C__INCLUDED_)<br />
I use the GetInteger() function to get the UserID and PIN numbers.
John P.
|
|
|
|
|
So what was the previous mention of CLogin for? Is that somehow related to CKeypad ?
"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);<br />
<br />
if (kp.Get_Integer("Enter ID Number", 0, 99999, &intValue))<br />
John P.
|
|
|
|
|
When I use Image::GetThumbnailImage to get a thumbnail from a PNG file, the background color becomes black, it's white in the original one. And no such a problem about JPG/BMP files.
How to solve it?
Thanks a lot.
|
|
|
|
|
followait wrote: it's white in the original one
Is it white or transparent?
You may need to create your own thumbnail image by creating
a Bitmap of the appropriate pixel format and using a Graphics
object created from that Bitmap, use DrawImage() to draw the
source image on the thumbnail image.
BTW - GDI+ will not preserve transparency if you save the thumbnail
image to a png file. I think only 32-bit ARGB TIFF files preserve
transparency.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Hi,
I'm having a problem with the caret in my windowless control (created in part with the CFlashWnd object in an article by Makarov Igor.) If I click in a text region on my control, the caret does not appear. However, if I open any other application's window or click on the desktop (anything to shift the focus from my app to another), the caret suddenly appears in the windowless text region.
Has anyone seen this behavior? How can I fix this problem?
Thanks,
Brian
|
|
|
|
|
Hi there,
I am new to C++. My job is to recompile a c++ project from VC 6 and Ultimate Grid (Version from 1999?) to VC 2005 and Ultimate Grid 7.2
when compiling, I get the following Linker errors:
<code>
1>UGCBType.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: static bool __cdecl UGXPThemes::DrawBackground(struct HWND__ *,struct HDC__ *,enum UGXPCellType,enum UGXPThemeState,struct tagRECT const *,struct tagRECT const *)" (?DrawBackground@UGXPThemes@@SA_NPAUHWND__@@PAUHDC__@@W4UGXPCellType@@W4UGXPThemeState@@PBUtagRECT@@4@Z)" in Funktion ""public: virtual void __thiscall CUGCheckBoxType::OnDraw(class CDC *,struct tagRECT *,int,long,class CUGCell *,int,int)" (?OnDraw@CUGCheckBoxType@@UAEXPAVCDC@@PAUtagRECT@@HJPAVCUGCell@@HH@Z)".
1>UGCelTyp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: static bool __cdecl UGXPThemes::DrawBackground(struct HWND__ *,struct HDC__ *,enum UGXPCellType,enum UGXPThemeState,struct tagRECT const *,struct tagRECT const *)" (?DrawBackground@UGXPThemes@@SA_NPAUHWND__@@PAUHDC__@@W4UGXPCellType@@W4UGXPThemeState@@PBUtagRECT@@4@Z)".
1>UGCtrl.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: static bool __cdecl UGXPThemes::DrawBackground(struct HWND__ *,struct HDC__ *,enum UGXPCellType,enum UGXPThemeState,struct tagRECT const *,struct tagRECT const *)" (?DrawBackground@UGXPThemes@@SA_NPAUHWND__@@PAUHDC__@@W4UGXPCellType@@W4UGXPThemeState@@PBUtagRECT@@4@Z)".
1>UGDLType.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: static bool __cdecl UGXPThemes::DrawBackground(struct HWND__ *,struct HDC__ *,enum UGXPCellType,enum UGXPThemeState,struct tagRECT const *,struct tagRECT const *)" (?DrawBackground@UGXPThemes@@SA_NPAUHWND__@@PAUHDC__@@W4UGXPCellType@@W4UGXPThemeState@@PBUtagRECT@@4@Z)".
</code>
Any ideas?
THx for any help!
horatio
|
|
|
|
|
horatio wrote: I am new to C++. My job is to recompile a c++ project from VC 6 and Ultimate Grid (Version from 1999?) to VC 2005 and Ultimate Grid 7.2
That is exactly how I started out as a C++ beginner.
led mike
|
|
|
|
|
Did you forget to link a required lib?
Du kommst aus den USA aber dein Compiler liefert deutsche Fehlermeldungen?
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Hi Everyone,
I have created one application for compiling and executing a 'C' source file. In my application i have created one button for compiling as well as executing (This single button will do both compilation and execution operations). I want to create one more button for stoping (terminating / killing the process) the compilation or execution process(i don't know while clicking this button whether my application is in compilation or execution phase).
Please suggest me how can i handle this or what code i have to write for this new button ???
Thanks in advance
Sanjeeva Kumar.
|
|
|
|
|
Did you really make a C compiler? That's amazing!!!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Don't be so flippant, it's probably urgent.
led mike
|
|
|
|
|