|
I am afraid you still don't make any sense
You know you're obsessed with computer graphics when you're outside and you look up at the trees and think, "Wow! That's spectacular resolution!"
|
|
|
|
|
vasusree wrote: can we insert dialog box in between listbox items in runtime.
No. What exactly do you mean by this?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
means when we select the listbox item then we should get the dialog exactly below that and below listbox items should be below that dialog
|
|
|
|
|
vasusree wrote: means when we select the listbox item then we should get the dialog exactly below that...
Below what? Which dialog?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Can you explain the difference between Thread,Process,
Event,Mutex and Semaphore.
I only know it is much related to Multithreading.
It would be greatly appreciated if someone explains in detail.
Thank you.
|
|
|
|
|
|
why should a call back function be static when its called from an another class?
say we have a class A and class B
assume that class A calls a function in B say "b" and passes the address of an another function in A say "a".
then to get get this working why is it a must that the function "a" be static.....we are passing the address of the member function as whole rt?.....
|
|
|
|
|
namaskaaram wrote: why should a call back function be static when its called from an another class?
It is not only when it has to be called from another class: it is whenever your callback function is a member function of a class.
The difference between static member functions and non-static member functions is that for the non-static one, there is an implicit parameter that is passed to the function: the address of the instance of your class (the this pointer). As static member functions are shared across all instances of your class (and thus don't belong to a particular instance, thus cannot access non-static data from one instance), there is no implicit 'this' parameter that is passed.
This of course change the prototype of the callback function (because of the implicit parameter), that's why static and non-static member functions behave differently.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
how to set the col width and row height according client rect and make the cells full fill with the client area.
I calc the value as follow way, but it still can't meet the rect....
BOOL CPgDialog::OnInitDialog()
{
CRect clrect;
long row=0,col=0;
m_grid.SetRows(20); // total rows 20
m_grid.SetCols(20); // total cols 20
m_grid.GetClientRect(&clrect);
long lwidth =clrect.Width()/m_grid.GetRows()*14.4; // inch?
long lheight = clrect.Height()/m_grid.GetCols()*14.4;
for (col=0;col< m_grid.GetCols();col++)
{
m_grid.SetColWidth(col,lwidth);
}
for (row=0;row
|
|
|
|
|
Are your sure that SetColWidth and SetRowHeight functions requires size in other units than pixels? Try without your "14.4 " multiplier.
|
|
|
|
|
Hi, All
i have one project, use CFrameWnd.
example:
CMainFrm : public CFrameWnd
CChildFrm : public CFrameWnd
in CMainFrm : load CChildFrm and CChildFrm must be DoModal()
How to make CChildFrm to DoModal()
I use VC 7.0
|
|
|
|
|
DoModal is from CDialog, it has nothing to do with CFrameWnd. Why do you want to call DoModal ?
Take a look at BeginModalState[^] (hum, not a lot of info, I agree ). I think this will do what you are looking for (but I never tested it myself).
You didn't answer my question in your previous thread: how did you do to make it compile under VC6 ?
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
thank all, i have just solved my problem.
i forgot my initial var.
DoModal for Frame have requirement of customer,
in some case, it modalless and Domodal.
|
|
|
|
|
huynhnb wrote: DoModal for Frame have requirement of customer,
in some case, it modalless and Domodal.
It is not because your customer wants to have a modal frame window that you are 'allowed' to call DoModal which is not part of the CFrameWnd class . I'm wondering how you did that. Did you simply make a cast from a CFrameWnd into a CDialog ?
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
Source code :
// Child Frame .H
class CSDIChildFrame : public CFrameWnd
{
DECLARE_DYNCREATE(CSDIChildFrame)
// Attributes
public:
CSDIChildFrame(); // protected constructor used by dynamic creation
// Operations
public:
BOOL m_bClose;
BOOL m_bModal;
int RunModalLoop(DWORD dwFlags);
int DoModal(CWnd *pParentWnd);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSDIChildFrame)
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CSDIChildFrame();
// Generated message map functions
//{{AFX_MSG(CSDIChildFrame)
// NOTE - the ClassWizard will add and remove member functions here.
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnExit();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
// Child frame .cpp
// SDIChildFrame.cpp : implementation file
//
#include "stdafx.h"
#include "SDIChildFrame.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSDIChildFrame
IMPLEMENT_DYNCREATE(CSDIChildFrame, CFrameWnd)
CSDIChildFrame::CSDIChildFrame() : m_bClose(FALSE)
{
}
CSDIChildFrame::~CSDIChildFrame()
{
}
BEGIN_MESSAGE_MAP(CSDIChildFrame, CFrameWnd)
//{{AFX_MSG_MAP(CSDIChildFrame)
// NOTE - the ClassWizard will add and remove mapping macros here.
ON_COMMAND(ID_MENUITEM32772, OnExit)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSDIChildFrame message handlers
int CSDIChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
CCreateContext pContext;
return 0;
}
int CSDIChildFrame::DoModal(CWnd *pParentWnd)
{
BOOL bEnableParent, bResult;
HWND hWndParent, hWndTop;
m_bModal = TRUE;
hWndParent = CWnd::GetSafeOwner_(NULL, &hWndTop);
AfxHookWindowCreate(this);
bEnableParent = FALSE;
if (hWndParent != NULL && ::IsWindowEnabled(hWndParent))
{
::EnableWindow(hWndParent, FALSE);
bEnableParent = TRUE;
}
bResult = CFrameWnd::LoadFrame(
IDR_MENU1,
WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE | WS_VISIBLE,
pParentWnd,
NULL);
if (bResult)
{
DWORD dwFlags = MLF_SHOWONIDLE;
m_nFlags = m_nFlags & WF_CONTINUEMODAL;
if (GetStyle() & DS_NOIDLEMSG)
{
dwFlags |= MLF_NOIDLEMSG;
}
VERIFY(RunModalLoop(dwFlags) == m_nModalResult);
}
if (bEnableParent)
::EnableWindow(hWndParent, TRUE);
if (hWndParent != NULL)
::SetActiveWindow(hWndParent);
AfxUnhookWindowCreate(); // just in case
Detach(); // just in case
// re-enable windows
if (::IsWindow(hWndTop))
::EnableWindow(hWndTop, TRUE);
hWndTop = NULL;
CWinApp* pApp = AfxGetApp();
if (pApp != NULL)
pApp->EnableModeless(TRUE);
return m_nModalResult;
}
int CSDIChildFrame::RunModalLoop(DWORD dwFlags)
{
ASSERT(::IsWindow(m_hWnd)); // window must be created
ASSERT(!(m_nFlags & WF_MODALLOOP)); // window must not already be in modal state
// for tracking the idle time state
BOOL bIdle = TRUE;
LONG lIdleCount = 0;
BOOL bShowIdle = (dwFlags & MLF_SHOWONIDLE) && !(GetStyle() & WS_VISIBLE);
HWND hWndParent = ::GetParent(m_hWnd);
m_nFlags |= (WF_MODALLOOP|WF_CONTINUEMODAL);
// In VC 6.0
MSG* pMsg = &AfxGetThread()->m_msgCur;
// In VC 7.0
// MSG* pMsg = AfxGetCurrentMessage();
// acquire and dispatch messages until the modal state is done
for (;;)
{
/*
ASSERT(ContinueModal());
*/
if (m_bClose)
{
goto ExitModal;
}
// phase1: check to see if we can do idle work
while (bIdle &&
!::PeekMessage(pMsg, NULL, NULL, NULL, PM_NOREMOVE))
{
/*
ASSERT(ContinueModal());
*/
if (m_bClose)
{
goto ExitModal;
}
// show the dialog when the message queue goes idle
if (bShowIdle)
{
ShowWindow(SW_SHOWNORMAL);
UpdateWindow();
bShowIdle = FALSE;
}
// call OnIdle while in bIdle state
if (!(dwFlags & MLF_NOIDLEMSG) && hWndParent != NULL && lIdleCount == 0)
{
// send WM_ENTERIDLE to the parent
::SendMessage(hWndParent, WM_ENTERIDLE, MSGF_DIALOGBOX, (LPARAM)m_hWnd);
}
if (m_bClose)
{
goto ExitModal;
}
if ((dwFlags & MLF_NOKICKIDLE) ||
!SendMessage(WM_KICKIDLE, MSGF_DIALOGBOX, lIdleCount++))
{
// stop idle processing next time
bIdle = FALSE;
}
}
// phase2: pump messages while available
do
{
/*
ASSERT(ContinueModal());
*/
if (m_bClose)
{
goto ExitModal;
}
// pump message, but quit on WM_QUIT
if (!AfxGetThread()->PumpMessage())
{
AfxPostQuitMessage(0);
return -1;
}
// show the window when certain special messages rec'd
if (bShowIdle &&
(pMsg->message == 0x118 || pMsg->message == WM_SYSKEYDOWN))
{
ShowWindow(SW_SHOWNORMAL);
UpdateWindow();
bShowIdle = FALSE;
}
/*
if (!ContinueModal())
goto ExitModal;
*/
if (m_bClose)
{
goto ExitModal;
}
// reset "no idle" state after pumping "normal" message
if (AfxGetThread()->IsIdleMessage(pMsg))
{
bIdle = TRUE;
lIdleCount = 0;
}
if (m_bClose)
{
goto ExitModal;
}
} while (::PeekMessage(pMsg, NULL, NULL, NULL, PM_NOREMOVE));
}
ExitModal:
m_nFlags &= ~(WF_MODALLOOP|WF_CONTINUEMODAL);
return m_nModalResult;
}
void CSDIChildFrame::OnExit()
{
// TODO: Add your command handler code here
m_bClose = TRUE;
}
// include in Stdafx.h
#include <afxpriv.h>
// Use
void CMainFrame::OnLoadDoModalFrame()
{
CSDIChildFrame *pChildFrame = new CSDIChildFrame();
pChildFrame ->DoModal(this);
}
|
|
|
|
|
my problem is once we select the listbox item we get the pop up and it will be positioned exactly down that item.once we select another item now pervious popup should close and new popur should open in same as above
please help as quickly as possiblle
|
|
|
|
|
vasusree wrote: the listbox
Which listbox ?
vasusree wrote: the pop up
Which pop-up ?
You have to provide more information if you want help.
(BTW, using 'the' means that you speak about something that is known from the reader, which is not the case here).
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
can you explain please
we select the listbox item we get the pop up
whitesky
|
|
|
|
|
A possible scenario:
- Display your popup as a modeless dialog, keeping a variable for this dialog.
- When you detect a new selection in your list-box, close the dialog, and then recreate it and move to desired position. Or just move it, if already created.
- If you want the popup to disappear automatically when it looses focus, then handle a corresponding message, probably
WM_ACTIVATE or WM_KILLFOCUS .
|
|
|
|
|
if u don't mind do u have any sample code.
or any example in code project
|
|
|
|
|
|
i need this project without using tooltips
|
|
|
|
|
I have sample code.
My mail ID is amar.sutar@gmail.com
Regards
Amar
|
|
|
|
|
Hi !!!
What is an Array Pointer or Pointer to an Array?
Please a little example.
Thx.
By !!!
-:KNOX:-
|
|
|
|
|