|
Hi,
I developed a thumbnail viewer using doc / view architecture and GDI+. I have done the rotate, flip options, but when we choose or click any thumbnail image, I want to draw the focus rectangle around the image instead of bluecolor shadow selection. Can u help me ...... if it is possible send a sample code.
Thanking you.
Regards,
Inbakumar.G
-- modified at 9:37 Thursday 1st December, 2005
|
|
|
|
|
Greetings:
I am trying to create one of those dialog boxes that have an "expand and contract" feature. I'm sure you have all seen them: The box has a smaller "fixed" segment, say, at the top, but there is a control, like a button that says "More >>" that causes it to expand at the bottom and reveal additional controls and options.
I think I understand that I need to create TWO dialog resource templates, one representing the fixed top portion and a second that is layed out at the top identical to the first dialog but larger at the bottom with the extra controls. Then, when the "More >>" button is pushed, somehow, I swap the old resource template for the new one.
Its the "somehow" part that has me stumped. I have two questions:
1. How do I keep the dialog open while I swapp templates? (Or can I? Is this done some other way?)
2. How do I do this trick while keeping the fixed part of the dialog positioned on the screen? In otherwords, I don't want the the new, larger, dialog window trying to re-center itself. I want the top part to stay put and the swap operation to appear as though the dialog has literally expanded at the bottom.
If it turns out that I have to essentially close the old dialog and re-open it with the larger template, then I would like to preserve the illusion that the original dialog is simply expanding to revela more controls.
I guess that is a pretty loaded request but any assistance would be greatly appreciated.
Thank you,
Mark
|
|
|
|
|
You can create a second dialog resource and attach a class to it. Create it as modeless, and a child of the main dialog. When user presses the more button, show it using ShowWindow(SW_SHOW); and position it correctly using SetWindowPos() etc. Similarly when button is pressed again, check if it is visible: m_ChildDialog.ShowWindow(! m_ChildDialog.IsWindowVisible());
Hope that helps.
this is this.
|
|
|
|
|
Hi Khan:
Is there anyway to do this and still keep the dialogs modal?
Also, what will happen if the user moves the new window? Won't the old window be revealed behind it?
Thanks for your help!
Mark
|
|
|
|
|
If you need to scroll the controls at the bottom into view, then create all the controls on the main dialog, and increase/decrease the height of the dialog in a loop using SetWindowPos() .
this is this.
|
|
|
|
|
I've done this by dinamically hiding\disabling set of controls + resize of the dialog itself. If your extra portion is in the middle, this would need some efforts to reposition other controls, but I have done this too before.
Igor Green
http://www.grigsoft.com/ - files and folders comparison tools
|
|
|
|
|
|
Thanks Igor. I'll check these out.
Mark
|
|
|
|
|
What do you think if I implement my classes in .h files instead of dividing the declarations in .h files and the implementation in .cpp?
Is this a bad programming style or it will bother the compiler?
|
|
|
|
|
For me it seems strange,
I know that AppWizard makes the reverse for CAboutDlg of
a single/multidocument app
It inserts the declaration in .cpp before the implementation
I think it's better the usual way
|
|
|
|
|
it wont bother that much the compiler if you do it correctly.
however, it is a bad habit to do so.
we generally put into headers only declarations, other includes, class definitions, and the implementation code into deparated .cpp files...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20]
|
|
|
|
|
toxcct wrote: it wont bother that much the compiler if you do it correctly.
It doesn't bother the compiler, but it bothers the linker.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Hello,
It's a bad (C/C++) programming practice and it will bother the linker if you include the header in more than one place. (Multiple defined symbols...). Besides that, if you place all your code in header files (no *.cpp file(s)) you'll not be able to create object files and executable code...
If you are talking about templates (I assume you are not), then you have to put all the code in a *.inl document or in the header file.
Hope this helps you.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
bad idea, if you change the implementation all file dependant on that header file will be recompiled.
Also, I don't think the debugger will be able to step in the code.
anyway, bad idea, I sure others will give you other reasons why.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
|
Hello i am using datagrid control in Vc++.net.
when i set a float value to a cell, it returns the fol error.
my code is
***********
Datagrid->set_Item(1,1,System::Convert::ToSingle(textBox1->Text) );
Error
********
error C2664: 'void System::Windows::Forms::DataGrid::set_Item(int,int,System::Object __gc *)' : cannot convert parameter 3 from 'float' to 'System::Object __gc *'
The datagrid columns are of float type.
otherwise if i use toString function,
Datagrid->set_Item(1,1,System::Convert::ToSingle(textBox1->Text) );
it compiles well but, returns runtime error, cannot convert from target type to primitive type..
Pls help me
Salai
|
|
|
|
|
Hi to all,
I've got a big problem with the code below
CWorkRecordset::CWorkRecordset(CDaoDatabase* pdb)
: CDaoRecordset(pdb)
{
//{{AFX_FIELD_INIT(CWorkRecordset)
m_lUser = 1;
m_lCode = 0;
m_lDept = 0;
m_lWork = 0;
m_lSource = 0;
m_oStartTm = COleDateTime::GetCurrentTime();
m_nFields = 6;
//}}AFX_FIELD_INIT
m_nDefaultType = dbOpenDynaset;
}
The problem occours during the creation of the obj,
and only if:
- I'm running in debug mode
- The PC where Visual C++ Professional 6.0 (no service pack) is installed has Win XP as OS
Program crashes when it execute:
m_oStartTm = COleDateTime::GetCurrentTime();
If I run in release mode, no crash occours
If I run in debug/release mode in a Win 2000 PC, no problem
The state of obj m_oStartTm is "valid" before assignment
Can anybody help me?
Thanks in advance
Cristian
|
|
|
|
|
Have you stepped into COleDateTime::GetCurrentTime() to see what is causing the crash?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: Have you stepped into COleDateTime::GetCurrentTime() to see what is causing the crash?
As I try to step into using F11 the program crashes, the debug window says:
Debug assertion failed!
File: winctrl5.cpp
line: 189
Before calling that function obj m_oStartTm.dt = 0.0000 & m_oStartTm.status = valid
I don't understand...
|
|
|
|
|
misturas wrote: File: winctrl5.cpp
line: 189
Hmm, this is inside of the CDateTimeCtrl::GetTime() method. Can you set a breakpoint in it and then check the call stack once that breakpoint is reached? I'm curious how you got there from COleDateTime::GetCurrentTime() .
Another suggestion would be to change the initialization to:
m_oStartTm = COleDateTime(0); and see what that produces.
Also, what does CWorkRecordset::DoFieldExchange() look like?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
So, using m_oStartTm = COleDateTime(0); causes a compiling error(0);
DoFieldExchange is:
pFX->SetFieldType(CDaoFieldExchange::outputColumn);
DFX_Long(pFX, _T(cRSsbUser), m_lUser);
DFX_Long(pFX, _T(cRSsbCode), m_lCode);
DFX_Long(pFX, _T(cRSsbDept), m_lDept);
DFX_Long(pFX, _T(cRSsbWork), m_lWork);
DFX_DateTime(pFX, _T(cRSsbDateHour), m_oStartTm);
DFX_Long(pFX, _T(cRSsbSource), m_lSource);
where cRSsbUser is the name of a access table column
And finally, if I set a breakpoint in winctrl5.cpp, when i run the debug Visual C++ disable that brakpoint
Now in italy is quite late, i think I'll go sleepin an hour, if i apologize if i don't reply immediately
Thanks in advance, tomorrow i will try again
-- modified at 16:34 Thursday 1st December, 2005
|
|
|
|
|
misturas wrote: So, using m_oStartTm = COleDateTime(0); causes a compiling error(0);
What about this instead:
m_oStartTm = (DATE) 0; Even if this does pacify the compiler, I feel the underlying problem still exists. I just created a test program with a class derived from CDaoRecordset , and an Access table having a date/time column. The constructor looked liked yours and I got no assertion. At this point, I would suggest you do the same thing, and then start adding bits and pieces of code until the problem shows up. Make sense?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: What about this instead:
m_oStartTm = (DATE) 0;
Even if this does pacify the compiler, I feel the underlying problem still exists. I just created a test program with a class derived from CDaoRecordset, and an Access table having a date/time column. The constructor looked liked yours and I got no assertion. At this point, I would suggest you do the same thing, and then start adding bits and pieces of code until the problem shows up. Make sense?
I apologize if i reply only now, I had problems with internet connection
I just want to ask if you have the same configuration I submit in my first msg, because if I use win 2000 I have no problem!
|
|
|
|
|
I am using Windows XP SP2.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hello, I searched this message board and I did not find anything about changing the color of the scrollbar in my edit box so I decided to ask. In my dialog box I have 4 edit boxes and I want to modify the style of the scrollbar (CSS does this in webdesign). See an example here of CSS scrollbar style modification
|
|
|
|