This seems to work fine, including putting text and bitmaps on or into the panes. I further wish to be able to have tool tips for each pane.
If I do this in CJBK_III_SBarCls.cpp:
m_CJBK_III_SBar.GetStatusBarCtrl().SetTipText(0, _T("This is Pane 0"));
m_CJBK_III_SBar.GetStatusBarCtrl().SetTipText(1, _T("This is Pane 1"));
m_CJBK_III_SBar.GetStatusBarCtrl().SetTipText(2, _T("This is Pane 2"));
Everything compiles, links and visually displays OK. Putting the mouse over any of the panes however, does nothing.
1. What am I missing?
2. Do I hve to create a CToolTipCtrl within the class?
3. If I don't have to create a CToolTipCtrl, how does one set things like text colors, delay times, .Activate etc.?
I am trying to follow "ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.en/dv_vclib/html/7505a1f3-0c37-4cb1-b30b-af83f75bdf91.htm" in the help files.
A link to an example or simple example would be quite helpful.
In the Solitaire game, when you are moving the card around, it moves "over"' the other cards. I'm trying to figure out how this is done using either of the draw-related functions within cards.dll. I can move a card around on the playing area just fine. If that card moves over any of the other cards, it will erase them. If I add invalidating code to the end of the OnMouseMove() function, the card I am moving becomes obscurred by the other cards constantly being redrawn. What can I do to ensure that the card I am moving stays atop the other cards and at the same keep those other cards updated?
Unless there's no other way, I'd like to use the functions provided in cards.dll if I can. I've done very little in regards to GDI so my problem(s) here may be elementary.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
I believe the perfect way to go would be to use DirectX.
But you could try to set the CS_SAVEBITS style in the WNDCLASS structure for the cards window.
This way the window being moved will restore the background rather than the window in the background drawing itself.
«_Superman_» I love work. It gives me something to do between weekends.
When you move a card, it leaves behind two rectangles that need to be
repainted, to fill in the area where the card was.
For each move, I would calculate those two rectangles, use
the InvalidateRect() function (twice) to add those exposed rects
to the window's update region, then call UpdateWindow() to force an
In the WM_PAINT handler, you're probably already drawing all the cards
that are visible by iterating through a collection of some kind.
If you aren't already, you'll probably want to keep track of the
Z-order of the cards so cards on top get rendered last. That means
when a card is dragged, it needs to be moved to the top of the z-order
before doing the redraws that occur while moving the card. That should
solve the "becomes obscurred by the other cards constantly being redrawn"
issue, since the card being moved is drawn last.
To keep track of z-order, I would just use a simple collection like a
CTypedPtrArray, since generally only one card at a time is going to
change in z-order, and most likely its going to move to the top. You
can just remove the card object from the array and insert it back in
at the end of the array. The WM_PAINT handler then just needs to
draw cards in the same order they are in the array.
I suppose that, when moving a card, it automatically comes to the top of the Z order, so, inside WM_PAINT handler it should be drawn last of all. The update region should be the union of the starting and ending position rectangles.
Just a guess: hope it makes sense.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke