|
Have you tried it? I haven't....I was hoping you would try it and report
back to us with the results
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
LPSTR_TEXTCALLBACK only affects one item/subitem at a time
|
|
|
|
|
Me view is derived from CFormView.
I need to add dialog in my view like a fixed child window. I do this in OnCreate.
m_TableDialog.Create(IDD_DIALOGTABLE, this);
The problem: The m_TableDialog doesn't receive messages, but controls in it do. So, for example CMyView::OnLButtonDown never called. What's the problem?
-- modified at 1:02 Sunday 9th September, 2007
|
|
|
|
|
progDes wrote: The problem: The m_TableDialog doesn't receive messages, but controls in it do. So, for example CMyView::OnLButtonDown never called.
I'm confused. m_TaleDialog is a CMyView class object? The WM_LBUTTONDOWN message
should go to the window under the cursor unless the mouse is captured by another window.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
No, m_TableDialog is CDialogTable object. And the dialog is creating in CMyView::Create. The owner of m_TableDialog is a view class. May be the creation of dialog is wrong? Looks like some modal dialog catch all messages.
|
|
|
|
|
Again, the WM_LBUTTONDOWN message should go to the window under the cursor
unless the mouse is captured by another window.
Where are you clicking and where do you expect to get the message?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'm clicking on dialog window, and waiting the message in CDialogTable::OnLMouseDown.
The strange thing:
Controls are acting correct, buttons are animating etc, but there is a beep sound when I'm selecting element in CListCtrl (just like, trying to do something when modal dialog on the top), bu elements are selecting correctly.
|
|
|
|
|
I'm not picturing how your windows are arranged so it's tough to tell
what's going on.
Your CDialogTable is a child of a CFormView, right?
If so, it's on top of its parent in the z-order. How much of its parent is it covering up?
What controls are on which windows?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
SOLVED
This is long to explain, but in general I'm a fool myself
|
|
|
|
|
whith the GDI+ method DrawImage(), i can display a normal size image, but i can't display an image with 400M size. is there size limit and how can i display a big size image? thanks.
|
|
|
|
|
Where did you get an image of that magnitude? I can't say I've ever tried to display one that large.
Some suggestions would be to not use interpolation to see if it renders. If your using something like InterpolationModeHighQualityBicubic you might be asking too much of the graphics object.
Did you try rendering a much smaller image using the same code to see if it's displaying it in a part of your coordinate system that is visible. You might be rendering it in negative coordinates or somewhere off the client area.
Does the large image display with other rendering programs like MS Photoeditor or something similar that will scale it to fit the screen?
Try to eliminate those possibilities first if you haven't already.
|
|
|
|
|
Another thing I forgot to add is to ask if the image isn't rendering but the app is responsive, or does it seem locked up and not responding?
The reason for my question is that I've noticed for compression/decompression using a well known library like zlib, if the file image is excessively large, the decompression routine can take a very long time to finish. If the file format uses advanced compression schemes, the code probably will perform, performance-wise, similar to zlib since it's probably about as efficient as they come (within reason).;)
If it seems to hang, it might not be done decompressing yet. I found myself blaming MSXML for taking a long time to load/save very large xml files only to realize that it was the decompression/compression stages I had inserted between the DOM parser and the file that were taking so long. Even changing the cache sizes had minimal effect on the time required for processing so I'm guessing it's inherent in what the compression algorithm does that starts to bog down with excessively large files.
Just an idea.
|
|
|
|
|
well is this a higher res image(may be for print purposes) or just plain old large (like maps). Here are some ideas depending on the anser:
1. if the image is high res image such as 1200, 2400 dpi letter size rgb image, downsample the image first . Because, displaying that image (fitting the screen) full res is asking the graphics subsystem to downsample it on the fly. Image quality will not suffer (assuming you downsample it right). Do not over do it allowing the viewer zoom in say up to 300%. So even down to 300dpi will bring file size down to 1/16 allowing your self zoom in roughly about 300% without quality problems.
2. if the image is lower res (300 dpi or less), but large. most likely scenario you will not display it fitting the screen. Because it will look horrible, even if displaying was possible. In that case extract a region and display only that depending on the scroll position.
I hope this gives you some ideas.
|
|
|
|
|
thanks Teashirt2.
the image i want to display is 300dpi , 400M letter size RGB. as your suggestion, i can display it in an extract region. but i still want to display it in the whole view client. and my view is derived from ScrollView, but still can not display it.
|
|
|
|
|
help:
first i draw a white circle using opengl, and then i loaded an image as texture and display the texture, but i was confused that the circle color was changed into the some color as the texture's! what is wrong with it?
thanks.
|
|
|
|
|
Lao Wang wrote: first i draw a white circle using opengl, and then i loaded an image as texture and display the texture, but i was confused that the circle color was changed into the some color as the texture's! what is wrong with it?
In opengl textures cannot display by themselves, they have to be pasted onto something, since your circle was the only thing there, you pasted it onto that. By turning on and off texturing at the appropriate times, you can have multiple objects with a texture each.
http://nehe.gamedev.net/lesson.asp?index=02[^]
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
thank you Corazon.
but i have pasted my texture to a rectangle. in fact i want to some white circles as the background and load a texture in the front. of course, the texture is pasted onto a rectangle. but after displayed, the background color was changed!
|
|
|
|
|
try this:
draw circle
turn on texturing
draw rectangle
turn off texturing
it sounds like you are not disabling texturing after drawing the square, thus leaving the texture bound to every opengl call that follows.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
thank you Corazon for your kind. i will try it with your suggestion.
|
|
|
|
|
hi all
i want to get data from sharescope sofware.
it gives data to xls
but how can i get it in my program directly
thank you.
|
|
|
|
|
can anybody tell me how to change the color of the text appear in EditBox. I am using following code but nothing happen
<br />
if(SetTextColor(GetDC(GetWindow(hWndDlg,IDC_EDIT1)),<br />
RGB(255,0,0)) == CLR_INVALID)<br />
OutputDebugString(L"Error SetTextColor");
|
|
|
|
|
You have to map WM_CTLCOLOR in the dialog class. In that you have to check for the control type and window (if needed). Then set the color to the DC.
- NS -
|
|
|
|
|
If you want some independence from the dialog box, you can control it directly from within a derived control class. This is not the best or easiest way, but it's an option nonetheless...
Create a new class and derive it from CEdit. Create some member variable for text color, background color, background brush etc...
// .h file
class CEditControl : public CEdit
{
// ...
private:
COLORREF m_colorBack;
COLORREF m_colorText;
CBrush m_brushBack;
//...
}
When you choose your variable for the edit control using class wizard, choose category "control", and for the type choose your derived type instead of CEdit.
Also don't forget to include your derived class in your StdAfx.h file
// StdAfx.h
#include "EditControl.h"
Create a handler for the "=WM_CTLCOLOR" message in your derived edit class. It's important to note that there are two WM_CTLCOLOR messages in the wizard. Choose the one with the "=" in front of it. Set it up as described below.
// .cpp file
CEditControl::CEditControl()
: m_colorBack(RGB(255,255,0))
, m_colorText(RGB(255,0,0))
{
m_brushBack.CreateSolidBrush(m_colorBack);
}
CEditControl::~CEditControl()
{
m_brushBack.DeleteObject();
}
BEGIN_MESSAGE_MAP(CEditControl, CEdit)
//{{AFX_MSG_MAP(CEditControl)
ON_WM_CTLCOLOR_REFLECT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CEditControl message handlers
HBRUSH CEditControl::CtlColor(CDC* pDC, UINT nCtlColor)
{
// TODO: Change any attributes of the DC here
/*
This sets the text background to transparent. Works good
for single line edit controls but for multiline you will
need OPAQUE to prevent refresh issues with the text when
typing in the middle of a line in the string.
For example, when edit is multiline, use this instead:
pDC->SetBkMode(OPAQUE);
pDC->SetBkColor(m_colorCustom);
pDC->SetTextColor(m_colorText);
*/
pDC->SetBkMode(TRANSPARENT);
pDC->SetTextColor(m_colorText);
// Return a non-NULL brush if the parent's handler should not be called
return m_brushBack;
// return NULL;
}
|
|
|
|
|
You got a pair of MFC solutions. Are you using MFC or using Win32 directly?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Please confirm what are using.. in Win32 you have to handle WM_CTLCOLOREDIT and in MFC you have to handle WM_CTLCOLOR message for Coloring Edit Control
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|