Visual C++ :: Display Anti-aliased PARGB Bitmaps In A Menu

Dec 2, 2012

I'm attaching a project that demonstrates the issue. I need to display a context menu with anti-aliased bitmaps. I wrote my own method to convert an icon into a bitmap (see the CreatePARGBBitmapFromIcon() method) but the resulting bitmap seems to lose all anti-aliasing when displayed in a menu. What is interesting is that the same bitmap is displayed without any issues in a CStatic 'stPic1' control (the one in the middle.) The visual artifact also seems to be different on different OS. Take a look at the screenshots attached.

View 1 Replies


ADVERTISEMENT

Visual C++ :: How To Append Two Bitmaps

Nov 28, 2013

Is there a way to append two bitmaps, one of them in a top of another one ? I mean arrange them like tile horizontally.

View 1 Replies View Related

Visual C++ :: Direct2D - Auto-resizing Bitmaps

Feb 9, 2013

Apparently the default behavior with Direct2D when rendering is to scale everything I render based on the size of the render target/window. How can I prevent this? I want to decide for myself when to scale the image, regardless of the size of the window.

View 1 Replies View Related

Visual C++ :: Enable / Disable Menu Item 2 In OnUpdate Handler Of Menu Item 1?

Sep 15, 2014

I have two menu items. When item 1 is disabled, I want item 2 to be disabled as well. In the OnUpdate handler of menu item 1, I have tried to use "t_pMenu = pCmdUI->m_pMenu;", "t_pMenu = pCmdUI->m_pSubMenu;" and "t_pMenu = pCmdUI->m_pParentMenu;" but I always get NULL t_pMenu. How can I achieve this purpose?

Code:
void CDummyView::OnUpdateMenuItem1(CCmdUI* pCmdUI)
{
if(m_bShowMenuItem1) {
pCmdUI->Enable(TRUE);

[Code]....

View 14 Replies View Related

C++ :: Simple Program To Display Menu With Options

Mar 23, 2014

I decided to create a simple program to display a menu with options, while that is easy enough I had some difficulty when selecting an option that has options inside which also has an option again. While I had many issues in the past I'm finally finished with it and it works fine, but being new to programming and not knowing various other methods available.

Code:
//:::::::::::::::::::::Simple Menu Program::::::::::::::::
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

#include <iostream>
#include <string>

//function prototypes

[Code] .....

View 1 Replies View Related

C/C++ :: Menu Won't Show Display Entire Price?

Apr 15, 2014

I am working on a drink machine simulation. I have a text file that holds the prices, names and inventory. My problem is It won't let me set my prices at 1.00 or higher. Ex: I set the price to 1.50 in the text file then when it reads the info and stores the price it only stores .50 instead of 1.50.

my code:

#include <iostream>
#include <string>
#include <fstream>

[Code].....

View 1 Replies View Related

C/C++ :: Menu Won't Show Display Entire Price

Apr 15, 2014

I am working on a drink machine simulation. I have a text file that holds the prices, names and inventory. My problem is It won't let me set my prices at 1.00 or higher. Ex: I set the price to 1.50 in the text file then when it reads the info and stores the price it only stores .50 instead of 1.50.

textfile looks like this:
Apple Juice 1.50 20
Mango Juice 1.50 20
Sprite Mix 1.90 20
Coca Cola 1.90 20

[Code].....

View 2 Replies View Related

C++ :: Menu Program Broken Down Into Series Of Calls To Function For Each Of Menu Items

Aug 19, 2013

I am trying to write a menu program that will be broken down into a series of calls to function for each of the menu items. Two of the menu items will be simple programs which I wrote.

I want two of the functions to run one of the two programs I am trying to include as items in the menu.

So far I am only familiar with variables, loops, if statements, and I just learned how to write functions.

The problem I am have is that I don't quite understand how to write a function that will run one of the two programs. Also I am having a hard time writing the program in away that would allow the user to select the menu items.

View 2 Replies View Related

C :: Program Based On Menu System - Option To Go Back To A Previous Menu

Apr 7, 2014

I'm creating a program that is based on a menu system. Basically each menu is its own user-defined function. The problem is at each menu you can input 'b' to go to the previous menu. I just have it call the function of that menu.

However, do the functions need to complete themselves eventually? If I just keep calling functions will I just keep going further and further deeper into ever running functions?

If so how do I avoid this and yet keep the option to go back to a previous menu/function?

View 2 Replies View Related

Visual C++ :: Lag When Clicking MFC File Menu

Jan 9, 2014

I am developing a CFormView MFC app. When I go to click something on the menu, it takes awhile before the event happens. The project is build optimized in release mode. I have 3 additional threads and I thought they might be blocking the internal MFC framework stuff, but I use the Sleep() call in each thread to yield to the MFC main app.

View 7 Replies View Related

Visual C++ :: How To Show File Menu

Mar 14, 2013

I have an MDI application using different menus depending on the current document template in use.

I need to show the top-level File Menu from the IDR_MAINFRAME window when a command is sent from the active document.

I would like to application to deactivate the active child window and then show the File menu as if the alt-F key was pressed from the keyboard.

I have tried CMenu *pMenu=AfxGetMainWnd()->GetMenu();

but this does not display the menu at all.

View 2 Replies View Related

Visual C++ :: How To Reposition Menu Bar For Dialog Box

Dec 23, 2013

Normally, menu bar resides below the title bar. See attachment MenuBarOriginal.JPG

Is there a way that we can position the menu bar? For example,place it on the side or anywhere on the dialog box?

MenuBarModified.JPG is some sample of menu bar positions that I want to place.

I want to do this on a dialog box.

View 6 Replies View Related

Visual C++ :: Menu Item Separator

Aug 6, 2014

I'm using this tutorial for making an owner draw menu. [URL] ...

When I go into the .rc file and remove all of the MENUITEM SEPARATORs all the menu options are squished to the left of the menu as in the screenshot. As long as there is just one MENU SEPARATOR anywhere the menu is fine. If I could make the application without MENU SEPARATORs that would be awesome.

View 7 Replies View Related

Visual C++ :: How To Modify File Menu Width

May 15, 2013

I derived a class from CRecentFileList in order to set the number of displayed chars for MRU.

The problem is that if I open the app with 256 set for this number (it is read from .ini file) the display is correct. But after I change it to 10 for e.g., File menu width remains unchanged altghough MRU are correctly displayed on 10 (or at least file name lenghts) chars.

how can I tell to the menu to shrink to actual width?

View 10 Replies View Related

Visual C++ :: Change Menu Bar Font Size In Mainframe

Jul 30, 2014

Can change the menu bar font size in CMainFrame::OnCreate()? Here's what I have:

Code:

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) {
CRect rect;
GetClientRect(&rect);
if (CFrameWnd::OnCreate(lpCreateStruct) == -1) {
return -1;

[Code] ....

The line "m_wndToolBar.SetFont(&m_font);" does nothing.

View 2 Replies View Related

Visual C++ :: MFC - How To Change Font Of String With Menu Button

Dec 17, 2012

I want create menu button to change font of CString displyed in main window. We can see string "SAMPLE",and when i press menu button that i created i want to string "SAMPLE" to display with different font,i already created CFont object and added italic style with CreateFont;

This is my menu function:and CString m_text and CFont font1 are declared in FesbDoc.h

ON_COMMAND(ID_EDIT_FONT, &CFesbView::OnEditFont)
void CFesbView::OnEditFont() {
CFesbDoc* pDoc = GetDocument();
::::WHAT TO ADD HERE:::::::
Invalidate();
}

View 5 Replies View Related

Visual C++ :: How To Modify System Menu To Execute A Function

Feb 11, 2013

I wish to add the item 'Website' to an MFC Dialog app System Menu so that it can activate the following method:

Code:
void CMyDlg::OnWebpage()
{
ShellExecute( NULL, NULL, _T("[URL]..."), NULL, NULL, 0 );
}// OnWebpage()
I have tried this:

Code:

#define IDM_WEBSITE (WM_USER + 101)
//..
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
pSysMenu->AppendMenuW(MF_STRING, IDM_WEBSITE, _T("Website"));
}

[Code]...

The code compiles without error but and the 'website' item appears on the System Menu but it doesnt do anything.

I've inspected the following but don't really understand how it works and it seems to me there should be a simpler way to accomplish my end.

Modifying the System Menu By John Simmons 26 Jan 2007 [URL]....

View 8 Replies View Related

Visual C++ :: Menu Item To Explore Current Path

Feb 21, 2015

I quite often use an ide written in assembler: RadAsm3[URL] .....

It has a menu item to explore current path. I have used other ide's that have a similar feature but:

The one in RadAsm3 will activate a current Explorer window if the current path is the same as the one requested.
All others open a new Explorer window.

I would like to implement the RadAsm3 approach using Visual Studio 2013 Community c++ as my host compiler for testing.

I tried to get the title of current windows but it appears ShellExecute "explore" does not produce a conventional window???

View 1 Replies View Related

Visual C++ :: SetTimer / OnTimer Causes File Menu To Flicker

Nov 26, 2012

I have a (large) application that works perfectly under XP. When I run it under Windows 7 the "File Edit View..." menu in my application flickers when everything is otherwise idle.

I have traced this down to SetTimer and its associated OnTimer function. OnTimer usually does nothing, so I have commented out everything leaving this:

Code:
void MyView::OnTimer(UINT nIDEvent) { }

I have also changed the SetTimer call to give one tick every five seconds.

I now see the same behaviour: the File menu is very briefly greyed-out every five seconds, leading to the flicker. Nothing else in the window is exhibiting this flicker.

So, I have a call to a null function every five seconds that manages to affect a menu.

what may be causing this?

View 12 Replies View Related

C/C++ :: Creating A Menu That Will Return The Menu After A Selection

Apr 7, 2014

This is what I have so far, it gives me a nice menu to select from and it all works but after I make a selection it closes the program. I tried to return to it but it won't work for me

#include <stdio.h>
int main() {
int choice;
int deposit;
int balance = 500; {
printf(" CHOOSE FROM THE FOLLOWING

[code]....

View 14 Replies View Related

Visual C++ :: Member Function - Add Vertical Colour Text In Popup Menu

Jun 4, 2013

I was reading a c++ code written in embarcadero ide to add vertical colour text in popup menu.

While reading the code, I had seen following instructions.

private:

Code:
void __fastcall ExpandMenuItemWidth(TObject *Sender, TCanvas *ACanvas,int &Width, int &Height);

Code:
void __fastcall DrawNewItem(TObject *Sender, TCanvas *ACanvas, const TRect &ARect, bool Selected);

The above two methods used in the code like below:

Code:
PopupMenu1->Items->Items[i]->OnMeasureItem = ExpandMenuItemWidth;
PopupMenu1->Items->Items[i]->OnDrawItem = DrawNewItem;

What is happening when we are using member function without parameters like above?

I found above code at: [URL] ....

View 2 Replies View Related

Visual C++ :: Tool Tips Not Showing - Toolbar Menu Items Disabled / Inactive

Jan 8, 2014

My problem is ToolTips are not shown if any of the tool-bar menu items is disabled/inactive.

They are shown when all tool bar menus are active/enabled.

I am using TTS_ALWAYSTIP while creating Tool-Bar.

What to do to enable/display tool-tips always.

View 5 Replies View Related

Visual C++ :: Display Hex In Edit Box?

Sep 24, 2013

I'm trying to take a value from an edit box and display it in the edit box as hex. I'm using this code:

CString buffer;
int intbuf;
m_edit[5]->GetWindowTextA(buffer);
intbuf = atoi(buffer);
buffer.Format("%02X", intbuf);
m_edit[5]->SetWindowTextA(buffer);

If I include the last line of code here I get a stack overflow error. If I don't include it, I can run through the debugger and the buffer CString is converted to hex just like I want, I just can't display it because I get that error.

View 4 Replies View Related

Visual C++ :: Display A Monthly Calendar?

Dec 5, 2012

I need to write a function that displays the days of a specified month. I have been looking for sample code but haven't had much luck. Here are the guidelines for the function:

Write a void function named displayCalendarDays. This function is passed two input parameters. The first parameter is an int that represents the start day. Start days are numbered from 0 to 6 with 0 representing Sunday and 6 representing Saturday. The second parameter is an int that represents the number of days in the month. If the start day is not in the range 0 to 6 or if the number of days is not in the range 1 to 31, the program should display useful error message instead of displaying a calendar. If the parameters are OK, the program should display a calendar similar to the following:

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

After the last day of the calendar is displayed, the function should advance the cursor to the next line.

Note that for the display above, the start day is 3 and the numbers of days is 31.

View 1 Replies View Related

Visual C++ :: Project To Display Raw Image

Nov 25, 2012

Used some online code example to put a little project to display raw image. The display does not seem to work.For some purposes, I like this to work with a dialog based MFC project.XDVView is derived from CScrollView.

See OnInitDialog() and OnDraw(CDC* pDC).8bit 768x756

View 14 Replies View Related

Visual C++ :: CFileDialog Does Not Display File Name Correctly

Sep 13, 2013

I haven't seen this before but on Windows 7 Home Professional and VC 2012 in one particular app, a CFileDialog displays only the rightmost 11 characters plus the extension of the default file name. The rest of the name is there and you can scroll left in the file name edit to display it all, but initially the text is shifted left so it doesn't all display.

Code:
CFileDialog dlg(TRUE, "csv", strFileName, OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY, "Comma Seperated Values Files (*.csv)|*.csv|All Files (*.*)|*.*||");

strFileName can contain anything and it will do it. Even a string literal will do it.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved