|
Hi,
I am using my own gridview derived from Clistview.
My problem is to make the first column always fixed on Horizontal scroll.
Can anybody knows the best solution for this in MFC..
Thank you in advance...
|
|
|
|
|
sma123# wrote: ...first column always fixed on Horizontal scroll. What exactly do you mean by this?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Hi David,
I have a grid control derived from Cwnd. I am displaying the grid on ClistView.
The problem is when I using horizontal scroll all columnc are shifting including first column. I need to fix the first column remaining can move with scroll.
I am using MFC control which is older one.
If you have any suggestion on this?
Thanks in advance.
|
|
|
|
|
Handle the HDN_BEGINTRACK message by returning TRUE . If you are using MFC, check out OnHeaderBeginTrack() . There are plenty of examples of both of these.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
You need to look at the attributes of the columns in your control. You could possibly change the order or set the width to zero. However, you probably need to either subclass this control to manage this behaviour, or even create a new control from scratch.
|
|
|
|
|
Hello...This question may sound silly to some of you but I've been stuck on it for few days and can't find any answer... So I need to have the mouse position x and y displayed in the status bar.
So far I add new string to the table, in the indicators array,
afx_msg void OnUpdateCurPos(CCmdUI *pCmdUI) in the message map and ON_UPDATE_COMMAND_UI(ID_INDICATOR_CURSOR,OnUpdateCurPos)
When I run it's there but can't find the right way to update the cords. I think it must work with ON_MOUSEMOVE func...I've tried several codes in ON_MOUSEMOVE and OnUpdateCurPos but it doesn't work at all...
Working with SDI.
|
|
|
|
|
What does your OnUpdateCurPos() and OnMouseMove() functions look like? Have you called SetCapture() ?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Well that is the problem :P I've added SetCapture() when you press LButton, but I'm not rly sure if I need it?
void CMainFrame::OnLButtonDown(UINT nFlags, CPoint point)
{
SetCapture();
CFrameWnd::OnLButtonDown(nFlags, point);
}
void CMainFrame::OnMouseMove(UINT nFlags, CPoint point)
{
if(GetCapture()==this){
posX=point.x;
posY=point.y;
}
CFrameWnd::OnMouseMove(nFlags, point);
}
void CMainFrame::OnUpdateCursor(CCmdUI *pCmdUI){
CString pos;
pos.Format(ID_INDICATOR_CURSOR,posX,posY);
m_wndStatusBar.SetPaneText(m_wndStatusBar.CommandToIndex(ID_INDICATOR_CURSOR),pos);
}
Well atleast now the sting is updated with 0's. Its defined as " x: %d ,y: %d ". So the OnUpdateCursor() is working but not with the right values...
|
|
|
|
|
What happens when you change your Format statement to
pos.Format(" x: %d ,y: %d " ,posX,posY);
|
|
|
|
|
Nothing. Stays the same:
"x: 0 , y: 0"
|
|
|
|
|
It that the value of pos immediately after the Format() call?
|
|
|
|
|
Yes... Seems like OnMouseMove doesn't update posX and posY.
If I do :
void CMainFrame::OnUpdateCursor(CCmdUI *pCmdUI){
CString pos;
posX=100;
posY=200;
pos.Format(L" x: %d ,y: %d ",posX,poxY);
m_wndStatusBar.SetPaneText(m_wndStatusBar.CommandToIndex(ID_INDICATOR_CURSOR),pos);
}
It does put
"x: 100,y: 200"
in the status bar...
|
|
|
|
|
So, it looks like GetCapture() != this, perhaps have a look at this[^] article.
|
|
|
|
|
In OnMouseMove() , what is the value of point.x and point.y ?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
I can't rly get the debuger to stop there ... It's kinda like skipping it all? Any other way of checking ?
|
|
|
|
|
Vladislav Gospodinov wrote: Any other way of checking ?
TRACE() .
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
So it doesn't TRACE() anything at all when called in
CMainFrame::OnMouseMove so it's like it doesn't get the mouse moving at all in MainFrame class...
it does trace correct values if I call it in the View class
CpositionView::OnMouseMove
however I can't find a way to send them from View to MainFrame, although I have included ***View.h and taka them like
CpositionView::positionX
I get a lot of errors :P
|
|
|
|
|
Try this!
void CDlgStatusBarDlg::OnMouseMove(UINT nFlags, CPoint point)
{
CString s;
s.Format("X=%d Y=%d",point.x,point.y);
m_bar.SetPaneText(0,s);
CDialog::OnMouseMove(nFlags, point);
}
Source: [Adding a status bar to an MFC dialog[^]]
|
|
|
|
|
I want to spend one hour a day, five days a week, for three weeks, with a small kit.
Atmel, AMD, Intel, Motorola, PIC, ST-Micro, Your_Favorite_Suggestion_Here,,,, I'm happy to look at anyone's opinion, especially those who have been there / done that.
The concept I have in my head is to review the basics, test out some simple circuits, blink some lights, read some knobs, communicate via some UARTs, write a few interrupt handlers for push button switches, set up a bluetooth connection, access a wifi connection, maybe send a ping command to some machine, arrange a USB connection,,,,
I'm thinking along the lines of a microcontroller on a printed circuit board, with pins and clips and stuff that are large enough to test with alligator clips and so on.
yackity yackity yack; whatever.
Please offer your idea(s) as to which vendor(s) offer(s) such a kit that will be most useful for this.
Top considerations are
-- PC software; e.g., compiler, debug, and an Interactive Development Environment are high on the list
-- Cost, and price.
-- Existing online user community
-- Documentation
-- Physical size large enough to get to the physical pins via printed circuit lines
-- Physical size small enough to let you work on your desktop
SUGGESTIONS ???
|
|
|
|
|
This interests me. See if it interests you:
Single Board Computer[^]
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Excellent marketing if nothing else.
Good picking it out on your part.
I looked at it and in two seconds thought "yes" without reading a single word about it.
I'll spend 90 seconds reading about it and see what I think.
If you have any personal experience with this board, put up some words that everyone can read.
|
|
|
|
|
Good stuff; the debug looks good.
I didn't see anywhere to develop USB code for your own USB projects.
Did I miss something ?
|
|
|
|
|
Never heard of the Rabbit 4000.
Anybody worked with this on a regular project ?
|
|
|
|
|
We did one project with it and it turned out fine, decent debugger, and as I recall lots of example projects. The documentation was good, the parts had good amounts of RAM and Program space, they are not the fastest processors around nut they served our needs well.
|
|
|
|
|
Was USB involved in your projects ?
|
|
|
|