|
If you want the columns right aligned, specify LVCFMT_RIGHT for the nFormat parameter of the InsertColumn function. This will work nicely for all columns except the first one. For some reason, you can't right align the first column I don't think.
YourListControl.InsertColumn( 0, _T("Column0"), LVCFMT_RIGHT, 100 );
Chris Richardson
C/C++ Include Finder[^]
|
|
|
|
|
You can, but you have to set the style to right align after you have created the column.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
I'm trying to make a Winamp plugin (Win32 DLL) and a text-only one will compile just fine. Whenever I add any resource script to it, however, I get this error:
Linking...<br />
.\Debug\script1.res : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt<br />
Error executing link.exe.<br />
|
|
|
|
|
I'm trying to find out if there's a way to leverage the "Searching" progress indicator in XP. When you search for files in Exporer displayed the Luna interface, you get a little wrap-around progress indicator with 3 gradient filled boxes. It basically uses a WM_TIMER message to update the box positions.
Spy++ tells me that this the window class is SA_Progress, but a Google search gives me only 1 newsgroup comment. I know it's trivial to implement, but I'd like to conform to the active theme colors and shapes, and the documentation for GetThemeColor isn't exactly definitive (or existant). Any suggestions? Thanks.
|
|
|
|
|
|
Check out CListCtrl::GetTopIndex and CListCtrl::GetCountPerPage. You should be able to calculate the last visible item this way. Cheers.
|
|
|
|
|
|
Hi,
I'm trying to turn a bitmap on and off (if it were a CWnd, I would use CWnd::ShowWindow(SH_HIDE) ) How can I do this?
Basically, here is what I will have:
I will have "layers" of bitmaps in one rectangular area. I am a little familiar with device contexts and will try to associate each layer with it's own device context.
When I want to Show/Hide a layer, I will operate on that specific device context.
Each layer will have a unique color used -- there is only one color used in drawing on that layer.
Are there any suggestions on how I can programmatically turn on/off a specific layer?
Thank you very much!
Johnny
|
|
|
|
|
|
If you have no more than 8 layers, just use an 8 bit deep
bitmap-- treat it as a paletted image. Generate the palette
on the fly depending on the colors of the layers, their
transparency, order, etc. Then blit to the display using the
generated palette. If you have more than 8 layers, then
you can do the same but your original bitmap will not be
compatible with gdi as is-- use it to construct a final
image and blit that to the display.
|
|
|
|
|
This is in the lines of what I was looking for. I'm adapting the Oscilloscope project in CP's
"http://www.codeproject.com/miscctrl/oscope.asp" by Mark C. Malburg
and he uses bit blit-ing.
I will be putting 5 (maybe 8 max) plots on the same grid. If the user wants to turn off a plot(s) then that is when I want to do my business.
Any more suggestions/help? Thanks all!
Johnny
|
|
|
|
|
Make sure when drawing into the layered bitmap,
to use the R2_MERGEPEN raster op so that when
drawing with a pen designed for one layer you
aren't obliterating the others.
|
|
|
|
|
|
Hello all,
I want to test the state of mouse buttons in inside MouseMove handler .
I suppose i must work with Wparam or Lparam but how ?
thank you in adavance
|
|
|
|
|
afx_msg void OnMouseMove( UINT nFlags, CPoint point );
is the prototype of the MouseMove handler in CWnd (MFC)
In this:
nFlags
Indicates whether various virtual keys are down. This parameter can be any combination of the following values:
MK_CONTROL Set if the CTRL key is down.
MK_LBUTTON Set if the left mouse button is down.
MK_MBUTTON Set if the middle mouse button is down.
MK_RBUTTON Set if the right mouse button is down.
MK_SHIFT Set if the SHIFT key is down.
if (nFlags & MK_LBUTTON)
{
// Left mouse button is down
}
if (nFlags & MK_MBUTTON)
{
// Middle mouse button is down
}
My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
modified 29-Aug-18 21:01pm.
|
|
|
|
|
O yes ! thx you !
it works great !
|
|
|
|
|
if (wParam & MK_LBUTTON) //left button down
if (wParam & MK_RBUTTON) //right button down
Joel Lucsy
|
|
|
|
|
Thx ! your solution is grat for PreTranslateMessage !
Thx again
|
|
|
|
|
Arf i have a problem ;(
Your solution works great when the view is derived from CView, but when is derived from CListCtrl it doesn't work !
You know why ?
Thx
|
|
|
|
|
I'm new to this. I want to be able to send a command from the client application to the server application. For example to call the one of the servers dialog box or menu item. Which calls do I need to do achieve this.
Thanks
|
|
|
|
|
Ok,
I don't know the official word for doing this, but in windows, if you have a box with text and the text spans further than what the box can display (i.e. on the taskbar at the bottom of the screen), if you hold the mouse over the box, a yellow box pops up displaying the full text. How would I implement this into a dialog control that i have? I have an input form with several static text boxes, which sometimes get overloaded because I fill them with more text than what the user can normally see.
Thanks,
Mike Mathers
|
|
|
|
|
Its called a tooltip. There are several classes available her on CP.
Note that for a static text control to have a tooltip, it must have a unique ID and have the Notify style set in its resources.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
Thank you for the quick response. I was looking more to do this myself if possible, I've been reading up on CToolTipCtrl, and I've set the Notify Styles on all the static controls that need this. But what is the next step, do I include a CToolTipCtrl object in my dialog class? I'm a little stumped and MSDN is not helping.
|
|
|
|
|
I wouldn;t bother with the tooltip control. If your doing this on a dialog, follow these steps (which work on form views etc as well).
1. Call EnableToolTips(TRUE) in the OnInit dialog.
2. Add the function prototype
afx_msg BOOL OnToolTipNotify(UINT id, NMHDR *pNMHDR, LRESULT * pResult);
3. Add this MESSAGE_MAP entry
ON_NOTIFY_EX(TTN_NEEDTEXT, 0, OnToolTipNotify)
4. Add your funtion
BOOL CYourDialog::OnToolTipNotify(UINT , NMHDR *pNMHDR, LRESULT * )
{
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
static char tooltiptext[256] = "";
if (pTTT->uFlags & TTF_IDISHWND)
{
UINT nID = ::GetDlgCtrlID((HWND)pNMHDR->idFrom);
pTTT->lpszText = NULL;
switch (nID)
{
case IDC_TITLE :
pTTT->lpszText = "Tray setup title";
break;
}
if (pTTT->lpszText != NULL)
{
return(TRUE);
}
}
return(FALSE);
}
Then just write your tooltips text for each control.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
I'm writing an editor, and I want to have current Line and Column displayed.
Line is working fine, but column doesn't always work right.
if I try to get the CharIndex of the beginning of the line this way,
long int nStartChar = SendMessage(EM_LINEINDEX,-1,0);
I eventually hit a problem after 88x lines, where (nCurrChar - nStartChar) is 65xxx
if I try to get the CharIndex of the beginning of the line this way,
long int nStartChar = LOWORD(pEdit->CharFromPos(ptLineBegin));
where ptLineBegin is based on GetCaretPos() and x forced to 0, then the column is based on the left of the window, and not the actual beginning of the line.
Can anyone give me some help, please? Thanks!
BW
"We get general information and specific information, but none of the specific information talks about time, place or methods or means..."
- Tom Ridge - US Secretary of Homeland Security
|
|
|
|