// MyDialogs.cpp // Implementation of Dialog Box classes in MyDialogs.h #include //Windows Application Frameworks header #include "resource.h" //resource file #include "MyDialogs.h" //Declarations for Dialog Box classes #include "ImgEditJob_ids.h" //Contains image editing function IDs #include "CMainWindow.h" //Declarations for CMainWindow class /********************************************************************** Implementation of CBrightnessDialog **********************************************************************/ // Create message map for this class.... BEGIN_MESSAGE_MAP (CBrightnessDialog, CDialog) ON_WM_CREATE () ON_BN_CLICKED(ID_BRIGHT_UP, OnBrightUp) ON_BN_CLICKED(ID_BRIGHT_DOWN, OnBrightDown) END_MESSAGE_MAP () // Brightness control dialog box message handlers... void CBrightnessDialog::OnBrightUp(){ /********************************************************************** Sets the flag EDIT_FUNCTION to the integer which represents the image editing function that increases an image's brightness. Then calls Invalidate(FALSE) to cause a repaint of the image **********************************************************************/ p->image->EDIT_FUNCTION = JOBID_BRIGHTNESS_UP; //Notify OnPaint() of //specific function to peform AfxGetMainWnd()->Invalidate(FALSE); //Force a repaint of the image } void CBrightnessDialog::OnBrightDown(){ /********************************************************************** Sets the flag EDIT_FUNCTION to the integer which represents the image editing function that decreases an image's brightness. Then calls Invalidate(FALSE) to cause a repaint of the image **********************************************************************/ p->image->EDIT_FUNCTION = JOBID_BRIGHTNESS_DOWN; //Notify OnPaint() of //specific function to peform AfxGetMainWnd()->Invalidate(FALSE); //Force a repaint of the image } void CBrightnessDialog::PostNcDestroy(){ /********************************************************************** Destroys the dialog box and returns resources to the dynamic memory heap **********************************************************************/ CDialog::PostNcDestroy (); delete this; //delete this CDialog object } /********************************************************************** Implementation of CContrastDialog **********************************************************************/ // Create Message Map for This Class...... BEGIN_MESSAGE_MAP (CContrastDialog, CDialog) ON_WM_CREATE () ON_BN_CLICKED(ID_CONT_UP, OnContrastUp) ON_BN_CLICKED(ID_CONT_DOWN, OnContrastDown) END_MESSAGE_MAP () // Member functions void CContrastDialog::OnContrastUp () { /********************************************************************** Sets the flag EDIT_FUNCTION to the integer which represents the image editing function that increases an image's contrast. Then calls Invalidate(FALSE) to cause a repaint of the image **********************************************************************/ p->image->EDIT_FUNCTION = JOBID_CONTRAST_UP; //Notify OnPaint() of //specific function to peform AfxGetMainWnd()->Invalidate(FALSE); //Force a repaint of the image } void CContrastDialog::OnContrastDown () { /********************************************************************** Sets the flag EDIT_FUNCTION to the integer which represents the image editing function that decreases an image's contrast. Then calls Invalidate(FALSE) to cause a repaint of the image **********************************************************************/ p->image->EDIT_FUNCTION = JOBID_CONTRAST_DOWN; //Notify OnPaint() of //specific function to peform AfxGetMainWnd()->Invalidate(FALSE); //Force a repaint of the image } void CContrastDialog::PostNcDestroy(){ /********************************************************************** Destroys the dialog box and returns resources to the dynamic memory heap **********************************************************************/ CDialog::PostNcDestroy (); delete this; //delete this CDialog object } /********************************************************************** Implementation of CTintDialog **********************************************************************/ BEGIN_MESSAGE_MAP(CTintDialog, CDialog) ON_WM_CREATE () ON_BN_CLICKED(ID_REDTINT_UP, OnRedTintUp) ON_BN_CLICKED(ID_REDTINT_DOWN, OnRedTintDown) ON_BN_CLICKED(ID_GREENTINT_UP, OnGreenTintUp) ON_BN_CLICKED(ID_GREENTINT_DOWN, OnGreenTintDown) ON_BN_CLICKED(ID_BLUETINT_UP, OnBlueTintUp) ON_BN_CLICKED(ID_BLUETINT_DOWN, OnBlueTintDown) END_MESSAGE_MAP () void CTintDialog::OnRedTintUp(){ /********************************************************************** Sets the flag EDIT_FUNCTION to the integer which represents the image editing function that increases the shade of red in an image. Then calls Invalidate(FALSE) to cause a repaint of the image **********************************************************************/ p->image->EDIT_FUNCTION = JOBID_RED_TINT_UP; AfxGetMainWnd()->Invalidate(FALSE); } void CTintDialog::OnRedTintDown(){ /********************************************************************** Sets the flag EDIT_FUNCTION to the integer which represents the image editing function that decreases the shade of red in an image. Then calls Invalidate(FALSE) to cause a repaint of the image **********************************************************************/ p->image->EDIT_FUNCTION = JOBID_RED_TINT_DOWN; AfxGetMainWnd()->Invalidate(FALSE); } void CTintDialog::OnGreenTintUp(){ /********************************************************************** Sets the flag EDIT_FUNCTION to the integer which represents the image editing function that increases the shade of green in an image. Then calls Invalidate(FALSE) to cause a repaint of the image **********************************************************************/ p->image->EDIT_FUNCTION = JOBID_GREEN_TINT_UP; AfxGetMainWnd()->Invalidate(FALSE); } void CTintDialog::OnGreenTintDown(){ /********************************************************************** Sets the flag EDIT_FUNCTION to the integer which represents the image editing function that increases the shade of green in an image. Then calls Invalidate(FALSE) to cause a repaint of the image **********************************************************************/ p->image->EDIT_FUNCTION = JOBID_GREEN_TINT_DOWN; AfxGetMainWnd()->Invalidate(FALSE); } void CTintDialog::OnBlueTintUp(){ /********************************************************************** Sets the flag EDIT_FUNCTION to the integer which represents the image editing function that increases the shade of blue in an image. Then calls Invalidate(FALSE) to cause a repaint of the image **********************************************************************/ p->image->EDIT_FUNCTION = JOBID_BLUE_TINT_UP; AfxGetMainWnd()->Invalidate(FALSE); } void CTintDialog::OnBlueTintDown(){ /********************************************************************** Sets the flag EDIT_FUNCTION to the integer which represents the image editing function that increases the shade of blue in an image. Then calls Invalidate(FALSE) to cause a repaint of the image **********************************************************************/ p->image->EDIT_FUNCTION = JOBID_BLUE_TINT_DOWN; AfxGetMainWnd()->Invalidate(FALSE); } void CTintDialog::PostNcDestroy (){ /********************************************************************** Destroys the dialog box and returns resources to the dynamic memory heap **********************************************************************/ CDialog::PostNcDestroy(); delete this; //delete this CDialog object } /////////////MyDialogs.cpp