IDR_MENU_POPUP option [Color] in VS2010 from VC++ 6.0
Requesting advice for IDR_MENU_POPUP option [Color] in VS2010 implementation from VC++ 6.0
Hello programmers; my username is Falconcpp and this is my subject:
Creating a Popup Color Menu in Visual Studio 2010 Ultimate in a Project of C++ Language / Templates Visual C++ MFC / MFC Application.
Background:
I saw the 4 tutorial videos about MatrixGrid by thomastom99 on the internet site http://vcplusplustutorials.ktsinfote...ogramming.aspx
(Reference for internet search: VC++ GUI Tutorials using MFC | VC++ IN)
These 4 videos are about creating a Matrix Grid of 8 rows and 8 columns, which 64 cells you can eventually paint in different colors and add text within the cells.
This original MatrixGrid program is made in VC++ 6.0 and using MFC. You can download the source code and give it a try.
Situation:
I’m a beginner in both C++ and MFC.
By analyzing the 4 MatrixGrid videos, I wrote 445 blocks of instructions to follow (step by step) in order to reproduce the MatrixGrid creation.
So far, I´m already on the step 344 of 445, and my project is running OK. Nevertheless, I’m stuck in the part where the Popup Color Menu should allow me to see the colors palette in order to customize new colors for the 64 cells within the Matrix Grid.
Request:
Therefore, my request to all of you -especially for those that are experts about VS2010 Ultimate, C++ and MFC, and that also have knowledge about VC++ 6.0- is to provide me with some advice in order to be able to see the colors palette after clicking with the Mouse Button on the option [Color] of my submenu named (IDR_MENU_POPUP).
Special considerations:
The original 4 MatrixGrid videos project were made in VC++ 6.0
And my own program which I’m developing is being made in VS2010 Ultimate in a Project of C++ Language / Templates: Visual C++ MFC / MFC Application / Visual Style and Colors: Visual Studio 2008.
So I’ve been having lots of adjustments to implement already due to the difference of versions and yet so far the project is running.
Visual Display:
In my own program, after I click [Debug] and [Start without debugging] Compilation is OK and the Main Frame displays the following drawing in the North West corner of the screen:
Zoom: Then -within the screen- I can resize the whole Matrix Grid to 25%, 50%, 100% or 200% with the [Zoom] button that I created on the top toolbar of the Main Frame.
Paint: Then I can paint each one of the 64 cells: with 1 click of the Left Mouse Button (LMB) 1 cell becomes painted in Red color; Next, if 1 cell is painted in Red color already then with 1 more click of the LMB this cell becomes painted in Green color; Next, if 1 cell is painted in Green color already then with 1 more click of the LMB this cell becomes painted in Blue color; Next, if 1 cell is painted in Blue color already then with 1 more click of the LMB this cell becomes painted in Black color; Finally, if 1 cell is painted in Black color already then with 1 more click of the LMB this cell becomes painted in White color (so the cell goes back to its original color).
Popup Menu: Then, if I paint 1 cell in Red color for example, and after this, I click on this Red cell with the Right Mouse Button (RMB) -that is, the secondary mouse button- then my submenu appears (named IDR_MENU_POPUP) and it displays the following 4 options:
[ Cut ]
[ Copy ]
[ Paste ]
-----------
[ Color ]
The Problem: If I place the cursor on the option [Color] then this submenu button becomes highlighted in soft blue color, however, the Problem is that if I click on the option [Color] either with the LMB or the RMB then the Colors Palette DOESN’T APPEAR AT ALL; thus I can’t customize a new color for the cell. And at the present stage this should be possible already.
And this is why hereby I am requesting your expert advice.
Source Code:
I will display the source code related exclusively to my submenu IDR_MENU_POPUP and after this, also I will display the file entitled “MatrixGrid.clw” that appears in the source code of the videos example and that doesn’t appear in my own program, since the Class Wizard is a special class in the version VC++ 6.0 but in my own Version VS2010 it is just a submenu option of the top toolbar [Project] and then [Class Wizard] . . . and I believe that this has something to do with the present Problem.
The comments before the code are my descriptions of the code reference:
My project regarding OnPopupColor() in the file MatrixGridView.cpp (Definition)
My project regarding OnContextMenu(CWnd* pWnd, CPoint point)
This is how this member function was created in the file MatrixGridView.cpp (Definition) by my program after using the option [Project] and [Class Wizard]
This is how I modified this function by replacing the green comment /* pWnd */ with the text pWnd and by erasing the 3 lines about #ifndef and theApp.GetContextMenuManager . . . and its respective #endif And then I added the code according to the video’s example source code:
This is the file MatrixGridDoc.h after adding code about COLORREF m_cColor;
class CMatrixGridDoc : public CDocument
{
protected: // create from serialization only
CMatrixGridDoc();
DECLARE_DYNCREATE(CMatrixGridDoc)
// Attributes
public:
COLORREF m_cColor;
CCell m_arrCellArray[500][500];
int m_iYoffset;
int m_iXoffset;
int m_iWidth;
int m_iHeight;
int m_iColoums;
int m_iRow;
Etc...
};
This is the file MatrixGrid.clw that appears in the example’s videos source code (but it doesn’t appear in my own program)
; CLW file contains information for the MFC ClassWizard
Final comment and request:
Expert programmers, I will appreciate your kind advice in order to allow the option [Color] of my submenu named IDR_MENU_POPUP to provide the Colors Palette in order to customize a new color for the cells within the Matrix Grid. Thank you very much.
Falconcpp
Re: IDR_MENU_POPUP option [Color] in VS2010 from VC++ 6.0
Thread's 2nd edition (using the wrap code tags around selected text and also including one attachment, a PDF file):
Requesting advice for IDR_MENU_POPUP option [Color] in VS2010 implementation from VC++ 6.0
Hello programmers; my username is Falconcpp and this is my subject:
Creating a Popup Color Menu in Visual Studio 2010 Ultimate in a Project of C++ Language / Templates Visual C++ MFC / MFC Application.
Background:
I saw the 4 tutorial videos about MatrixGrid by thomastom99 on the internet site http://vcplusplustutorials.ktsinfote...ogramming.aspx
(Reference for internet search: VC++ GUI Tutorials using MFC | VC++ IN)
These 4 videos are about creating a Matrix Grid of 8 rows and 8 columns, which 64 cells you can eventually paint in different colors and add text within the cells.
This original MatrixGrid program is made in VC++ 6.0 and using MFC. You can download the source code and give it a try.
Situation:
I’m a beginner in both C++ and MFC.
By analyzing the 4 MatrixGrid videos, I wrote 445 blocks of instructions to follow (step by step) in order to reproduce the MatrixGrid creation.
So far, I´m already on the step 344 of 445, and my project is running OK. Nevertheless, I’m stuck in the part where the Popup Color Menu should allow me to see the colors palette in order to customize new colors for the 64 cells within the Matrix Grid.
Request:
Therefore, my request to all of you -especially for those that are experts about VS2010 Ultimate, C++ and MFC, and that also have knowledge about VC++ 6.0- is to provide me with some advice in order to be able to see the colors palette after clicking with the Mouse Button on the option [Color] of my submenu named (IDR_MENU_POPUP).
Special considerations:
The original 4 MatrixGrid videos project were made in VC++ 6.0
And my own program which I’m developing is being made in VS2010 Ultimate in a Project of C++ Language / Templates: Visual C++ MFC / MFC Application / Visual Style and Colors: Visual Studio 2008.
So I’ve been having lots of adjustments to implement already due to the difference of versions and yet so far the project is running.
Visual Display:
In my own program, after I click [Debug] and [Start without debugging] Compilation is OK and the Main Frame displays the following drawing in the North West corner of the screen:
Zoom: Then -within the screen- I can resize the whole Matrix Grid to 25%, 50%, 100% or 200% with the [Zoom] button that I created on the top toolbar of the Main Frame.
Paint: Then I can paint each one of the 64 cells: with 1 click of the Left Mouse Button (LMB) 1 cell becomes painted in Red color; Next, if 1 cell is painted in Red color already then with 1 more click of the LMB this cell becomes painted in Green color; Next, if 1 cell is painted in Green color already then with 1 more click of the LMB this cell becomes painted in Blue color; Next, if 1 cell is painted in Blue color already then with 1 more click of the LMB this cell becomes painted in Black color; Finally, if 1 cell is painted in Black color already then with 1 more click of the LMB this cell becomes painted in White color (so the cell goes back to its original color).
Popup Menu: Then, if I paint 1 cell in Red color for example, and after this, I click on this Red cell with the Right Mouse Button (RMB) -that is, the secondary mouse button- then my submenu appears (named IDR_MENU_POPUP) and it displays the following 4 options:
[ Cut ]
[ Copy ]
[ Paste ]
-----------
[ Color ]
The Problem: If I place the cursor on the option [Color] then this submenu button becomes highlighted in soft blue color, however, the Problem is that if I click on the option [Color] either with the LMB or the RMB then the Colors Palette DOESN’T APPEAR AT ALL; thus I can’t customize a new color for the cell. And at the present stage this should be possible already.
And this is why hereby I am requesting your expert advice.
Source Code:
I will display the source code related exclusively to my submenu IDR_MENU_POPUP and after this, also I will display the file entitled “MatrixGrid.clw” that appears in the source code of the videos example and that doesn’t appear in my own program, since the Class Wizard is a special class in the version VC++ 6.0 but in my own Version VS2010 it is just a submenu option of the top toolbar [Project] and then [Class Wizard] . . . and I believe that this has something to do with the present Problem.
The comments before the code are my descriptions of the code reference:
My project regarding OnPopupColor() in the file MatrixGridView.cpp (Definition)
My project regarding OnContextMenu(CWnd* pWnd, CPoint point)
This is how this member function was created in the file MatrixGridView.cpp (Definition) by my program after using the option [Project] and [Class Wizard]
This is how I modified this function by replacing the green comment /* pWnd */ with the text pWnd and by erasing the 3 lines about #ifndef and theApp.GetContextMenuManager . . . and its respective #endif And then I added the code according to the video’s example source code:
This is the file MatrixGridDoc.h after adding code about COLORREF m_cColor;
Code:
class CMatrixGridDoc : public CDocument
{
protected: // create from serialization only
CMatrixGridDoc();
DECLARE_DYNCREATE(CMatrixGridDoc)
// Attributes
public:
COLORREF m_cColor;
CCell m_arrCellArray[500][500];
int m_iYoffset;
int m_iXoffset;
int m_iWidth;
int m_iHeight;
int m_iColoums;
int m_iRow;
Etc...
};
This is the file MatrixGrid.clw that appears in the example’s videos source code (but it doesn’t appear in my own program)
Final comment and request:
Expert programmers, I will appreciate your kind advice in order to allow the option [Color] of my submenu named IDR_MENU_POPUP to provide the Colors Palette in order to customize a new color for the cells within the Matrix Grid. Thank you very much.
Falconcpp
Re: IDR_MENU_POPUP option [Color] in VS2010 from VC++ 6.0
Paul McKenzie,
This time I posted the thread properly and I included one attachment for a better view (a PDF file).
Thank you for your reply. However, please note that I added one correction regarding the two code lines:
// DeleteWindow();
ScreenToClient(&point);
Later on the programmer of the example videos will invert these two lines to:
DeleteWindow();
// ScreenToClient(&point);
However, at the present stage of the program these two code lines must remain like this:
// DeleteWindow();
ScreenToClient(&point);
So the program runs OK; however, the Color option still won´t allow the colors' palette to appear. And I apologize because I had to add this correction, however this happened because later on the programmer will invert the two code lines. If you would take a look at the 4 MatrixGrid videos by thomastom99 on the internet site http://vcplusplustutorials.ktsinfote...ogramming.aspx
Then my thread would make better sense for your experience. In the meantime I appreciate your concern.
Falconcpp.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.