scroll content of a dialog Topic is solved
-
- Earned a small fee
- Posts: 24
- Joined: Fri Aug 19, 2005 9:54 am
scroll content of a dialog
hello,
i have to scroll the content of a modal dialog.
how can i do this?
can i use wxScolledWindow? it's needfull to create the dialog modal because the program have to wait until the user ends the dialog.
i have to scroll the content of a modal dialog.
how can i do this?
can i use wxScolledWindow? it's needfull to create the dialog modal because the program have to wait until the user ends the dialog.
Re: scroll content of a dialog
Yes.schmallaria wrote: can i use wxScolledWindow?
If you allready have it in a frame, try MakeModal() to create a modal frame.schmallaria wrote: it's needfull to create the dialog modal because the program have to wait until the user ends the dialog.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
-
- Earned a small fee
- Posts: 24
- Joined: Fri Aug 19, 2005 9:54 am
-
- Earned a small fee
- Posts: 24
- Joined: Fri Aug 19, 2005 9:54 am
i dosn't work ...
let me explain what i want to do:
my main application (developed with mfc) calls a function from a dll (developed with wxwidgets).
when the function is called a modal dialog will be created (this is because the main application have to stop until the user ends the dialog).
on the dialog are a lot of controls wich are not all displayed, because of that i must scroll the content of the dialog.
i can't use a wxFrame, because after the construction of the frame the program returned to the main application but i want to stop the main thread until the user click the ok or cancel button.
let me explain what i want to do:
my main application (developed with mfc) calls a function from a dll (developed with wxwidgets).
when the function is called a modal dialog will be created (this is because the main application have to stop until the user ends the dialog).
on the dialog are a lot of controls wich are not all displayed, because of that i must scroll the content of the dialog.
i can't use a wxFrame, because after the construction of the frame the program returned to the main application but i want to stop the main thread until the user click the ok or cancel button.
-
- wxWorld Domination!
- Posts: 1339
- Joined: Wed Aug 03, 2005 8:10 am
- Location: BANGALORE, INDIA
- Contact:
-
- Earned a small fee
- Posts: 24
- Joined: Fri Aug 19, 2005 9:54 am
-
- wxWorld Domination!
- Posts: 1339
- Joined: Wed Aug 03, 2005 8:10 am
- Location: BANGALORE, INDIA
- Contact:
-
- Earned a small fee
- Posts: 24
- Joined: Fri Aug 19, 2005 9:54 am
exactly this is my problem.
when i use a wxDialog everything is fine. the main application stop, the user can click a button and the the dll function returned to the main application.
but how to scroll the content of the dialog?
there are a lot of controls and to see all i have to scroll down with a little scrollbar. the wxDialog doesn't scroll in standard.
how can i do this?
when i use a wxDialog everything is fine. the main application stop, the user can click a button and the the dll function returned to the main application.
but how to scroll the content of the dialog?
there are a lot of controls and to see all i have to scroll down with a little scrollbar. the wxDialog doesn't scroll in standard.
how can i do this?
-
- wxWorld Domination!
- Posts: 1339
- Joined: Wed Aug 03, 2005 8:10 am
- Location: BANGALORE, INDIA
- Contact:
-
- Earned a small fee
- Posts: 24
- Joined: Fri Aug 19, 2005 9:54 am
thank you for your answer
...now i see the modal dialog with the scrollwindow and my controls, but i don't see the scrollbar and it doesn't scroll.
here is the code i use for (i use evc++ and the wince port of wxwidgets):
...now i see the modal dialog with the scrollwindow and my controls, but i don't see the scrollbar and it doesn't scroll.
here is the code i use for (i use evc++ and the wince port of wxwidgets):
Code: Select all
MyDialog::MyDialog(const wxString& title)
: wxDialog(NULL, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, wxDIALOG_NO_PARENT)
{
//create the main sizer
wxBoxSizer* main_sizer = new wxBoxSizer(wxVERTICAL);
//create the scrollwindow
wxScrolledWindow* wnd = new wxScrolledWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, wxT("scroll"));
//create the second sizer
wxBoxSizer* innersizer = new wxBoxSizer(wxVERTICAL);
//create a lot of controls to see how it scrolls
wxTextCtrl* m_textCtrl;
m_textCtrl = new wxTextCtrl(wnd, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, 0);
innersizer->Add(m_textCtrl, 1, wxEXPAND |wxALL, 5);
m_textCtrl = new wxTextCtrl(wnd, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, 0);
innersizer->Add(m_textCtrl, 1, wxEXPAND |wxALL, 5);
m_textCtrl = new wxTextCtrl(wnd, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, 0);
innersizer->Add(m_textCtrl, 1, wxEXPAND |wxALL, 5);
m_textCtrl = new wxTextCtrl(wnd, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, 0);
innersizer->Add(m_textCtrl, 1, wxEXPAND |wxALL, 5);
m_textCtrl = new wxTextCtrl(wnd, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, 0);
innersizer->Add(m_textCtrl, 1, wxEXPAND |wxALL, 5);
m_textCtrl = new wxTextCtrl(wnd, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, 0);
innersizer->Add(m_textCtrl, 1, wxEXPAND |wxALL, 5);
m_textCtrl = new wxTextCtrl(wnd, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, 0);
innersizer->Add(m_textCtrl, 1, wxEXPAND |wxALL, 5);
m_textCtrl = new wxTextCtrl(wnd, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, 0);
innersizer->Add(m_textCtrl, 1, wxEXPAND |wxALL, 5);
m_textCtrl = new wxTextCtrl(wnd, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, 0);
innersizer->Add(m_textCtrl, 1, wxEXPAND |wxALL, 5);
m_textCtrl = new wxTextCtrl(wnd, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, 0);
innersizer->Add(m_textCtrl, 1, wxEXPAND |wxALL, 5);
m_textCtrl = new wxTextCtrl(wnd, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, 0);
innersizer->Add(m_textCtrl, 1, wxEXPAND |wxALL, 5);
m_textCtrl = new wxTextCtrl(wnd, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, 0);
innersizer->Add(m_textCtrl, 1, wxEXPAND |wxALL, 5);
//set the second sizer to the scolledwindow
wnd->SetSizer(innersizer);
wnd->SetAutoLayout(true);
wnd->Layout();
//add the scrolledwindow to the main sizer
main_sizer->Add(wnd, 1, wxEXPAND | wxALL, 5);
SetSizer(main_sizer);
SetAutoLayout(true);
Layout();
}
-
- Earned a small fee
- Posts: 24
- Joined: Fri Aug 19, 2005 9:54 am
i have forgotten a line of code:
simply add and it works
thank you guys
simply add
Code: Select all
wnd->SetScrollbars(20,20,50,50);
thank you guys