|
So true.... May the Code be with you
led mike
|
|
|
|
|
You guys are hilarious, I am cracking up?
|
|
|
|
|
Well, Im making a listbox that displays thumbnails of images using a CImageList. The drawing is working fine, but I want the listbox to draw the items in a similar way to the listcontrol. For example:
------------------|^
XXXXX XXXXX |-
XXXXX XXXXX |
XXXXX XXXXX |
img1 img2 |
|
XXXXX XXXXX |
XXXXX XXXXX |
XXXXX XXXXX |
img3 img4 |-
------------------|v
In the ascii above (...), I want to display 2 columns of images (actually, depends on the width of the control) and only the vertical scrollbar. I tried setting the multicolumn property to true on the designer, and it kinda works, but the scroll shown is the horizontal scrollbar, and not the vertical. If I leave the control with multicolumn set to false, there is only one column and a vertical scrollbar (whatever the width of the control, the items wont be calculated to use this space...).
What can I do to accomplish my goal?
Thanks,
Andrés Cartín
|
|
|
|
|
u have 4 types of views in a CListView control, Large Icons, small icons, report and list..
if u want that style u should change the style of the listview to Large icons, this can be done at design time by right-clicking the control --> Properties and changing style..
If u want to change the view at runtime u can use CListView::ModifyStyle function, with LVS_ICONS as a parameter.
hope this helps
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
hi
use 'Large Icons' view from the CListView properties
Regards
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
I know I could have used the listview, but I wont. I need to customly draw a bitmap behind each item (yes, another bitmap apart from the image from the image list). The problem with the listview is that i cant do the drawing of the background image on the OnCustomDrawList. Any help?
|
|
|
|
|
|
You can't using a Modal dialog. If you make your dialog Modeless, you will be able to continue while the dialog is displayed.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
do you dialog modeless then...
|
|
|
|
|
|
Sir,
I want to apply password to the file/folder with the help of my application .Please suggest some tutorials for that.Last time i was told to get the knowledge up to black belt, device drivers, file extentions.But i was not suggested where to study these things online.Please suggest any online link .I want to start from the scratch.
Thanks
|
|
|
|
|
|
hi all,
I need to hide/show menus instead of just disable/enable them when UpdateCmdUI is called... how???
Thanx
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
You'll need to call CMenu::RemoveMenu and CMenu::InsertMenuItem to physically remove and restore them. There are no hide / show options.
|
|
|
|
|
Im not sure its possible or no but if you have a custom menu you can use of drawitem when it want to shows items.
|
|
|
|
|
Hi,
Im trying to get this output in the console:
*
**
***
****
*****
******
*******
********
*********
**********
***********
With a genest loop.
How do i get those spaces?
I tried the ascii char '32', but that didn't work either.
Anyone any suggestion?
Thanks in advance!
Edit: its a triangle which is outlined to the right. Its not displayed correctly!
|
|
|
|
|
strange,
(char)32 or char(32) or you can use (' ') to write a space...
all should work
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
Hi Mohammed,
Thanks for your reply.
I was kinda wondering how i can increase and decrease the spaces in a geneste for loop.
Do you know how i can do that?
|
|
|
|
|
I dont know what 'genest' mean - not even in the dictionary, so I assume it to mean 'nested loop', if this is true, then here is the code:
<br />
#include <iostream.h><br />
<br />
void main()<br />
{<br />
for (int i=0;i<10;i++)
{<br />
for(int j=0;j<5-i/2;j++)
cout<<' ';<br />
for(int k=0;k<i;k++)
cout<<'*';<br />
for(j=0;j<5-i/2;j++)
cout<<' ';<br />
cout<<endl;<br />
<br />
}<br />
}
hope this helps
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
how do you display your spaces ??
don't printf(" "); do that correctly ?
|
|
|
|
|
#include <iostream>
#include <algorithm>
#include <iterator>
using namespace std;
char diagram[][12] = { " *",
" **",
" ***",
" ****",
" *****",
" ******",
" *******",
" ********",
" *********",
" **********",
"***********" };
int main()
{
copy(diagram, diagram + 11, ostream_iterator<char*>(cout, "\n"));
}
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Hi Zac,
Thank you for your reply.
Isnt this possible to do this with 2/3 for loops?
|
|
|
|
|
Yustme wrote: Isnt this possible to do this with 2/3 for loops?
Possible? Yes. You can actually do it in 1 loop. I hardcoded the string for simplicity, but you can have that generated as well as print it to the screen all in 1 loop. However, there is no need to do so when you can use STL's built in algorithms to do it for you. Why write 15+ lines of code when 1 will suffice?
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Hi Zac,
This is an assignment of a book. Im learning C++ now and they are not that far yet.
Its chapter 3. All assignments are about loops, for loops in particular.
Thats why i wanna do this with a for statement.
|
|
|
|
|
Assuming you want to generate the strings as well as write them, you will do this then:
const unsigned int TRIANGLE_HEIGHT = 11;
for (int i = 0; i < TRIANGLE_HEIGHT; ++i)
{
for (int j = 0; j < TRIANGLE_HEIGHT; ++j)
{
if (j >= TRIANGLE_HEIGHT - i)
cout << '*';
else
cout << ' ';
}
cout << endl;
}
cout << endl;
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|