|
dybs wrote: Events and delegates are your friends here.
Delegates? Are you thinking of C#?
Steve
|
|
|
|
|
I was thinking Visual C++. I'll admit, I haven't done any MFC programming, my work is all in C++ .NET, where we do have delegates. I guess I should probably do a bit of reading up on MFC before posting anything in this forum again. My apologies if my previous post is misleading at all.
Dybs
|
|
|
|
|
Hi all,
I am working in vc6.0 using MFC.
I have a peculiar problem with Edit box display.
I have some parameters to display in edit box like,
Flash type : 0
Flash Address : 0x00
etc.
I need to align ':'character so that':' appears on the same column
So I am stuffing the Flash Type with spaces.
Eventhough I change the location of ':' to be same,
The edit box is displaying like,
Flash type : 0
Flash Address : 0x00
The alignment is not proper.But If I send the buffer to hyperterminal the alignment is proper.
Please clarify how can I align ':'in edit box.
Regards,
Sunil Kumar
|
|
|
|
|
sunilkumar.d wrote: Eventhough I change the location of ':' to be same,
The edit box is displaying like,
Flash type : 0
Flash Address : 0x00
Change the font of the edit control to Courier. As a hint to create a font use CreatePointFont( 120, _T( "Courier" ), NULL );
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Make sure that the "Flash type:" and "Flash Address:" labels (i.e., static controls) are the same width and are right-justified.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I am trying to compile
with the statement
CText* pTextElement = new CText(************
but get an undeclared identifier message
does any body know what I need to include in the header
files for this
please?
thanks Simon
|
|
|
|
|
I don't see a CText class in the docs.
Is it a control class? Looking for CEdit maybe?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You've told the compiler you want to use CText but have failed to declare such a class.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
are you using the tk library
may be you are missing some referance
Vikas Amin
My First Article on CP" Virtual Serial Port "[^]
modified on Thursday, July 24, 2008 5:33 PM
|
|
|
|
|
right click on CText and click goto decalartion! and post the class content here
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
I want to make a toolbar type window that has owner drawn button controls on it. I also need to be able to "stack" them on one side, either left or right, but those are two different issues.
Figure 1
is the application I’m trying to mimic and I know it was written in Qt. notice the controls across the top of the main window and to bars across each view on either side of the splitter. I believe it should be possible to design a bar that I could use in all three places with little modification.
Figure 2
is what I can figure to be the window structure I should use.
Please how would you implement the toolbar I described?
Thank you,
Nathan
|
|
|
|
|
Are you using MFC?
If so, I personally use a CControlBar-derived class.
Overriding CalcFixedLayout/CalcDynamicLayout makes it easy to position
any controls (and/or individual CToolBars) and report the total size of
the bar to MFC.
There's also the CDialogBar if you prefer to work with a dialog resource
as a control bar.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
What would be the best way to make that CControlBar-Derived class the full width of it's parent.
|
|
|
|
|
Nathan Going wrote: What would be the best way to make that CControlBar-Derived class the full width of it's parent.
I don't know the best way, but I use something like this:
CSize CMyControlBar::CalcFixedLayout(BOOL bStretch, BOOL bHorz)
{
CRect ParentClientRect;
GetParent()->GetClientRect(&ParentClientRect);
int desiredheight = ...;
return CSize(ParentClientRect.Width(), desiredheight);
}
CSize CMyControlBar::CalcDynamicLayout(int nLength, DWORD dwMode)
{
return CalcFixedLayout(dwMode & LM_STRETCH, dwMode & LM_HORZ);
}
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
i have two dlgs which i want to access the same variable,
i,ve got some global variables in the "Globals" folder but i cant access them from the childdlg.
i thought global was GLOBAL?
how to do this easy.
thx
|
|
|
|
|
If the variable is in the parent window which create the dialog
you can use GetParent() method to get the parent window , and make sure your global variable is declared in parent header with public access.
Vikas Amin
My First Article on CP" Virtual Serial Port "[^]
modified on Thursday, July 24, 2008 5:33 PM
|
|
|
|
|
thanx i'll look into that
|
|
|
|
|
rolfhorror wrote: i,ve got some global variables in the "Global" folder
Really? I'm not the most experienced developer around but I'm pretty sure you can't put variables into folders.
rolfhorror wrote: how to do this easy.
If you don't understand that those Dialogs are Classes and/or if you don't understand how to pass/access variables between classes then my guess would be that this might be the easiest.[^]
led mike
|
|
|
|
|
when i say folder, i mean the "folder" at the bottom on the classtree with the name "Globals".
|
|
|
|
|
rolfhorror wrote: maybe you should look at that book yourself
Good one! You are well on your way to being an excellent C++ developer! Good luck.
led mike
|
|
|
|
|
i'm not here to flame, so no offense. it was all in good humor.
(by the way, i have that book)
|
|
|
|
|
rolfhorror wrote: i'm not here to flame, so no offense. it was all in good humor.
rolfhorror wrote: (by the way, i have that book)
Then my comment about the dialogs being classes and that standard mechanisms for passing values or accessing values applies, should have helped yes? I mean I have not read that book but I would imagine that is covered yes?
led mike
|
|
|
|
|
thanx for you help
|
|
|
|
|
just a guess, have you checked this[^] article ?
|
|
|
|