|
Just add them to your toolbar, and then add the code handlers for both items as required.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I'd like to add this button in a dialog. But I dnt know where are these button or if its ones is already made
|
|
|
|
|
You have to make the button yourself (just use a button control), then within the event handler of the button press, add the code you need for prompting the user for file names (see my solution[^]).
|
|
|
|
|
What do you mean "already made"? If you are creating an application then you should know that all toolbar or dialog buttons have to be added to the project by you. In both cases the Visual Studio Framework does most of the hard work for you; all you have to do is use the designer to drag items to the right place.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
If you're talking about using the Windows common dialog for "Save As..." or "File Open" then look at CFileDialog[^] if you're using MFC or the Common Items Dialog[^] when using just the WinAPI.
|
|
|
|
|
Yes Im using mfc, then I must look CFileDialog?
|
|
|
|
|
Yes... you can still use the WinAPI directly, but using MFC classes is generally easier.
|
|
|
|
|
antonio343 wrote:
Do you know if it is made already?
Oy vey, you want to know how it is made already!
Anyway, jewish language jokes aside, you add buttons to your dialog though the UI editor in MFC, bring up the toolbar, drag and drop a button where you want it, give it a meaningfull ID, add a handler, add the code.
If that is too much, do a basic tutorial in MFC.
==============================
Nothing to say.
modified 3-Nov-11 3:54am.
|
|
|
|
|
I remember this user from before stating he was just starting to learn to use MFC plus he's not a native English speaker... So, we need to be patient with the new ones...
|
|
|
|
|
Could you show me how to use to load/save file with CFileDialog??
I dont find some example
|
|
|
|
|
Gotta learn the joy of Google / Bing. Simple search for CFileDialog(), 2nd returned result was a tutorial.
CFileDialog()[^]
You'd find it a lot faster yourself rather than wait around for somebody to post an answer.
|
|
|
|
|
I'm triying to do this:
void CDlgResultados::SaveToFile(void)
{
this->UpdateData();
CFile f;
CString strFilter =_T("*.txt");
CFileDialog FileDlg(FALSE, _T(".txt"), NULL, 0, strFilter);
if( FileDlg.DoModal() == IDOK )
{
f.Open(FileDlg.GetFileName(), CFile::modeCreate | CFile::modeWrite);
CArchive ar(&f, CArchive::store);
ar << cadena;
ar.Close();
}
else
return;
f.Close();
}
Everything run well, but it function save the file in the folder of my project and not when I want.
what happen?
|
|
|
|
|
|
Ok, thank you very much
Everything run right
|
|
|
|
|
I'm sorry, I didn't understand very well what you said.
What do you mean?
I have a button in a dialog, which I'd like to be the open botton (Load). I know that in the toolbar there are this button but they haven't code only
BEGIN_MESSAGE_MAP(CAdestApp, CWinAppEx)
ON_COMMAND(ID_FILE_OPEN, &CWinAppEx::OnFileOpen)
..
|
|
|
|
|
So add a handler. In the dialog editor double click the button, this will present you with a class::name() combo, normally you can accept it, but yiou can change the name if you like. CLick OK, then the code will be created for you (empty code, consisting of just the name and perhaps a return).
You then add the code you like to this handler to get it to do something interesting.
==============================
Nothing to say.
|
|
|
|
|
The text cannot be entered into CEdit control, no mouse cursor.
Just curious if this is normal in CDialog.
I just wanted to keep track of the dialog during the development, do not really need this.
Thanks for reading.
Vaclav
|
|
|
|
|
I'm not sure what you mean here, I have just tried this on a dialog of my own and have no problem adding to the text box after selecting the title bar.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
If I check the "Title bar" in dialog properties (resource) I cannot get the mouse pointer to show in the CEdit box. Hence I cannot enter any text into it.
The dialog is in tab control and the title bar is not highlited.
All of the buttons in the dialog still works normally.
I added tool tip into the CEdit control and it works with or without the title bar active.
|
|
|
|
|
Vaclav_Sal wrote: If I check the "Title bar" in dialog properties (resource)
I'm not sure I understand what you mean here; what has this to do with what happens when you run the dialog?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
This problem is using VC2010,a lthiugh I suspect the same issue would be present in VC6
I have an MDI view, within this view is a splitter window with 2 views. The pane on the right contains a propertysheet.
Some of the page of the sheet contain splitter windows, one such page has a 1 row by 3 columns, of this splitter panes 1 and 3 contain their own splitters of 2 rows by 1 column.
Visual representation:
+------++---------------------------------+
| pane ||+-------------------------------+|
| |||propertySheet ||
| |||+-----------------------------+||
| ||||PropertyPage |||
| ||||+---------------------------+|||
| ||||| Splitter ||||
| |||||+-------++--------++------+||||
| |||||| || || |||||
| |||||| Row1 || || Row1 |||||
| |||||| || || |||||
| |||||| || || |||||
| |||||+-------+| |+------+||||
| |||||| || || |||||
| |||||| Row2 || || Row2 |||||
| |||||| || || |||||
| |||||+-------++--------++------+||||
| ||||+---------------------------+|||
| |||+-----------------------------+||
| ||+-------------------------------+|
+------++---------------------------------+
If the main view is not maximized, dragging any of the internal splitters, everything re-sizes and works correctly.
If you resize the view by dragging one of its edges, everything but the panes lebelled row1/2 in the above diagram resize correctly. Row1/2 receive a WM_SIZE message, resize their controls, BUT those controls do not actually resize or redraw.
If you maximize the view, these panes do not receive a WM_SIZE message. A restore message, they do.
Clues:
I have a similar view layout for another document type. This one does not have the propertysheet, but does have the internal layout of the page within the propertysheet. All these views resize correctly on all events.
This leads me to beleive that the propertysheet/page is somehow killing the messages or locking the windows somehow (LockWindowUpdate), it could be down to parent/child window chains. It could even be down to the styles of the window(s) (or extended styles).
Basically I am looking for ideas/pointers in this area to try and get me out of the hole I am in.
Any suggestions or help appreciated.
If you vote me down, my score will only get lower
modified 2-Nov-11 13:50pm.
|
|
|
|
|
Well, after a day banging my head against the wall on this issue. I finally tracked down the issue.
Its not my code at all. Its the windows kernal.
Apparently, the stack used for nested windows is in the kernal memory and their is a max limit of the nesting depth at which a call to MoveWindow will fail to send a WM_SIZE message to the re-sized window.
To get around this my CSplitterWnd derived class (I already had one), just uses a PostMessage to itself to defer the call to RecalcLayout which does the MoveWindow calls. If I do this the windows get resized in stages down the window chain and they all work correctly as the kernal stack limit never gets hit.
If you vote me down, my score will only get lower
|
|
|
|
|
Mr. Dear friends,
First of all I wish good work come easy.
May I ask you a question about C + + builder?
The following questions in the writing programs in C + + or c + + builder can you help?
I am new software languages. Vey in C + + Builder C + + code, scripts, etc.. I do not know with no interest.
Dear friends help you if you would like to thank you now wish you good work.
question:
- The user's name, last name, phone, address, professional educational status, marital status of many of the sections in this form in a form designed for entering data.
- Also entered in our database, this data must be stored in the old records and see how a program will be reached if needed, this information is written? "
Best Regards
Thanks
Kenan
|
|
|
|
|
What exactly does this have to do with C++? Your question appears to be concerned with the layout of a form or the definition of a database table. Please try rewording your query.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Since I converted from VS6 to VS2010, I have found that lots of my dialog messages no longer work (e.g., BN_CLICKED, CBN_SELCHANGED).
I can Spy++ on the dialog and see the WM_COMMAND with the right notify code, by my dialogs handlers aren't getting the messages.
I expected some issues on upgrading, but this wasn't one of them!
Any suggestions on how to find out what is happening to my messages?
Cheers
|
|
|
|