|
Mark_VC wrote: I would really like toolbar by itself so that the program looks professional. I may use calcFixedlayout. If you have a neat way how to do it, please do help.
thanks.
I'm afraid I don't understand what your saying. How would a dialog bar look nonprofesional?
Nathan
|
|
|
|
|
A toolbar will wrap the buttons if you set its size appropriately.
A problem, unless there's enough buttons, is that when you resize it to the right size,
it may not fill an entire side of a window.
To get around this, I personally embed the toolbar in a control bar - the control bar always
stays the height of the window and the width of two columns of buttons. The embedded
toolbar is sized appropriately to get the two columns.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
how can i resize it so that the buttons inside it wrap itself. As far as I know, it always aligns button in a single column in vertical toolbar. I tried resizing it, it still shows the buttons in single column. Help please.
Mark
|
|
|
|
|
Make sure the toolbar control has the TBSTYLE_WRAPABLE style.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I tried TBSTYLE_WRAPABLE. It probably works only when the toolbar is floating. When the toolbar is docked, it aligns itself in single column again. I know i have to use calcDynamicLayout and CalcFixedLayout. I do not know who to override them and what code to put in it.
Thanks every one for help though
|
|
|
|
|
It doesn't have to be floating.
You didn't mention MFC before, but now that you've mentioned it -
Override CalcFixedLayout()...
If you return the proper size for the bar it will work.
The width should be the size of two buttons (for two columns).
The height should be the height of the client area of the parent.
For CalcDynamicLayout() I often just route the call to CalcFixedLayout()
unless I need different functionality there - something like:
CSize CMyControlBar::CalcDynamicLayout(int nLength, DWORD dwMode)<br />
{<br />
return CalcFixedLayout(dwMode & LM_STRETCH, dwMode & LM_HORZ);<br />
}<br />
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
What to put in CalcFixedLayout override. I though i have to set flag for each toolbar buttion in the CalcFixedLaout function(weather the buttion is to be wrapped or not). What would that code be? Or I should simply use TBSTYLE_WRAPABLE style for Toolbar without any code in CalcFixedLayout and it should work?
Thanks again.
Mark
|
|
|
|
|
Mark_VC wrote: What to put in CalcFixedLayout override.
All you need is to return the size you want.
For vertical, two columns, something like this maybe...
CRect CliRect;
GetParent()->GetClientRect(&CliRect);
CRect ButtonRect;
GetToolBarCtrl().GetItemRect(0, &ButtonRect);
return CSize(ButtonRect.Width() * 2, CliRect.Height());
The wrapable style only needs to be set on the toolbar itself. You also don't need
separators although they can be used to aid wrapping in some instances.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I will try this code. I did try using the width function of the toolbar but that increased the width but did not wrap the buttions. I will use this approach now. I will update you how did it go.
|
|
|
|
|
Use Separator at the place from where you need to wrap.
I think this will help you.
|
|
|
|
|
may be yes but i am looking for a photoshop type of application where you see a vertical toolblar on the left side. Same as MS Paint type toolbar. Thanks.
|
|
|
|
|
Hello,
I am making one network application which controls computers on LAN, it is for internet cafes,
i have problem how to get computers ip address on LAN?
anyone has some ideas?
thanks
|
|
|
|
|
You probably need a boadcast message which all the computers will respond to with some identifiable information. Fortunately someone already thought of that and invented both the ICMP protocol and Ping. I have no idea how they work but I reckon you should start with these to find out how to do it.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Matthew Faithfull wrote: Fortunately someone already thought of that and invented both the ICMP protocol and Ping.
Which can be easily ignored by machines, resulting in false negatives.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Gofur Halmuratov wrote: anyone has some ideas?
NetServerEnum() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
I have Memory DC on which image is present. Using StretchBlt() i used to display the image.
While Zooming out the image i used to minus some value(X) the source recangle Left and Top and plus the same value(X) from right and Bottom of source rectangle.
Now, Is there any problem if i access the -ve coordinate from memory DC??
Please give u'r comments.
Hi this is SHivraj
|
|
|
|
|
shivrajbhosale wrote: Now, Is there any problem if i access the -ve coordinate from memory DC??
I don't know what that means but the image in your memory DC did not change by bliting it to the screen in different ways.
|
|
|
|
|
Do you have any problem about coordinate ?
|
|
|
|
|
The sin of the Y-Coordinate depends on which MAP_MODE you use.
Take a look to
CDC::SetMapMode
virtual int SetMapMode( int nMapMode );
in the help.
There is a explanation about coordinates and how are they used.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Hello everybody,
having a DlgItem, for example a a CEdit oder or a CStatic, on a CDialog the CDialog periodically receives WM_MOUSEMOVE messages when the mouse is over the DlgItem without any movement. The coordinates, as expected, don't change.
Does anybody have an explanation for this behaviour?
Thanks in advance
MS
|
|
|
|
|
I expect either windows shoves one at you every now and then, or the mouse driver may be more sensitive than needed.
Just a quick thought... If you have the mouse set up one way, slow movements of the mouse are VERY slow movements of the cursor, and fast movements VERY fast - so just a teeny shifting (esp of an optical mouse) may be enough to get the driver to say "I've moved", but not enough to move a pixel.
Do you get them when you unplug the mouse?
And do you care? You should be able to cope with the user moving the mouse anyway.
Iain.
|
|
|
|
|
Iain Clarke wrote: I expect either windows shoves one at you every now and then, or the mouse driver may be more sensitive than needed.
That was my first thought too. But when the mouse rests moveless over the dialog client area beside a DlgItem, no WM_MOUSEMOVE messages occur.
Iain Clarke wrote: And do you care? You should be able to cope with the user moving the mouse anyway.
Since the coordinates don' t change, I can easily filter the wrong messages by comparing the actual coordinates with the last, so it is no problem. But I would be keen to know the reason.
MS
|
|
|
|
|
|
Hello,
I have a combobox on my dialog and the dialog is created without resources.
Now I want to decide the width of the combo box depending upon the number characters that would appeaar in any combo box.
If I decide according to the font size of the combo box then for some sizes the size of the combo box is right but for others it is not.
I have done the following
width of combo box = num characters* size of font;
Please help.
Prithaa
|
|
|
|
|
Do you need to MoveWindow?
|
|
|
|