// Content.h: interface for the CContent class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_CONTENT_H__F2111FBC_82D0_4B54_8758_781E649E7ACF__INCLUDED_) #define AFX_CONTENT_H__F2111FBC_82D0_4B54_8758_781E649E7ACF__INCLUDED_ #if _MSC_VER > 1000 #pragma once #include #include "GameEngine.h" #include "Resource.h" #include "Bitmap.h" #include "Button.h" #include "ToggleButton.h" #include "Answers.h" #include "MenuGroup1.h" #endif // _MSC_VER > 1000 #define NUMBEROF_FILLS_PER_REACTION 16 #define NUMBEROF_TRANSFORMATION_QUESTION 32 #define NUMBEROF_LITTLE_COMPOUND 32 #include "Panel.h" class CContent : public CPanel { private: void CheckLittleCompoundsForCorrect(); void TransformationManager(); void ManagerFinalizingAnswers(); void Reload(); void AnswerManager(); void SetNavigationButtons(); void ContinueToNextQues(); void QuestionManager(); void CreateNewPage(); void SimpleExerciseManager(); int test; DWORD PlayMovie(WORD wDevID, DWORD dwFrom, DWORD dwTo); void SetVideoClip(int xPos,int yPos,char *szFileName); HWND hwndMovie; HANDLE hFile; int ContentIndex; POINT ptCurPosition; void Manager(); void ConfManager(); void TextManager(); void CompoundManager(); void SetElements(char* filename,bool bOnlyElements,bool bStartWithNewLine=false); void ReactionManager(); int earlierX; ////needed when listing lone compounds int aboveElementX; int aboveElementY; int aboveElementWidth; int aboveElementHeight; void DrawBond(HDC hDC,int iBondType,POINT ptStart,POINT ptEnd); char GetChar(); void NewLine(); Bitmap **pElements; HDC _hOffDC; HBITMAP _hLayerBitmap ; HBITMAP hOldBitmap; Bitmap *bmpBackGround; int iCurIndex; int iCurPosition[32]; char szTopic[32]; char szContent[32768]; int iNextToRead; int iSetCursor; CButton * buttonHome[2]; CButton * buttonNext[2]; CButton * buttonPrev[2]; CButton * butNextQ; CButton * butPrevQ; CButton * butStart; CButton *butCheck; char szPrevFile[64]; //all about nevigating char szNextFile[64]; Bitmap *bmp; Bitmap *bmpAbove,*bmpBelow; void DrawInsidePanel(HDC hDC); struct PosElements *pPosElements; int iElementCount; int iShowingTextElement; POINT ptMousePointer; HDC hTextDC; bool IsQuesion; bool IsMainPage; bool IsEndPage; int iQuesitions; int iRightAnswers; int iFlagPrevReactions[32]; int iCorrectAnswers[32]; int iGivenAswers[32]; CToggleButton *pTglButton[8]; int iAnswCount; bool IsTransformation; int iNumberOfFills; int iNumberOfCorrectFills; CAnswers *pAnsw; struct PosElements *pAnswElements; int iNumberOfOptions; char szNamesOfOption[16][64]; void SetAnswElements(char* szFileName,bool bOnlyElements,POINT ptStart); CMenuGroup ** pMenuGroups;//[NUMBEROF_LITTLE_COMPOUND]; int iMenuGroups; int ifileQuestions; int ifileAttepmts; int ifileAnswersRight; bool bUpNoAnsPnl; bool bIsCheckingAnswers; bool bIgnoreMainPage; Bitmap *bmpRight1,*bmpWrong1,*bmpArrow1; Bitmap *bmpRight2,*bmpWrong2,*bmpQues2; struct TransformationMenu{ int iNumber; int iSelectedAnswer[NUMBEROF_LITTLE_COMPOUND]; int iCorrectAnswer[NUMBEROF_LITTLE_COMPOUND]; }; struct TransformationMenu *transMenu; struct TransformationQuestion{ int iNumber; char szGivenAnswer[NUMBEROF_FILLS_PER_REACTION][64]; char szCorrectAnswer[NUMBEROF_FILLS_PER_REACTION][64]; }; struct TransformationQuestion* transQuestion; int MouseOvAtAnsw; /*struct CorrectTransformation{ bool bLetShow; int x; int y; int width; int height; char szNameCorrect[32]; } corrections;*/ void SetAllButtonNotReady(); bool SetSettings(); void GetSettings(); bool isFromExercise; bool addToProfile; public: bool IsCheckingAnswers(); CContent(int ix,int iy,int iwidth,int iheight,int iLayerWidth,int iLayerHeight,UINT uiBG); virtual ~CContent(); void SetAnswerPanel(CAnswers *pAnsw){CContent::pAnsw=pAnsw;} void SetContent(char *szFileName,int iCursor=-1); void SetLayerWidth(int width){iLayerWidth=width;} void DrawScreen(HDC hDC); bool MouseButtonDown(int x, int y, BOOL bLeft); void MouseButtonUp(int x, int y, BOOL bLeft); void MouseMove(int x, int y); void ChangeTo(char *szTopic,int iIndex,bool bUpdate=false); void Update(bool bSetCurosr=false); void ClearLast(); void ShowPanel(bool bShow); char* GetContent(){return szContent;} }; #endif // !defined(AFX_CONTENT_H__F2111FBC_82D0_4B54_8758_781E649E7ACF__INCLUDED_)