MyColorDlgBar.cpp
上传用户:cding2008
上传日期:2007-01-03
资源大小:1812k
文件大小:19k
- /////////////////////////////////////////////////////////////////////////////
- // MyColorDlgBar.cpp : implementation file of the CMycolorDlgBar class
- //
- // ModelMagic 3D and 'glOOP' (OpenGL Object Oriented Programming library)
- // Copyright (c) Craig Fahrnbach 1997, 1999
- //
- // OpenGL is a registered trademark of Silicon Graphics
- //
- //
- // This program is provided for educational and personal use only and
- // is provided without guarantee or warrantee expressed or implied.
- //
- // Commercial use is strickly prohibited without written permission
- // from ImageWare Development.
- //
- /////////////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "ModelMagic3D.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- ////////////////////////////////////////////////////////////////////
- // CMyColorDlgBar globals
- // RECT {left, top, right, bottom };
- static RECT rectColorPaletteWnd = { 5, 5, 110, 100};
- static RECT rectGradientWnd = {112, 5, 125, 100};
- static RECT rectSliderWnd = {125, 0, 140, 105};
- static RECT rectLButtonWnd = { 5, 105, 137, 130};
- static RECT rectComboBox = { 5, 135, 137, 245};
- //static RECT rectLButtonWnd = { 5, 105, 85, 130};
- //static RECT rectRButtonWnd = { 57, 115, 137, 140};
- //static RECT rectComboBox = { 5, 145, 137, 245};
- ////////////////////////////////////////////////////////////////////
- // CMyColorDlgBar Construction/Destruction
- CMyColorDlgBar::CMyColorDlgBar()
- {
- m_pColorWnd = NULL;
- m_pLButtonWnd = NULL;
- // m_pRButtonWnd = NULL;
- m_pColorGradientWnd = NULL;
- m_pSliderCtrl = NULL;
- m_pComboBox = NULL;
- m_Color.SetColor4f(1.0f, 1.0f, 1.0f, 1.0f); // Default to White
- m_ColorRef.SetColor4f(1.0f, 1.0f, 1.0f, 1.0f);
- m_Color.m_szName = "White";
- m_iSliderMaxRange = 255;
- }
-
- CMyColorDlgBar::~CMyColorDlgBar()
- {
- }
-
-
- BOOL CMyColorDlgBar::Create( CWnd* pParentWnd,
- UINT nIDTemplate,
- UINT nStyle,
- UINT nID, BOOL bChange)
- {
- if(!CDialogBar::Create(pParentWnd,nIDTemplate,nStyle,nID))
- return FALSE;
-
- m_bChangeDockedSize = bChange;
- m_sizeFloating = m_sizeDocked = m_sizeDefault;
- return TRUE;
- }
-
- BOOL CMyColorDlgBar::Create( CWnd* pParentWnd,
- LPCTSTR lpszTemplateName,
- UINT nStyle,
- UINT nID, BOOL bChange)
- {
- if (!CDialogBar::Create( pParentWnd, lpszTemplateName,
- nStyle, nID))
- return FALSE;
-
- m_bChangeDockedSize = bChange;
- m_sizeFloating = m_sizeDocked = m_sizeDefault;
- return TRUE;
- }
-
- ////////////////////////////////////////////////////////////////////
- // Overloaded functions
- CSize CMyColorDlgBar::CalcDynamicLayout(int nLength, DWORD nMode)
- {
- // Return default if it is being docked or floated
- if ((nMode & LM_VERTDOCK) || (nMode & LM_HORZDOCK))
- {
- if (nMode & LM_STRETCH) // if not docked stretch to fit
- return CSize((nMode & LM_HORZ) ? 32767 : m_sizeDocked.cx,
- (nMode & LM_HORZ) ? m_sizeDocked.cy : 32767);
- else
- return m_sizeDocked;
- }
- if (nMode & LM_MRUWIDTH)
- return m_sizeFloating;
- // In all other cases, accept the dynamic length
- if (nMode & LM_LENGTHY)
- return CSize(m_sizeFloating.cx, (m_bChangeDockedSize) ?
- m_sizeFloating.cy = m_sizeDocked.cy = nLength :
- m_sizeFloating.cy = nLength);
- else
- return CSize((m_bChangeDockedSize) ?
- m_sizeFloating.cx = m_sizeDocked.cx = nLength :
- m_sizeFloating.cx = nLength, m_sizeFloating.cy);
- }
- BEGIN_MESSAGE_MAP(CMyColorDlgBar, CDialogBar)
- //{{AFX_MSG_MAP(CMyColorDlgBar)
- ON_WM_CREATE()
- ON_WM_PALETTECHANGED()
- ON_WM_QUERYNEWPALETTE()
- ON_WM_DESTROY()
- ON_WM_KEYDOWN()
- ON_WM_PAINT()
- ON_WM_VSCROLL()
- ON_CONTROL(CBN_DROPDOWN, IDC_COLORDLG_COMBO, OnDropdown)
- ON_CONTROL(CBN_SELCHANGE, IDC_COLORDLG_COMBO, OnSelchange)
- ON_WM_PARENTNOTIFY()
- ON_WM_TIMER()
- //}}AFX_MSG_MAP
- // USER defined messages
- ON_MESSAGE( WM_CPW_LBUTTONDOWN, OnColorPaletteLButtonDown)
- ON_MESSAGE( WM_CPW_RBUTTONDOWN, OnColorPaletteRButtonDown)
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////
- // CMyColorDlgBar methods/implementation
- void CMyColorDlgBar::PaintSelColorWnd(CWnd* pWnd, C3dColor* pColor)
- {
- if(!pWnd)
- return;
- // Get the size of color window
- RECT rect;
- pWnd->GetWindowRect(&rect);
- // Get a pointer to the windows device context
- CDC* pDC = pWnd->GetDC();
- if(pDC && pColor)
- pDC->FillSolidRect(0,
- 0,
- rect.right-rect.left,
- rect.bottom-rect.top,
- COLORREF RGB(pColor->m_fColor[0]*255,
- pColor->m_fColor[1]*255,
- pColor->m_fColor[2]*255));
- ReleaseDC(pDC);
- }
- void CMyColorDlgBar::PaintObject(C3dColor* pColor)
- {
- if(!pColor)
- return;
- // Get a pointer to our windows main frame
- CMainFrame* pMainFrame = STATIC_DOWNCAST(CMainFrame, AfxGetMainWnd());
- ASSERT_VALID(pMainFrame);
- // Get a pointer to our active view
- CMyglView* pView = (CMyglView*)pMainFrame->m_pActiveView;
- ASSERT_VALID(pView);
- // Get a pointer to our view's document
- CMyglDoc* pDoc = pView->GetDocument();
- ASSERT_VALID(pDoc);
- // Get a pointer to our document's 3dWorld
- C3dWorld* pWorld = pDoc->m_pWorld;
- ASSERT_VALID(pWorld);
- // Get a pointer to our worlds selected object
- C3dObject* pObj = pWorld->m_pSelectedObj;
-
-
- if(pObj)
- {
- // Set the objects color
- pObj->m_Color.SetColor4fv(pColor);
- // Force the object to rebuild its' display list
- pObj->m_bBuildLists = TRUE;
- }
- // Force a repaint of the active C3dWorld window
- if(pView)
- pView->InvalidateRect(NULL, FALSE);
- }
- void CMyColorDlgBar::ResetColorSlider()
- {
- int iStepsPlus;
- int iStepsMinus;
- // Bias our initial slider position based on the rgb color
- // values of our selected color
- m_iInitColorSliderPos = (int)(((m_Color.m_fColor[0]+m_Color.m_fColor[1]+m_Color.m_fColor[2])/3)*255);
- // Set the slider to our starting position
- m_pSliderCtrl->SetPos(m_iInitColorSliderPos);
- // Determine the number of incremental steps
- iStepsPlus = m_iSliderMaxRange-m_iInitColorSliderPos;
- iStepsMinus = m_iInitColorSliderPos;
- // Define our color index values
- if(iStepsPlus)
- {
- m_fRedPlus = (1-m_Color.m_fColor[0])/iStepsPlus;
- m_fGrnPlus = (1-m_Color.m_fColor[1])/iStepsPlus;
- m_fBluPlus = (1-m_Color.m_fColor[2])/iStepsPlus;
- }
- else
- {
- m_fRedPlus = 0.0f;
- m_fGrnPlus = 0.0f;
- m_fBluPlus = 0.0f;
- }
- if(iStepsMinus)
- {
- m_fRedMinus = m_Color.m_fColor[0]/iStepsMinus;
- m_fGrnMinus = m_Color.m_fColor[1]/iStepsMinus;
- m_fBluMinus = m_Color.m_fColor[2]/iStepsMinus;
- }
- else
- {
- m_fRedMinus = 0.0f;
- m_fGrnMinus = 0.0f;
- m_fBluMinus = 0.0f;
- }
- PaintRangeWnd(&m_Color, m_iInitColorSliderPos, m_iSliderMaxRange);
- }
- void CMyColorDlgBar::PaintRangeWnd(C3dColor* pColor, int iPosn, int iRange)
- {
- CDC* pDC;
- RECT rect;
- int i, x, cx;
- // Get the size of the gradient window
- m_pColorGradientWnd->GetWindowRect(&rect);
- m_pColorGradientWnd->ScreenToClient(&rect);
- // Get a pointer to the windows device context
- pDC = m_pColorGradientWnd->GetDC();
- // Calcualte a few constants for later use...
- float fWindowHeight = (float)(rect.bottom-rect.top);
- float fGradientHeight = fWindowHeight/iRange;
- cx = (int)fGradientHeight;
- if(cx<1)
- cx=1;
- // Display gradient fill for colors below the CSliderCtrl
- // position.
- for(i=0; i<iPosn; i++)
- {
- float fColorScale = (float)i/iPosn;
- float gradientX = (fWindowHeight/iRange)*i;
- x = (int)gradientX;
- pDC->FillSolidRect(0, x,
- (rect.right-rect.left), cx,
- COLORREF RGB(pColor->m_fColor[0]*fColorScale*255,
- pColor->m_fColor[1]*fColorScale*255,
- pColor->m_fColor[2]*fColorScale*255));
- }
- // Display gradient fill for colors above the CSliderCtrl
- // position.
- for(i=iPosn; i<=iRange; i++)
- {
- float gradientX = (fWindowHeight/iRange)*i;
- x = (int)gradientX;
- float red = pColor->m_fColor[0]+(m_fRedPlus*(i-iPosn));
- float grn = pColor->m_fColor[1]+(m_fGrnPlus*(i-iPosn));
- float blu = pColor->m_fColor[2]+(m_fBluPlus*(i-iPosn));
- pDC->FillSolidRect(0, x,
- (rect.right-rect.left), cx,
- COLORREF RGB(red*255, grn*255, blu*255));
- }
- ReleaseDC(pDC);
- }
- /////////////////////////////////////////////////////////////////////
- // CMyColorDlgBar message handlers
- int CMyColorDlgBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
- if (CDialogBar::OnCreate(lpCreateStruct) == -1)
- return -1;
- // Get the last setting of the window position from
- // the ini file and restore
- WINDOWPLACEMENT wp;
- if (ReadWindowPlacement(&wp, "Settings", "ColorDlgWndPos"))
- SetWindowPlacement(&wp);
- // Initially hide the Dialog bar until all windows have been
- // positioned.
- ShowWindow(SW_HIDE);
- // Create a font for our DialogBar and our combo box
- m_hFont = ::CreateFont(-8, // nHeight
- 0, // nWidth
- 0, // nEscapement
- 0, // nOrientation
- FW_NORMAL, // nWeight
- FALSE, // bItalic
- FALSE, // bUnderline
- 0, // cStrikeOut
- ANSI_CHARSET, // nCharSet
- OUT_DEFAULT_PRECIS, // nOutPrecision
- CLIP_DEFAULT_PRECIS,// nClipPrecision
- DEFAULT_QUALITY, // nQuality
- DEFAULT_PITCH | // nPitchAndFamily
- FF_SWISS,
- "MS Sans Serif"); // lpszFacename
- // Set the child window font
- SendMessage(WM_SETFONT, (WPARAM)m_hFont, 0L);
- // Create the Color Palette window
- m_pColorWnd = new CMyColorPaletteWnd();
- if (!m_pColorWnd->Create(NULL, // dwExtStyle
- NULL, // Class Name
- "Palette Cube", // Window Name
- WS_CHILD | WS_VISIBLE | // dwStyle
- WS_DLGFRAME,
- rectColorPaletteWnd, // rect
- this, // CWnd* pParentWnd
- 0, // UINT nID
- 0)) { // pContext
- delete m_pColorWnd;
- m_pColorWnd = NULL;
- return -1;
- }
- // Create the Left mouse color window
- m_pLButtonWnd = new CWnd();
- if (!m_pLButtonWnd->Create(NULL, // lpszClassName
- NULL, // lpszWindowName
- WS_CHILD | WS_VISIBLE | WS_DLGFRAME | WS_CLIPSIBLINGS, //dwStyle
- rectLButtonWnd, // rect
- this, // CWnd* pParentWnd
- IDC_COLORDLG_LBUTTONWND,// UINT nID
- 0)) { // pContext
- delete m_pLButtonWnd;
- m_pLButtonWnd = NULL;
- return -1;
- }
- /*
- // Create the Right mouse color window
- m_pRButtonWnd = new CWnd();
- if (!m_pRButtonWnd->Create(NULL, // lpszClassName
- NULL, // lpszWindowName
- WS_CHILD | WS_VISIBLE | WS_DLGFRAME | WS_CLIPSIBLINGS, //dwStyle
- rectRButtonWnd, // rect
- this, // CWnd* pParentWnd
- IDC_COLORDLG_RBUTTONWND,// UINT nID
- 0)) { // pContext
- delete m_pRButtonWnd;
- m_pRButtonWnd = NULL;
- return -1;
- }
- */
- // Create the color gradient window
- m_pColorGradientWnd = new CWnd();
- if (!m_pColorGradientWnd->Create(NULL, // lpszClassName
- NULL, // lpszWindowName
- WS_CHILD | WS_VISIBLE | WS_DLGFRAME | WS_CLIPSIBLINGS, //dwStyle
- rectGradientWnd, // rect
- this, // CWnd* pParentWnd
- NULL, //IDC_COLORDLG_RBUTTONWND,// UINT nID
- 0)) { // pContext
- delete m_pColorGradientWnd;
- m_pColorGradientWnd = NULL;
- return -1;
- }
- // Create our color gradient slider control
- m_pSliderCtrl = new CSliderCtrl();
- if (!m_pSliderCtrl->Create(WS_CHILD | WS_VISIBLE | TBS_VERT | TBS_NOTICKS | TBS_LEFT, //dwStyle
- rectSliderWnd, // rect
- this, // CWnd* pParentWnd
- IDC_COLORDLG_SLIDER)) { // UINT nID
- delete m_pSliderCtrl;
- m_pSliderCtrl = NULL;
- return -1;
- }
- m_pSliderCtrl->SetRange(0, m_iSliderMaxRange, TRUE);
- // Create our color ComboBox
- m_pComboBox = new CComboBox();
- if (!m_pComboBox->Create(WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST, //dwStyle
- rectComboBox, // rect
- this, // CWnd* pParentWnd
- IDC_COLORDLG_COMBO)) { // UINT nID
- delete m_pComboBox;
- m_pComboBox = NULL;
- return -1;
- }
- // Set the combo box font
- m_pComboBox->SendMessage(WM_SETFONT, (WPARAM)m_hFont, 0L);
- // Start a timer, which when called will fill the combo box. We need a slight
- // delay while the application creates a default world..
- SetTimer( 0, 900, NULL);
- return 0;
- }
- void CMyColorDlgBar::OnTimer(UINT nIDEvent)
- {
- // Stop the timer
- KillTimer(0);
-
- // Fill the combo box
- OnDropdown();
- CDialogBar::OnTimer(nIDEvent);
- }
- void CMyColorDlgBar::OnPaint()
- {
- CPaintDC dc(this); // device context for painting
-
- PaintSelColorWnd(m_pLButtonWnd, &m_Color);
- ResetColorSlider();
- // Do not call CDialogBar::OnPaint() for painting messages
- }
- void CMyColorDlgBar::OnPaletteChanged(CWnd* pFocusWnd)
- {
- // Route message to CWnd derived class
- // Notify the Color Palette window of a palette change...
- if (m_pColorWnd) {
- // OnPaletteChanged is not public, so send a message.
- m_pColorWnd->SendMessage(WM_PALETTECHANGED,
- (WPARAM)(pFocusWnd->GetSafeHwnd()),
- (LPARAM)0);
- }
- }
- BOOL CMyColorDlgBar::OnQueryNewPalette()
- {
- // Route message to CWnd derived class
- // Notify the Color Palette window of a palette change...
- if (m_pColorWnd) {
- // OnPaletteChanged is not public, so send a message.
- m_pColorWnd->SendMessage(WM_QUERYNEWPALETTE,
- (WPARAM)0,
- (LPARAM)0);
- }
- return FALSE;
- }
- void CMyColorDlgBar::OnDestroy()
- {
- CDialogBar::OnDestroy();
-
- // Save the state of our CDialogBar derived class window
- WINDOWPLACEMENT wp;
- wp.length = sizeof wp;
- if (GetWindowPlacement(&wp))
- {
- wp.flags = 0;
- if (IsZoomed())
- wp.flags |= WPF_RESTORETOMAXIMIZED;
- // and write it to the .INI file
- WriteWindowPlacement(&wp, "Settings", "ColorDlgWndPos");
- }
- if(m_pColorWnd)
- {
- // Destroy the window and delete the class
- m_pColorWnd->DestroyWindow();
- delete m_pColorWnd;
- }
- /*
- if(m_pRButtonWnd)
- {
- // Destroy the right mouse color window and
- // delete the class
- m_pRButtonWnd->DestroyWindow();
- delete m_pRButtonWnd;
- }
- */
- if(m_pLButtonWnd)
- {
- // Destroy the left mouse color window and
- // delete the class
- m_pLButtonWnd->DestroyWindow();
- delete m_pLButtonWnd;
- }
- if(m_pColorGradientWnd)
- {
- // Destroy the color range window and
- // delete the class
- m_pColorGradientWnd->DestroyWindow();
- delete m_pColorGradientWnd;
- }
- if(m_pSliderCtrl)
- {
- // Destroy the left mouse color window and
- // delete the class
- m_pSliderCtrl->DestroyWindow();
- delete m_pSliderCtrl;
- }
- if(m_pComboBox)
- {
- // Destroy the combobox window and
- // delete the class
- m_pComboBox->DestroyWindow();
- delete m_pComboBox;
- }
- if(m_hFont)
- // Delete the font object
- DeleteObject(m_hFont);
- }
- void CMyColorDlgBar::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
- {
- // Route message to CMyColorPaletteWnd derived CWnd class
- if (m_pColorWnd) {
- // OnKeyDown is not public, so send a message.
- m_pColorWnd->SendMessage(WM_KEYDOWN,
- (WPARAM)nChar,
- (LPARAM)nFlags<<16 | nRepCnt);
- }
-
-
- CDialogBar::OnKeyDown(nChar, nRepCnt, nFlags);
- }
- long CMyColorDlgBar::OnColorPaletteLButtonDown(WPARAM wParam, LPARAM lParam)
- {
- m_Color.m_fColor[0] = m_pColorWnd->m_fRed;
- m_Color.m_fColor[1] = m_pColorWnd->m_fGrn;
- m_Color.m_fColor[2] = m_pColorWnd->m_fBlu;
- m_ColorRef.m_fColor[0] = m_pColorWnd->m_fRed;
- m_ColorRef.m_fColor[1] = m_pColorWnd->m_fGrn;
- m_ColorRef.m_fColor[2] = m_pColorWnd->m_fBlu;
- PaintSelColorWnd(m_pLButtonWnd, &m_Color);
- // DisplayRGBValues();
- ResetColorSlider();
- return 0L;
- }
- long CMyColorDlgBar::OnColorPaletteRButtonDown(WPARAM wParam, LPARAM lParam)
- {
- // PaintSelColorWnd(m_pRButtonWnd, &m_Color);
- return 0L;
- }
- void CMyColorDlgBar::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
- {
- // Note: MFC maps vertically oriented CSliderCtrl to WM_VSCROLL
- // and horizontally oriented CSliderCtrl to WM_HSCROLL
- int posn, delta;
- // Get the position of our color slider and calculate the
- // difference in position to our initial position
- posn = m_pSliderCtrl->GetPos();
- delta = posn - m_iInitColorSliderPos;
- if(delta > 0)
- {
- m_Color.m_fColor[0] = m_ColorRef.m_fColor[0]+(m_fRedPlus*delta);
- m_Color.m_fColor[1] = m_ColorRef.m_fColor[1]+(m_fGrnPlus*delta);
- m_Color.m_fColor[2] = m_ColorRef.m_fColor[2]+(m_fBluPlus*delta);
- }
- else
- {
- m_Color.m_fColor[0] = m_ColorRef.m_fColor[0]+(m_fRedMinus*delta);
- m_Color.m_fColor[1] = m_ColorRef.m_fColor[1]+(m_fGrnMinus*delta);
- m_Color.m_fColor[2] = m_ColorRef.m_fColor[2]+(m_fBluMinus*delta);
- }
- // Limit check our color values
- if( m_Color.m_fColor[0] > 1.0f) // red
- m_Color.m_fColor[0] = 1.0f;
- if( m_Color.m_fColor[0] < 0.0f)
- m_Color.m_fColor[0] = 0.0f;
- if( m_Color.m_fColor[1] > 1.0f) // green
- m_Color.m_fColor[1] = 1.0f;
- if( m_Color.m_fColor[1] < 0.0f)
- m_Color.m_fColor[1] = 0.0f;
- if( m_Color.m_fColor[2] > 1.0f) // blue
- m_Color.m_fColor[2] = 1.0f;
- if( m_Color.m_fColor[2] < 0.0f)
- m_Color.m_fColor[2] = 0.0f;
-
- PaintSelColorWnd(m_pLButtonWnd, &m_Color);
- // DisplayRGBValues();
-
- CDialogBar::OnVScroll(nSBCode, nPos, pScrollBar);
- }
- void CMyColorDlgBar::OnDropdown()
- {
- // Get a pointer to our windows main frame
- CMainFrame* pMainFrame = STATIC_DOWNCAST(CMainFrame, AfxGetMainWnd());
- ASSERT_VALID(pMainFrame);
- // Get a pointer to our active view
- CMyglView* pView = (CMyglView*)pMainFrame->m_pActiveView;
- ASSERT_VALID(pView);
- // Get a pointer to our view's document
- CMyglDoc* pDoc = pView->GetDocument();
- ASSERT_VALID(pDoc);
- // Get a pointer to our document's 3dWorld
- C3dWorld* pWorld = pDoc->m_pWorld;
- ASSERT_VALID(pWorld);
- // Get a pointer to our color list
- C3dColorList* pList = &pWorld->m_ColorList;
- // Fill the color ComboBox listbox
- if(pList && m_pComboBox)
- pList->LoadComboBox(m_pComboBox, &m_Color);
- }
- void CMyColorDlgBar::OnSelchange()
- {
- int select = m_pComboBox->GetCurSel();
- if(select == CB_ERR)
- return;
- C3dColor* pColor = (C3dColor*)m_pComboBox->GetItemData(select);
- if(pColor)
- {
- m_Color.m_fColor[0] = pColor->m_fColor[0];
- m_Color.m_fColor[1] = pColor->m_fColor[1];
- m_Color.m_fColor[2] = pColor->m_fColor[2];
- m_ColorRef.m_fColor[0] = pColor->m_fColor[0];
- m_ColorRef.m_fColor[1] = pColor->m_fColor[1];
- m_ColorRef.m_fColor[2] = pColor->m_fColor[2];
- PaintSelColorWnd(m_pLButtonWnd, &m_Color);
-
- // DisplayRGBValues();
- ResetColorSlider();
- }
- }
- void CMyColorDlgBar::OnParentNotify(UINT message, LPARAM lParam)
- {
- CDialogBar::OnParentNotify(message, lParam);
- if(message == WM_LBUTTONDOWN)
- {
- CPoint point;
- point.x = lParam & 0x00FF; //mask
- point.y = lParam>>16;
- if(point.x > rectLButtonWnd.left &&
- point.x < rectLButtonWnd.right &&
- point.y > rectLButtonWnd.top &&
- point.y < rectLButtonWnd.bottom)
- {
- PaintObject(&m_Color);
- }
- }
- if(message == WM_PAINT)
- {
- int temp = 0;
- }
- }