|
I passed rectangle size(10,10,30,30)(hadrcode value).
Even though i am not able to see the toolbar. Is there any standard size limit for ractangle??
|
|
|
|
|
there is no as such size of the toolbar actually...can you please give me piece of code so that i can look furthrer to figure out something.
|
|
|
|
|
i tried by the following 2 methods in oncreate()
Method 1:
----------
CFrameWndEx* pParent = STATIC_DOWNCAST(CFrameWndEx, AfxGetMainWnd());
//handle to application window
if (!m_wndToolBar.CreateEx(pParent,
TBSTYLE_FLAT,
WS_CHILD | CBRS_ALIGN_TOP) ||
!m_wndToolBar.LoadToolBar(IDR_PAGEPREVIEW))
{
TRACE0("Failed to create toolbar\n");
return -1;
}
Method 2:
-------
CRect rc(10,10,100,100);
m_wndToolBar.CreateEx(this,0,0,&rc);
m_wndToolBar.LoadToolBar(IDR_PAGEPREVIEW);
|
|
|
|
|
Hello!
Could someone tell me if a CMFCToolbar in a CDialog is correctly supported?
I can get my toolbar to work fine in a CDialog (inside a CView of an CMDIChildWndEx), but next time I open another document (MDI child window) the respective docked panes doesn't appear docked at all.
This happens after the Create() method of the toolbar. I suppose that settings of the Docking Manager (global?) are somehow changed during creation of the toolbar.
Below is the way I'm creating the toolbar:
BOOL MyCDialog::OnInitDialog() {
...
m_toolbar.EnableLargeIcons(FALSE);
m_toolbar.Create( this, AFX_DEFAULT_TOOLBAR_STYLE, IDR_TOOLBAR );
m_toolbar.LoadToolBar( IDR_TOOLBAR, 0, 0, TRUE /* Is locked */);
DWORD tbStyle = m_toolbar.GetPaneStyle();
tbStyle |= CBRS_TOOLTIPS | CBRS_FLYBY;
tbStyle &= ~(CBRS_GRIPPER | CBRS_SIZE_DYNAMIC | CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT);
m_toolbar.SetPaneStyle(tbStyle);
m_toolbar.SetOwner(this); //dont know if is really necessary
m_toolbar.SetRouteCommandsViaFrame(FALSE);
...
}
Thanks in advance.
Regards.
|
|
|
|
|
Hello,
When I try to add docking to my own toolbar with dropdown buttons, the right end of the toolbar is cut off, presumably because of the wider button with the dropdown arrow. The same happens if I dock the toolbar vertically. How can I make my docking toolbar work with both dropdown buttons?
I made changes to the code as given in the link "http://www.microsoft.com/msj/0898/c0898.aspx". But its not working for me. My application is as MDI application.
Someone help me.
Thanks
Engilela
|
|
|
|
|
Any Expert programmer,
Please guide me in starting my project.
I am planning to do a Visual C++ project. I would like to make my front end/hci in Visual Studio C++ and the programming. However I'd like to get my data from a relational database which I've designed it in Ms Access 2007. Please suggest me a way of how to go about doing this, I've read about MFC but also in the books I came across Win API, Im confused what i should be using.
Desperate programmer,
Hitesh
|
|
|
|
|
|
Member 1862846 wrote: However I'd like to get my data from a relational database which I've designed it in Ms Access 2007. Please suggest me a way of how to go about doing this...
See if this helps.
"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
|
|
|
|
|
Hi
Actually i have Rich text contol present in my dialog. I will get messages from the board, when the messages exceeds the size of the window, scroll bar automatically comes because of i had set the scroll bar(Vertical scroll bar) property of Rich Text Control.
My question is, when message exceeds the window size, the scroll bar automatically goes up. i don want scroll bar to move up rather it should go down, then only i can able to see latest updates form the board at time itself.
Thanks in advance,
Thanks,
Balaji
|
|
|
|
|
Not sure that I understand. When you say "get messages from the board" do you mean the keyboard? I also don't understand how adding text to a rich edit control moves the scroll bar up. If you add text to the end of the edit control then the scroll bar moves down for me. The text does move up.
Perhaps you can try LineScroll() with a negative number of lines. For instance
MyEdit.LineScroll(MyEdit.GetFirstVisibleLine(), 0)
makes the top line of the text in the edit control visible
Graham
Librarians rule, Ook!
|
|
|
|
|
Hi Graham,
thanks for ur reply. I'm explaining the problem on behalf of Balaji.
Problem :
Information in Rich Text Box are updated by thread, whenever thread gets message(text), it will be updated on RichTextBox Control.
Right now, we are concatenaing the message(text) and update the concate_string in the RichTextControl, using the following API,
myRichTextBox.SetText(concat_string);
What we are suppose to do is, recently updated text should be visible to user.
To view the recent text, we are using scroll bars manually. Instead, we want to display the last updated text.
we are using Rich Text Box 6.0 (SP4). we tried with the following APIs,
myEdit.SetScrollBar();
but it's throwing Error..
Thanks
Ram
|
|
|
|
|
OK, things are a lot clearer now, thanks. I was assuming that you were using the CRichEditCtrl from MFC, but you are actually using RichTextBox from the .Net framework library
What I think you want to do is:
a) Before appending the message to the RichTextBox get the current length of the text from the TextLength property. This is the char index of the last character of the last message
b) Calculate the line number of this position using GetLineFromCharIndex
c) Append the text
d) Calculate the line number that you want at the bottom of the display from the number calculated in b) plus the number of lines in the display
e) Calculate the char index of the beginning of the line calculated in d) using the GetFirstCharIndexFromLine
f) Set the caret to begining of the line calculated above using the Select method
g) Scroll the caret to the bottom of the display using the ScrollToCaret() method
The following code should do it (note I have not tested this yet)
int line = myRichTextBox.GetLineFromCharIndex(myRichTextBox.TextLength);
myRichTextBox.SetText(concat_string);
int pos = myRichTextBox.GetFirstCharIndexFromLine(line + NumberOfLinesInRichTextBox(myRichTextBox));
myRichTextBox.Select(pos, pos);
myRichTextBox.ScrollToCaret();
As in a previous answer[^] the function NumberOfLinesInRichTextBox could either return a constant value determined by experiment or calculate the number of visible lines in the RichTextBox using Text Metrics.
Apologies for not having time at the moment to test this out, but I hope I've given you enough of a steer to allow you to get this working
Graham
Librarians rule, Ook!
|
|
|
|
|
hi i am trying to display icons or bitmaps on popup menu and on status bar for dialog based application.
i got some demo examples for this but those examples are for MDI & SDI,i applied whatever logic is there for MDI n SDI but that is not working for dialog box n i want to show this for a dialog based application only.
thanks in advance
|
|
|
|
|
|
thanks Hamid.
Putting a Progress Bar, BitMap, Animation or Dialog in a Multi Pane Status Bar (The Easy Way).
i tried to run this application but it is getting crashed.
|
|
|
|
|
this application is giving some compile time errors
|
|
|
|
|
|
Can you show your errors?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
thanks Hamid,
it is working now.
can u plz tell me how to divide status bar panes into 3 equal parts of a dialog box?
|
|
|
|
|
I think you cant do it.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
i have done that n that is working properly.
i could do this coz of demo of i got 1 class ie CBmpMenu.
|
|
|
|
|
Hi all
I would like to stop executing the
std::getline( std::cin, aString )
function from another thread
when getline is blocked waiting for user input.
A possible solution is to put the function into another thread
and stop this last when I need.
Instead of using another thread, is there some global
function or OS function that is possible to call?
I imagine since std::cin should be running in a OS
thread, right?...maybe some signal?
Thanks for your help
ManuStone
|
|
|
|
|
|
|
could any1 tell me how to put a back ground picture in a mfc dialog?
|
|
|
|